X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_Equal.cpp;h=74ed7d4db3ea51a21d4706146cc75e9066a6071b;hb=471cc7b52168016a3b6fff7e64cdd800cd7d8f91;hp=9cfd69b595de843b8e1ff87db92f72ad0c6c8590;hpb=c3ae28ba30027cc4a6a757ef623f40adaae96ead;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_Equal.cpp b/src/SketcherPrs/SketcherPrs_Equal.cpp index 9cfd69b59..74ed7d4db 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.cpp +++ b/src/SketcherPrs/SketcherPrs_Equal.cpp @@ -28,14 +28,27 @@ SketcherPrs_Equal::SketcherPrs_Equal(ModelAPI_Feature* theConstraint, myPntArray->AddVertex(0., 0., 0.); } -bool SketcherPrs_Equal::updatePoints(double theStep) const +bool SketcherPrs_Equal::IsReadyToDisplay(ModelAPI_Feature* theConstraint, + const std::shared_ptr&/* thePlane*/) { + bool aReadyToDisplay = false; + + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); + + aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && + SketcherPrs_Tools::getShape(aObj2).get() != NULL; + + return aReadyToDisplay; +} + +bool SketcherPrs_Equal::updateIfReadyToDisplay(double theStep) const +{ + if (!IsReadyToDisplay(myConstraint, myPlane)) + return false; + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); - if (SketcherPrs_Tools::getShape(aObj1).get() == NULL) - return false; - if (SketcherPrs_Tools::getShape(aObj2).get() == NULL) - return false; // Set points of the presentation SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();