#include <ModelAPI_ResultBody.h>
#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultPart.h>
#include <XGUI_Tools.h>
#include <XGUI_Displayer.h>
foreach (ObjectPtr anObj, aDisplayed) {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
// result constructions should not be taken as a body
- if (aResult.get() != NULL && aResult->groupName() == ModelAPI_ResultBody::group()) {
+ if (aResult.get() != NULL &&
+ ((aResult->groupName() == ModelAPI_ResultBody::group()) ||
+ ((aResult->groupName() == ModelAPI_ResultPart::group()))) ) {
GeomShapePtr aShape = aResult->shape();
if (aShape.get()) {
// vertices, edges should not be taken as a body
else {
aSelAttr->setValue(aFeature, GeomShapePtr());
GeomShapePtr aShape = aSelAttr->value();
- if (!aShape.get() && aSelAttr->contextFeature()->firstResult().get()) {
+ if (!aShape.get() && aSelAttr->contextFeature().get() &&
+ aSelAttr->contextFeature()->firstResult().get()) {
aShape = aSelAttr->contextFeature()->firstResult()->shape();
}
- if (aShape.get()) {
+ if (aShape.get() && aShape->isPlanar()) {
const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
setSketchPlane(aTDShape);
isOwnerSet = true;