FEM: Use single smesh mesh generator throughout FreeCAD
Creating a mesh generator resets a critical data structure and makes all existing meshes invalid. Hence the SMESH_gen is made a singleton and all FreeCAD code is changed accordingly.
This commit is contained in:
7
src/3rdParty/salomesmesh/inc/SMESH_Gen.hxx
vendored
7
src/3rdParty/salomesmesh/inc/SMESH_Gen.hxx
vendored
@@ -60,8 +60,9 @@ typedef std::set<int> TSetOfInt;
|
||||
class SMESH_EXPORT SMESH_Gen
|
||||
{
|
||||
public:
|
||||
SMESH_Gen();
|
||||
~SMESH_Gen();
|
||||
|
||||
static SMESH_Gen* get();
|
||||
|
||||
SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode)
|
||||
throw(SALOME_Exception);
|
||||
@@ -159,6 +160,10 @@ public:
|
||||
// std::map < int, SMESH_2D_Algo * >_map2D_Algo;
|
||||
// std::map < int, SMESH_3D_Algo * >_map3D_Algo;
|
||||
|
||||
protected:
|
||||
SMESH_Gen();
|
||||
static SMESH_Gen* generator;
|
||||
|
||||
private:
|
||||
|
||||
int _localId; // unique Id of created objects, within SMESH_Gen entity
|
||||
|
||||
10
src/3rdParty/salomesmesh/src/SMESH/SMESH_Gen.cpp
vendored
10
src/3rdParty/salomesmesh/src/SMESH/SMESH_Gen.cpp
vendored
@@ -55,6 +55,7 @@ using namespace std;
|
||||
|
||||
//#include <vtkDebugLeaks.h>
|
||||
|
||||
SMESH_Gen* SMESH_Gen::generator = nullptr;
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
@@ -74,6 +75,15 @@ SMESH_Gen::SMESH_Gen()
|
||||
//vtkDebugLeaks::SetExitError(0);
|
||||
}
|
||||
|
||||
SMESH_Gen* SMESH_Gen::get() {
|
||||
|
||||
if(!generator)
|
||||
generator = new SMESH_Gen();
|
||||
|
||||
return generator;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* Destructor
|
||||
|
||||
Reference in New Issue
Block a user