Salome HOME
Debug sewing. Enable polygons creation while sewing free border to side.
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.hxx
index 3dc5173f695103f3191ffe410ebc7bab9e8692b9..beafd34e111d7a23894e00cd27544bd9e1d79ba0 100644 (file)
@@ -70,9 +70,8 @@ class SMESH_MeshEditor {
   // with a quadrangle built on the same 4 nodes.
   // Return false if proper faces not found
 
-  bool Reorient (const SMDS_MeshElement * theFace);
-  // Reverse the normal of theFace
-  // Return false if theFace is null
+  bool Reorient (const SMDS_MeshElement * theElement);
+  // Reverse theElement orientation
 
 
   bool TriToQuad (std::set<const SMDS_MeshElement*> &  theElems,
@@ -122,13 +121,23 @@ class SMESH_MeshEditor {
   // Generate new elements by extrusion of theElements 
   // by theStep by theNbSteps
 
-  int ExtrusionAlongTrack (std::set<const SMDS_MeshElement*> & theElements,
-                          SMESH_subMesh*                      theTrackPattern,
-                          const SMDS_MeshNode*                theNodeStart,
-                          const bool                          theHasAngles,
-                          std::list<double>&                  theAngles,
-                          const bool                          theHasRefPoint,
-                          const gp_Pnt&                       theRefPoint);
+  enum Extrusion_Error {
+    EXTR_OK,
+    EXTR_NO_ELEMENTS, 
+    EXTR_PATH_NOT_EDGE,
+    EXTR_BAD_PATH_SHAPE,
+    EXTR_BAD_STARTING_NODE,
+    EXTR_BAD_ANGLES_NUMBER,
+    EXTR_CANT_GET_TANGENT
+    };
+  
+  Extrusion_Error ExtrusionAlongTrack (std::set<const SMDS_MeshElement*> & theElements,
+                                       SMESH_subMesh*                      theTrackPattern,
+                                       const SMDS_MeshNode*                theNodeStart,
+                                       const bool                          theHasAngles,
+                                       std::list<double>&                  theAngles,
+                                       const bool                          theHasRefPoint,
+                                       const gp_Pnt&                       theRefPoint);
   // Generate new elements by extrusion of theElements along path given by theTrackPattern,
   // theHasAngles are the rotation angles, base point can be given by theRefPoint
 
@@ -180,7 +189,8 @@ class SMESH_MeshEditor {
                            const SMDS_MeshNode* theSide2FirstNode,
                            const SMDS_MeshNode* theSide2SecondNode,
                            const SMDS_MeshNode* theSide2ThirdNode = 0,
-                           bool                 theSide2IsFreeBorder = true);
+                           const bool           theSide2IsFreeBorder = true,
+                           const bool           toCreatePoly = false);
   // Sew the free border to the side2 by replacing nodes in
   // elements on the free border with nodes of the elements
   // of the side 2. If nb of links in the free border and
@@ -217,20 +227,21 @@ class SMESH_MeshEditor {
   void InsertNodesIntoLink(const SMDS_MeshElement*          theFace,
                            const SMDS_MeshNode*             theBetweenNode1,
                            const SMDS_MeshNode*             theBetweenNode2,
-                           std::list<const SMDS_MeshNode*>& theNodesToInsert);
-  // insert theNodesToInsert into theFace between theBetweenNode1
-  // and theBetweenNode2 and split theElement.
-
-  static int SortQuadNodes (const SMDS_Mesh * theMesh,
-                            int               theNodeIds[] );
-  // Set 4 nodes of a quadrangle face in a good order.
-  // Swap 1<->2 or 2<->3 nodes and correspondingly return
-  // 1 or 2 else 0.
-
-  static bool SortHexaNodes (const SMDS_Mesh * theMesh,
-                             int               theNodeIds[] );
-  // Set 8 nodes of a hexahedron in a good order.
-  // Return success status
+                           std::list<const SMDS_MeshNode*>& theNodesToInsert,
+                           const bool                       toCreatePoly = false);
+  // insert theNodesToInsert into theFace between theBetweenNode1 and theBetweenNode2.
+  // If toCreatePoly is true, replace theFace by polygon, else split theFace.
+
+//  static int SortQuadNodes (const SMDS_Mesh * theMesh,
+//                            int               theNodeIds[] );
+//  // Set 4 nodes of a quadrangle face in a good order.
+//  // Swap 1<->2 or 2<->3 nodes and correspondingly return
+//  // 1 or 2 else 0.
+//
+//  static bool SortHexaNodes (const SMDS_Mesh * theMesh,
+//                             int               theNodeIds[] );
+//  // Set 8 nodes of a hexahedron in a good order.
+//  // Return success status
 
   static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
                                const SMDS_MeshElement* elemInGroups,