From: nds Date: Thu, 23 Jun 2016 06:34:22 +0000 (+0300) Subject: Correction for circle to hide AIS object when result is set. isFeatureValue should... X-Git-Tag: V_2.4.0~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=617216ca68f20a6698f46ee290f293bd1bd67607;p=modules%2Fshaper.git Correction for circle to hide AIS object when result is set. isFeatureValue should not check 1st/2nd/3rd points in Circle by center mode. --- diff --git a/src/SketchPlugin/SketchPlugin_Circle.cpp b/src/SketchPlugin/SketchPlugin_Circle.cpp index 332909184..9c9a78c6e 100644 --- a/src/SketchPlugin/SketchPlugin_Circle.cpp +++ b/src/SketchPlugin/SketchPlugin_Circle.cpp @@ -143,15 +143,23 @@ bool SketchPlugin_Circle::isFeatureValid() { std::shared_ptr aCenter = std::dynamic_pointer_cast(attribute(CENTER_ID())); - std::shared_ptr aFirstPnt = - std::dynamic_pointer_cast(attribute(FIRST_POINT_ID())); - std::shared_ptr aSecondPnt = - std::dynamic_pointer_cast(attribute(SECOND_POINT_ID())); - std::shared_ptr aThirdPnt = - std::dynamic_pointer_cast(attribute(THIRD_POINT_ID())); - - return aCenter->isInitialized() && aFirstPnt->isInitialized() && - aSecondPnt->isInitialized() && aThirdPnt->isInitialized(); + bool aValid = aCenter->isInitialized(); + + std::string aType = std::dynamic_pointer_cast( + data()->attribute(CIRCLE_TYPE()))->value(); + if (aType == CIRCLE_TYPE_THREE_POINTS()) { + std::shared_ptr aFirstPnt = + std::dynamic_pointer_cast(attribute(FIRST_POINT_ID())); + std::shared_ptr aSecondPnt = + std::dynamic_pointer_cast(attribute(SECOND_POINT_ID())); + std::shared_ptr aThirdPnt = + std::dynamic_pointer_cast(attribute(THIRD_POINT_ID())); + aValid = aValid && + aFirstPnt->isInitialized() && + aSecondPnt->isInitialized() && + aThirdPnt->isInitialized(); + } + return aValid; } void SketchPlugin_Circle::move(double theDeltaX, double theDeltaY)