]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/StdMeshers/StdMeshers_Penta_3D.cxx
Salome HOME
PAL13312 (EDF262 SMESH mesh concatenation operation needed):
[modules/smesh.git] / src / StdMeshers / StdMeshers_Penta_3D.cxx
index f615ea97a3a04cc01c961cd0ed18d897d98d2300..51b33214fadc17d02597a094a397f46650cba7a2 100644 (file)
 #include "SMDS_VolumeTool.hxx"
 #include "SMESHDS_SubMesh.hxx"
 #include "SMESH_Mesh.hxx"
-#include "SMESH_subMesh.hxx"
 #include "SMESH_MeshEditor.hxx"
+#include "SMESH_subMesh.hxx"
+#include "SMESH_subMeshEventListener.hxx"
 
+#include <BRepTools.hxx>
+#include <BRepTools_WireExplorer.hxx>
 #include <BRep_Tool.hxx>
 #include <TopAbs_ShapeEnum.hxx>
 #include <TopExp.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Shell.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <gp_Pnt.hxx>
-#include <BRepTools.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <TopTools_MapOfShape.hxx>
 
 #include <stdio.h>
 #include <algorithm>
@@ -828,6 +829,7 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1()
   SMESH_Mesh* pMesh = GetMesh();
   SMESHDS_Mesh * meshDS = pMesh->GetMeshDS();
   //
+  SMESH_subMesh *aSubMesh1 = pMesh->GetSubMeshContaining(aFxy1);
   SMESH_subMesh *aSubMesh0 = pMesh->GetSubMeshContaining(aFxy0);
   SMESHDS_SubMesh *aSM0 = aSubMesh0->GetSubMeshDS();
   //
@@ -888,6 +890,16 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1()
     }
     meshDS->SetMeshElementOnShape(face, aFxy1);
   }
+
+  // update compute state of top face submesh
+  aSubMesh1->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
+
+  // assure that mesh on the top face will be cleaned when it is cleaned
+  // on the bottom face
+  SMESH_subMesh* volSM = pMesh->GetSubMesh( myTool->GetSubShape() );
+  volSM->SetEventListener( new SMESH_subMeshEventListener(true),
+                           SMESH_subMeshEventListenerData::MakeData( aSubMesh1 ),
+                           aSubMesh0 ); // translate CLEAN event of aSubMesh0 to aSubMesh1
 }
 
 //=======================================================================
@@ -1542,12 +1554,12 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
   // try to load the rest nodes
 
   // get all faces from theFace
-  map<int,const SMDS_MeshElement*> allFaces, foundFaces;
+  TIDSortedElemSet allFaces, foundFaces;
   SMDS_ElemIteratorPtr eIt = smFace->GetElements();
   while ( eIt->more() ) {
     const SMDS_MeshElement* e = eIt->next();
     if ( e->GetType() == SMDSAbs_Face )
-      allFaces.insert( make_pair(e->GetID(),e) );
+      allFaces.insert( e );
   }
   // Starting from 2 neighbour nodes on theBaseEdge, look for a face
   // the nodes belong to, and between the nodes of the found face,
@@ -1594,7 +1606,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
             return false;
           }
           par_nVec_2->second[ row ] = node;
-          foundFaces.insert( make_pair(face->GetID(),face) );
+          foundFaces.insert( face );
           n2 = node;
           if ( nbFaceNodes==4 || (myCreateQuadratic && nbFaceNodes==8) ) {
             n1 = par_nVec_1->second[ row ];