Salome HOME
PAL16567
[modules/smesh.git] / src / SMESH / SMESH_Pattern.hxx
index cc0bd159a1e317fbd22c4ccaa6bdb99552a72327..a2ee3050da6f78b98419795292def1603b87f96f 100644 (file)
@@ -15,7 +15,7 @@
 //  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
 // File      : SMESH_Pattern.hxx
 // Created   : Mon Aug  2 10:30:00 2004
@@ -41,6 +41,7 @@ class SMDS_MeshFace;
 class SMDS_MeshVolume;
 class SMDS_MeshNode;
 class SMESH_Mesh;
+class SMESHDS_SubMesh;
 class TopoDS_Shell;
 class TopoDS_Vertex;
 class TopoDS_Face;
@@ -65,7 +66,7 @@ class SMESH_Pattern {
 
   bool Load (SMESH_Mesh*        theMesh,
              const TopoDS_Face& theFace,
-             bool               theProject);
+             bool               theProject = false);
   // Create a pattern from the mesh built on <theFace>.
   // <theProject>==true makes override nodes positions
   // on <theFace> computed by mesher
@@ -100,7 +101,17 @@ class SMESH_Pattern {
   // the loaded pattern to <theFace>. The first key-point
   // will be mapped into <theNodeIndexOnKeyPoint1>-th node
 
-  bool Apply (std::set<const SMDS_MeshFace*>& theFaces,
+  bool Apply (SMESH_Mesh*          theMesh,
+              const SMDS_MeshFace* theFace,
+              const TopoDS_Shape&  theSurface,
+              const int            theNodeIndexOnKeyPoint1,
+              const bool           theReverse);
+  // Compute nodes coordinates applying
+  // the loaded pattern to <theFace>. The first key-point
+  // will be mapped into <theNodeIndexOnKeyPoint1>-th node
+
+  bool Apply (SMESH_Mesh*                     theMesh,
+              std::set<const SMDS_MeshFace*>& theFaces,
               const int                       theNodeIndexOnKeyPoint1,
               const bool                      theReverse);
   // Compute nodes coordinates applying
@@ -134,8 +145,9 @@ class SMESH_Pattern {
   // Create nodes and elements in <theMesh> using nodes
   // coordinates computed by either of Apply...() methods
 
-
+  // ----------
   // Inquiries
+  // ----------
 
   enum ErrorCode {
     ERR_OK,
@@ -156,6 +168,7 @@ class SMESH_Pattern {
     // Load(face)
     ERR_LOADF_NARROW_FACE, // too narrow face
     ERR_LOADF_CLOSED_FACE, // closed face
+    ERR_LOADF_CANT_PROJECT, // impossible to project nodes
     // Load(volume)
     ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
     ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
@@ -199,8 +212,18 @@ class SMESH_Pattern {
   void DumpPoints() const;
   // Debug
 
+  // -----------------------------
+  // Utilities for advanced usage
+  // -----------------------------
 
- private:
+  TopoDS_Shape GetSubShape( const int i ) const {
+    if ( i < 1 || i > myShapeIDMap.Extent() ) return TopoDS_Shape();
+    return myShapeIDMap( i );
+  }
+  // Return a shape from myShapeIDMap where shapes are indexed so that first go
+  // ordered vertices, then ordered edge, then faces and maybe a shell
+
+private:
   // private methods
 
   struct TPoint {
@@ -305,6 +328,10 @@ class SMESH_Pattern {
   void clearMesh(SMESH_Mesh* theMesh) const;
   // clear mesh elements existing on myShape in theMesh
 
+  static SMESHDS_SubMesh * getSubmeshWithElements(SMESH_Mesh*         theMesh,
+                                                  const TopoDS_Shape& theShape);
+  // return submesh containing elements bound to theShape in theMesh
+
  private:
   // fields