get2dPoint(theWnd, theEvent, myCurrentPoint);
myDragDone = false;
launchEditing();
+ // Init flyout point for radius rotation
+ FeaturePtr aFeature = myCurrentSelection.begin().key();
+ std::shared_ptr<SketchPlugin_Feature> aSPFeature =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
+ if (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID()) {
+ DataPtr aData = aSPFeature->data();
+ AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
+ std::shared_ptr<GeomDataAPI_Point2D> aFPAttr =
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aAttr);
+ aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY);
+ }
} else if (isSketchOpe && isEditing) {
// If selected another object commit current result
GeomAPI_Circ aCircle(aCenter, aNormal, aRadius);
- std::shared_ptr<GeomAPI_Pnt> anAnchor = aCircle.project(aFlyoutPnt);
- std::shared_ptr<GeomAPI_XYZ> anAnchorXYZ = anAnchor->xyz();
- anAnchorXYZ = anAnchorXYZ->decreased(aCenter->xyz());
- std::shared_ptr<GeomAPI_Dir> aDeltaDir(new GeomAPI_Dir(anAnchorXYZ));
- const double aDelta = 1e-3;
- anAnchor->setX(anAnchor->x() + aDelta * aDeltaDir->x());
- anAnchor->setY(anAnchor->y() + aDelta * aDeltaDir->y());
- anAnchor->setZ(anAnchor->z() + aDelta * aDeltaDir->z());
+ std::shared_ptr<GeomAPI_Pnt> anAnchor = SketcherPrs_Tools::getAnchorPoint(myConstraint, myPlane);
+ //std::shared_ptr<GeomAPI_Pnt> anAnchor = aCircle.project(aFlyoutPnt);
+ //std::shared_ptr<GeomAPI_XYZ> anAnchorXYZ = anAnchor->xyz();
+ //anAnchorXYZ = anAnchorXYZ->decreased(aCenter->xyz());
+ //std::shared_ptr<GeomAPI_Dir> aDeltaDir(new GeomAPI_Dir(anAnchorXYZ));
+ //const double aDelta = 1e-3;
+ //anAnchor->setX(anAnchor->x() + aDelta * aDeltaDir->x());
+ //anAnchor->setY(anAnchor->y() + aDelta * aDeltaDir->y());
+ //anAnchor->setZ(anAnchor->z() + aDelta * aDeltaDir->z());
SetMeasuredGeometry(aCircle.impl<gp_Circ>(), anAnchor->impl<gp_Pnt>());
SetCustomValue(aRadius);