1 // SMESH StdMeshers : 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 : StdMeshers_Penta_3D.hxx
27 #ifndef StdMeshers_Penta_3D_HeaderFile
28 #define StdMeshers_Penta_3D_HeaderFile
32 typedef std::map < int, int > StdMeshers_DataMapOfIntegerInteger;
34 ////////////////////////////////////////////////////////////////////////
36 // class StdMeshers_SMESHBlock
40 #include <TopoDS_Vertex.hxx>
41 #include <TopoDS_Shell.hxx>
42 #include <TopTools_IndexedMapOfOrientedShape.hxx>
44 #include "SMESH_Block.hxx"
46 class StdMeshers_SMESHBlock {
50 StdMeshers_SMESHBlock();
52 void Load (const TopoDS_Shell& theShell);
54 void Load (const TopoDS_Shell& theShell,
55 const TopoDS_Vertex& theV000,
56 const TopoDS_Vertex& theV001);
58 void ComputeParameters(const gp_Pnt& thePnt,
61 void ComputeParameters(const gp_Pnt& thePnt,
62 const TopoDS_Shape& theShape,
65 void Point(const gp_XYZ& theParams,
68 void Point(const gp_XYZ& theParams,
69 const TopoDS_Shape& theShape,
72 int ShapeID(const TopoDS_Shape& theShape);
74 const TopoDS_Shape& Shape(const int theID);
77 int ErrorStatus() const;
82 TopTools_IndexedMapOfOrientedShape myShapeIDMap;
84 TopoDS_Shape myEmptyShape;
88 ////////////////////////////////////////////////////////////////////////
90 // class StdMeshers_TNode
92 #include "SMDS_MeshNode.hxx"
94 class StdMeshers_TNode {
100 myXYZ.SetCoord(99., 99., 99.);
105 void SetNode(const SMDS_MeshNode* theNode) {
106 myNode=(SMDS_MeshNode*) theNode;
109 const SMDS_MeshNode* Node()const {
113 void SetShapeSupportID (const int theID) {
114 myShapeSupportID=theID;
117 int ShapeSupportID()const {
118 return myShapeSupportID;
121 void SetNormCoord (const gp_XYZ& theXYZ) {
125 const gp_XYZ& NormCoord ()const{
129 void SetBaseNodeID (const int theID) {
133 int BaseNodeID ()const{
138 SMDS_MeshNode* myNode;
139 int myShapeSupportID;
144 ////////////////////////////////////////////////////////////////////////
146 // class StdMeshers_Penta_3D
148 #include "SMESH_Mesh.hxx"
149 #include <TopoDS_Shape.hxx>
151 class StdMeshers_Penta_3D {
154 StdMeshers_Penta_3D();
156 //~StdMeshers_Penta_3D();
158 bool Compute(SMESH_Mesh& , const TopoDS_Shape& );
160 int ErrorStatus() const {
161 return myErrorStatus;
164 void SetTolerance(const double theTol3D) {
168 double Tolerance() const {
173 protected: // methods
181 void ShapeSupportID(const bool theIsUpperLayer,
182 const SMESH_Block::TShapeID theBNSSID,
183 SMESH_Block::TShapeID& theSSID);
185 void FindNodeOnShape(const TopoDS_Shape& aS,
186 const gp_XYZ& aParams,
187 StdMeshers_TNode& aTN);
189 void CreateNode(const bool theIsUpperLayer,
190 const gp_XYZ& aParams,
191 StdMeshers_TNode& aTN);
193 void ClearMeshOnFxy1();
195 void MakeMeshOnFxy1();
197 void MakeConnectingMap();
199 int GetIndexOnLayer(const int aID);
201 void MakeVolumeMesh();
203 void SetMesh(SMESH_Mesh& theMesh) {
204 myMesh=(void *)&theMesh;
207 SMESH_Mesh* GetMesh()const {
208 return (SMESH_Mesh*)myMesh;
212 TopoDS_Shape myShape;
213 StdMeshers_SMESHBlock myBlock;
217 vector <StdMeshers_TNode> myTNodes;
220 double myTol3D; // Tolerance value
221 StdMeshers_DataMapOfIntegerInteger myConnectingMap;