Salome HOME
23422: EDF 14312 - Strange behavior of Viscous Layer Surface offset + smooth
[modules/smesh.git] / src / StdMeshers / StdMeshers_ProjectionUtils.hxx
index 266918aafe55658c1ffd41282833988771ab6977..d44e477f0ddd5a4bdc83018bd90ba04ccd86ba08 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include "SMESH_StdMeshers.hxx"
 
+#include "StdMeshers_FaceSide.hxx"
 #include "SMDS_MeshElement.hxx"
 
+#include <BRepMesh_DataStructureOfDelaun.hxx>
+#include <ShapeAnalysis_Surface.hxx>
 #include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Vertex.hxx>
@@ -47,8 +52,6 @@ class SMESH_Algo;
 class SMESH_Hypothesis;
 class SMESH_Mesh;
 class SMESH_subMesh;
-class TopTools_IndexedDataMapOfShapeListOfShape;
-class TopTools_IndexedMapOfShape;
 class TopoDS_Shape;
 
 /*!
@@ -92,7 +95,7 @@ namespace StdMeshers_ProjectionUtils
 
 
   /*!
-   * \brief Finds transformation beween two sets of 2D points using
+   * \brief Finds transformation between two sets of 2D points using
    *        a least square approximation
    */
   class TrsfFinder2D
@@ -112,7 +115,7 @@ namespace StdMeshers_ProjectionUtils
     bool IsIdentity() const { return ( _trsf.Form() == gp_Identity ); }
   };
   /*!
-   * \brief Finds transformation beween two sets of 3D points using
+   * \brief Finds transformation between two sets of 3D points using
    *        a least square approximation
    */
   class TrsfFinder3D
@@ -136,6 +139,33 @@ namespace StdMeshers_ProjectionUtils
     bool Invert();
   };
 
+  /*!
+   * \brief Morph mesh on the target FACE to lie within FACE boundary w/o distortion
+   */
+  class Morph
+  {
+    std::vector< const SMDS_MeshNode* >    _bndSrcNodes;
+    Handle(BRepMesh_DataStructureOfDelaun) _triaDS;
+    SMESH_subMesh*                         _srcSubMesh;
+    bool                                   _moveAll;
+    gp_XY                                  _scale;
+  public:
+
+    Morph(const TSideVector& srcWires);
+
+    bool Perform(SMESH_MesherHelper&           tgtHelper,
+                 const TSideVector&            tgtWires,
+                 Handle(ShapeAnalysis_Surface) tgtSurface,
+                 const TNodeNodeMap&           src2tgtNodes,
+                 const bool                    moveAll);
+
+    // return source boundary nodes. 0-th node is zero
+    const std::vector< const SMDS_MeshNode* >& GetBndNodes() const { return _bndSrcNodes; }
+
+    // return UV of the i-th source boundary node
+    gp_XY GetBndUV(const int iNode) const;
+  };
+
   /*!
    * \brief Looks for association of all sub-shapes of two shapes
    * \param theShape1 - shape 1