diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d566177..817885e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) ####################################################################### diff --git a/libsrc/meshing/bcfunctions.cpp b/libsrc/meshing/bcfunctions.cpp index 1bab1b75..46317661 100644 --- a/libsrc/meshing/bcfunctions.cpp +++ b/libsrc/meshing/bcfunctions.cpp @@ -1,6 +1,7 @@ #include #include +#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; diff --git a/libsrc/meshing/bcfunctions.hpp b/libsrc/meshing/bcfunctions.hpp index 593838af..074654ae 100644 --- a/libsrc/meshing/bcfunctions.hpp +++ b/libsrc/meshing/bcfunctions.hpp @@ -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 & face_colours); + extern DLL_HEADER void GetFaceColours(Mesh & mesh, Array & 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 diff --git a/libsrc/occ/CMakeLists.txt b/libsrc/occ/CMakeLists.txt index 640eab0b..6dc5453e 100644 --- a/libsrc/occ/CMakeLists.txt +++ b/libsrc/occ/CMakeLists.txt @@ -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}) diff --git a/libsrc/occ/occgeom.hpp b/libsrc/occ/occgeom.hpp index ffa9f5f4..de725ef4 100644 --- a/libsrc/occ/occgeom.hpp +++ b/libsrc/occ/occgeom.hpp @@ -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, MeshingParameters & mparam, + DLL_HEADER virtual int GenerateMesh (shared_ptr & 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 diff --git a/libsrc/occ/occpkg.cpp b/libsrc/occ/occpkg.cpp index 9000e10a..32947d6d 100644 --- a/libsrc/occ/occpkg.cpp +++ b/libsrc/occ/occpkg.cpp @@ -10,10 +10,14 @@ #include #include +#include #include "../meshing/bcfunctions.hpp" #include "vsocc.hpp" +// __declspec(dllimport) void AutoColourBcProps(Mesh & mesh, const char *bccolourfile); +// __declspec(dllimport) void GetFaceColours(Mesh & mesh, Array & 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 ng_geometry; - extern shared_ptr mesh; + extern DLL_HEADER shared_ptr ng_geometry; + extern DLL_HEADER shared_ptr mesh; char * err_needsoccgeometry = (char*) "This operation needs an OCC geometry"; extern char * err_needsmesh; diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index 2cc8fdc7..354851a3 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -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) diff --git a/nglib/CMakeLists.txt b/nglib/CMakeLists.txt index 85636332..f172f7e6 100644 --- a/nglib/CMakeLists.txt +++ b/nglib/CMakeLists.txt @@ -16,6 +16,7 @@ if(WIN32) $ $ + $ ) 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})