Added AIS_DragAction_Confirmed drag action, which will be called by AIS_ViewController when the drag interaction is confirmed (mouse moved more than click threshold).
//! Dragging action.
enum AIS_DragAction
{
- AIS_DragAction_Start, //!< (try) start dragging object
- AIS_DragAction_Update, //!< perform dragging (update position)
- AIS_DragAction_Stop, //!< stop dragging (save position)
- AIS_DragAction_Abort, //!< abort dragging (restore initial position)
+ AIS_DragAction_Start, //!< (try) start dragging object
+ AIS_DragAction_Confirmed, //!< dragging interaction is confirmed.
+ AIS_DragAction_Update, //!< perform dragging (update position)
+ AIS_DragAction_Stop, //!< stop dragging (save position)
+ AIS_DragAction_Abort, //!< abort dragging (restore initial position)
};
#endif // _AIS_DragAction_HeaderFile
myLocTrsfStart = LocalTransformation();
return Standard_True;
}
+ case AIS_DragAction_Confirmed:
+ {
+ return Standard_True;
+ }
case AIS_DragAction_Update:
{
mySensSphere->ResetLastDetectedPoint();
}
break;
}
+ case AIS_DragAction_Confirmed:
+ {
+ return Standard_True;
+ }
case AIS_DragAction_Update:
{
Transform (theDragTo.x(), theDragTo.y(), theView);
myGL.Dragging.ToStart = true;
myGL.Dragging.PointStart = myUI.Dragging.PointStart;
}
+ if (myUI.Dragging.ToConfirm)
+ {
+ myUI.Dragging.ToConfirm = false;
+ myGL.Dragging.ToConfirm = true;
+ }
if (myUI.Dragging.ToMove)
{
myUI.Dragging.ToMove = false;
myMouseClickCounter = 0;
myMouseSingleButton = -1;
myMouseStopDragOnUnclick = true;
+ myUI.Dragging.ToConfirm = true;
}
}
}
return;
}
+ case AIS_DragAction_Confirmed:
+ {
+ if (myDragObject.IsNull())
+ {
+ return;
+ }
+
+ myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
+ myGL.Dragging.PointTo, theAction);
+ return;
+ }
case AIS_DragAction_Update:
{
if (myDragObject.IsNull())
}
else if (myGL.Dragging.ToMove)
{
+ if (myGL.Dragging.ToConfirm)
+ {
+ OnObjectDragged (theCtx, theView, AIS_DragAction_Confirmed);
+ }
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
myGL.OrbitRotation.ToRotate = false;
myGL.ViewRotation .ToRotate = false;
struct _draggingParams
{
bool ToStart; //!< start dragging
+ bool ToConfirm; //!< confirm dragging
bool ToMove; //!< perform dragging
bool ToStop; //!< stop dragging
bool ToAbort; //!< abort dragging (restore previous position)
Graphic3d_Vec2i PointStart; //!< drag start point
Graphic3d_Vec2i PointTo; //!< drag end point
- _draggingParams() : ToStart (false), ToMove (false), ToStop (false), ToAbort (false) {}
+ _draggingParams() : ToStart (false), ToConfirm (false), ToMove (false), ToStop (false), ToAbort (false) {}
} Dragging;
struct _orbitRotation
Selection.ToApplyTool = false;
IsNewGesture = false;
ZoomActions.Clear();
- Panning.ToStart = false;
- Panning.ToPan = false;
- Dragging.ToStart = false;
- Dragging.ToMove = false;
- Dragging.ToStop = false;
- Dragging.ToAbort = false;
+ Panning.ToStart = false;
+ Panning.ToPan = false;
+ Dragging.ToStart = false;
+ Dragging.ToConfirm = false;
+ Dragging.ToMove = false;
+ Dragging.ToStop = false;
+ Dragging.ToAbort = false;
OrbitRotation.ToStart = false;
OrbitRotation.ToRotate = false;
ViewRotation.ToStart = false;