}
bool SketcherPrs_Coincident::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
- const std::shared_ptr<GeomAPI_Ax3>&/* thePlane*/)
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane)
{
- bool aReadyToDisplay = false;
+ gp_Pnt aPoint;
+ return readyToDisplay(theConstraint, thePlane, aPoint);
+}
+bool SketcherPrs_Coincident::readyToDisplay(ModelAPI_Feature* theConstraint,
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane,
+ gp_Pnt& thePoint)
+{
+ bool aReadyToDisplay = false;
// Get point of the presentation
std::shared_ptr<GeomAPI_Pnt2d> aPnt = SketcherPrs_Tools::getPoint(theConstraint,
SketchPlugin_Constraint::ENTITY_A());
- if (aPnt.get() == NULL)
+ if (aPnt.get() == NULL) {
aPnt = SketcherPrs_Tools::getPoint(theConstraint, SketchPlugin_Constraint::ENTITY_B());
-
- aReadyToDisplay = aPnt.get() != NULL;
+ aReadyToDisplay = aPnt.get() != NULL;
+ if (aReadyToDisplay)
+ thePoint = aPnt->impl<gp_Pnt>();
+ }
return aReadyToDisplay;
}
const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode)
{
- bool aReadyToDisplay = IsReadyToDisplay(myConstraint, mySketcherPlane);
- if (aReadyToDisplay) {
- std::shared_ptr<GeomAPI_Pnt2d> aPnt = SketcherPrs_Tools::getPoint(myConstraint,
- SketchPlugin_Constraint::ENTITY_A());
- if (aPnt.get() == NULL)
- aPnt = SketcherPrs_Tools::getPoint(myConstraint, SketchPlugin_Constraint::ENTITY_B());
- std::shared_ptr<GeomAPI_Pnt> aPoint = mySketcherPlane->to3D(aPnt->x(), aPnt->y());
- myPoint = aPoint->impl<gp_Pnt>();
- }
+ gp_Pnt aPoint;
+ bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aPoint);
+ if (aReadyToDisplay)
+ myPoint = aPoint;
// Get point of the presentation
static Handle(Graphic3d_AspectMarker3d) aPtA;