31 wxWindow* aParent,
const wxGLAttributes& aGLAttribs,
32 wxWindowID aId,
const wxPoint& aPos,
33 const wxSize& aSize,
long aStyle,
const wxString& aName,
34 const wxPalette& aPalette ) :
35 HIDPI_GL_CANVAS( aVcSettings, aParent, aGLAttribs, aId, aPos, aSize, aStyle, aName,
37 m_mouse_is_moving( false ),
38 m_mouse_was_moved( false ),
39 m_camera_is_moving( false ),
55 if( event.Dragging() )
57 if( event.LeftIsDown() )
59 else if( event.MiddleIsDown() )
71 bool mouseActivity =
false;
77 int modifiers =
event.ShiftDown() ? WXK_SHIFT
78 : (
event.ControlDown() ? WXK_CONTROL
79 : (
event.AltDown() ? WXK_ALT : 0 ) );
86 delta_move *= 0.01f *
event.GetWheelRotation();
87 else if( event.GetWheelRotation() < 0 )
88 delta_move = -delta_move;
101 if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL
107 mouseActivity =
true;
112 mouseActivity =
true;
117 mouseActivity =
true;
122 m_camera.
Zoom( ( event.GetWheelRotation() * zoomSign ) > 0 ? 1.1f : 1 / 1.1f );
A class used to derive camera objects from.
virtual void Pan(const wxPoint &aNewMousePosition)=0
virtual void Drag(const wxPoint &aNewMousePosition)=0
Calculate a new mouse drag position.
bool SetCurWindowSize(const wxSize &aSize)
Update the windows size of the camera.
void SetCurMousePosition(const wxPoint &aPosition)
Update the current mouse position without make any new calculations on camera.
static const float m_delta_move_step_factor
HIDPI_GL_3D_CANVAS(const KIGFX::VC_SETTINGS &aVcSettings, CAMERA &aCamera, wxWindow *parent, const wxGLAttributes &aGLAttribs, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxGLCanvasName, const wxPalette &palette=wxNullPalette)
void OnMouseWheelCamera(wxMouseEvent &event, bool aPan)
void OnMouseMoveCamera(wxMouseEvent &event)
wxGLCanvas wrapper for HiDPI/Retina support.
KIGFX::VC_SETTINGS m_settings
< Current VIEW_CONTROLS settings.
virtual wxSize GetNativePixelSize() const
wxPoint GetNativePosition(const wxPoint &aPoint) const
Convert the given point from client coordinates to native pixel coordinates.
Structure to keep VIEW_CONTROLS settings for easy store/restore operations.
bool m_scrollReversePanH
Whether to invert the scroll wheel movement for horizontal pan.
int m_scrollModifierZoom
What modifier key to enable zoom with the (vertical) scroll wheel.
int m_scrollModifierPanH
What modifier key to enable horizontal pan with the (vertical) scroll wheel.
bool m_scrollReverseZoom
Whether to invert the scroll wheel movement for zoom.
int m_scrollModifierPanV
What modifier key to enable vertical with the (vertical) scroll wheel.