+ return aReadyToDisplay;
+ if (aCyrcFeature->getKind() == SketchPlugin_Circle::ID()) { // circle
+ aCenterAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aCyrcFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID()));
+ AttributeDoublePtr aCircRadius =
+ std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
+ aCyrcFeature->data()->attribute(SketchPlugin_Circle::RADIUS_ID()));
+ aRadius = aCircRadius->value();
+ } else { // arc
+ aCenterAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aCyrcFeature->data()->attribute(SketchPlugin_Arc::CENTER_ID()));
+ std::shared_ptr<GeomDataAPI_Point2D> aStartAttr =
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>
+ (aCyrcFeature->data()->attribute(SketchPlugin_Arc::START_ID()));
+ aRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt());
+ }
+ std::shared_ptr<GeomAPI_Pnt> aCenter = thePlane->to3D(aCenterAttr->x(), aCenterAttr->y());
+ std::shared_ptr<GeomAPI_Dir> aNormal = thePlane->normal();
+
+ GeomAPI_Circ aCircle(aCenter, aNormal, aRadius);
+
+ std::shared_ptr<GeomAPI_Pnt> anAnchor = SketcherPrs_Tools::getAnchorPoint(theConstraint, thePlane);
+
+ gp_Circ aCirc = aCircle.impl<gp_Circ>();
+ gp_Pnt anAncorPnt = anAnchor->impl<gp_Pnt>();
+ // anchor point should not coincide to the location point of the circle
+ // OCCT does not process this case.
+
+ aReadyToDisplay = anAncorPnt.Distance(aCirc.Location()) > 1e-7;
+ return aReadyToDisplay;
+}
+
+void SketcherPrs_Radius::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
+{
+ if (!IsReadyToDisplay(myConstraint, myPlane)) {
+ Events_Error::throwException("An empty AIS presentation: SketcherPrs_Radius");