Salome HOME
typo-fix by Kunda + minor changes
[modules/smesh.git] / src / SMESH / SMESH_MesherHelper.hxx
index 8c598fb62ffeecdb5b0bd14619d60fa9f422ad15..d4f54833ae574dacf157d599aa2f7d4ea926213c 100644 (file)
@@ -52,7 +52,7 @@ typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
 
 typedef SMDS_Iterator<const TopoDS_Shape*>  PShapeIterator;
 typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
-  
+
 typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
 typedef std::map< double, TNodeColumn >    TParam2ColumnMap;
 
@@ -122,7 +122,9 @@ class SMESH_EXPORT SMESH_MesherHelper
   /*!
    * \brief Return true if 2D mesh on FACE is distored
    */
-  static bool IsDistorted2D( SMESH_subMesh* faceSM, bool checkUV=false );
+  static bool IsDistorted2D( SMESH_subMesh*      faceSM,
+                             bool                checkUV = false,
+                             SMESH_MesherHelper* faceHelper = NULL);
 
   /*!
    * \brief Returns true if given node is medium
@@ -187,7 +189,7 @@ class SMESH_EXPORT SMESH_MesherHelper
    * \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, esle use explorer
+    * \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,
@@ -201,11 +203,12 @@ class SMESH_EXPORT SMESH_MesherHelper
                          const SMESH_Mesh&   mesh,
                          TopAbs_ShapeEnum    ancestorType=TopAbs_SHAPE);
   /*!
-   * \brief Return iterator on ancestors of the given type
+   * \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);
+                                        TopAbs_ShapeEnum    ancestorType,
+                                        const TopoDS_Shape* container = 0);
   /*!
    * \brief Find a common ancestor, of the given type, of two shapes
    */
@@ -317,6 +320,12 @@ public:
    * \brief Return the shape set by IsQuadraticSubMesh() or SetSubShape() 
    */
   const TopoDS_Shape& GetSubShape() const  { return myShape; }
+  /*!
+   * \brief Copy shape information from another helper to improve performance
+   *        since SetSubShape() can be time consuming if there are many edges
+   */
+  void CopySubShapeInfo(const SMESH_MesherHelper& other);
+
 
   /*!
    * \brief Convert a shape to its index in the SMESHDS_Mesh
@@ -552,9 +561,15 @@ public:
   /*!
    * \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
    *        has a degenerated edges
-    * \retval bool - true if it has
+   *  \retval bool - true if there are degenerated edges
    */
   bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
+  /*!
+   * \brief Return a number of degenerated edges in the shape set through
+   *        IsQuadraticSubMesh() or SetSubShape()
+   *  \retval size_t - nb edges
+   */
+  size_t NbDegeneratedEdges() const { return myDegenShapeIds.size(); }
 
   /*!
    * \brief Check if shape is a seam edge or it's vertex
@@ -601,6 +616,12 @@ public:
    *  \retval bool - true if it has
    */
   bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
+  /*!
+   * \brief Return a number of real seam edges in the shape set through
+   *        IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
+   *  \retval size_t - nb of real seams
+   */
+  size_t NbRealSeam() const;
   /*!
    * \brief Return index of periodic parametric direction of a closed face
    *  \retval int - 1 for U, 2 for V direction
@@ -610,6 +631,10 @@ public:
    * \brief Return an alternative parameter for a node on seam
    */
   double GetOtherParam(const double param) const;
+  /*!
+   * \brief Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
+   */
+  int IsOnSeam(const gp_XY& uv) const;
 
   /*!
    * \brief Return existing or create new medium nodes between given ones
@@ -692,6 +717,7 @@ public:
 
   static void WriteShape(const TopoDS_Shape& s);
 
+
  protected:
 
   /*!
@@ -708,9 +734,10 @@ public:
 
   double getFaceMaxTol( const TopoDS_Shape& face ) const;
 
+
  private:
 
-  // Forbiden copy constructor
+  // forbidden copy constructor
   SMESH_MesherHelper (const SMESH_MesherHelper& theOther);
 
   // key of a map of bi-quadratic face to it's central node