Salome HOME
Debug of the selector filter by neighbors and make sketch results stored in the data...
[modules/shaper.git] / src / Model / Model_BodyBuilder.cpp
index c17c9b8d56c3ea2cf4870d67825bb84db2679001..370ce2ad15cc01cf8debdae11968600083897edb 100755 (executable)
@@ -133,75 +133,6 @@ Model_BodyBuilder::Model_BodyBuilder(ModelAPI_Object* theOwner)
 {
 }
 
-// Converts evolution of naming shape to selection evelution and back to avoid
-// naming support on the disabled results. Deeply in the labels tree, recursively.
-static void evolutionToSelectionRec(TDF_Label theLab, const bool theFlag) {
-  std::list<std::pair<TopoDS_Shape, TopoDS_Shape> > aShapePairs; // to store old and new shapes
-  Handle(TNaming_NamedShape) aName;
-  int anEvolution = -1;
-  if (theLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
-    TNaming_Evolution aNSEvol = aName->Evolution();
-    if ((aNSEvol == TNaming_SELECTED && theFlag) ||
-        (aNSEvol != TNaming_SELECTED && !theFlag)) { // nothing to do, it is already correct
-      return;
-    }
-    anEvolution = (int)(aNSEvol);
-    if (!theFlag) {
-      Handle(TDataStd_Integer) anAttrEvol;
-      if (theLab.FindAttribute(TDataStd_Integer::GetID(), anAttrEvol)) {
-        anEvolution = anAttrEvol->Get();
-      }
-    } else {
-      TDataStd_Integer::Set(theLab, anEvolution);
-    }
-
-    for(TNaming_Iterator anIter(aName); anIter.More(); anIter.Next()) {
-      // iterator goes in reversed order relatively to the Builder, to, make the list reversed
-      aShapePairs.push_front(std::pair<TopoDS_Shape, TopoDS_Shape>
-        (anIter.OldShape(), anIter.NewShape()));
-    }
-
-    // create new
-    TNaming_Builder aBuilder(theLab);
-    TNaming_Evolution anEvol = (TNaming_Evolution)(anEvolution);
-    std::list<std::pair<TopoDS_Shape, TopoDS_Shape> >::iterator aPairsIter = aShapePairs.begin();
-    for(; aPairsIter != aShapePairs.end(); aPairsIter++) {
-      if (theFlag) { // disabled => make selection
-        if (anEvolution == TNaming_DELETE) // issue 2274 : don't put too many same null shapes
-          aBuilder.Select(aPairsIter->first, aPairsIter->first);
-        else if (anEvolution == TNaming_PRIMITIVE)
-          aBuilder.Select(aPairsIter->second, aPairsIter->second);
-        else
-          aBuilder.Select(aPairsIter->second, aPairsIter->first);
-      } else if (anEvol == TNaming_GENERATED) {
-        aBuilder.Generated(aPairsIter->first, aPairsIter->second);
-      } else if (anEvol == TNaming_MODIFY) {
-        aBuilder.Modify(aPairsIter->first, aPairsIter->second);
-      } else if (anEvol == TNaming_DELETE) {
-        aBuilder.Delete(aPairsIter->first);
-      } else if (anEvol == TNaming_PRIMITIVE) {
-        aBuilder.Generated(aPairsIter->second);
-      } else if (anEvol == TNaming_SELECTED) {
-        aBuilder.Select(aPairsIter->second, aPairsIter->first);
-      }
-    }
-  }
-  // recursive call for all sub-labels
-  TDF_ChildIterator anIter(theLab, Standard_False);
-  for(; anIter.More(); anIter.Next()) {
-    evolutionToSelectionRec(anIter.Value(), theFlag);
-  }
-}
-
-void Model_BodyBuilder::evolutionToSelection(const bool theFlag)
-{
-  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
-  if (!aData || !aData->isValid()) // unknown case
-    return;
-  TDF_Label& aShapeLab = aData->shapeLab();
-  evolutionToSelectionRec(aShapeLab, theFlag);
-}
-
 void Model_BodyBuilder::store(const GeomShapePtr& theShape,
                               const bool theIsStoreSameShapes)
 {