Salome HOME
rnc: Slightly extended documentation of "over-constrained faces/volumes" controls...
[modules/smesh.git] / src / SMESH / SMESH_MesherHelper.hxx
index 2f89ce7899239f2abc9617f95c7e8c864f8032b5..b8a679ed86bbed692cc76aa0a3f09465b4f15aa4 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:      SMESH_MesherHelper.hxx
@@ -43,6 +43,7 @@
 
 class GeomAPI_ProjectPointOnSurf;
 class GeomAPI_ProjectPointOnCurve;
+class SMESH_ProxyMesh;
 
 typedef std::map<SMESH_TLink, const SMDS_MeshNode*>           TLinkNodeMap;
 typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
@@ -96,7 +97,8 @@ public:
   static bool LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
                               const TopoDS_Face& theFace,
                               const TopoDS_Edge& theBaseEdge,
-                              SMESHDS_Mesh*      theMesh);
+                              SMESHDS_Mesh*      theMesh,
+                              SMESH_ProxyMesh*   theProxyMesh=0);
   /*!
    * \brief Return support shape of a node
    * \param node - the node
@@ -104,7 +106,7 @@ public:
    * \retval TopoDS_Shape - found support shape
    */
   static TopoDS_Shape GetSubShapeByNode(const SMDS_MeshNode* node,
-                                        SMESHDS_Mesh*        meshDS);
+                                        const SMESHDS_Mesh*  meshDS);
 
   /*!
    * \brief Return a valid node index, fixing the given one if necessary
@@ -143,6 +145,10 @@ public:
 
   static double MaxTolerance( const TopoDS_Shape& shape );
 
+  static bool IsClosedEdge( const TopoDS_Edge& anEdge );
+
+  static TopoDS_Vertex IthVertex( const bool is2nd, TopoDS_Edge anEdge, const bool CumOri=true );
+
 
 public:
   // ---------- PUBLIC INSTANCE METHODS ----------
@@ -301,16 +307,19 @@ public:
   /*!
    * \brief Check and fix node UV on a face
    *  \param force - check even if checks of other nodes on this face passed OK
+   *  \param distXYZ - returns result distance and point coordinates
    *  \retval bool - false if UV is bad and could not be fixed
    */
   bool CheckNodeUV(const TopoDS_Face&   F,
                    const SMDS_MeshNode* n,
                    gp_XY&               uv,
                    const double         tol,
-                   const bool           force=false) const;
+                   const bool           force=false,
+                   double               distXYZ[4]=0) const;
   /*!
    * \brief Check and fix node U on an edge
    *  \param force - check even if checks of other nodes on this edge passed OK
+   *  \param distXYZ - returns result distance and point coordinates
    *  \retval bool - false if U is bad and could not be fixed
    */
   bool CheckNodeU(const TopoDS_Edge&   E,
@@ -318,7 +327,7 @@ public:
                   double&              u,
                   const double         tol,
                   const bool           force=false,
-                  double*              distance=0) const;
+                  double               distXYZ[4]=0) const;
   /*!
    * \brief Return middle UV taking in account surface period
    */
@@ -448,6 +457,10 @@ public:
   void AddTLinkNodeMap(const TLinkNodeMap& aMap)
     { myTLinkNodeMap.insert(aMap.begin(), aMap.end()); }
 
+  void AddTLinks(const SMDS_MeshEdge*   edge);
+  void AddTLinks(const SMDS_MeshFace*   face);
+  void AddTLinks(const SMDS_MeshVolume* vol);
+
   /**
    * Returns myTLinkNodeMap
    */
@@ -501,7 +514,10 @@ protected:
   // to create quadratic elements
   bool            myCreateQuadratic;
   bool            mySetElemOnShape;
-  std::set< int > myOkNodePosShapes;
+
+  std::map< int,bool > myNodePosShapesValidity;
+  bool toCheckPosOnShape(int shapeID ) const;
+  void setPosOnShapeValidity(int shapeID, bool ok ) const;
 
 };