]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_AttributeSelection.cpp
Salome HOME
Improve Model package coverage: remove unused methods, open/save tests improvements
[modules/shaper.git] / src / Model / Model_AttributeSelection.cpp
index 1db965d233bc30a35d1ed1269207245c9ce2be69..e088c9a4410490ac5915599341e3f92dd0403538 100644 (file)
@@ -1020,76 +1020,6 @@ void Model_AttributeSelection::selectSubShape(const std::string& theType,
   }
 }
 
-int Model_AttributeSelection::Id()
-{
-  int anID = 0;
-  std::shared_ptr<GeomAPI_Shape> aSelection = value();
-  ResultPtr aContextRes = context();
-  // support for compsolids:
-  while(ModelAPI_Tools::bodyOwner(aContextRes).get()) {
-    aContextRes = ModelAPI_Tools::bodyOwner(aContextRes);
-  }
-  std::shared_ptr<GeomAPI_Shape> aContext = aContextRes->shape();
-
-
-  TopoDS_Shape aMainShape = aContext->impl<TopoDS_Shape>();
-  const TopoDS_Shape& aSubShape = aSelection->impl<TopoDS_Shape>();
-  // searching for the latest main shape
-  if (aSelection && !aSelection->isNull() && aContext && !aContext->isNull())
-  {
-    std::shared_ptr<Model_Document> aDoc =
-      std::dynamic_pointer_cast<Model_Document>(context()->document());
-    if (aDoc.get()) {
-      Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aMainShape, aDoc->generalLabel());
-      if (!aNS.IsNull()) {
-        aMainShape = TNaming_Tool::CurrentShape(aNS);
-      }
-    }
-
-    TopTools_IndexedMapOfShape aSubShapesMap;
-    TopExp::MapShapes(aMainShape, aSubShapesMap);
-    anID = aSubShapesMap.FindIndex(aSubShape);
-  }
-  return anID;
-}
-
-void Model_AttributeSelection::setId(int theID)
-{
-  std::shared_ptr<GeomAPI_Shape> aSelection;
-
-  ResultPtr aContextRes = context();
-  // support for compsolids:
-  while(ModelAPI_Tools::bodyOwner(aContextRes).get()) {
-    aContextRes = ModelAPI_Tools::bodyOwner(aContextRes);
-  }
-  std::shared_ptr<GeomAPI_Shape> aContext = aContextRes->shape();
-
-  TopoDS_Shape aMainShape = aContext->impl<TopoDS_Shape>();
-  // searching for the latest main shape
-  if (theID > 0 && aContext && !aContext->isNull())
-  {
-    std::shared_ptr<Model_Document> aDoc =
-      std::dynamic_pointer_cast<Model_Document>(aContextRes->document());
-    if (aDoc.get()) {
-      Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aMainShape, aDoc->generalLabel());
-      if (!aNS.IsNull()) {
-        aMainShape = TNaming_Tool::CurrentShape(aNS);
-      }
-    }
-
-    TopTools_IndexedMapOfShape aSubShapesMap;
-    TopExp::MapShapes(aMainShape, aSubShapesMap);
-    const TopoDS_Shape& aSelShape = aSubShapesMap.FindKey(theID);
-
-    std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
-    aResult->setImpl(new TopoDS_Shape(aSelShape));
-
-    aSelection = aResult;
-  }
-
-  setValue(aContextRes, aSelection);
-}
-
 std::string Model_AttributeSelection::contextName(const ResultPtr& theContext) const
 {
   std::string aResult;