Salome HOME
Updated copyright comment
[modules/shaper.git] / src / Selector / Selector_Selector.cpp
index 260d8da9d4c26218fdf88057dd61349687d837dc..9e9a5425b338b856b1789b26fa7381c780ed7ce2 100644 (file)
@@ -1,4 +1,4 @@
-  // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Selector_Selector.h>
@@ -74,20 +73,18 @@ TopoDS_Shape Selector_Selector::value()
   return TopoDS_Shape(); // empty, error shape
 }
 
-std::string Selector_Selector::name(Selector_NameGenerator* theNameGenerator) {
+std::wstring Selector_Selector::name(Selector_NameGenerator* theNameGenerator) {
   return myAlgo->name(theNameGenerator);
 }
 
 TDF_Label Selector_Selector::restoreByName(
-  std::string theName, const TopAbs_ShapeEnum theShapeType,
+  std::wstring theName, const TopAbs_ShapeEnum theShapeType,
   Selector_NameGenerator* theNameGenerator, const bool theGeometricalNaming)
 {
   TDF_Label aResult;
-  myAlgo = Selector_Algo::restoreByName(
-    myLab, myBaseDocumentLab, theName, theShapeType, theNameGenerator, aResult);
+  myAlgo = Selector_Algo::restoreByName(myLab, myBaseDocumentLab, theName, theShapeType,
+    theGeometricalNaming, theNameGenerator, aResult);
   if (myAlgo) {
-    if (theGeometricalNaming)
-      myAlgo->setGeometricalNaming();
     return aResult;
   }
   return TDF_Label();
@@ -105,31 +102,6 @@ void Selector_Selector::combineGeometrical(const TopoDS_Shape theContext)
     aNewAlgo->solve(theContext);
     delete myAlgo;
     myAlgo = aNewAlgo;
-  } else {
-    // if can not select, select the compound in a custom way
-    TopTools_MapOfShape aMap;
-    TopoDS_ListOfShape aList;
-    for(TopExp_Explorer anExp(theContext, aValue.ShapeType()); anExp.More(); anExp.Next()) {
-      if (aMap.Add(anExp.Current())) {
-        if (myAlgo->sameGeometry(aValue, anExp.Current()))
-          aList.Append(anExp.Current());
-      }
-    }
-    if (aList.Size() > 1) {
-      TopoDS_Builder aBuilder;
-      TopoDS_Compound aCompound;
-      aBuilder.MakeCompound(aCompound);
-      for(TopoDS_ListIteratorOfListOfShape aListIter(aList); aListIter.More(); aListIter.Next()) {
-        aBuilder.Add(aCompound, aListIter.Value());
-      }
-      Selector_Algo* aNewAlgo = Selector_Algo::relesectWithAllGeometry(myAlgo, theContext);
-      if (aNewAlgo) {
-        aNewAlgo->store();
-        aNewAlgo->solve(theContext);
-        delete myAlgo;
-        myAlgo = aNewAlgo;
-      }
-    }
   }
 }