From: sbh Date: Wed, 24 Sep 2014 14:09:18 +0000 (+0400) Subject: Issue #144 Display flyout point for parellel constraint at point calculated by cascad... X-Git-Tag: V_0.4.4~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b17070687a4d8b10262f03a0313d81ee48481480;p=modules%2Fshaper.git Issue #144 Display flyout point for parellel constraint at point calculated by cascade, not at zero --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 60c3e23b1..b11bff256 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -109,10 +109,10 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi boost::shared_ptr aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y()); boost::shared_ptr aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y()); - boost::shared_ptr aFlyoutPnt = - aFlyOutAttr->isInitialized() ? - sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()) : boost::shared_ptr(); - + boost::shared_ptr aFlyoutPnt = boost::shared_ptr(); + if(aFlyOutAttr->isInitialized()) { + aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); + } // value calculation boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE())); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index d0ca9f88b..a1dce4b0c 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -77,10 +77,10 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou boost::shared_ptr aPoint1 = sketch()->to3D(aStartPoint->x(), aStartPoint->y()); boost::shared_ptr aPoint2 = sketch()->to3D(anEndPoint->x(), anEndPoint->y()); - boost::shared_ptr aFlyoutPnt = - aFlyOutAttr->isInitialized() ? - sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()) : boost::shared_ptr(); - + boost::shared_ptr aFlyoutPnt = boost::shared_ptr(); + if (aFlyOutAttr->isInitialized()) { + aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); + } // value calculation boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp index 3503ff45d..056eda939 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp @@ -73,7 +73,10 @@ AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevi boost::shared_ptr aFlyoutAttr = boost::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - boost::shared_ptr aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); + boost::shared_ptr aFlyoutPnt = boost::shared_ptr();; + if(aFlyoutAttr->isInitialized()) { + aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); + } AISObjectPtr anAIS = thePrevious; if (!anAIS)