From 171be43909f55eb16ae1de8b67ab68660ce28f1f Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 18 Jun 2015 12:35:53 +0300 Subject: [PATCH] For for bounding planes selection in composite features --- src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp | 10 ++++++++-- .../FeaturesPlugin_RevolutionBoolean.cpp | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp index fcc224488..af44526a7 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp @@ -33,12 +33,18 @@ ListOfShape FeaturesPlugin_ExtrusionBoolean::MakeSolids(const ListOfShape& theFa std::shared_ptr aFromShape; std::shared_ptr aToShape; std::shared_ptr anObjRef = selection(FROM_OBJECT_ID()); - if (anObjRef) { + if(anObjRef.get() != NULL) { aFromShape = std::dynamic_pointer_cast(anObjRef->value()); + if(aFromShape.get() == NULL && anObjRef->context().get() != NULL) { + aFromShape = anObjRef->context()->shape(); + } } anObjRef = selection(TO_OBJECT_ID()); - if (anObjRef) { + if(anObjRef.get() != NULL) { aToShape = std::dynamic_pointer_cast(anObjRef->value()); + if(aToShape.get() == NULL && anObjRef->context().get() != NULL) { + aToShape = anObjRef->context()->shape(); + } } // Getting extrusion sizes. diff --git a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp index 646792492..09a0fd72b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp @@ -48,12 +48,18 @@ ListOfShape FeaturesPlugin_RevolutionBoolean::MakeSolids(const ListOfShape& theF std::shared_ptr aFromShape; std::shared_ptr aToShape; anObjRef = selection(FROM_OBJECT_ID()); - if (anObjRef) { + if(anObjRef.get() != NULL) { aFromShape = std::dynamic_pointer_cast(anObjRef->value()); + if(aFromShape.get() == NULL && anObjRef->context().get() != NULL) { + aFromShape = anObjRef->context()->shape(); + } } anObjRef = selection(TO_OBJECT_ID()); - if (anObjRef) { + if(anObjRef.get() != NULL) { aToShape = std::dynamic_pointer_cast(anObjRef->value()); + if(aToShape.get() == NULL && anObjRef->context().get() != NULL) { + aToShape = anObjRef->context()->shape(); + } } // Getting revolution angles. -- 2.39.2