return;
ResultPtr aContext = anObjectAttr->context();
- ResultBodyPtr aCtxOwner = ModelAPI_Tools::bodyOwner(aContext);
- GeomShapePtr aParent = aCtxOwner ? aCtxOwner->shape() : aContext->shape();
+ GeomShapePtr aParent;
+ if (aContext.get()) {
+ ResultBodyPtr aCtxOwner = ModelAPI_Tools::bodyOwner(aContext);
+ aParent = aCtxOwner ? aCtxOwner->shape() : aContext->shape();
+ } else { // get it from a feature
+ FeaturePtr aFeature = anObjectAttr->contextFeature();
+ if (aFeature.get()) {
+ aParent = aFeature->firstResult()->shape();
+ }
+ }
if (!aParent)
return;
std::shared_ptr<ModelAPI_ResultBody> aResultBody =
document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, aSolid, aFilletEdgesAndVertices, aResult, aFilletBuilder);
+ loadNamingDS(aResultBody, aSolid, aResult, aFilletBuilder);
setResult(aResultBody, aResultIndex);
aResultIndex++;
}
void FeaturesPlugin_Fillet::loadNamingDS(
std::shared_ptr<ModelAPI_ResultBody> theResultBody,
const std::shared_ptr<GeomAPI_Shape> theBaseShape,
- const ListOfShape& theFilletShapes,
const std::shared_ptr<GeomAPI_Shape> theResultShape,
const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape)
{
return;
}
- std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = theMakeShape->mapOfSubShapes();
-
- const int aDeletedTag = 1;
- const int aModifyTag = 2;
- const int aGeneratedTag = 3;
- /// sub solids will be placed at labels 4, 5, etc. if result is compound of solids
- const int aSubsolidsTag = 4;
-
- theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
+ theResultBody->storeModified(theBaseShape, theResultShape);
- const std::string aModFaceName = "Modified_Face";
const std::string aFilletFaceName = "Fillet_Face";
// Store modified faces
- theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), theBaseShape,
- GeomAPI_Shape::FACE, aModifyTag, aModFaceName, *aMapOfShapes);
+ theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE);
// Store new faces generated from edges and vertices
- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
- GeomAPI_Shape::EDGE, aGeneratedTag, aFilletFaceName, *aMapOfShapes);
- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
- GeomAPI_Shape::VERTEX, aGeneratedTag, aFilletFaceName, *aMapOfShapes);
+ theResultBody->loadGeneratedShapes(theMakeShape,
+ theBaseShape,
+ GeomAPI_Shape::EDGE,
+ aFilletFaceName);
+ theResultBody->loadGeneratedShapes(theMakeShape,
+ theBaseShape,
+ GeomAPI_Shape::VERTEX,
+ aFilletFaceName);
// Deleted shapes
- theResultBody->loadDeletedShapes(theMakeShape.get(), theBaseShape,
- GeomAPI_Shape::EDGE, aDeletedTag);
- theResultBody->loadDeletedShapes(theMakeShape.get(), theBaseShape,
- GeomAPI_Shape::FACE, aDeletedTag);
+ theResultBody->loadDeletedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE);
+ theResultBody->loadDeletedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE);
}