27 #ifndef _SMESH_MESH_HXX_
28 #define _SMESH_MESH_HXX_
38 #include "Utils_SALOME_Exception.hxx"
40 #include <TopoDS_Shape.hxx>
41 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
42 #include <TopTools_ListOfShape.hxx>
49 #pragma warning(disable:4251) // Warning DLL Interface ...
50 #pragma warning(disable:4290) // Warning Exception ...
73 bool theIsEmbeddedMode,
81 void ShapeToMesh(
const TopoDS_Shape & aShape);
85 TopoDS_Shape GetShapeToMesh()
const;
93 double GetShapeDiagonalSize()
const;
97 static double GetShapeDiagonalSize(
const TopoDS_Shape & aShape);
102 static const TopoDS_Solid& PseudoShape();
115 void ClearSubMesh(
const int theShapeId);
120 int UNVToMesh(
const char* theFileName);
122 int MEDToMesh(
const char* theFileName,
const char* theMeshName);
124 std::string STLToMesh(
const char* theFileName);
126 int CGNSToMesh(
const char* theFileName,
const int theMeshIndex, std::string& theMeshName);
129 bool theMakeRequiredGroups =
true );
132 AddHypothesis(
const TopoDS_Shape & aSubShape,
int anHypId, std::string* error=0)
133 throw(SALOME_Exception);
136 RemoveHypothesis(const TopoDS_Shape & aSubShape,
int anHypId)
137 throw(SALOME_Exception);
140 GetHypothesisList(const TopoDS_Shape & aSubShape) const
141 throw(SALOME_Exception);
145 const
bool andAncestors,
146 TopoDS_Shape* assignedTo=0) const;
148 int GetHypotheses(const TopoDS_Shape & aSubShape,
151 const
bool andAncestors,
152 std::list< TopoDS_Shape > * assignedTo=0) const;
156 const
bool andAncestors,
157 TopoDS_Shape* assignedTo=0) const;
162 const
bool andAncestors,
163 std::list< TopoDS_Shape > * assignedTo=0) const;
169 void ClearLog() throw(SALOME_Exception);
171 int GetId()
const {
return _id; }
173 bool MeshExists(
int meshId )
const;
184 throw(SALOME_Exception);
186 SMESH_subMesh *GetSubMeshContaining(
const TopoDS_Shape & aSubShape)
const
187 throw(SALOME_Exception);
189 SMESH_subMesh *GetSubMeshContaining(
const int aShapeID)
const
190 throw(SALOME_Exception);
194 std::list<SMESH_subMesh*> GetGroupSubMeshesContaining(
const TopoDS_Shape & shape)
const
195 throw(SALOME_Exception);
199 void NotifySubMeshesHypothesisModification(
const SMESH_Hypothesis* theChangedHyp);
211 bool IsNotConformAllowed()
const;
213 bool IsMainShape(
const TopoDS_Shape& theShape)
const;
218 const TopTools_ListOfShape& GetAncestors(
const TopoDS_Shape& theSubShape)
const;
220 void SetAutoColor(
bool theAutoColor)
throw(SALOME_Exception);
222 bool GetAutoColor() throw(SALOME_Exception);
228 void SetIsModified(
bool isModified);
230 bool GetIsModified()
const {
return _isModified; }
237 bool HasModificationsToDiscard()
const;
248 bool HasDuplicatedGroupNamesMED();
250 void ExportMED(
const char * theFile,
251 const char* theMeshName = NULL,
252 bool theAutoGroups =
true,
255 bool theAutoDimension =
false,
256 bool theAddODOnVertices =
false,
257 bool theAllElemsToGroup =
false)
258 throw(SALOME_Exception);
260 void ExportDAT(const
char * file,
261 const
SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
262 void ExportUNV(const
char * file,
263 const
SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
264 void ExportSTL(const
char * file,
266 const
char * name = 0,
267 const
SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
268 void ExportCGNS(const
char * file,
270 const
char * meshName = 0);
271 void ExportGMF(const
char * file,
273 bool withRequiredGroups = true );
274 void ExportSAUV(const
char *file,
275 const
char* theMeshName = NULL,
276 bool theAutoGroups = true) throw(SALOME_Exception);
278 double GetComputeProgress() const;
280 int NbNodes() const throw(SALOME_Exception);
281 int Nb0DElements() const throw(SALOME_Exception);
282 int NbBalls() const throw(SALOME_Exception);
289 int NbBiQuadQuadrangles() const throw(SALOME_Exception);
290 int NbBiQuadTriangles() const throw(SALOME_Exception);
296 int NbTriQuadraticHexas() const throw(SALOME_Exception);
299 int NbHexagonalPrisms() const throw(SALOME_Exception);
300 int NbPolyhedrons() const throw(SALOME_Exception);
302 int NbSubMesh() const throw(SALOME_Exception);
304 int NbGroup()
const {
return _mapGroup.size(); }
306 int NbMeshes()
const;
311 const TopoDS_Shape& theShape=TopoDS_Shape(),
319 std::list<int> GetGroupIds()
const;
323 bool RemoveGroup (
const int theGroupID);
325 SMESH_Group* ConvertToStandalone (
int theGroupID );
329 virtual void RemoveGroup (
const int theGroupID)=0;
330 virtual void HypothesisModified ()=0;
331 virtual void Load ()=0;
334 void SetCallUp( TCallUp * upCaller );
336 bool SynchronizeGroups();
341 void ClearMeshOrder();
346 bool SortByMeshOrder(std::vector<SMESH_subMesh*>& theListToSort)
const;
352 std::ostream& Dump(ostream & save);
356 void fillAncestorsMap(
const TopoDS_Shape& theShape);
357 void getAncestorsSubMeshes(
const TopoDS_Shape& theSubShape,
358 std::vector< SMESH_subMesh* >& theSubMeshes)
const;