Salome HOME
NPAL18095: Pb. with dump python and mesh group by filter.
[modules/smesh.git] / src / StdMeshers / StdMeshers_ProjectionUtils.hxx
index 52d11dc2c9b8ddf6b8261dcf8dc48dbb5737a3c3..a2ce626ef7b4881ee1f25b3f92e71f7c5efb5c60 100644 (file)
@@ -42,6 +42,7 @@ class SMDS_MeshNode;
 class SMESH_Mesh;
 class SMESH_Hypothesis;
 class SMESH_subMesh;
+class TopTools_IndexedDataMapOfShapeListOfShape;
 
 /*!
  * \brief Class encapsulating methods common to Projection algorithms
@@ -51,6 +52,7 @@ class StdMeshers_ProjectionUtils
  public:
 
   typedef TopTools_DataMapOfShapeShape                         TShapeShapeMap;
+  typedef TopTools_IndexedDataMapOfShapeListOfShape            TAncestorMap;
   typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
 
   /*!
@@ -90,9 +92,11 @@ class StdMeshers_ProjectionUtils
    * \brief Insert vertex association defined by a hypothesis into a map
     * \param theHyp - hypothesis
     * \param theAssociationMap - association map
+    * \param theTargetShape - the shape theHyp assigned to
    */
   static void InitVertexAssociation( const SMESH_Hypothesis* theHyp,
-                                     TShapeShapeMap &        theAssociationMap);
+                                     TShapeShapeMap &        theAssociationMap,
+                                     const TopoDS_Shape&     theTargetShape);
 
   /*!
    * \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap
@@ -113,10 +117,6 @@ class StdMeshers_ProjectionUtils
 
   /*!
    * \brief Finds an edge by its vertices in a main shape of the mesh
-    * \param aMesh - the mesh
-    * \param V1 - vertex 1
-    * \param V2 - vertex 2
-    * \retval TopoDS_Edge - found edge
    */
   static TopoDS_Edge GetEdgeByVertices( SMESH_Mesh*          aMesh,
                                         const TopoDS_Vertex& V1,
@@ -124,24 +124,26 @@ class StdMeshers_ProjectionUtils
                                         
   /*!
    * \brief Return another face sharing an edge
-    * \param aMesh - mesh
-    * \param edge - edge
-    * \param face - face
-    * \retval TopoDS_Face - found face
+   * \param edgeToFaces - data map of descendants to ancestors
+   */
+  static TopoDS_Face GetNextFace( const TAncestorMap& edgeToFaces,
+                                  const TopoDS_Edge&  edge,
+                                  const TopoDS_Face&  face);
+  /*!
+   * \brief Return other vertex of an edge
    */
-  static TopoDS_Face GetNextFace( SMESH_Mesh*        aMesh,
-                                  const TopoDS_Edge& edge,
-                                  const TopoDS_Face& face);
+  static TopoDS_Vertex GetNextVertex(const TopoDS_Edge&   edge,
+                                     const TopoDS_Vertex& vertex);
 
   /*!
    * \brief Return an oriented propagation edge
     * \param aMesh - mesh
     * \param fromEdge - start edge for propagation
-    * \retval TopoDS_Edge - found edge
+    * \retval pair<int,TopoDS_Edge> - propagation step and found edge
    */
-  static TopoDS_Edge GetPropagationEdge( SMESH_Mesh*        aMesh,
-                                         const TopoDS_Edge& anEdge,
-                                         const TopoDS_Edge& fromEdge);
+  static std::pair<int,TopoDS_Edge> GetPropagationEdge( SMESH_Mesh*        aMesh,
+                                                        const TopoDS_Edge& anEdge,
+                                                        const TopoDS_Edge& fromEdge);
 
   /*!
    * \brief Find corresponding nodes on two faces
@@ -193,6 +195,17 @@ class StdMeshers_ProjectionUtils
   static int Count(const TopoDS_Shape&    shape,
                    const TopAbs_ShapeEnum type,
                    const bool             ignoreSame);
+
+  /*!
+   * \brief Set event listeners to submesh with projection algo
+    * \param subMesh - submesh with projection algo
+    * \param srcShape - source shape
+    * \param srcMesh - source mesh
+   */
+  static void SetEventListener(SMESH_subMesh* subMesh,
+                               TopoDS_Shape   srcShape,
+                               SMESH_Mesh*    srcMesh);
+
 };
 
 #endif