+ /*!
+ * \brief Return UV of a point inside a quadrilateral FACE by it's
+ * normalized parameters within a unit quadrangle and the
+ * corresponding projections on sub-shapes of the real-world FACE.
+ * The used calculation method is called Trans-Finite Interpolation (TFI).
+ * \param x,y - normalized parameters that should be in range [0,1]
+ * \param a0,a1,a2,a3 - UV of VERTEXes of the FACE == projections on VERTEXes
+ * \param p0,p1,p2,p3 - UV of the point projections on EDGEs of the FACE
+ * \return gp_XY - UV of the point on the FACE
+ *
+ * Y ^ Order of those UV in the FACE is as follows.
+ * |
+ * a3 p2 a2
+ * o---x-----o
+ * | : |
+ * | :UV |
+ * p3 x...O.....x p1
+ * | : |
+ * o---x-----o ----> X
+ * a0 p0 a1
+ */
+ inline static gp_XY calcTFI(double x, double y,
+ const gp_XY& a0,const gp_XY& a1,const gp_XY& a2,const gp_XY& a3,
+ const gp_XY& p0,const gp_XY& p1,const gp_XY& p2,const gp_XY& p3);
+
+ /*!
+ * \brief Same as "gp_XY calcTFI(...)" but in 3D
+ */
+ inline static gp_XYZ calcTFI(double x, double y,
+ const gp_XYZ& a0,const gp_XYZ& a1,const gp_XYZ& a2,const gp_XYZ& a3,
+ const gp_XYZ& p0,const gp_XYZ& p1,const gp_XYZ& p2,const gp_XYZ& p3);
+ /*!
+ * \brief Count nb of sub-shapes
+ * \param shape - the shape
+ * \param type - the type of sub-shapes to count
+ * \param ignoreSame - if true, use map not to count same shapes, else use explorer
+ * \retval int - the calculated number
+ */
+ static int Count(const TopoDS_Shape& shape,
+ const TopAbs_ShapeEnum type,
+ const bool ignoreSame);
+
+ /*!
+ * \brief Return number of unique ancestors of the shape
+ */
+ static int NbAncestors(const TopoDS_Shape& shape,
+ const SMESH_Mesh& mesh,
+ TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE);
+ /*!
+ * \brief Return iterator on ancestors of the given type, included into a container shape
+ */
+ static PShapeIteratorPtr GetAncestors(const TopoDS_Shape& shape,
+ const SMESH_Mesh& mesh,
+ TopAbs_ShapeEnum ancestorType,
+ const TopoDS_Shape* container = 0);
+ /*!
+ * \brief Find a common ancestor, of the given type, of two shapes
+ */
+ static TopoDS_Shape GetCommonAncestor(const TopoDS_Shape& shape1,
+ const TopoDS_Shape& shape2,
+ const SMESH_Mesh& mesh,
+ TopAbs_ShapeEnum ancestorType);
+ /*!
+ * \brief Return orientation of sub-shape in the main shape
+ */
+ static TopAbs_Orientation GetSubShapeOri(const TopoDS_Shape& shape,
+ const TopoDS_Shape& subShape);
+
+ static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape );
+
+ static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh );
+
+ static bool IsBlock( const TopoDS_Shape& shape );
+
+ static double MaxTolerance( const TopoDS_Shape& shape );
+
+ static double GetAngle( const TopoDS_Edge & E1, const TopoDS_Edge & E2,
+ const TopoDS_Face & F, const TopoDS_Vertex & V,
+ gp_Vec* faceNormal=0);
+
+ static bool IsClosedEdge( const TopoDS_Edge& anEdge );
+
+ static TopoDS_Vertex IthVertex( const bool is2nd, TopoDS_Edge anEdge, const bool CumOri=true );
+
+ static TopAbs_ShapeEnum GetGroupType(const TopoDS_Shape& group,
+ const bool avoidCompound=false);
+
+ static TopoDS_Shape GetShapeOfHypothesis( const SMESHDS_Hypothesis * hyp,
+ const TopoDS_Shape& shape,
+ SMESH_Mesh* mesh);
+
+