port to smesh 8.3

using #ifdef EXTERNAL_SMESH for the diff
This commit is contained in:
looooo
2018-04-17 21:22:26 +02:00
committed by wmayer
parent 5941a32f71
commit 21cdc9ea4a
15 changed files with 84 additions and 10 deletions

View File

@@ -67,7 +67,7 @@ SET(MeshPart_SRCS
)
add_library(MeshPart SHARED ${MeshPart_SRCS})
target_link_libraries(MeshPart ${MeshPart_LIBS})
target_link_libraries(MeshPart ${MeshPart_LIBS} ${EXTERNAL_SMESH_LIBS})
fc_target_copy_resource(MeshPart

View File

@@ -42,10 +42,17 @@
#endif
#include <SMESH_Gen.hxx>
#include <StdMeshers_MaxLength.hxx>
#ifdef EXTERNAL_SMESH
#include <SMESH_Mesh.hxx>
#include <SMESHDS_Mesh.hxx>
#else
#include <StdMeshers_TrianglePreference.hxx>
#endif
#include <StdMeshers_LocalLength.hxx>
#include <StdMeshers_NumberOfSegments.hxx>
#include <StdMeshers_AutomaticLength.hxx>
#include <StdMeshers_TrianglePreference.hxx>
#include <StdMeshers_MEFISTO_2D.hxx>
#include <StdMeshers_Deflection1D.hxx>
#include <StdMeshers_Arithmetic1D.hxx>
@@ -68,6 +75,11 @@
using namespace MeshPart;
#ifdef EXTERNAL_SMESH
SMESH_Gen* Mesher::_mesh_gen = 0;
#endif
MeshingOutput::MeshingOutput()
{
buffer.reserve(80);
@@ -311,8 +323,17 @@ Mesh::MeshObject* Mesher::createMesh() const
#else
std::list<SMESH_Hypothesis*> hypoth;
#ifndef EXTERNAL_SMESH
SMESH_Gen* meshgen = SMESH_Gen::get();
#else
if (! Mesher::_mesh_gen)
Mesher::_mesh_gen = new SMESH_Gen();
SMESH_Gen* meshgen = Mesher::_mesh_gen;
#endif
SMESH_Mesh* mesh = meshgen->CreateMesh(0, true);
int hyp=0;
switch (method) {
@@ -385,9 +406,10 @@ Mesh::MeshObject* Mesher::createMesh() const
StdMeshers_Regular_1D* hyp1d = new StdMeshers_Regular_1D(hyp++,0,meshgen);
hypoth.push_back(hyp1d);
}
#ifndef EXTERNAL_SMESH
StdMeshers_TrianglePreference* hyp2d_1 = new StdMeshers_TrianglePreference(hyp++,0,meshgen);
hypoth.push_back(hyp2d_1);
#endif
StdMeshers_MEFISTO_2D* alg2d = new StdMeshers_MEFISTO_2D(hyp++,0,meshgen);
hypoth.push_back(alg2d);
} break;

View File

@@ -27,6 +27,7 @@
#include <Base/Stream.h>
class TopoDS_Shape;
class SMESH_Gen;
namespace Mesh { class MeshObject; }
namespace MeshPart {
@@ -152,6 +153,10 @@ private:
#endif
std::vector<uint32_t> colors;
struct Vertex;
#ifdef EXTERNAL_SMESH
static SMESH_Gen *_mesh_gen;
#endif
};
class MeshingOutput : public std::streambuf