OpenCascade for Windows

This commit is contained in:
Matthias 2016-03-14 14:22:25 +01:00
parent 2dcbd988b8
commit ad6785731f
8 changed files with 40 additions and 32 deletions

View File

@ -125,7 +125,7 @@ endmacro()
if(WIN32)
get_WIN32_WINNT(ver)
add_definitions(-D_WIN32_WINNT=${ver})
add_definitions(-D_WIN32_WINNT=${ver} -DWNT -DWNT_WINDOW)
set(CMAKE_MFC_FLAG 0)
# add_definitions(-DNGINTERFACE_EXPORTS)
# add_definitions(-DNGLIB_EXPORTS)
@ -246,9 +246,11 @@ endif (USE_MPI)
if (USE_OCC)
find_package(OpenCasCade REQUIRED)
add_definitions(-DOCCGEOMETRY -D_OCC64)
add_definitions(-DHAVE_IOSTREAM -DHAVE_IOSTREAM_H -DHAVE_LIMITS -DHAVE_LIMITS_H -DHAVE_IOMANIP -DHAVE_IOMANIP_H)
include_directories(${OCC_INCLUDE_DIR})
if(WIN32)
install( DIRECTORY "${OCC_LIBRARY_DIR}/../bin" DESTINATION . COMPONENT netgen )
install( FILES ${OCC_LIBRARIES_BIN} DESTINATION bin COMPONENT netgen )
endif(WIN32)
endif (USE_OCC)
#######################################################################

View File

@ -1,6 +1,7 @@
#include <mystdlib.h>
#include <meshing.hpp>
#include "bcfunctions.hpp"
namespace netgen
@ -31,7 +32,7 @@ namespace netgen
colours match is defined as "eps" and is currently
2.5e-5 (for square of distance)
*/
bool ColourMatch(Vec3d col1, Vec3d col2, double eps = DEFAULT_EPS)
bool ColourMatch(Vec3d col1, Vec3d col2, double eps)
{
if(eps <= 0.0) eps = DEFAULT_EPS;

View File

@ -43,11 +43,11 @@ namespace netgen
- BC Prop 3: 8500 : Colour 0 (no colour defined)
*/
//extern void OCCAutoColourBcProps(Mesh & mesh, OCCGeometry & occgeometry, const char *occcolourfile);
extern void AutoColourBcProps(Mesh & mesh, const char *bccolourfile);
extern DLL_HEADER void AutoColourBcProps(Mesh & mesh, const char *bccolourfile);
extern void GetFaceColours(Mesh & mesh, Array<Vec3d> & face_colours);
extern DLL_HEADER void GetFaceColours(Mesh & mesh, Array<Vec3d> & face_colours);
extern bool ColourMatch(Vec3d col1, Vec3d col2, double eps = 2.5e-05);
extern DLL_HEADER bool ColourMatch(Vec3d col1, Vec3d col2, double eps = 2.5e-05);
}
#endif

View File

@ -4,7 +4,7 @@ add_library(occ ${NG_LIB_TYPE}
occconstruction.cpp occgenmesh.cpp occgeom.cpp occmeshsurf.cpp
)
add_library(occvis ${NG_LIB_TYPE} occpkg.cpp vsocc.cpp)
add_library(occvis ${NG_LIB_TYPE} vsocc.cpp)
if(NOT WIN32)
target_link_libraries( occ ${OCC_LIBRARIES} ${PYTHON_LIBS})

View File

@ -247,7 +247,7 @@ namespace netgen
virtual void Save (string filename) const;
void BuildFMap();
DLL_HEADER void BuildFMap();
Box<3> GetBoundingBox()
{ return boundingbox;}
@ -276,7 +276,7 @@ namespace netgen
}
void CalcBoundingBox ();
void BuildVisualizationMesh (double deflection);
DLL_HEADER void BuildVisualizationMesh (double deflection);
void RecursiveTopologyTree (const TopoDS_Shape & sh,
stringstream & str,
@ -284,17 +284,17 @@ namespace netgen
bool free,
const char * lname);
void GetTopologyTree (stringstream & str);
DLL_HEADER void GetTopologyTree (stringstream & str);
void PrintNrShapes ();
DLL_HEADER void PrintNrShapes ();
void CheckIrregularEntities (stringstream & str);
DLL_HEADER void CheckIrregularEntities (stringstream & str);
void SewFaces();
DLL_HEADER void SewFaces();
void MakeSolid();
DLL_HEADER void MakeSolid();
void HealGeometry();
DLL_HEADER void HealGeometry();
// Philippose - 15/01/2009
// Sets the maximum mesh size for a given face
@ -381,16 +381,16 @@ namespace netgen
vvispar[i-1].Lowlight();
}
void GetUnmeshedFaceInfo (stringstream & str);
void GetNotDrawableFaces (stringstream & str);
bool ErrorInSurfaceMeshing ();
DLL_HEADER void GetUnmeshedFaceInfo (stringstream & str);
DLL_HEADER void GetNotDrawableFaces (stringstream & str);
DLL_HEADER bool ErrorInSurfaceMeshing ();
// void WriteOCC_STL(char * filename);
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
DLL_HEADER virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
int perfstepsstart, int perfstepsend);
virtual const Refinement & GetRefinement () const;
DLL_HEADER virtual const Refinement & GetRefinement () const;
};
@ -431,11 +431,11 @@ namespace netgen
void PrintContents (OCCGeometry * geom);
OCCGeometry * LoadOCC_IGES (const char * filename);
OCCGeometry * LoadOCC_STEP (const char * filename);
OCCGeometry * LoadOCC_BREP (const char * filename);
DLL_HEADER OCCGeometry * LoadOCC_IGES (const char * filename);
DLL_HEADER OCCGeometry * LoadOCC_STEP (const char * filename);
DLL_HEADER OCCGeometry * LoadOCC_BREP (const char * filename);
extern OCCParameters occparam;
DLL_HEADER extern OCCParameters occparam;
// Philippose - 31.09.2009

