X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_Transformation.cpp;h=82e375f0f989fc0b401f1006eff3d8eb9373f12d;hb=449259f5540f1e1d7e5e0595e10f80e18a15e038;hp=4441f39349d94491dba4b7112facaa6a7151ffe6;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_Transformation.cpp b/src/SketcherPrs/SketcherPrs_Transformation.cpp index 4441f3934..82e375f0f 100644 --- a/src/SketcherPrs/SketcherPrs_Transformation.cpp +++ b/src/SketcherPrs/SketcherPrs_Transformation.cpp @@ -48,9 +48,11 @@ SketcherPrs_Transformation::SketcherPrs_Transformation(ModelAPI_Feature* theCons } bool SketcherPrs_Transformation::IsReadyToDisplay(ModelAPI_Feature* theConstraint, - const std::shared_ptr&/* thePlane*/) + const std::shared_ptr& thePlane) { bool aReadyToDisplay = false; + if (!thePlane) + return aReadyToDisplay; std::shared_ptr aData = theConstraint->data(); // Get transformated objects list @@ -86,7 +88,7 @@ bool SketcherPrs_Transformation::IsReadyToDisplay(ModelAPI_Feature* theConstrain bool SketcherPrs_Transformation::updateIfReadyToDisplay(double theStep, bool withColor) const { - if (!IsReadyToDisplay(myConstraint, myPlane)) + if (!IsReadyToDisplay(myConstraint, plane())) return false; std::shared_ptr aData = myConstraint->data(); @@ -144,12 +146,12 @@ void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& the if (aStart.get() && aEnd.get() && aStart->isInitialized() && aEnd->isInitialized()) { // Add start point - std::shared_ptr aPnt = myPlane->to3D(aStart->x(), aStart->y()); + std::shared_ptr aPnt = plane()->to3D(aStart->x(), aStart->y()); Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(aPnt->impl()); StdPrs_Point::Add(thePrs, aPoint, myDrawer); // Add end point - aPnt = myPlane->to3D(aEnd->x(), aEnd->y()); + aPnt = plane()->to3D(aEnd->x(), aEnd->y()); aPoint = new Geom_CartesianPoint(aPnt->impl()); StdPrs_Point::Add(thePrs, aPoint, myDrawer); } @@ -159,7 +161,7 @@ void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& the GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID()); if (aCenter.get() && aCenter->isInitialized()) { // Show center of rotation - std::shared_ptr aPnt = myPlane->to3D(aCenter->x(), aCenter->y()); + std::shared_ptr aPnt = plane()->to3D(aCenter->x(), aCenter->y()); Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(aPnt->impl()); StdPrs_Point::Add(thePrs, aPoint, myDrawer); }