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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : StdMeshers_Penta_3D.hxx
27 #ifndef StdMeshers_Penta_3D_HeaderFile
28 #define StdMeshers_Penta_3D_HeaderFile
30 #include "SMESH_StdMeshers.hxx"
34 ////////////////////////////////////////////////////////////////////////
36 // class StdMeshers_SMESHBlock
38 ////////////////////////////////////////////////////////////////////////
41 #include <TopoDS_Vertex.hxx>
42 #include <TopoDS_Shell.hxx>
43 #include <TopTools_IndexedMapOfOrientedShape.hxx>
44 #include <TColStd_MapOfInteger.hxx>
46 #include "SMESH_Block.hxx"
48 #include "SMESH_MesherHelper.hxx"
50 typedef std::map< double, std::vector<const SMDS_MeshNode*> > StdMeshers_IJNodeMap;
52 class STDMESHERS_EXPORT StdMeshers_SMESHBlock {
56 StdMeshers_SMESHBlock();
58 void Load (const TopoDS_Shell& theShell);
60 void Load (const TopoDS_Shell& theShell,
61 const TopoDS_Vertex& theV000,
62 const TopoDS_Vertex& theV001);
64 void ComputeParameters(const gp_Pnt& thePnt,
67 void ComputeParameters(const gp_Pnt& thePnt,
68 const TopoDS_Shape& theShape,
71 void ComputeParameters(const double& theU,
72 const TopoDS_Shape& theShape,
75 void Point(const gp_XYZ& theParams,
78 void Point(const gp_XYZ& theParams,
79 const TopoDS_Shape& theShape,
82 int ShapeID(const TopoDS_Shape& theShape);
84 const TopoDS_Shape& Shape(const int theID);
86 SMESH_Block & Block() { return myTBlock; }
88 bool IsForwadEdge(const int theEdgeID);
90 int ErrorStatus() const;
95 TopTools_IndexedMapOfOrientedShape myShapeIDMap;
97 TopoDS_Shape myEmptyShape;
98 vector<int> myIsEdgeForward;
103 ////////////////////////////////////////////////////////////////////////
105 // class StdMeshers_TNode
107 ////////////////////////////////////////////////////////////////////////
108 #include "SMDS_MeshNode.hxx"
110 class STDMESHERS_EXPORT StdMeshers_TNode {
116 myXYZ.SetCoord(99., 99., 99.);
121 void SetNode(const SMDS_MeshNode* theNode) {
122 myNode=(SMDS_MeshNode*) theNode;
125 const SMDS_MeshNode* Node()const {
129 void SetShapeSupportID (const int theID) {
130 myShapeSupportID=theID;
133 int ShapeSupportID()const {
134 return myShapeSupportID;
137 void SetNormCoord (const gp_XYZ& theXYZ) {
141 const gp_XYZ& NormCoord ()const{
145 void SetBaseNodeID (const int theID) {
149 int BaseNodeID ()const{
154 SMDS_MeshNode* myNode;
155 int myShapeSupportID;
160 ////////////////////////////////////////////////////////////////////////
162 // class StdMeshers_Penta_3D
164 ////////////////////////////////////////////////////////////////////////
165 #include "SMESH_Mesh.hxx"
166 #include <TopoDS_Shape.hxx>
168 class STDMESHERS_EXPORT StdMeshers_Penta_3D {
171 StdMeshers_Penta_3D();
173 ~StdMeshers_Penta_3D();
175 bool Compute(SMESH_Mesh& , const TopoDS_Shape& );
177 int ErrorStatus() const {
178 return myErrorStatus;
181 void SetTolerance(const double theTol3D) {
185 double Tolerance() const {
189 bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
190 const TopoDS_Face& theFace,
191 const TopoDS_Edge& theBaseEdge,
192 SMESHDS_Mesh* theMesh);
193 // Load nodes bound to theFace into column (vectors) and rows
195 // The value of theIJNodes map is a vector of ordered nodes so
196 // that the 0-the one lies on theBaseEdge.
197 // The key of theIJNodes map is a normalized parameter of each
198 // 0-the node on theBaseEdge.
201 protected: // methods
209 double SetHorizEdgeXYZ(const gp_XYZ& aBNXYZ,
211 vector<const SMDS_MeshNode*>*& aCol1,
212 vector<const SMDS_MeshNode*>*& aCol2);
214 void ShapeSupportID(const bool theIsUpperLayer,
215 const SMESH_Block::TShapeID theBNSSID,
216 SMESH_Block::TShapeID& theSSID);
218 void FindNodeOnShape(const TopoDS_Shape& aS,
219 const gp_XYZ& aParams,
221 StdMeshers_TNode& aTN);
223 void CreateNode(const bool theIsUpperLayer,
224 const gp_XYZ& aParams,
225 StdMeshers_TNode& aTN);
227 void ClearMeshOnFxy1();
229 void MakeMeshOnFxy1();
231 void MakeConnectingMap();
233 int GetIndexOnLayer(const int aID);
235 void MakeVolumeMesh();
237 void SetMesh(SMESH_Mesh& theMesh) {
238 myMesh=(void *)&theMesh;
241 SMESH_Mesh* GetMesh()const {
242 return (SMESH_Mesh*)myMesh;
246 TopoDS_Shape myShape;
247 StdMeshers_SMESHBlock myBlock;
251 vector <StdMeshers_TNode> myTNodes;
254 double myTol3D; // Tolerance value
255 std::map < int, int > myConnectingMap;
257 vector<StdMeshers_IJNodeMap> myWallNodesMaps; // nodes on a face
258 vector<gp_XYZ> myShapeXYZ; // point on each sub-shape
260 bool myCreateQuadratic;
261 SMESH_MesherHelper* myTool; // toll for working with quadratic elements