Salome HOME
typo-fix by Kunda
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.hxx
index 103e4a4172ca4b0028106ccea29044ed35d6b3bd..3fc13aca6c7bbc28927caf09b9f91d0da05f4b61 100644 (file)
@@ -83,11 +83,12 @@ public:
   // --------------------------------------------------------------------------------
   struct ElemFeatures //!< Features of element to create
   {
-    SMDSAbs_ElementType myType;
-    bool                myIsPoly, myIsQuad;
-    int                 myID;
-    double              myBallDiameter;
-    std::vector<int>    myPolyhedQuantities;
+    SMDSAbs_ElementType               myType;
+    bool                              myIsPoly, myIsQuad;
+    int                               myID;
+    double                            myBallDiameter;
+    std::vector<int>                  myPolyhedQuantities;
+    std::vector<const SMDS_MeshNode*> myNodes; // not managed by ElemFeatures
 
     SMESH_EXPORT ElemFeatures( SMDSAbs_ElementType type=SMDSAbs_All, bool isPoly=false, bool isQuad=false )
       :myType( type ), myIsPoly(isPoly), myIsQuad(isQuad), myID(-1), myBallDiameter(0) {}
@@ -172,7 +173,7 @@ public:
    * \param theElems     - The triangles to be fused.
    * \param theCriterion - Is used to choose a neighbour to fuse with.
    * \param theMaxAngle  - Is a max angle between element normals at which fusion
-   *                       is still performed; theMaxAngle is mesured in radians.
+   *                       is still performed; theMaxAngle is measured in radians.
    * \return bool - Success or not.
    */
   bool TriToQuad (TIDSortedElemSet &                   theElems,
@@ -180,7 +181,7 @@ public:
                   const double                         theMaxAngle);
   /*!
    * \brief Split quadrangles into triangles.
-   * \param theElems     - The faces to be splitted.
+   * \param theElems     - The faces to be split.
    * \param theCriterion - Is used to choose a diagonal for splitting.
    * \return bool - Success or not.
    */
@@ -188,7 +189,7 @@ public:
                   SMESH::Controls::NumericalFunctorPtr theCriterion);
   /*!
    * \brief Split quadrangles into triangles.
-   * \param theElems  - The faces to be splitted.
+   * \param theElems  - The faces to be split.
    * \param the13Diag - Is used to choose a diagonal for splitting.
    * \return bool - Success or not.
    */
@@ -471,7 +472,8 @@ public:
   // Return list of group of nodes close to each other within theTolerance.
   // Search among theNodes or in the whole mesh if theNodes is empty.
 
-  void MergeNodes (TListOfListOfNodes & theNodeGroups);
+  void MergeNodes (TListOfListOfNodes & theNodeGroups,
+                   const bool           theAvoidMakingHoles = false);
   // In each group, the cdr of nodes are substituted by the first one
   // in all elements.
 
@@ -540,7 +542,7 @@ public:
   // additional nodes are inserted on a link provided that no
   // volume elements share the splitted link.
   // The side 2 is a free border if theSide2IsFreeBorder == true.
-  // Sewing is peformed between the given first, second and last
+  // Sewing is performed between the given first, second and last
   // nodes on the sides.
   // theBorderFirstNode is merged with theSide2FirstNode.
   // if (!theSide2IsFreeBorder) then theSide2SecondNode gives
@@ -749,6 +751,20 @@ public:
                     const size_t                               nbSteps,
                     SMESH_SequenceOfElemPtr&                   srcElements);
 
+  /*!
+   * \brief Computes new connectivity of an element after merging nodes
+   *  \param [in] elems - the element
+   *  \param [out] newElemDefs - definition(s) of result element(s)
+   *  \param [inout] nodeNodeMap - nodes to merge
+   *  \param [in] avoidMakingHoles - if true and and the element becomes invalid
+   *             after merging (but not degenerated), removes nodes causing
+   *             the invalidity from \a nodeNodeMap.
+   *  \return bool - true if the element should be removed
+   */
+  bool applyMerge( const SMDS_MeshElement*      elems,
+                   std::vector< ElemFeatures >& newElemDefs,
+                   TNodeNodeMap&                nodeNodeMap,
+                   const bool                   avoidMakingHoles );
   /*!
    * \brief Create 1D and 2D elements around swept elements
    * \param mapNewNodes - source nodes and ones generated from them
@@ -781,11 +797,11 @@ public:
     double        Angle       ()const               { return myAngle; }
     double        Parameter   ()const               { return myPrm; }
   };
-  Extrusion_Error MakeEdgePathPoints(std::list<double>&                     aPrms,
+  Extrusion_Error makeEdgePathPoints(std::list<double>&                     aPrms,
                                      const TopoDS_Edge&                     aTrackEdge,
                                      bool                                   aFirstIsStart,
                                      std::list<SMESH_MeshEditor_PathPoint>& aLPP);
-  Extrusion_Error MakeExtrElements(TIDSortedElemSet                       theElements[2],
+  Extrusion_Error makeExtrElements(TIDSortedElemSet                       theElements[2],
                                    std::list<SMESH_MeshEditor_PathPoint>& theFullList,
                                    const bool                             theHasAngles,
                                    std::list<double>&                     theAngles,
@@ -793,7 +809,7 @@ public:
                                    const bool                             theHasRefPoint,
                                    const gp_Pnt&                          theRefPoint,
                                    const bool                             theMakeGroups);
-  static void LinearAngleVariation(const int          NbSteps,
+  static void linearAngleVariation(const int          NbSteps,
                                    std::list<double>& theAngles);
 
   bool doubleNodes( SMESHDS_Mesh*           theMeshDS,
@@ -812,7 +828,7 @@ private:
   // Nodes and elements created during last operation
   SMESH_SequenceOfElemPtr myLastCreatedNodes, myLastCreatedElems;
 
-  // Description of error/warning occured during last operation
+  // Description of error/warning occurred during last operation
   SMESH_ComputeErrorPtr   myError;
 };