class ViewerTest_EventManager;
DEFINE_STANDARD_HANDLE(ViewerTest_EventManager, Standard_Transient)
-//! used to manage mouse event (move,select,shiftselect)
+//! used to manage mouse event (move,press,release). There is an interface to select, shiftselect in view.
//! By default the events are transmitted to interactive context.
class ViewerTest_EventManager : public Standard_Transient
{
Standard_EXPORT ViewerTest_EventManager(const Handle(V3d_View)& aView, const Handle(AIS_InteractiveContext)& aCtx);
+ //! Processing key button pressed
+ //! \param buf_ret key button symbol
+ //! \return true if processed
+ Standard_EXPORT virtual Standard_Boolean ProcessKeyPress (const char* buf_ret) { (void)buf_ret; return Standard_False; }
+
+ //! Processing mouse button pressed
+ //! \param theXPressed X pixel coordinate
+ //! \param theXPressed Y pixel coordinate
+ //! \param theIsShift state if the SHIFT key modifier is ON
+ //! \return true if processed
+ Standard_EXPORT virtual Standard_Boolean ProcessButton1Press (const Standard_Integer theXPressed,
+ const Standard_Integer theYPressed,
+ Standard_Boolean theIsShift)
+ { (void)theXPressed; (void)theYPressed; (void)theIsShift; return Standard_False; }
+
+ //! Processing mouse button released
+ //! \param theXPressed X pixel coordinate
+ //! \param theXPressed Y pixel coordinate
+ //! \param theIsShift state if the SHIFT key modifier is ON
+ //! \return true if processed
+ Standard_EXPORT virtual Standard_Boolean ProcessButton1Release (const Standard_Integer theXPressed,
+ const Standard_Integer theYPressed,
+ Standard_Boolean theIsShift)
+ { (void)theXPressed; (void)theYPressed; (void)theIsShift; return Standard_False; }
+
+ //! Processing mouse move over the viewer
+ //! \param theXPressed X pixel coordinate
+ //! \param theXPressed Y pixel coordinate
+ Standard_EXPORT virtual Standard_Boolean ProcessMouseMove (const Standard_Integer theXPressed,
+ const Standard_Integer theYPressed)
+ { (void)theXPressed; (void)theYPressed; return Standard_False; }
+
Standard_EXPORT virtual void MoveTo (const Standard_Integer xpix, const Standard_Integer ypix);
Standard_EXPORT virtual void Select();
break;
case WM_LBUTTONUP:
+ ViewerTest::CurrentEventManager()->ProcessButton1Release (X_Motion, Y_Motion, (fwKeys & MK_SHIFT) != 0);
+
if (IsDragged && !DragFirst)
{
if (!GetActiveAISManipulator().IsNull())
return ViewerWindowProc (hwnd, Msg, wParam, lParam);
case WM_LBUTTONDOWN:
+ ViewerTest::CurrentEventManager()->ProcessButton1Press (LOWORD(lParam), HIWORD(lParam), (fwKeys & MK_SHIFT) != 0);
+
if (!GetActiveAISManipulator().IsNull())
{
IsDragged = ( fwKeys == MK_LBUTTON );
return ViewerWindowProc( hwnd, Msg, wParam, lParam );
case WM_MOUSEMOVE:
+ ViewerTest::CurrentEventManager()->ProcessMouseMove (LOWORD (lParam), HIWORD (lParam));
+
if (IsDragged)
{
X_Motion = LOWORD (lParam);
{
c[0] = '*';
}
+ ViewerTest::CurrentEventManager()->ProcessKeyPress (c);
+
VT_ProcessKeyPress (c);
}
break;