Salome HOME
0021096: EDF 1729 SMESH: Create a Projection 1D-2D algorithm
[modules/smesh.git] / src / StdMeshers / StdMeshers_Import_1D.cxx
index c1230451be5430dd5fdc13e70757ca1da36b1b05..649a44d96dc393de1cd0dfd9aab548fdbf277a4b 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 //  SMESH SMESH : implementaion of SMESH idl descriptions
@@ -168,7 +168,7 @@ namespace // INTERNAL STUFF
 
     set< SMESH_subMesh*, _SubLess > _subM; // submeshes relating to this srcMesh
     set< SMESH_subMesh*, _SubLess > _copyMeshSubM; // submeshes requesting mesh copying
-    set< SMESH_subMesh*, _SubLess > _copyGroupSubM; // submeshes requesting mesh copying
+    set< SMESH_subMesh*, _SubLess > _copyGroupSubM; // submeshes requesting group copying
     set< SMESH_subMesh*, _SubLess > _computedSubM;
 
     SMESHDS_SubMesh*     _importMeshSubDS; // submesh storing a copy of _srcMesh
@@ -457,8 +457,9 @@ namespace // INTERNAL STUFF
       {
         removeImport = true;
       }
-      else if ( SMESH_subMesh::REMOVE_ALGO == event ||
-                SMESH_subMesh::REMOVE_FATHER_ALGO == event )
+      else if (( SMESH_subMesh::REMOVE_ALGO == event ||
+                 SMESH_subMesh::REMOVE_FATHER_ALGO == event ) &&
+               SMESH_subMesh::ALGO_EVENT == eventType )
       {
         SMESH_Gen* gen = subMesh->GetFather()->GetGen();
         SMESH_Algo* algo = gen->GetAlgo(*subMesh->GetFather(),subMesh->GetSubShape() );
@@ -470,7 +471,9 @@ namespace // INTERNAL STUFF
         // treate removal of Import algo from subMesh
         removeSubmesh( subMesh, (_ListenerData*) data );
       }
-      else if ( modifHyp )
+      else if ( modifHyp ||
+                ( SMESH_subMesh::CLEAN         == event &&
+                  SMESH_subMesh::COMPUTE_EVENT == eventType))
       {
         // treate modification of ImportSource hypothesis
         clearSubmesh( subMesh, (_ListenerData*) data, /*all=*/false );
@@ -486,7 +489,7 @@ namespace // INTERNAL STUFF
         for ( ; d != dList.end(); ++d )
           if ( d->_subM.count( subMesh ))
           {
-            set<SMESH_subMesh*>::iterator smIt = d->_subM.begin();
+            set<SMESH_subMesh*,_SubLess>::iterator smIt = d->_subM.begin();
             for( ; smIt != d->_subM.end(); ++smIt )
               if ( (*smIt)->IsMeshComputed() )
                 d->_computedSubM.insert( *smIt);
@@ -889,8 +892,8 @@ void StdMeshers_Import_1D::importMesh(const SMESH_Mesh*          srcMesh,
   e2e->clear();
 
   // Remember created groups in order to remove them as soon as the srcHyp is
-  // modified or something other similar happens. Store them in a hypothesis
-  // as it stores its values anyway
+  // modified or something other similar happens. This imformation must be persistent,
+  // for that store them in a hypothesis as it stores its values in the file anyway
   srcHyp->StoreResultGroups( resultGroups, *srcMeshDS, *tgtMeshDS );
 }