// Init flyout point for radius rotation\r
FeaturePtr aFeature = myCurrentSelection.begin().key();\r
\r
+ get2dPoint(theWnd, theEvent, myCurrentPoint);\r
if (isSketcher) {\r
myIsDragging = true;\r
- get2dPoint(theWnd, theEvent, myCurrentPoint);\r
myDragDone = false;\r
\r
myPreviousDrawModeEnabled = aViewer->enableDrawMode(false);\r
if (aFeature.get() != NULL) {\r
std::shared_ptr<SketchPlugin_Feature> aSPFeature = \r
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);\r
- if (aSPFeature.get() && aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID()) {\r
+ if (aSPFeature.get() && \r
+ (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID() ||\r
+ aSPFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) {\r
DataPtr aData = aSPFeature->data();\r
AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());\r
std::shared_ptr<GeomDataAPI_Point2D> aFPAttr = \r
aFOperation->commit();\r
\r
myIsDragging = true;\r
- get2dPoint(theWnd, theEvent, myCurrentPoint);\r
myDragDone = false;\r
\r
myPreviousDrawModeEnabled = aViewer->enableDrawMode(false);\r
// selected entities, e.g. selection of point(attribute on a line) should edit the point\r
restoreSelection();\r
launchEditing();\r
+ if (aFeature.get() != NULL) {\r
+ std::shared_ptr<SketchPlugin_Feature> aSPFeature = \r
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);\r
+ if (aSPFeature.get() && \r
+ (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID() ||\r
+ aSPFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) {\r
+ DataPtr aData = aSPFeature->data();\r
+ AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());\r
+ std::shared_ptr<GeomDataAPI_Point2D> aFPAttr = \r
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aAttr);\r
+ aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY);\r
+ }\r
+ }\r
restoreSelection();\r
}\r
}\r
\r
Handle(V3d_View) aView = theWnd->v3dView();\r
gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView);\r
- double aX, aY;\r
- PartSet_Tools::convertTo2D(aPoint, myCurrentSketch, aView, aX, aY);\r
- double dX = aX - myCurrentPoint.myCurX;\r
- double dY = aY - myCurrentPoint.myCurY;\r
+ Point aMousePnt;\r
+ get2dPoint(theWnd, theEvent, aMousePnt);\r
+ double dX = aMousePnt.myCurX - myCurrentPoint.myCurX;\r
+ double dY = aMousePnt.myCurY - myCurrentPoint.myCurY;\r
\r
ModuleBase_IWorkshop* aWorkshop = myModule->workshop();\r
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);\r
aDisplayer->updateViewer();\r
\r
myDragDone = true;\r
- myCurrentPoint.setValue(aX, aY);\r
+ myCurrentPoint = aMousePnt;\r
}\r
}\r
\r
double SketcherPrs_Angle::calculateDistanceToFlyoutPoint()
{
- gp_Dir aBisector((myFirstPoint.XYZ() + mySecondPoint.XYZ()) * 0.5 - myCenterPoint.XYZ());
- //gp_Pnt aFlyPnt(aFlyoutPnt->x(), aFlyoutPnt->y(), aFlyoutPnt->z());
- gp_XYZ aFlyDir = myFlyOutPoint.XYZ() - myCenterPoint.XYZ();
- double aDistance = aFlyDir.Dot(aBisector.XYZ());
- // make a positive distance in order to AIS angle presentation is not reversed
- aDistance = fabs(aDistance);
- return aDistance;
+ //gp_Dir aBisector = gp_Dir((myFirstPoint.XYZ() + mySecondPoint.XYZ()) * 0.5 - myCenterPoint.XYZ());
+ //gp_XYZ aFlyDir = myFlyOutPoint.XYZ() - myCenterPoint.XYZ();
+
+ //double aDistance = aFlyDir.Dot(aBisector.XYZ());
+ //// make a positive distance in order to AIS angle presentation is not reversed
+ //aDistance = fabs(aDistance);
+ //return aDistance;
+ return myFlyOutPoint.Distance(myCenterPoint);
}