]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESH/SMESH_MeshEditor.hxx
Salome HOME
PAL13460 (PAL EDF 301 force the mesh to go through a point)
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.hxx
index c8395886646326f22681e785bfc4644dbe0faa36..6d1b90a29c7401002fea565694d44330a4e3e2e0 100644 (file)
 #include <list>
 #include <map>
 
-typedef map<const SMDS_MeshElement*,
-            list<const SMDS_MeshElement*> > TElemOfElemListMap;
-typedef map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
-
-typedef map<const SMDS_MeshNode*, SMESHDS_SubMesh*>           RemoveQuadNodeMap;
-typedef map<const SMDS_MeshNode*, SMESHDS_SubMesh*>::iterator ItRemoveQuadNodeMap;
+typedef std::map<const SMDS_MeshElement*,
+                 std::list<const SMDS_MeshElement*> >        TElemOfElemListMap;
+typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
 
 class SMDS_MeshFace;
 class SMDS_MeshNode;
@@ -63,7 +60,7 @@ class gp_Pnt;
  */
 // ============================================================
 
-template < class TMeshElem >
+template < class TMeshElem = SMDS_MeshElement>
 struct TIDCompare {
   bool operator () (const TMeshElem* e1, const TMeshElem* e2) const
   { return e1->GetID() < e2->GetID(); }
@@ -82,6 +79,21 @@ public:
 
   SMESH_MeshEditor( SMESH_Mesh* theMesh );
 
+  /*!
+   * \brief Add element
+   */
+  SMDS_MeshElement* AddElement(const std::vector<const SMDS_MeshNode*> & nodes,
+                               const SMDSAbs_ElementType                 type,
+                               const bool                                isPoly,
+                               const int                                 ID = 0);
+  /*!
+   * \brief Add element
+   */
+  SMDS_MeshElement* AddElement(const std::vector<int>  & nodeIDs,
+                               const SMDSAbs_ElementType type,
+                               const bool                isPoly,
+                               const int                 ID = 0);
+
   bool Remove (const std::list< int >& theElemIDs, const bool isNodes);
   // Remove a node or an element.
   // Modify a compute state of sub-meshes which become empty
@@ -170,7 +182,8 @@ public:
                       const gp_Ax1&      theAxis,
                       const double       theAngle,
                       const int          theNbSteps,
-                      const double       theToler);
+                      const double       theToler,
+                      const bool         theMakeWalls=true);
   // Generate new elements by rotation of theElements around theAxis
   // by theAngle by theNbSteps
 
@@ -449,21 +462,21 @@ public:
 
   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
 
-  SMESH_SequenceOfElemPtr GetLastCreatedNodes() { return myLastCreatedNodes; }
+  const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
 
-  SMESH_SequenceOfElemPtr GetLastCreatedElems() { return myLastCreatedElems; }
+  const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
 
 private:
 
-  void ConvertElemToQuadratic(SMESHDS_SubMesh *theSm,
-                              SMESH_MesherHelper* theHelper,
-                             const bool theForce3d);
+  void ConvertElemToQuadratic(SMESHDS_SubMesh *   theSm,
+                              SMESH_MesherHelper& theHelper,
+                             const bool          theForce3d);
   //Auxiliary function for "ConvertToQuadratic" is intended to convert
   //elements contained in submesh to quadratic
 
-  void RemoveQuadElem( SMESHDS_SubMesh *theSm,
+  void RemoveQuadElem( SMESHDS_SubMesh *    theSm,
                       SMDS_ElemIteratorPtr theItr,
-                      RemoveQuadNodeMap& theRemoveNodeMap);
+                      const int            theShapeID);
   //Auxiliary function for "ConvertFromQuadratic" is intended to convert quadratic
   //element to ordinary and for removing quadratic nodes