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 ////////////////////////////////////////////////////////////////////////
34 // class StdMeshers_SMESHBlock
36 ////////////////////////////////////////////////////////////////////////
39 #include <TopoDS_Vertex.hxx>
40 #include <TopoDS_Shell.hxx>
41 #include <TopTools_IndexedMapOfOrientedShape.hxx>
43 #include "SMESH_Block.hxx"
45 typedef std::map< double, std::vector<const SMDS_MeshNode*> > StdMeshers_IJNodeMap;
47 class StdMeshers_SMESHBlock {
51 StdMeshers_SMESHBlock();
53 void Load (const TopoDS_Shell& theShell);
55 void Load (const TopoDS_Shell& theShell,
56 const TopoDS_Vertex& theV000,
57 const TopoDS_Vertex& theV001);
59 void ComputeParameters(const gp_Pnt& thePnt,
62 void ComputeParameters(const gp_Pnt& thePnt,
63 const TopoDS_Shape& theShape,
66 void ComputeParameters(const double& theU,
67 const TopoDS_Shape& theShape,
70 void Point(const gp_XYZ& theParams,
73 void Point(const gp_XYZ& theParams,
74 const TopoDS_Shape& theShape,
77 int ShapeID(const TopoDS_Shape& theShape);
79 const TopoDS_Shape& Shape(const int theID);
81 SMESH_Block & Block() { return myTBlock; }
83 bool IsForwadEdge(const int theEdgeID);
85 int ErrorStatus() const;
90 TopTools_IndexedMapOfOrientedShape myShapeIDMap;
92 TopoDS_Shape myEmptyShape;
93 vector<int> myIsEdgeForward;
98 ////////////////////////////////////////////////////////////////////////
100 // class StdMeshers_TNode
102 ////////////////////////////////////////////////////////////////////////
103 #include "SMDS_MeshNode.hxx"
105 class StdMeshers_TNode {
111 myXYZ.SetCoord(99., 99., 99.);
116 void SetNode(const SMDS_MeshNode* theNode) {
117 myNode=(SMDS_MeshNode*) theNode;
120 const SMDS_MeshNode* Node()const {
124 void SetShapeSupportID (const int theID) {
125 myShapeSupportID=theID;
128 int ShapeSupportID()const {
129 return myShapeSupportID;
132 void SetNormCoord (const gp_XYZ& theXYZ) {
136 const gp_XYZ& NormCoord ()const{
140 void SetBaseNodeID (const int theID) {
144 int BaseNodeID ()const{
149 SMDS_MeshNode* myNode;
150 int myShapeSupportID;
155 ////////////////////////////////////////////////////////////////////////
157 // class StdMeshers_Penta_3D
159 ////////////////////////////////////////////////////////////////////////
160 #include "SMESH_Mesh.hxx"
161 #include <TopoDS_Shape.hxx>
163 class StdMeshers_Penta_3D {
166 StdMeshers_Penta_3D();
168 //~StdMeshers_Penta_3D();
170 bool Compute(SMESH_Mesh& , const TopoDS_Shape& );
172 int ErrorStatus() const {
173 return myErrorStatus;
176 void SetTolerance(const double theTol3D) {
180 double Tolerance() const {
184 static bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
185 const TopoDS_Face& theFace,
186 const TopoDS_Edge& theBaseEdge,
187 SMESHDS_Mesh* theMesh);
188 // Load nodes bound to theFace into column (vectors) and rows
190 // The value of theIJNodes map is a vector of ordered nodes so
191 // that the 0-the one lies on theBaseEdge.
192 // The key of theIJNodes map is a normalized parameter of each
193 // 0-the node on theBaseEdge.
196 protected: // methods
204 double SetHorizEdgeXYZ(const gp_XYZ& aBNXYZ,
206 vector<const SMDS_MeshNode*>*& aCol1,
207 vector<const SMDS_MeshNode*>*& aCol2);
209 void ShapeSupportID(const bool theIsUpperLayer,
210 const SMESH_Block::TShapeID theBNSSID,
211 SMESH_Block::TShapeID& theSSID);
213 void FindNodeOnShape(const TopoDS_Shape& aS,
214 const gp_XYZ& aParams,
216 StdMeshers_TNode& aTN);
218 void CreateNode(const bool theIsUpperLayer,
219 const gp_XYZ& aParams,
220 StdMeshers_TNode& aTN);
222 void ClearMeshOnFxy1();
224 void MakeMeshOnFxy1();
226 void MakeConnectingMap();
228 int GetIndexOnLayer(const int aID);
230 void MakeVolumeMesh();
232 void SetMesh(SMESH_Mesh& theMesh) {
233 myMesh=(void *)&theMesh;
236 SMESH_Mesh* GetMesh()const {
237 return (SMESH_Mesh*)myMesh;
241 TopoDS_Shape myShape;
242 StdMeshers_SMESHBlock myBlock;
246 vector <StdMeshers_TNode> myTNodes;
249 double myTol3D; // Tolerance value
250 std::map < int, int > myConnectingMap;
252 vector<StdMeshers_IJNodeMap> myWallNodesMaps; // nodes on a face
253 vector<gp_XYZ> myShapeXYZ; // point on each sub-shape