00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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