+ typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*,
+ TIDCompare> TNodeNodeMap;
+
+
+ /*!
+ * \brief Finds transformation beween 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 beween 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();
+ };