From 3eb3f9ef9ec25ea5c339c81db2ae2f25e42cd5c7 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 6 Apr 2015 16:30:39 +0300 Subject: [PATCH] Do not show Rigid symbol on external objects --- src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp | 15 +++++++++++++-- src/XGUI/XGUI_Displayer.cpp | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp index 741674a5b..8867e16d5 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp @@ -6,6 +6,7 @@ #include "SketchPlugin_ConstraintRigid.h" #include "SketchPlugin_ConstraintParallel.h" +#include "SketchPlugin_Feature.h" #include @@ -34,8 +35,18 @@ AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious return thePrevious; AISObjectPtr anAIS = thePrevious; - if (!anAIS) { - anAIS = SketcherPrs_Factory::rigidConstraint(this, sketch()->coordinatePlane()); + if (anAIS.get() == NULL) { + std::shared_ptr aData = data(); + std::shared_ptr anAttr = + std::dynamic_pointer_cast(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); + ObjectPtr aObj = anAttr->object(); + if (aObj.get() != NULL) { + FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + std::shared_ptr aSkFea = + std::dynamic_pointer_cast(aFeature); + if (!aSkFea->isExternal()) + anAIS = SketcherPrs_Factory::rigidConstraint(this, sketch()->coordinatePlane()); + } } return anAIS; diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index e77247629..cbe4bb8fe 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -103,7 +103,7 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool isUpdateViewer) GeomPresentablePtr aPrs = std::dynamic_pointer_cast(theObject); bool isShading = false; if (aPrs.get() != NULL) { - anAIS = aPrs->getAISObject(AISObjectPtr()); + anAIS = aPrs->getAISObject(anAIS); } else { ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult.get() != NULL) { -- 2.39.2