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 "SMESH_Hypothesis.hxx"
35 #include "SMESH_subMesh.hxx"
36 #include "SMESHDS_ListOfCommand.hxx"
37 //#include "SMESHDS_ListOfAsciiString.hxx"
38 //#include "SMESHDS_ListIteratorOfListOfAsciiString.hxx"
41 #include "Utils_SALOME_Exception.hxx"
44 #include <TopExp_Explorer.hxx>
46 #include <TopoDS_Iterator.hxx>
47 #include <TopoDS_Compound.hxx>
48 #include <TopoDS_CompSolid.hxx>
49 #include <TopoDS_Solid.hxx>
50 #include <TopoDS_Shell.hxx>
51 #include <TopoDS_Face.hxx>
52 #include <TopoDS_Wire.hxx>
53 #include <TopoDS_Edge.hxx>
54 #include <TopoDS_Vertex.hxx>
55 #include <TopoDS_Shape.hxx>
56 #include <TopTools_IndexedMapOfShape.hxx>
68 SMESH_Mesh(int localId,
71 const Handle(SMESHDS_Document)& myDocument);
73 virtual ~SMESH_Mesh();
75 void ShapeToMesh(const TopoDS_Shape& aShape)
76 throw (SALOME_Exception);
78 bool AddHypothesis(const TopoDS_Shape& aSubShape,
80 throw (SALOME_Exception);
82 bool RemoveHypothesis(const TopoDS_Shape& aSubShape,
84 throw (SALOME_Exception);
86 const list<SMESHDS_Hypothesis*>&
87 GetHypothesisList(const TopoDS_Shape& aSubShape)
88 throw (SALOME_Exception);
90 const SMESHDS_ListOfCommand& GetLog()
91 throw (SALOME_Exception);
93 // const SMESHDS_ListOfAsciiString& GetLog()
94 // throw (SALOME_Exception);
97 throw (SALOME_Exception);
101 const Handle(SMESHDS_Mesh)& GetMeshDS();
105 SMESH_subMesh* GetSubMesh(const TopoDS_Shape & aSubShape)
106 throw (SALOME_Exception);
108 SMESH_subMesh* GetSubMeshContaining(const TopoDS_Shape & aSubShape)
109 throw (SALOME_Exception);
111 const list <SMESH_subMesh*>&
112 GetSubMeshUsingHypothesis(SMESHDS_Hypothesis* anHyp)
113 throw (SALOME_Exception);
115 void ExportDAT( const char* file )
116 throw (SALOME_Exception);
117 void ExportMED( const char* file )
118 throw (SALOME_Exception);
119 void ExportUNV( const char* file )
120 throw (SALOME_Exception);
123 throw (SALOME_Exception);
126 throw (SALOME_Exception);
129 throw (SALOME_Exception);
132 throw (SALOME_Exception);
135 throw (SALOME_Exception);
138 throw (SALOME_Exception);
141 throw (SALOME_Exception);
144 throw (SALOME_Exception);
147 throw (SALOME_Exception);
152 int _id; // id given by creator (unique within the creator instance)
154 int _idDoc; // id given by SMESHDS_Document
155 bool _isShapeToMesh; // set to true when a shape is given (only once)
156 list<SMESHDS_Hypothesis*> _subShapeHypothesisList;
157 list<SMESH_subMesh*> _subMeshesUsingHypothesisList;
158 Handle (SMESHDS_Document) _myDocument;
159 Handle (SMESHDS_Mesh) _myMeshDS;
160 TopTools_IndexedMapOfShape _subShapes;
161 map<int, SMESH_subMesh*> _mapSubMesh;