27 #ifndef _SMESH_MESH_HXX_
28 #define _SMESH_MESH_HXX_
39 #include "Utils_SALOME_Exception.hxx"
41 #include <TopoDS_Shape.hxx>
42 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
43 #include <TopTools_ListOfShape.hxx>
45 #include "MEDCouplingMemArray.hxx"
53 #include <boost/filesystem.hpp>
55 #include <boost/thread.hpp>
58 #pragma warning(disable:4251)
59 #pragma warning(disable:4290)
84 bool theIsEmbeddedMode,
92 void ShapeToMesh(
const TopoDS_Shape & aShape);
96 TopoDS_Shape GetShapeToMesh()
const;
107 double GetShapeDiagonalSize()
const;
111 static double GetShapeDiagonalSize(
const TopoDS_Shape & aShape);
116 static const TopoDS_Solid& PseudoShape();
129 void ClearSubMesh(
const int theShapeId);
134 int UNVToMesh(
const char* theFileName);
136 int MEDToMesh(
const char* theFileName,
const char* theMeshName);
138 std::string STLToMesh(
const char* theFileName);
140 int CGNSToMesh(
const char* theFileName,
const int theMeshIndex, std::string& theMeshName);
143 bool theMakeRequiredGroups =
true );
146 AddHypothesis(
const TopoDS_Shape & aSubShape,
int anHypId, std::string* error=0);
149 RemoveHypothesis(
const TopoDS_Shape & aSubShape,
int anHypId);
151 const std::list <const SMESHDS_Hypothesis * >&
152 GetHypothesisList(
const TopoDS_Shape & aSubShape)
const;
156 const bool andAncestors,
157 TopoDS_Shape* assignedTo=0)
const;
159 int GetHypotheses(
const TopoDS_Shape & aSubShape,
161 std::list< const SMESHDS_Hypothesis * >& aHypList,
162 const bool andAncestors,
163 std::list< TopoDS_Shape > * assignedTo=0)
const;
167 const bool andAncestors,
168 TopoDS_Shape* assignedTo=0)
const;
172 std::list< const SMESHDS_Hypothesis * >& aHypList,
173 const bool andAncestors,
174 std::list< TopoDS_Shape > * assignedTo=0)
const;
178 const std::list<SMESHDS_Command*> & GetLog();
184 bool MeshExists(
int meshId )
const;
196 SMESH_subMesh *GetSubMeshContaining(
const TopoDS_Shape & aSubShape)
const;
198 SMESH_subMesh *GetSubMeshContaining(
const int aShapeID)
const;
202 std::list<SMESH_subMesh*> GetGroupSubMeshesContaining(
const TopoDS_Shape & shape)
const;
206 void NotifySubMeshesHypothesisModification(
const SMESH_Hypothesis* theChangedHyp);
218 bool IsNotConformAllowed()
const;
220 bool IsMainShape(
const TopoDS_Shape& theShape)
const;
222 TopoDS_Shape GetShapeByEntry(
const std::string& entry)
const;
228 const TopTools_ListOfShape& GetAncestors(
const TopoDS_Shape& theSubShape)
const;
230 void SetAutoColor(
bool theAutoColor);
238 void SetIsModified(
bool isModified);
247 bool HasModificationsToDiscard()
const;
264 bool HasDuplicatedGroupNamesMED();
275 MEDCoupling::MCAuto<MEDCoupling::DataArrayByte>
276 ExportMEDCoupling(
const char* theMeshName = NULL,
277 bool theAutoGroups =
true,
279 bool theAutoDimension =
false,
280 bool theAddODOnVertices =
false,
281 double theZTolerance = -1.,
282 bool theSaveNumbers =
true);
284 void ExportMED(
const char * theFile,
285 const char* theMeshName = NULL,
286 bool theAutoGroups =
true,
289 bool theAutoDimension =
false,
290 bool theAddODOnVertices =
false,
291 double theZTolerance = -1.,
292 bool theSaveNumbers =
true);
294 void ExportDAT(
const char * file,
296 const bool renumber =
true);
297 void ExportUNV(
const char * file,
299 const bool renumber =
true);
300 void ExportSTL(
const char * file,
302 const char * name = 0,
304 void ExportCGNS(
const char * file,
306 const char * meshName = 0,
307 const bool groupElemsByType =
false);
308 void ExportGMF(
const char * file,
310 bool withRequiredGroups =
true );
312 double GetComputeProgress()
const;
314 smIdType NbNodes()
const;
315 smIdType Nb0DElements()
const;
316 smIdType NbBalls()
const;
323 smIdType NbBiQuadQuadrangles()
const;
324 smIdType NbBiQuadTriangles()
const;
330 smIdType NbTriQuadraticHexas()
const;
333 smIdType NbQuadPrisms()
const;
334 smIdType NbBiQuadPrisms()
const;
335 smIdType NbHexagonalPrisms()
const;
336 smIdType NbPolyhedrons()
const;
338 smIdType NbSubMesh()
const;
340 size_t NbGroup()
const {
return _mapGroup.size(); }
342 int NbMeshes()
const;
346 const int theId = -1,
347 const TopoDS_Shape& theShape = TopoDS_Shape(),
355 std::list<int> GetGroupIds()
const;
357 SMESH_Group* GetGroup (
const int theGroupID)
const;
359 bool RemoveGroup (
const int theGroupID);
361 SMESH_Group* ConvertToStandalone (
int theGroupID );
372 void SetCallUp( TCallUp * upCaller );
374 bool SynchronizeGroups();
379 void ClearMeshOrder();
384 bool SortByMeshOrder(std::vector<SMESH_subMesh*>& theListToSort)
const;
390 std::ostream&
Dump(std::ostream & save);
399 virtual bool IsParallel(){
throw SALOME_Exception(
"Calling SMESH_Mesh::IsParallel");
return false;};
404 const TopoDS_Shape & aShape,
407 TopTools_IndexedMapOfShape* allowedSubShapes,
409 const bool includeSelf,
410 const bool complexShapeFirst,
411 const bool aShapeOnly){(void) gen;(void) aMesh;(void) aShape;(void) aDim;(void) aShapesId;(void) allowedSubShapes;(void) computeEvent;(void) includeSelf;(void) complexShapeFirst;(void) aShapeOnly;
throw SALOME_Exception(
"Calling SMESH_Mesh::ComputeSubMeshes");
return false;};
416 const char* theMeshName,
419 bool theAutoDimension,
420 bool theAddODOnVertices,
421 double theZTolerance,
422 bool theSaveNumbers);
425 void fillAncestorsMap(
const TopoDS_Shape& theShape);
426 void getAncestorsSubMeshes(
const TopoDS_Shape& theSubShape,
427 std::vector< SMESH_subMesh* >& theSubMeshes)
const;
SMDSAbs_ElementOrder
Definition: SMDSAbs_ElementType.hxx:70
@ ORDER_ANY
Definition: SMDSAbs_ElementType.hxx:71
SMDSAbs_ElementType
Type (node, edge, face or volume) of elements.
Definition: SMDSAbs_ElementType.hxx:34
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
Definition: SMESH_ComputeError.hxx:36
SMESH::Controls::PredicatePtr SMESH_PredicatePtr
Definition: SMESH_Controls.hxx:81
std::set< int > TSetOfInt
Definition: SMESH_Gen.hxx:65
MeshDimension
Definition: SMESH_Hypothesis.hxx:40
std::list< int > TListOfInt
Definition: SMESH_Mesh.hxx:76
std::list< TListOfInt > TListOfListOfInt
Definition: SMESH_Mesh.hxx:77
std::set< int > TSetOfInt
Definition: SMESH_Mesh.hxx:73
#define SMESH_EXPORT
Definition: SMESH_SMESH.hxx:37
Write a mesh to a MED file.
Definition: DriverMED_W_SMESHDS_Mesh.h:49
Definition: SMESHDS_Command.hxx:38
Definition: SMESHDS_Document.hxx:38
Definition: SMESHDS_GroupBase.hxx:42
Definition: SMESHDS_Hypothesis.hxx:37
Definition: SMESHDS_Mesh.hxx:68
Definition: SMESH_Gen.hxx:68
Definition: SMESH_Group.hxx:43
Definition: SMESH_HypoFilter.hxx:57
Definition: SMESH_Hypothesis.hxx:48
Hypothesis_Status
Definition: SMESH_Hypothesis.hxx:51
Definition: SMESH_Mesh.cxx:96
Definition: SMESH_Mesh.hxx:80
SMESH_Gen * GetGen()
Definition: SMESH_Mesh.hxx:192
bool GetIsModified() const
Definition: SMESH_Mesh.hxx:240
std::map< int, SMESH_Group * > _mapGroup
Definition: SMESH_Mesh.hxx:437
virtual void Unlock()
Definition: SMESH_Mesh.hxx:395
bool _isModified
modified since last total re-compute, issue 0020693
Definition: SMESH_Mesh.hxx:443
bool HasShapeToMesh() const
Return true if there is a geometry to be meshed, not PseudoShape()
Definition: SMESH_Mesh.hxx:100
const SMESHDS_Mesh * GetMeshDS() const
Definition: SMESH_Mesh.hxx:190
virtual bool ComputeSubMeshes(SMESH_Gen *gen, SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const ::MeshDimension aDim, TSetOfInt *aShapesId, TopTools_IndexedMapOfShape *allowedSubShapes, SMESH_subMesh::compute_event &computeEvent, const bool includeSelf, const bool complexShapeFirst, const bool aShapeOnly)
Definition: SMESH_Mesh.hxx:401
double _shapeDiagonal
diagonal size of bounding box of shape to mesh
Definition: SMESH_Mesh.hxx:445
SubMeshHolder * _subMeshHolder
Definition: SMESH_Mesh.hxx:439
std::vector< SMESH_subMesh * > _ancestorSubMeshes
Definition: SMESH_Mesh.hxx:449
TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors
Definition: SMESH_Mesh.hxx:447
SMESHDS_Mesh * _meshDS
Definition: SMESH_Mesh.hxx:435
std::ostream & Dump(std::ostream &save)
void UndefShapeToMesh()
Definition: SMESH_Mesh.hxx:102
boost::shared_ptr< SMDS_Iterator< SMESH_Group * > > GroupIteratorPtr
Definition: SMESH_Mesh.hxx:352
SMESH_Mesh(const SMESH_Mesh &)
Definition: SMESH_Mesh.hxx:461
bool _isShapeToMesh
Definition: SMESH_Mesh.hxx:433
SMESH_Gen * _gen
Definition: SMESH_Mesh.hxx:436
int GetId() const
Definition: SMESH_Mesh.hxx:182
int _groupId
Definition: SMESH_Mesh.hxx:431
int _nbSubShapes
Definition: SMESH_Mesh.hxx:432
const TAncestorMap & GetAncestorMap() const
Definition: SMESH_Mesh.hxx:258
size_t NbGroup() const
Definition: SMESH_Mesh.hxx:340
SMESHDS_Mesh * GetMeshDS()
Definition: SMESH_Mesh.hxx:188
SMESHDS_Document * _document
Definition: SMESH_Mesh.hxx:434
bool _isAutoColor
Definition: SMESH_Mesh.hxx:442
TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap
Return data map of descendant to ancestor shapes.
Definition: SMESH_Mesh.hxx:257
int _id
Definition: SMESH_Mesh.hxx:430
virtual void Lock()
Definition: SMESH_Mesh.hxx:394
virtual void wait()
Definition: SMESH_Mesh.hxx:397
TCallUp * _callUp
Definition: SMESH_Mesh.hxx:457
TListOfListOfInt _subMeshOrder
Definition: SMESH_Mesh.hxx:451
virtual bool IsParallel()
Definition: SMESH_Mesh.hxx:399
Definition: SMESH_subMesh.hxx:61
compute_event
Definition: SMESH_subMesh.hxx:116
SMESH::SMESH_Group_var AddGroup(SMESH::SMESH_Mesh_ptr theMesh, SMESH::ElementType theType, const QString &theGroupName)
Definition: SMESHGUI_GroupUtils.cxx:38
Definition: SMESH_Mesh.hxx:364
virtual TopoDS_Shape GetShapeByEntry(const std::string &entry)=0
virtual void RemoveGroup(const int theGroupID)=0
virtual void HypothesisModified(int hypID, bool updateIcons)=0
virtual ~TCallUp()
Definition: SMESH_Mesh.hxx:370
virtual bool IsLoaded()=0