View File

@ -10,10 +10,14 @@
#include <inctcl.hpp>
#include <visual.hpp>
#include <meshing.hpp>
#include "../meshing/bcfunctions.hpp"
#include "vsocc.hpp"
// __declspec(dllimport) void AutoColourBcProps(Mesh & mesh, const char *bccolourfile);
// __declspec(dllimport) void GetFaceColours(Mesh & mesh, Array<Vec3d> & face_colours);
// __declspec(dllimport) bool ColourMatch(Vec3d col1, Vec3d col2, double eps = 2.5e-05);
extern "C" int Ng_occ_Init (Tcl_Interp * interp);
@ -21,8 +25,8 @@ extern "C" int Ng_occ_Init (Tcl_Interp * interp);
namespace netgen
{
extern shared_ptr<NetgenGeometry> ng_geometry;
extern shared_ptr<Mesh> mesh;
extern DLL_HEADER shared_ptr<NetgenGeometry> ng_geometry;
extern DLL_HEADER shared_ptr<Mesh> mesh;
char * err_needsoccgeometry = (char*) "This operation needs an OCC geometry";
extern char * err_needsmesh;

View File

@ -1,4 +1,4 @@
set(netgen_sources demoview.cpp ngappinit.cpp onetcl.cpp parallelfunc.cpp ngpkg.cpp ../libsrc/stlgeom/stlpkg.cpp ../libsrc/visualization/visualpkg.cpp ../libsrc/csg/csgpkg.cpp ../libsrc/geom2d/geom2dpkg.cpp)
set(netgen_sources demoview.cpp ngappinit.cpp onetcl.cpp parallelfunc.cpp ngpkg.cpp ../libsrc/stlgeom/stlpkg.cpp ../libsrc/visualization/visualpkg.cpp ../libsrc/csg/csgpkg.cpp ../libsrc/geom2d/geom2dpkg.cpp ../libsrc/occ/occpkg.cpp ../libsrc/occ/vsocc.cpp)
if(USE_GUI)
if(WIN32)
@ -8,7 +8,7 @@ if(USE_GUI)
endif(WIN32)
add_executable(netgen ${netgen_sources})
target_link_libraries( netgen nglib ${ZLIB_LIBRARIES} ${LIBTOGL} ${TK_LIBRARY} ${TCL_LIBRARY} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_X11_LIB})
target_link_libraries( netgen nglib ${ZLIB_LIBRARIES} ${LIBTOGL} ${TK_LIBRARY} ${TCL_LIBRARY} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_X11_LIB} ${OCC_LIBRARIES})
if(NOT WIN32)
target_link_libraries( netgen mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis )
endif(NOT WIN32)

View File

@ -16,6 +16,7 @@ if(WIN32)
$<TARGET_OBJECTS:visual>
$<TARGET_OBJECTS:csgvis>
$<TARGET_OBJECTS:occ>
)
endif(WIN32)
@ -24,11 +25,11 @@ if(NOT WIN32)
target_link_libraries( nglib mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis )
endif(NOT WIN32)
target_link_libraries( nglib ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${TK_LIBRARY} ${TCL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} )
target_link_libraries( nglib ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${TK_LIBRARY} ${TCL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} )
if(USE_OCC)
if(USE_OCC AND NOT WIN32)
target_link_libraries(nglib occ)
endif(USE_OCC)
endif(USE_OCC AND NOT WIN32)
if(USE_PYTHON)
target_link_libraries(nglib ${PYTHON_LIBS})