Salome HOME
22473: EDF 2825 SMESH: Memory allocation problem with ViscousLayer2D
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.hxx
index 7368e3c0128a697742e3224f36cbfe72679626f7..8380cc900323d7674d40cb3631fbf32ecb7862a8 100644 (file)
@@ -169,11 +169,32 @@ public:
                  SMESH::Controls::NumericalFunctorPtr theCriterion);
 
 
-  enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, HEXA_TO_6 = 2, HEXA_TO_24 = 3 };//!<arg of SplitVolumesIntoTetra()
+  typedef std::map < const SMDS_MeshElement*, int, TIDCompare > TFacetOfElem;
+
+    //!<2nd arg of SplitVolumes()
+  enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, // split into tetrahedra
+                                HEXA_TO_6,
+                                HEXA_TO_24,
+                                HEXA_TO_2_PRISMS, // split into prisms
+                                HEXA_TO_4_PRISMS };
   /*!
-   * \brief Split volumic elements into tetrahedra.
+   * \brief Split volumic elements into tetrahedra or prisms.
+   *        If facet ID < 0, element is split into tetrahedra,
+   *        else a hexahedron is split into prisms so that the given facet is
+   *        split into triangles
    */
-  void SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, const int theMethodFlags);
+  void SplitVolumes (const TFacetOfElem & theElems, const int theMethodFlags);
+
+  /*!
+   * \brief For hexahedra that will be split into prisms, finds facets to
+   *        split into triangles 
+   *  \param [in,out] theHexas - the hexahedra
+   *  \param [in]     theFacetNormal - facet normal
+   *  \param [out]    theFacets - the hexahedra and found facet IDs
+   */
+  void GetHexaFacetsToSplit( TIDSortedElemSet& theHexas,
+                             const gp_Ax1&     theFacetNormal,
+                             TFacetOfElem &    theFacets);
 
 
   enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
@@ -193,12 +214,13 @@ public:
   // If the2D, smoothing is performed using UV parameters of nodes
   // on geometrical faces
 
+  typedef TIDTypeCompare TElemSort;
   typedef std::map < const SMDS_MeshElement*,
-    std::list<const SMDS_MeshElement*>, TIDTypeCompare >                   TTElemOfElemListMap;
+    std::list<const SMDS_MeshElement*>, TElemSort >                        TTElemOfElemListMap;
   typedef std::map<const SMDS_MeshNode*, std::list<const SMDS_MeshNode*> > TNodeOfNodeListMap;
   typedef TNodeOfNodeListMap::iterator                                     TNodeOfNodeListMapItr;
   typedef std::vector<TNodeOfNodeListMapItr>                               TVecOfNnlmiMap;
-  typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap, TIDCompare >   TElemOfVecOfNnlmiMap;
+  typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap, TElemSort >    TElemOfVecOfNnlmiMap;
   typedef std::auto_ptr< std::list<int> > PGroupIDs;
 
   PGroupIDs RotationSweep (TIDSortedElemSet & theElements,