Salome HOME
imn/auto-reorder_of_nodes_ver2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ShapeByMeshDlg.cxx
index 82b5202bbb4bf5c6ff99fde8481717c4de8ada99..d1a2dd8b3a30611986d144ffa2520b93c7b7a52d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
@@ -6,7 +6,7 @@
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -331,7 +331,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
 
       TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
 
-      std::map<double, GEOM::GEOM_Object_wrap> aGeomObjectsMap;
+      std::map<int, GEOM::GEOM_Object_wrap> aGeomObjectsMap;
       GEOM::GEOM_Object_wrap aGeomObject;
 
       GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
@@ -343,7 +343,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
 
         if (aGeomObject->_is_nil()) continue;
 
-        double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
+        int anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
         if (aShapesOp->IsDone() && !aGeomObjectsMap.count(anId) )
         {
           aGeomObjectsMap[anId] = aGeomObject;
@@ -372,13 +372,13 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
         aGeomObjects->length( aNumberOfGO );
 
         int i = 0;
-        std::map<double, GEOM::GEOM_Object_wrap>::iterator anIter;
+        std::map<int, GEOM::GEOM_Object_wrap>::iterator anIter;
         for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
-          aGeomObjects[i++] = (*anIter).second.in();
+          aGeomObjects[i++] = GEOM::GEOM_Object::_duplicate( (*anIter).second.in() );
 
         //create geometry group
         aGeomObject = aGroupOp->CreateGroup(aMeshShape, aGroupType);
-        aGroupOp->UnionList(myGeomObj, aGeomObjects);
+        aGroupOp->UnionList(aGeomObject, aGeomObjects);
 
         if (!aGroupOp->IsDone())
           return;