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>
42 #include <TColStd_MapOfInteger.hxx>
44 #include "SMESH_Block.hxx"
46 #include "SMESH_MesherHelper.hxx"
48 typedef std::map< double, std::vector<const SMDS_MeshNode*> > StdMeshers_IJNodeMap;
50 class StdMeshers_SMESHBlock {
54 StdMeshers_SMESHBlock();
56 void Load (const TopoDS_Shell& theShell);
58 void Load (const TopoDS_Shell& theShell,
59 const TopoDS_Vertex& theV000,
60 const TopoDS_Vertex& theV001);
62 void ComputeParameters(const gp_Pnt& thePnt,
65 void ComputeParameters(const gp_Pnt& thePnt,
66 const TopoDS_Shape& theShape,
69 void ComputeParameters(const double& theU,
70 const TopoDS_Shape& theShape,
73 void Point(const gp_XYZ& theParams,
76 void Point(const gp_XYZ& theParams,
77 const TopoDS_Shape& theShape,
80 int ShapeID(const TopoDS_Shape& theShape);
82 const TopoDS_Shape& Shape(const int theID);
84 SMESH_Block & Block() { return myTBlock; }
86 bool IsForwadEdge(const int theEdgeID);
88 int ErrorStatus() const;
93 TopTools_IndexedMapOfOrientedShape myShapeIDMap;
95 TopoDS_Shape myEmptyShape;
96 vector<int> myIsEdgeForward;
101 ////////////////////////////////////////////////////////////////////////
103 // class StdMeshers_TNode
105 ////////////////////////////////////////////////////////////////////////
106 #include "SMDS_MeshNode.hxx"
108 class StdMeshers_TNode {
114 myXYZ.SetCoord(99., 99., 99.);
119 void SetNode(const SMDS_MeshNode* theNode) {
120 myNode=(SMDS_MeshNode*) theNode;
123 const SMDS_MeshNode* Node()const {
127 void SetShapeSupportID (const int theID) {
128 myShapeSupportID=theID;
131 int ShapeSupportID()const {
132 return myShapeSupportID;
135 void SetNormCoord (const gp_XYZ& theXYZ) {
139 const gp_XYZ& NormCoord ()const{
143 void SetBaseNodeID (const int theID) {
147 int BaseNodeID ()const{
152 SMDS_MeshNode* myNode;
153 int myShapeSupportID;
158 ////////////////////////////////////////////////////////////////////////
160 // class StdMeshers_Penta_3D
162 ////////////////////////////////////////////////////////////////////////
163 #include "SMESH_Mesh.hxx"
164 #include <TopoDS_Shape.hxx>
166 class StdMeshers_Penta_3D {
169 StdMeshers_Penta_3D();
171 ~StdMeshers_Penta_3D();
173 bool Compute(SMESH_Mesh& , const TopoDS_Shape& );
175 int ErrorStatus() const {
176 return myErrorStatus;
179 void SetTolerance(const double theTol3D) {
183 double Tolerance() const {
187 bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
188 const TopoDS_Face& theFace,
189 const TopoDS_Edge& theBaseEdge,
190 SMESHDS_Mesh* theMesh);
191 // Load nodes bound to theFace into column (vectors) and rows
193 // The value of theIJNodes map is a vector of ordered nodes so
194 // that the 0-the one lies on theBaseEdge.
195 // The key of theIJNodes map is a normalized parameter of each
196 // 0-the node on theBaseEdge.
199 protected: // methods
207 double SetHorizEdgeXYZ(const gp_XYZ& aBNXYZ,
209 vector<const SMDS_MeshNode*>*& aCol1,
210 vector<const SMDS_MeshNode*>*& aCol2);
212 void ShapeSupportID(const bool theIsUpperLayer,
213 const SMESH_Block::TShapeID theBNSSID,
214 SMESH_Block::TShapeID& theSSID);
216 void FindNodeOnShape(const TopoDS_Shape& aS,
217 const gp_XYZ& aParams,
219 StdMeshers_TNode& aTN);
221 void CreateNode(const bool theIsUpperLayer,
222 const gp_XYZ& aParams,
223 StdMeshers_TNode& aTN);
225 void ClearMeshOnFxy1();
227 void MakeMeshOnFxy1();
229 void MakeConnectingMap();
231 int GetIndexOnLayer(const int aID);
233 void MakeVolumeMesh();
235 void SetMesh(SMESH_Mesh& theMesh) {
236 myMesh=(void *)&theMesh;
239 SMESH_Mesh* GetMesh()const {
240 return (SMESH_Mesh*)myMesh;
244 TopoDS_Shape myShape;
245 StdMeshers_SMESHBlock myBlock;
249 vector <StdMeshers_TNode> myTNodes;
252 double myTol3D; // Tolerance value
253 std::map < int, int > myConnectingMap;
255 vector<StdMeshers_IJNodeMap> myWallNodesMaps; // nodes on a face
256 vector<gp_XYZ> myShapeXYZ; // point on each sub-shape
258 bool myCreateQuadratic;
259 SMESH_MesherHelper* myTool; // toll for working with quadratic elements