Salome HOME
Update of CheckDone
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.hxx
index 5a56ba6c194ecd3ecf9eea38788367ddba2562e4..8d253a45f34734c5400060795035bf7f86a37453 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -87,7 +87,7 @@ public:
   {
     SMDSAbs_ElementType               myType;
     bool                              myIsPoly, myIsQuad;
-    int                               myID;
+    smIdType                          myID;
     double                            myBallDiameter;
     std::vector<int>                  myPolyhedQuantities;
     std::vector<const SMDS_MeshNode*> myNodes; // not managed by ElemFeatures
@@ -113,7 +113,7 @@ public:
 
     SMESH_EXPORT ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; return *this; }
     SMESH_EXPORT ElemFeatures& SetQuad(bool isQuad) { myIsQuad = isQuad; return *this; }
-    SMESH_EXPORT ElemFeatures& SetID  (int ID)      { myID = ID; return *this; }
+    SMESH_EXPORT ElemFeatures& SetID  (smIdType ID) { myID = ID; return *this; }
   };
 
   /*!
@@ -124,10 +124,14 @@ public:
   /*!
    * \brief Add element
    */
-  SMDS_MeshElement* AddElement(const std::vector<int> & nodeIDs,
-                               const ElemFeatures&      features);
+  SMDS_MeshElement* AddElement(const std::vector<smIdType> & nodeIDs,
+                               const ElemFeatures&           features);
+  /*!
+   * \brief Remove a node and fill a hole appeared by changing surrounding faces
+   */
+  void RemoveNodeWithReconnection( const SMDS_MeshNode* node );
 
-  int Remove (const std::list< int >& theElemIDs, const bool isNodes);
+  smIdType Remove (const std::list< smIdType >& theElemIDs, const bool isNodes);
   // Remove a node or an element.
   // Modify a compute state of sub-meshes which become empty
 
@@ -155,14 +159,29 @@ public:
   // with a quadrangle built on the same 4 nodes.
   // Return false if proper faces not found
 
+  void SplitEdge (const SMDS_MeshNode * theNode1,
+                  const SMDS_MeshNode * theNode2,
+                  double                thePosition);
+  // Replace each triangle bound by theNode1-theNode2 link
+  // with two triangles by connecting a node made on the link with a node opposite to the link.
+
+  void SplitFace (const SMDS_MeshElement * theFace,
+                  double                   theX,
+                  double                   theY,
+                  double                   theZ );
+  // Split a face into triangles each formed by two nodes of the face and a new node added
+  // at the given coordinates.
+
+
   bool Reorient (const SMDS_MeshElement * theElement);
   // Reverse theElement orientation
 
-  int Reorient2D (TIDSortedElemSet &       theFaces,
-                  const gp_Dir&            theDirection,
-                  const SMDS_MeshElement * theFace);
-  // Reverse theFaces whose orientation to be same as that of theFace
-  // oriented according to theDirection. Return nb of reoriented faces
+  int Reorient2D (TIDSortedElemSet &  theFaces,
+                  const gp_Vec&       theDirection,
+                  TIDSortedElemSet &  theRefFaces,
+                  bool                theAllowNonManifold);
+  // Reverse theFaces whose orientation to be same as that of theRefFaces
+  // optionally oriented according to theDirection. Return nb of reoriented faces
 
   int Reorient2DBy3D (TIDSortedElemSet & theFaces,
                       TIDSortedElemSet & theVolumes,
@@ -352,7 +371,7 @@ public:
     bool IsScaleVariation()  const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; }
     bool IsAngleVariation()  const { return myFlags & EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION; }
     int  NbSteps()           const {
-      return mySteps.IsNull() ? myPathPoints.size() - 1: mySteps->Length();
+      return mySteps.IsNull() ? (int)myPathPoints.size() - 1: mySteps->Length();
     }
     // stores elements to use for extrusion by normal, depending on
     // state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag;
@@ -501,7 +520,7 @@ public:
   // In each group, the cdr of nodes are substituted by the first one
   // in all elements.
 
-  typedef std::list< std::list< int > > TListOfListOfElementsID;
+  typedef std::list< std::list< smIdType > > TListOfListOfElementsID;
 
   void FindEqualElements(TIDSortedElemSet &        theElements,
                          TListOfListOfElementsID & theGroupsOfElementsID);
@@ -729,25 +748,26 @@ public:
                        bool                    toCopyElements = false,
                        bool                    toCopyExistingBondary = false,
                        bool                    toAddExistingBondary = false,
-                       bool                    aroundElements = false);
+                       bool                    aroundElements = false,
+                       bool                    toCreateAllElements= false);
 
  private:
 
   /*!
    * \brief Convert elements contained in a submesh to quadratic
-   * \return int - nb of checked elements
+   * \return smIdType - nb of checked elements
    */
-  int convertElemToQuadratic(SMESHDS_SubMesh *   theSm,
-                             SMESH_MesherHelper& theHelper,
-                             const bool          theForce3d);
+  smIdType convertElemToQuadratic(SMESHDS_SubMesh *   theSm,
+                                  SMESH_MesherHelper& theHelper,
+                                  const bool          theForce3d);
 
   /*!
    * \brief Convert quadratic elements to linear ones and remove quadratic nodes
    * \return nb of checked elements
    */
-  int removeQuadElem( SMESHDS_SubMesh *    theSm,
-                      SMDS_ElemIteratorPtr theItr,
-                      const int            theShapeID);
+  smIdType removeQuadElem( SMESHDS_SubMesh *    theSm,
+                           SMDS_ElemIteratorPtr theItr,
+                           const int            theShapeID);
   /*!
    * \brief Create groups of elements made during transformation
    * \param nodeGens - nodes making corresponding myLastCreatedNodes