SALOME - SMESH
|
00001 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 // SMESH SMESH : idl implementation based on 'SMESH' unit's calsses 00023 // File : StdMeshers_ProjectionUtils.hxx 00024 // Created : Thu Oct 26 15:37:24 2006 00025 // Author : Edward AGAPOV (eap) 00026 // 00027 #ifndef StdMeshers_ProjectionUtils_HeaderFile 00028 #define StdMeshers_ProjectionUtils_HeaderFile 00029 00030 #include "SMESH_StdMeshers.hxx" 00031 00032 #include <TopTools_DataMapOfShapeShape.hxx> 00033 #include <TopoDS_Edge.hxx> 00034 #include <TopoDS_Vertex.hxx> 00035 #include <TopoDS_Face.hxx> 00036 00037 #include <list> 00038 #include <map> 00039 00040 class TopoDS_Shape; 00041 class SMDS_MeshNode; 00042 class SMESH_Mesh; 00043 class SMESH_Hypothesis; 00044 class SMESH_subMesh; 00045 class TopTools_IndexedDataMapOfShapeListOfShape; 00046 00050 class StdMeshers_ProjectionUtils 00051 { 00052 public: 00053 00054 typedef TopTools_DataMapOfShapeShape TShapeShapeMap; 00055 typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap; 00056 typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap; 00057 00068 static bool FindSubShapeAssociation(const TopoDS_Shape& theShape1, 00069 SMESH_Mesh* theMesh1, 00070 const TopoDS_Shape& theShape2, 00071 SMESH_Mesh* theMesh2, 00072 TShapeShapeMap & theAssociationMap); 00073 00084 static int FindFaceAssociation(const TopoDS_Face& face1, 00085 TopoDS_Vertex VV1[2], 00086 const TopoDS_Face& face2, 00087 TopoDS_Vertex VV2[2], 00088 std::list< TopoDS_Edge > & edges1, 00089 std::list< TopoDS_Edge > & edges2); 00090 00097 static void InitVertexAssociation( const SMESH_Hypothesis* theHyp, 00098 TShapeShapeMap & theAssociationMap, 00099 const TopoDS_Shape& theTargetShape); 00100 00109 static bool InsertAssociation( const TopoDS_Shape& theShape1, 00110 const TopoDS_Shape& theShape2, 00111 TShapeShapeMap & theAssociationMap, 00112 const bool theBidirectional=true); 00113 00114 static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh ); 00115 00116 static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape ); 00117 00121 static TopoDS_Edge GetEdgeByVertices( SMESH_Mesh* aMesh, 00122 const TopoDS_Vertex& V1, 00123 const TopoDS_Vertex& V2); 00124 00129 static TopoDS_Face GetNextFace( const TAncestorMap& edgeToFaces, 00130 const TopoDS_Edge& edge, 00131 const TopoDS_Face& face); 00135 static TopoDS_Vertex GetNextVertex(const TopoDS_Edge& edge, 00136 const TopoDS_Vertex& vertex); 00137 00144 static std::pair<int,TopoDS_Edge> GetPropagationEdge( SMESH_Mesh* aMesh, 00145 const TopoDS_Edge& anEdge, 00146 const TopoDS_Edge& fromEdge); 00147 00158 static bool FindMatchingNodesOnFaces( const TopoDS_Face& face1, 00159 SMESH_Mesh* mesh1, 00160 const TopoDS_Face& face2, 00161 SMESH_Mesh* mesh2, 00162 const TShapeShapeMap & assocMap, 00163 TNodeNodeMap & nodeIn2OutMap); 00169 static bool IsClosedEdge( const TopoDS_Edge& anEdge ); 00170 00177 static TopoDS_Shape OuterShape( const TopoDS_Face& face, 00178 TopAbs_ShapeEnum type); 00179 00186 static bool MakeComputed(SMESH_subMesh * sm, const int iterationNb = 0); 00187 00195 static int Count(const TopoDS_Shape& shape, 00196 const TopAbs_ShapeEnum type, 00197 const bool ignoreSame); 00198 00205 static void SetEventListener(SMESH_subMesh* subMesh, 00206 TopoDS_Shape srcShape, 00207 SMESH_Mesh* srcMesh); 00208 00212 static bool IsBoundaryEdge(const TopoDS_Edge& edge, 00213 const TopoDS_Shape& edgeContainer, 00214 SMESH_Mesh& mesh); 00215 }; 00216 00217 #endif