Salome HOME
Replace oe by ?
[modules/smesh.git] / src / SMESH / SMESH_MesherHelper.hxx
index f26ed4f6f2a55eaa04cc4f005a51242dbc882694..087c515f02bd75a4796a09559d2e553718fc50ca 100644 (file)
 #include <gp_Pnt2d.hxx>
 
 #include <map>
+#include <vector>
 
 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;
@@ -94,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
@@ -102,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
@@ -139,6 +143,10 @@ public:
 
   static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh );
 
+  static double MaxTolerance( const TopoDS_Shape& shape );
+
+  static bool IsClosedEdge( const TopoDS_Edge& anEdge );
+
 
 public:
   // ---------- PUBLIC INSTANCE METHODS ----------
@@ -221,8 +229,15 @@ public:
                          const SMDS_MeshNode* n4,
                          const int id = 0,
                          const bool force3d = false);
+
+  /*!
+   * Creates polygon, with additional nodes in quadratic mesh
+   */
+  SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes,
+                                   const int id = 0,
+                                   const bool force3d = false);
   /*!
-   * Creates quadratic or linear tetraahedron
+   * Creates quadratic or linear tetrahedron
    */
   SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
                              const SMDS_MeshNode* n2,
@@ -264,11 +279,20 @@ public:
                              const SMDS_MeshNode* n8,
                              const int id = 0, 
                              bool force3d = true);
+
+  /*!
+   * Creates polyhedron. In quadratic mesh, adds medium nodes
+   */
+  SMDS_MeshVolume* AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
+                                        const std::vector<int>&                  quantities,
+                                        const int                                ID=0,
+                                        const bool                               force3d = true);
   /*!
    * \brief Return U of the given node on the edge
    */
   double GetNodeU(const TopoDS_Edge&   theEdge,
                   const SMDS_MeshNode* theNode,
+                  const SMDS_MeshNode* inEdgeNode=0,
                   bool*                check=0);
   /*!
    * \brief Return node UV on face
@@ -281,23 +305,27 @@ 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,
                   const SMDS_MeshNode* n,
                   double&              u,
                   const double         tol,
-                  const bool           force=false) const;
+                  const bool           force=false,
+                  double               distXYZ[4]=0) const;
   /*!
    * \brief Return middle UV taking in account surface period
    */
@@ -427,6 +455,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
    */
@@ -452,6 +484,9 @@ protected:
    */
   gp_Pnt2d GetUVOnSeam( const gp_Pnt2d& uv1, const gp_Pnt2d& uv2 ) const;
 
+  const SMDS_MeshNode* getMediumNodeOnComposedWire(const SMDS_MeshNode* n1,
+                                                   const SMDS_MeshNode* n2,
+                                                   bool                 force3d);
  private:
 
   // Forbiden copy constructor
@@ -465,8 +500,10 @@ protected:
   double          myPar1[2], myPar2[2]; // U and V bounds of a closed periodic surface
   int             myParIndex;     // bounds' index (1-U, 2-V, 3-both)
 
-  typedef std::map< int, GeomAPI_ProjectPointOnSurf* > TID2Projector;
-  TID2Projector   myFace2Projector;
+  typedef std::map< int, GeomAPI_ProjectPointOnSurf* > TID2ProjectorOnSurf;
+  TID2ProjectorOnSurf myFace2Projector;
+  typedef std::map< int, GeomAPI_ProjectPointOnCurve* > TID2ProjectorOnCurve;
+  TID2ProjectorOnCurve myEdge2Projector;
 
   TopoDS_Shape    myShape;
   SMESH_Mesh*     myMesh;
@@ -475,7 +512,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;
 
 };