]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #144 Display flyout point for parellel constraint at point calculated by cascad...
authorsbh <sergey.belash@opencascade.com>
Wed, 24 Sep 2014 14:09:18 +0000 (18:09 +0400)
committersbh <sergey.belash@opencascade.com>
Wed, 24 Sep 2014 14:09:18 +0000 (18:09 +0400)
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp

index 60c3e23b1f17bcadd58672db383d9db6b09536c4..b11bff25686049830fe7a127efa9361092e0ea38 100644 (file)
@@ -109,10 +109,10 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi
 
   boost::shared_ptr<GeomAPI_Pnt> aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y());
   boost::shared_ptr<GeomAPI_Pnt> aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y());
-  boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt =
-      aFlyOutAttr->isInitialized() ?
-          sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()) : boost::shared_ptr<GeomAPI_Pnt>();
-
+  boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = boost::shared_ptr<GeomAPI_Pnt>();
+  if(aFlyOutAttr->isInitialized()) {
+    aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y());
+  }
   // value calculation
   boost::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = boost::dynamic_pointer_cast<
       ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE()));
index d0ca9f88b565348aefca50c352ae49866b790328..a1dce4b0c5a0c77122b8118272534d612fced9f4 100644 (file)
@@ -77,10 +77,10 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou
 
   boost::shared_ptr<GeomAPI_Pnt> aPoint1 = sketch()->to3D(aStartPoint->x(), aStartPoint->y());
   boost::shared_ptr<GeomAPI_Pnt> aPoint2 = sketch()->to3D(anEndPoint->x(), anEndPoint->y());
-  boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt =
-      aFlyOutAttr->isInitialized() ?
-          sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()) : boost::shared_ptr<GeomAPI_Pnt>();
-
+  boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = boost::shared_ptr<GeomAPI_Pnt>();
+  if (aFlyOutAttr->isInitialized()) {
+    aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y());
+  }
   // value calculation
   boost::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = boost::dynamic_pointer_cast<
       ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE()));
index 3503ff45d5e076f440990e409015182f7a88a1bf..056eda9396ea1ef111796055c762de7e6a46a3a0 100644 (file)
@@ -73,7 +73,10 @@ AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevi
 
   boost::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr = boost::dynamic_pointer_cast<
       GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
-  boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
+  boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = boost::shared_ptr<GeomAPI_Pnt>();;
+  if(aFlyoutAttr->isInitialized()) {
+    aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
+  }
 
   AISObjectPtr anAIS = thePrevious;
   if (!anAIS)