external smesh: use version info

for precompiler conditionals
This commit is contained in:
looooo
2018-04-22 20:11:36 +02:00
committed by wmayer
parent 21cdc9ea4a
commit 547cc9f36c
13 changed files with 25 additions and 21 deletions

View File

@@ -648,6 +648,9 @@ endif()
# Salome SMESH sources are under src/3rdParty now
IF(BUILD_SMESH)
# set the internal smesh version:
set(SMESH_VERSION_MAJOR 5) # in src/3rdParty it says smesh is version 5.*, is this true?
#if we use smesh we definitely also need vtk, no matter of external or internal smesh
set (VTK_COMPONENTS
vtkCommonCore
@@ -734,13 +737,14 @@ endif()
endif()
find_package(MEDFile REQUIRED)
set(SMESH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/3rdParty/salomesmesh/inc)
else(NOT FREECAD_USE_EXTERNAL_SMESH)
find_package(SMESH CONFIG REQUIRED)
include_directories(${SMESH_INCLUDE_DIR})
link_directories(${SMESH_LIB_PATH})
SET(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES})
add_definitions(-DHAVE_NETGEN)
add_definitions(-DEXTERNAL_SMESH)
add_definitions(-DSMESH_VERSION_MAJOR=${SMESH_VERSION_MAJOR})
if(NOT SMESH_FOUND)
message(ERROR "================\n"
"SMESH not found.\n"

View File

@@ -119,7 +119,7 @@ PyMOD_INIT_FUNC(Fem)
Fem::StdMeshers_SegmentAroundVertex_0DPy ::init_type(femModule);
Fem::StdMeshers_SegmentLengthAroundVertexPy ::init_type(femModule);
Fem::StdMeshers_StartEndLengthPy ::init_type(femModule);
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
Fem::StdMeshers_TrianglePreferencePy ::init_type(femModule);
#endif
Fem::StdMeshers_Hexa_3DPy ::init_type(femModule);

View File

@@ -50,7 +50,7 @@
#include <StdMeshers_LocalLength.hxx>
#include <StdMeshers_NumberOfSegments.hxx>
#include <StdMeshers_AutomaticLength.hxx>
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
#include <StdMeshers_TrianglePreference.hxx>
#endif
#include <StdMeshers_MEFISTO_2D.hxx>

View File

@@ -90,7 +90,7 @@ using namespace Base;
using namespace boost;
static int StatCount = 0;
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
SMESH_Gen* FemMesh::_mesh_gen = 0;
#endif
@@ -493,7 +493,7 @@ SMESH_Mesh* FemMesh::getSMesh()
SMESH_Gen * FemMesh::getGenerator()
{
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
return SMESH_Gen::get();
#else
if (! FemMesh::_mesh_gen)
@@ -1165,7 +1165,7 @@ void FemMesh::read(const char *FileName)
// read brep-file
myMesh->STLToMesh(File.filePath().c_str());
}
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
else if (File.hasExtension("dat") ) {
// read brep-file
// vejmarie disable

View File

@@ -160,7 +160,7 @@ private:
SMESH_Mesh *myMesh;
std::list<SMESH_HypothesisPtr> hypoth;
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
static SMESH_Gen *_mesh_gen;
#endif
};

View File

@@ -37,7 +37,7 @@
#include <SMDSAbs_ElementType.hxx>
#include <SMDS_MeshElement.hxx>
#include <SMDS_VolumeTool.hxx>
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
#include <SMESHDS_Mesh.hxx>
#endif

View File

@@ -34,7 +34,7 @@
#include <Base/Console.h>
#include <SMESH_Gen.hxx>
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
#include <SMESHDS_Mesh.hxx>
#endif

View File

@@ -61,7 +61,7 @@
#include <StdMeshers_QuadraticMesh.hxx>
#include <StdMeshers_RadialPrism_3D.hxx>
#include <StdMeshers_SegmentAroundVertex_0D.hxx>
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
#include <StdMeshers_TrianglePreference.hxx>
#endif
#include <StdMeshers_ProjectionSource1D.hxx>

View File

@@ -53,7 +53,7 @@
#include <SMESH_Mesh.hxx>
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
#include <SMDS_VolumeTool.hxx>
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
#include <SMESHDS_Mesh.hxx>
#endif

View File

@@ -53,7 +53,7 @@
#include <StdMeshers_QuadraticMesh.hxx>
#include <StdMeshers_RadialPrism_3D.hxx>
#include <StdMeshers_SegmentAroundVertex_0D.hxx>
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
#include <StdMeshers_TrianglePreference.hxx>
#endif
#include <StdMeshers_ProjectionSource1D.hxx>
@@ -89,7 +89,7 @@ void SMESH_HypothesisPy<T>::init_type(PyObject* module)
SMESH_HypothesisPy::add_varargs_method("setLibName", &SMESH_HypothesisPy<T>::setLibName, "setLibName(String)");
SMESH_HypothesisPy::add_varargs_method("getLibName", &SMESH_HypothesisPy<T>::getLibName, "String getLibName()");
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
SMESH_HypothesisPy::add_varargs_method("setParameters", &SMESH_HypothesisPy<T>::setParameters, "setParameters(String)");
SMESH_HypothesisPy::add_varargs_method("getParameters", &SMESH_HypothesisPy<T>::getParameters, "String getParameters()");
SMESH_HypothesisPy::add_varargs_method("setLastParameters", &SMESH_HypothesisPy<T>::setLastParameters, "setLastParameters(String)");
@@ -145,7 +145,7 @@ Py::Object SMESH_HypothesisPy<T>::getLibName(const Py::Tuple& args)
}
#ifndef EXTERNAL_SMESH //////////////////////////////////////////////////////////
#if SMESH_VERSION_MAJOR < 7 //////////////////////////////////////////////////////////
template<class T>
Py::Object SMESH_HypothesisPy<T>::setParameters(const Py::Tuple& args)
{
@@ -653,7 +653,7 @@ StdMeshers_Hexa_3DPy::~StdMeshers_Hexa_3DPy()
// ----------------------------------------------------------------------------
#ifndef EXTERNAL_SMESH ///////////////////////////////////////////////////////////
#if SMESH_VERSION_MAJOR < 7 ///////////////////////////////////////////////////////////
void StdMeshers_TrianglePreferencePy::init_type(PyObject* module)
{
behaviors().name("StdMeshers_TrianglePreference");

View File

@@ -221,7 +221,7 @@ public:
StdMeshers_Hexa_3DPy(int hypId, int studyId, SMESH_Gen* gen);
~StdMeshers_Hexa_3DPy();
};
#ifndef EXTERNAL_SMESH ///////////////////////////////////////////////////////////////////////////////
#if SMESH_VERSION_MAJOR < 7 ///////////////////////////////////////////////////////////////////////////////
class StdMeshers_TrianglePreferencePy : public SMESH_HypothesisPy<StdMeshers_TrianglePreferencePy>
{
public:

View File

@@ -43,7 +43,7 @@
#include <SMESH_Gen.hxx>
#include <StdMeshers_MaxLength.hxx>
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
#include <SMESH_Mesh.hxx>
#include <SMESHDS_Mesh.hxx>
#else
@@ -75,7 +75,7 @@
using namespace MeshPart;
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
SMESH_Gen* Mesher::_mesh_gen = 0;
#endif
@@ -323,7 +323,7 @@ Mesh::MeshObject* Mesher::createMesh() const
#else
std::list<SMESH_Hypothesis*> hypoth;
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
SMESH_Gen* meshgen = SMESH_Gen::get();
#else
if (! Mesher::_mesh_gen)
@@ -406,7 +406,7 @@ Mesh::MeshObject* Mesher::createMesh() const
StdMeshers_Regular_1D* hyp1d = new StdMeshers_Regular_1D(hyp++,0,meshgen);
hypoth.push_back(hyp1d);
}
#ifndef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR < 7
StdMeshers_TrianglePreference* hyp2d_1 = new StdMeshers_TrianglePreference(hyp++,0,meshgen);
hypoth.push_back(hyp2d_1);
#endif

View File

@@ -154,7 +154,7 @@ private:
std::vector<uint32_t> colors;
struct Vertex;
#ifdef EXTERNAL_SMESH
#if SMESH_VERSION_MAJOR >= 7
static SMESH_Gen *_mesh_gen;
#endif
};