void moveObject(ObjectPtr theObj) const;
protected:
- std::string myAttributeID; /// the attribute name of the model feature
- std::string myParentId; /// name of parent
- FeaturePtr myFeature;
- bool myIsComputedDefault; /// Value should be computed on execute,
- /// like radius for circle's constraint (can not be zero)
+ /// The attribute name of the model feature
+ std::string myAttributeID;
+
+ /// Name of parent
+ std::string myParentId;
+
+ /// A feature which is processing by active operation
+ FeaturePtr myFeature;
- bool myIsValueDefault; /// the default value is defined in the XML for this attribute
- bool myIsEditing;
+ /// Value should be computed on execute, like radius for circle's constraint (can not be zero)
+ bool myIsComputedDefault;
-
++
++ /// the default value is defined in the XML for this attribute
++ bool myIsValueDefault;
+ /// Flag which shows that current operation is in editing mode
+ bool myIsEditing;
};
#endif
if (isSketcher) {
myIsDragging = true;
-
- get2dPoint(theWnd, theEvent, myCurX, myCurY);
+ get2dPoint(theWnd, theEvent, myCurrentPoint);
myDragDone = false;
launchEditing();
{
ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
ModuleBase_Operation* aOp = aWorkshop->currentOperation();
- if (!aOp)
- return;
- if (!sketchOperationIdList().contains(aOp->id()))
- return;
-
+ if (aOp) {
+ if (sketchOperationIdList().contains(aOp->id())) {
+ get2dPoint(theWnd, theEvent, myClickedPoint);
+
- // Only for sketcher operations
- ModuleBase_IViewer* aViewer = aWorkshop->viewer();
- if (myIsDragging) {
- aWorkshop->viewer()->enableSelection(myPreviousSelectionEnabled);
- myIsDragging = false;
- if (myDragDone) {
- //aOp->commit();
- myFeature2AttributeMap.clear();
-
- // Reselect edited object
- /*aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
- if (theEvent->modifiers() & Qt::ShiftModifier)
- aViewer->AISContext()->ShiftSelect();
- else
- aViewer->AISContext()->Select();
- */
- return;
+ // Only for sketcher operations
+ ModuleBase_IViewer* aViewer = aWorkshop->viewer();
+ if (myIsDragging) {
+ if (myDragDone) {
+ //aOp->commit();
+ myFeature2AttributeMap.clear();
+
+ // Reselect edited object
+ /*aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
+ if (theEvent->modifiers() & Qt::ShiftModifier)
+ aViewer->AISContext()->ShiftSelect();
+ else
+ aViewer->AISContext()->Select();
+ */
+ }
+ }
}
}
+ aWorkshop->viewer()->enableSelection(myPreviousSelectionEnabled);
+ myIsDragging = false;
}
void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)