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;
183 const std::list<SMESHDS_Command*> & GetLog();
189 bool MeshExists(
int meshId )
const;
201 SMESH_subMesh *GetSubMeshContaining(
const TopoDS_Shape & aSubShape)
const;
203 SMESH_subMesh *GetSubMeshContaining(
const int aShapeID)
const;
207 std::list<SMESH_subMesh*> GetGroupSubMeshesContaining(
const TopoDS_Shape & shape)
const;
211 void NotifySubMeshesHypothesisModification(
const SMESH_Hypothesis* theChangedHyp);
223 bool IsNotConformAllowed()
const;
225 bool IsMainShape(
const TopoDS_Shape& theShape)
const;
227 TopoDS_Shape GetShapeByEntry(
const std::string& entry)
const;
233 const TopTools_ListOfShape& GetAncestors(
const TopoDS_Shape& theSubShape)
const;
235 void SetAutoColor(
bool theAutoColor);
243 void SetIsModified(
bool isModified);
252 bool HasModificationsToDiscard()
const;
269 bool HasDuplicatedGroupNamesMED();
280 MEDCoupling::MCAuto<MEDCoupling::DataArrayByte>
281 ExportMEDCoupling(
const char* theMeshName = NULL,
282 bool theAutoGroups =
true,
284 bool theAutoDimension =
false,
285 bool theAddODOnVertices =
false,
286 double theZTolerance = -1.,
287 bool theSaveNumbers =
true);
289 void ExportMED(
const char * theFile,
290 const char* theMeshName = NULL,
291 bool theAutoGroups =
true,
294 bool theAutoDimension =
false,
295 bool theAddODOnVertices =
false,
296 double theZTolerance = -1.,
297 bool theSaveNumbers =
true);
299 void ExportDAT(
const char * file,
301 const bool renumber =
true);
302 void ExportUNV(
const char * file,
304 const bool renumber =
true);
305 void ExportSTL(
const char * file,
307 const char * name = 0,
309 void ExportCGNS(
const char * file,
311 const char * meshName = 0,
312 const bool groupElemsByType =
false);
313 void ExportStructuredCGNS(
const char * file,
315 const char * meshName = 0);
316 void ExportGMF(
const char * file,
318 bool withRequiredGroups =
true );
320 double GetComputeProgress()
const;
322 smIdType NbNodes()
const;
323 smIdType Nb0DElements()
const;
324 smIdType NbBalls()
const;
331 smIdType NbBiQuadQuadrangles()
const;
332 smIdType NbBiQuadTriangles()
const;
338 smIdType NbTriQuadraticHexas()
const;
341 smIdType NbQuadPrisms()
const;
342 smIdType NbBiQuadPrisms()
const;
343 smIdType NbHexagonalPrisms()
const;
344 smIdType NbPolyhedrons()
const;
346 smIdType NbSubMesh()
const;
348 size_t NbGroup()
const {
return _mapGroup.size(); }
350 int NbMeshes()
const;
354 const int theId = -1,
355 const TopoDS_Shape& theShape = TopoDS_Shape(),
363 std::list<int> GetGroupIds()
const;
365 SMESH_Group* GetGroup (
const int theGroupID)
const;
367 bool RemoveGroup (
const int theGroupID);
369 SMESH_Group* ConvertToStandalone (
int theGroupID );
380 void SetCallUp( TCallUp * upCaller );
382 bool SynchronizeGroups();
387 void ClearMeshOrder();
392 bool SortByMeshOrder(std::vector<SMESH_subMesh*>& theListToSort)
const;
398 std::ostream&
Dump(std::ostream & save);
407 virtual bool IsParallel(){
throw SALOME_Exception(
"Calling SMESH_Mesh::IsParallel");
return false;};
408 virtual int GetParallelElement(){
throw SALOME_Exception(
"Calling SMESH_Mesh::GetParallelElement");
return 0;};
413 const TopoDS_Shape & aShape,
416 TopTools_IndexedMapOfShape* allowedSubShapes,
418 const bool includeSelf,
419 const bool complexShapeFirst,
420 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;};
425 const char* theMeshName,
428 bool theAutoDimension,
429 bool theAddODOnVertices,
430 double theZTolerance,
431 bool theSaveNumbers);
434 void fillAncestorsMap(
const TopoDS_Shape& theShape);
435 void getAncestorsSubMeshes(
const TopoDS_Shape& theSubShape,
436 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:38
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:75
#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:98
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:99
Definition: SMESH_Mesh.hxx:80
bool GetIsModified() const
Definition: SMESH_Mesh.hxx:245
std::map< int, SMESH_Group * > _mapGroup
Definition: SMESH_Mesh.hxx:446
virtual void Unlock()
Definition: SMESH_Mesh.hxx:403
bool _isModified
modified since last total re-compute, issue 0020693
Definition: SMESH_Mesh.hxx:452
bool HasShapeToMesh() const
Return true if there is a geometry to be meshed, not PseudoShape()
Definition: SMESH_Mesh.hxx:100
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:410
const TAncestorMap & GetAncestorMap() const
Definition: SMESH_Mesh.hxx:263
double _shapeDiagonal
diagonal size of bounding box of shape to mesh
Definition: SMESH_Mesh.hxx:454
SubMeshHolder * _subMeshHolder
Definition: SMESH_Mesh.hxx:449
std::ostream & Dump(std::ostream &save)
std::vector< SMESH_subMesh * > _ancestorSubMeshes
Definition: SMESH_Mesh.hxx:458
const SMESHDS_Mesh * GetMeshDS() const
Definition: SMESH_Mesh.hxx:195
TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors
Definition: SMESH_Mesh.hxx:456
SMESHDS_Mesh * _meshDS
Definition: SMESH_Mesh.hxx:444
void UndefShapeToMesh()
Definition: SMESH_Mesh.hxx:102
boost::shared_ptr< SMDS_Iterator< SMESH_Group * > > GroupIteratorPtr
Definition: SMESH_Mesh.hxx:360
SMESH_Mesh(const SMESH_Mesh &)
Definition: SMESH_Mesh.hxx:470
bool _isShapeToMesh
Definition: SMESH_Mesh.hxx:442
SMESH_Gen * _gen
Definition: SMESH_Mesh.hxx:445
virtual int GetParallelElement()
Definition: SMESH_Mesh.hxx:408
int GetId() const
Definition: SMESH_Mesh.hxx:187
int _groupId
Definition: SMESH_Mesh.hxx:440
int _nbSubShapes
Definition: SMESH_Mesh.hxx:441
size_t NbGroup() const
Definition: SMESH_Mesh.hxx:348
SMESHDS_Document * _document
Definition: SMESH_Mesh.hxx:443
bool _isAutoColor
Definition: SMESH_Mesh.hxx:451
TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap
Return data map of descendant to ancestor shapes.
Definition: SMESH_Mesh.hxx:262
SMESH_Gen * GetGen()
Definition: SMESH_Mesh.hxx:197
int _id
Definition: SMESH_Mesh.hxx:439
virtual void Lock()
Definition: SMESH_Mesh.hxx:402
virtual void wait()
Definition: SMESH_Mesh.hxx:405
TCallUp * _callUp
Definition: SMESH_Mesh.hxx:466
TListOfListOfInt _subMeshOrder
Definition: SMESH_Mesh.hxx:460
virtual bool IsParallel()
Definition: SMESH_Mesh.hxx:407
SMESHDS_Mesh * GetMeshDS()
Definition: SMESH_Mesh.hxx:193
Definition: SMESH_subMesh.hxx:61
compute_event
Definition: SMESH_subMesh.hxx:116
algo_event
Definition: SMESH_subMesh.hxx:108
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:372
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:378
virtual bool IsLoaded()=0