X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_Coincident.cpp;h=2b6c57b846dbeaa146caa129e13a9ba5d27dac8c;hb=622ac935fd1d8a5bc282ee127666a3e9d1954713;hp=a2931fa51f26ffe664103ac88be206294f3ea7e7;hpb=f0eafd92c62014f9ade34e1ddaebe81983557a88;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index a2931fa51..2b6c57b84 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -36,10 +36,10 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject); SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) - : AIS_InteractiveObject(), myConstraint(theConstraint), mySketcherPlane(thePlane) +: AIS_InteractiveObject(), myConstraint(theConstraint), mySketcherPlane(thePlane), + myPoint(gp_Pnt(0.0, 0.0, 0.0)) { - -} +} bool SketcherPrs_Coincident::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) @@ -56,11 +56,13 @@ bool SketcherPrs_Coincident::readyToDisplay(ModelAPI_Feature* theConstraint, // Get point of the presentation std::shared_ptr aPnt = SketcherPrs_Tools::getPoint(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - if (aPnt.get()) { + if (aPnt.get() == NULL) aPnt = SketcherPrs_Tools::getPoint(theConstraint, SketchPlugin_Constraint::ENTITY_B()); - aReadyToDisplay = aPnt.get() != NULL; - if (aReadyToDisplay) - thePoint = aPnt->impl(); + + aReadyToDisplay = aPnt.get() != NULL; + if (aReadyToDisplay) { + std::shared_ptr aPoint = thePlane->to3D(aPnt->x(), aPnt->y()); + thePoint = aPoint->impl(); } return aReadyToDisplay; }