- }
- // remove the rest results if there were produced in the previous pass
- removeResults(aResultIndex);
-}
-
-//=================================================================================================
-void FeaturesPlugin_Revolution::LoadNamingDS(GeomAlgoAPI_Revolution& theFeature,
- std::shared_ptr<ModelAPI_ResultBody> theResultBody,
- std::shared_ptr<GeomAPI_Shape> theBasis,
- std::shared_ptr<GeomAPI_Shape> theContext)
-{
- //load result
- if(theBasis->isEqual(theContext))
- theResultBody->store(theFeature.shape());
- else
- theResultBody->storeGenerated(theContext, theFeature.shape());
-
- GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
- theFeature.mapOfShapes(*aSubShapes);
-
- std::string aGeneratedName = "LateralFace";
- theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape(), theBasis, EDGE,_LATERAL_TAG, aGeneratedName, *aSubShapes);
-
- //Insert from face
- std::string aBotName = "FromFace";
- std::shared_ptr<GeomAPI_Shape> aBottomFace = theFeature.firstShape();
- if(!aBottomFace->isNull()) {
- if(aSubShapes->isBound(aBottomFace)) {
- aBottomFace = aSubShapes->find(aBottomFace);
+ aSelection = selection(FROM_OBJECT_ID());
+ if(aSelection.get()) {
+ aFromShape = std::dynamic_pointer_cast<GeomAPI_Shape>(aSelection->value());
+ if(!aFromShape.get() && aSelection->context().get()) {
+ aFromShape = aSelection->context()->shape();
+ }
+ if (aFromShape.get() && aFromShape->isCompound()) {
+ GeomAPI_ShapeIterator anIt(aFromShape);
+ aFromShape = anIt.current();
+ }