Commit 352f6297 authored by Michael Turner's avatar Michael Turner

working shell for opencascade CAD engine

parent 3f4003e8
......@@ -171,6 +171,7 @@ INCLUDE (ThirdPartyScotch)
INCLUDE (ThirdPartyZlib)
INCLUDE (ThirdPartyBoost)
INCLUDE (ThirdPartyFFTW)
INCLUDE (ThirdPartyOCC)
INCLUDE (ThirdPartyArpack)
INCLUDE (ThirdPartyMPI)
INCLUDE (ThirdPartyPETSc)
......
SET(OCC_DIR "" CACHE FILEPATH "Path to OpenCascade directory")
FIND_LIBRARY(OCC_LIB NAMES PTKernel PATHS ${OCC_DIR}/lib)
SET(OOC_FOUND FALSE)
IF(OCC_LIB)
SET(OCC_FOUND TRUE)
MARK_AS_ADVANCED(OCC_LIB)
ENDIF(OCC_LIB)
IF(OCC_FOUND)
MESSAGE(STATUS "Found opencascade: ${OCC_LIB}")
SET(OCC_INC_DIR ${OCC_DIR}/inc CACHE FILEPATH "OpenCascade include directory.")
MARK_AS_ADVANCED(OCC_PATH)
MARK_AS_ADVANCED(OCC_INC_DIR)
ELSE(OCC_FOUND)
MESSAGE(FATAL_ERROR "could not find opencascade")
ENDIF(OCC_FOUND)
\ No newline at end of file
OPTION(NEKTAR_USE_OCC "Use opencascade for geometry interface." OFF)
IF(NEKTAR_USE_OCC)
INCLUDE(FindOCC)
INCLUDE_DIRECTORIES(${OCC_INC_DIR})
ENDIF(NEKTAR_USE_OCC)
\ No newline at end of file
#include <LibUtilities/CADSystem/CADSystem.h>
#include "occ.h"
using namespace std;
namespace Nektar{
namespace LibUtilities{
std::string CADSystem::GetName()
{
return m_name;
}
}
}
#include <LibUtilities/CADSystem/CADSystem.h>
#include "occ.h"
using namespace std;
namespace Nektar{
namespace LibUtilities{
std::string CADSystem::GetName()
{
returm m_name;
}
}
}
#ifndef NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSYSTEM_H
#define NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSYSTEM_H
#include <string>
#include <boost/shared_ptr.hpp>
#include <LibUtilities/LibUtilitiesDeclspec.h>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
namespace Nektar {
namespace LibUtilities {
class CADSystem
{
public:
friend class MemoryManager<CADSystem>;
LIB_UTILITIES_EXPORT CADSystem(std::string name) : m_name(name)
{
}
LIB_UTILITIES_EXPORT std::string GetName();
private:
std::string m_name;
};
typedef boost::shared_ptr<CADSystem> CADSystemSharedPtr;
}
}
#endif
#ifndef NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSYSTEM_H
#define NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSYSTEM_H
#include <string>
#include <boost/shared_ptr.hpp>
#include <LibUtilities/LibUtilitiesDeclspac.h>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
namespace Nektar {
namespace LibUtilities {
class CADSystem
{
public:
friend class MemoryManager<CADSystem>;
LIB_UTILITIES_EXPORT CADSystem(std::string name) : m_name(name)
{
}
LIB_UTILITIES_EXPORT std::string GetName();
private:
std::string m_name;
};
typedef boost::shared_ptr<CADSystem> CADSystemSharedPtr;
}
}
#endif
//
// occ.h
//
//
// Created by Michael Turner on 17/03/2015.
//
//
#ifndef _LIB_UTILITIES_CADSYSTEM_occ_h
#define _LIB_UTILITIES_CADSYSTEM_occ_h
#include <STEPControl_Reader.hxx>
#include <IGESControl_Reader.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <BRepTools.hxx>
#include <BRep_Tool.hxx>
#include <gp_Trsf.hxx>
#include <TopLoc_Location.hxx>
#endif
//
// occ.h
//
//
// Created by Michael Turner on 17/03/2015.
//
//
#ifndef _occ_h
#define _occ_h
#include <STEPControl_Reader.hxx>
#include <IGESControl_Reader.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <BRepTools.hxx>
#include <BRep_Tool.hxx>
#include <gp_Trsf.hxx>
#include <TopLoc_Location.hxx>
#endif
......@@ -310,6 +310,20 @@ SOURCE_GROUP("TimeIntegration Sources" FILES ${TimeIntegrationSources})
SOURCE_GROUP("FFT Headers" FILES ${FFTHeaders})
SOURCE_GROUP("FFT Sources" FILES ${FFTSources})
IF(NEKTAR_USE_OCC)
SET(CADSystemSources
./CADSystem/CADSystem.cpp
)
SET(CADSystemHeaders
./CADSystem/CADSystem.h
./CADSystem/occ.h
)
SOURCE_GROUP("CAD System Headers" FILES ${CADSystemHeaders})
SOURCE_GROUP("CAD System Sources" FILES ${CADSystemSources})
ENDIF(NEKTAR_USE_OCC)
SOURCE_GROUP("Base" FILES ${BaseHeaders})
SET(LibUtilityHeaders
......@@ -319,6 +333,7 @@ SET(LibUtilityHeaders
${PolyLibHeaders}
${CommunicationHeaders}
${FoundationHeaders}
${CADSystemHeaders}
${LinearAlgebraHeaders}
${BasicConstHeaders}
${InterpreterHeaders}
......@@ -338,6 +353,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/BasicConst/GitRevision.cpp.in
SET(LibUtilitySources
${BasicUtilsSources}
${FoundationSources}
${CADSystemSources}
${PolylibSources}
${CommunicationSources}
${LinearAlgebraSources}
......@@ -453,5 +469,9 @@ IF( NEKTAR_USE_PETSC )
ADD_DEPENDENCIES(LibUtilities petsc-3.5.2)
ENDIF( NEKTAR_USE_PETSC )
IF(NEKTAR_USE_OCC)
TARGET_LINK_LIBRARIES(LibUtilities LINK_PUBLIC ${OCC_LIB})
ENDIF(NEKTAR_USE_OCC)
INSTALL(FILES ${ExpressionTemplates} DESTINATION ${NEKTAR_INCLUDE_DIR}/ExpressionTemplates COMPONENT dev)
INSTALL(DIRECTORY ./ DESTINATION ${NEKTAR_INCLUDE_DIR}/LibUtilities COMPONENT dev FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment