1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_Mesh.hxx
25 // Author : Paul RASCLE, EDF
29 #ifndef _SMESH_MESH_HXX_
30 #define _SMESH_MESH_HXX_
32 #include "SMESHDS_Document.hxx"
33 #include "SMESHDS_Mesh.hxx"
34 #include "SMESHDS_Command.hxx"
35 #include "SMESH_Hypothesis.hxx"
36 #include "SMESH_subMesh.hxx"
37 #include "Utils_SALOME_Exception.hxx"
40 #include <TopExp_Explorer.hxx>
42 #include <TopoDS_Iterator.hxx>
43 #include <TopoDS_Compound.hxx>
44 #include <TopoDS_CompSolid.hxx>
45 #include <TopoDS_Solid.hxx>
46 #include <TopoDS_Shell.hxx>
47 #include <TopoDS_Face.hxx>
48 #include <TopoDS_Wire.hxx>
49 #include <TopoDS_Edge.hxx>
50 #include <TopoDS_Vertex.hxx>
51 #include <TopoDS_Shape.hxx>
52 #include <TopTools_IndexedMapOfShape.hxx>
64 SMESH_Mesh(int localId, int studyId, SMESH_Gen * gen,
65 SMESHDS_Document * myDocument);
67 virtual ~ SMESH_Mesh();
69 void ShapeToMesh(const TopoDS_Shape & aShape) throw(SALOME_Exception);
71 bool AddHypothesis(const TopoDS_Shape & aSubShape, int anHypId)
72 throw(SALOME_Exception);
74 bool RemoveHypothesis(const TopoDS_Shape & aSubShape, int anHypId)
75 throw(SALOME_Exception);
77 const list <const SMESHDS_Hypothesis * >&
78 GetHypothesisList(const TopoDS_Shape & aSubShape)
79 throw(SALOME_Exception);
81 const list<SMESHDS_Command*> & GetLog() throw(SALOME_Exception);
83 // const SMESHDS_ListOfAsciiString& GetLog()
84 // throw (SALOME_Exception);
86 void ClearLog() throw(SALOME_Exception);
90 SMESHDS_Mesh * GetMeshDS();
94 SMESH_subMesh *GetSubMesh(const TopoDS_Shape & aSubShape)
95 throw(SALOME_Exception);
97 SMESH_subMesh *GetSubMeshContaining(const TopoDS_Shape & aSubShape)
98 throw(SALOME_Exception);
100 const list < SMESH_subMesh * >&
101 GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp)
102 throw(SALOME_Exception);
104 void ExportDAT(const char *file) throw(SALOME_Exception);
105 void ExportMED(const char *file) throw(SALOME_Exception);
106 void ExportUNV(const char *file) throw(SALOME_Exception);
108 int NbNodes() throw(SALOME_Exception);
110 int NbEdges() throw(SALOME_Exception);
112 int NbFaces() throw(SALOME_Exception);
114 int NbTriangles() throw(SALOME_Exception);
116 int NbQuadrangles() throw(SALOME_Exception);
118 int NbVolumes() throw(SALOME_Exception);
120 int NbTetras() throw(SALOME_Exception);
122 int NbHexas() throw(SALOME_Exception);
124 int NbSubMesh() throw(SALOME_Exception);
128 int _id; // id given by creator (unique within the creator instance)
130 int _idDoc; // id given by SMESHDS_Document
131 bool _isShapeToMesh; // set to true when a shape is given (only once)
132 list<const SMESHDS_Hypothesis *> _subShapeHypothesisList;
133 list <SMESH_subMesh *> _subMeshesUsingHypothesisList;
134 SMESHDS_Document * _myDocument;
135 SMESHDS_Mesh * _myMeshDS;
136 TopTools_IndexedMapOfShape _subShapes;
137 map <int, SMESH_subMesh *>_mapSubMesh;