+
+ //-----------------------------------------------------------------------------------------
+ /*!
+ * \brief Finds transformation between two sets of 2D points using
+ * a least square approximation
+ */
+ class TrsfFinder2D
+ {
+ gp_GTrsf2d _trsf;
+ gp_XY _srcOrig;
+ public:
+ TrsfFinder2D(): _srcOrig(0,0) {}
+
+ void Set( const gp_GTrsf2d& t ) { _trsf = t; } // it's an alternative to Solve()
+
+ bool Solve( const std::vector< gp_XY >& srcPnts,
+ const std::vector< gp_XY >& tgtPnts );
+
+ gp_XY Transform( const gp_Pnt2d& srcUV ) const;
+
+ bool IsIdentity() const { return ( _trsf.Form() == gp_Identity ); }
+ };
+ //-----------------------------------------------------------------------------------------
+ /*!
+ * \brief Finds transformation between two sets of 3D points using
+ * a least square approximation
+ */
+ class TrsfFinder3D
+ {
+ gp_GTrsf _trsf;
+ gp_XYZ _srcOrig;
+ public:
+ TrsfFinder3D(): _srcOrig(0,0,0) {}
+
+ void Set( const gp_GTrsf& t ) { _trsf = t; } // it's an alternative to Solve()
+
+ bool Solve( const std::vector< gp_XYZ > & srcPnts,
+ const std::vector< gp_XYZ > & tgtPnts );
+
+ gp_XYZ Transform( const gp_Pnt& srcP ) const;
+
+ gp_XYZ TransformVec( const gp_Vec& v ) const;
+
+ bool IsIdentity() const { return ( _trsf.Form() == gp_Identity ); }
+
+ bool Invert();
+ };
+
+ //-----------------------------------------------------------------------------------------
+ /*!
+ * \brief Create a Delaunay triangulation of nodes on a face boundary
+ * and provide exploration of nodes shared by elements lying on
+ * the face. For a returned node, also return a Delaunay triangle
+ * the node lies in and its Barycentric Coordinates within the triangle.
+ * Only non-marked nodes are visited.
+ *
+ * The main methods are defined in ../SMESHUtils/SMESH_Delaunay.hxx
+ */
+ class Delaunay : public SMESH_Delaunay
+ {
+ public:
+
+ Delaunay( const TSideVector& wires, bool checkUV = false );
+
+ Delaunay( const std::vector< const UVPtStructVec* > & boundaryNodes,
+ SMESH_MesherHelper& faceHelper,
+ bool checkUV = false);
+
+ protected:
+ virtual gp_XY getNodeUV( const TopoDS_Face& face, const SMDS_MeshNode* node ) const;
+
+ private:
+ SMESH_MesherHelper* _helper;
+ StdMeshers_FaceSidePtr _wire;
+ bool *_checkUVPtr, _checkUV;
+ };
+ typedef boost::shared_ptr< Delaunay > DelaunayPtr;
+
+ //-----------------------------------------------------------------------------------------
+ /*!
+ * \brief Morph mesh on the target FACE to lie within FACE boundary w/o distortion
+ */
+ class Morph
+ {
+ Delaunay _delaunay;
+ SMESH_subMesh* _srcSubMesh;
+ public:
+
+ Morph(const TSideVector& srcWires);
+
+ bool Perform(SMESH_MesherHelper& tgtHelper,
+ const TSideVector& tgtWires,
+ Handle(ShapeAnalysis_Surface) tgtSurface,
+ const TNodeNodeMap& src2tgtNodes,
+ const bool moveAll);
+ };
+
+ //-----------------------------------------------------------------------------------------