X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintRigid.cpp;h=8867e16d55932720530b9e6e0ea9dde72eeb88b6;hb=64fc7e4fdd63997ec7a502b233ef5f88186d5bbb;hp=741674a5b9429e461ffa6cf1da6bbca6f7d00029;hpb=7fcf163a8a369889707c5b73eeeb2bc68a4b906e;p=modules%2Fshaper.git 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;