Image Component Library (ICL)
|
Class providing a mouse handler for class scene. More...
#include <SceneMouseHandler.h>
Public Member Functions | |
ICLGeom_API | SceneMouseHandler (const int pCameraIndex, Scene *pParentScene) |
Constructor. More... | |
SceneMouseHandler (const SceneMouseHandler &pSceneMouseHandler) | |
Copy constructor. More... | |
ICLGeom_API | ~SceneMouseHandler () |
Destructor. More... | |
ICLGeom_API SceneMouseHandler & | operator= (const SceneMouseHandler &pSceneMouseHandler) |
Assignment operator. More... | |
void | setParentScene (Scene *pParentScene) |
Set parent scene. More... | |
Scene * | getParentScene () |
Get parent scene. More... | |
ICLGeom_API void | setSensitivities (const float pTranslation, const float pRotation=1.0, const float pMouse=1.0, const float pWheel=0.001, const float pModifier=10.0) |
Set mouse & wheel sensitivities, modifier factor and factors for rotation and translation. More... | |
MouseSensitivities | getSensitivities (MouseSensitivitiesModifier pMouseSensitivitiesModifier) |
Get mouse and wheel sensitivities (low, normal, high). More... | |
void | setCameraIndex (const int pCameraIndex) |
Set camera index. More... | |
int | getCameraIndex () |
Get camera index. More... | |
virtual ICLGeom_API void | setMouseMappings () |
Set mouse mappings. More... | |
ICLGeom_API void | setMouseMapping (const qt::MouseEventType pMouseEventType, const bool pLeftMouseButton, const bool pMiddleMouseButton, const bool pRightMouseButton, const bool pShift, const bool pControl, const bool pAlt, MouseActionCallback pMouseActionCallback, void *pData=0) |
Set one mouse mapping. More... | |
virtual ICLGeom_API void | process (const qt::MouseEvent &pMouseEvent) |
Process mouse event using mouse mapping table. More... | |
Public Member Functions inherited from icl::qt::MouseHandler | |
MouseHandler (mouse_handler handler) | |
Create a mouse handler with given callback function. More... | |
Static Public Member Functions | |
static ICLGeom_API void | freeView (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData, bool pInverseX, bool pInverseY) |
Free view. More... | |
static void | freeView (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Free view with normal axes. More... | |
static void | freeViewInverseMouseX (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Free view with inversed x-axis. More... | |
static void | freeViewInverseMouseY (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Free view with inversed y-axis. More... | |
static void | freeViewInverseBoth (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Free view with inversed axes. More... | |
static ICLGeom_API void | rotateAroundOrigin (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Rotate around origin and correct camera orientation. More... | |
static ICLGeom_API void | strafe (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Strafe (camera movement up, down, left, right). More... | |
static ICLGeom_API void | rollAndDistance (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Roll and distance (camera movement forward and backward). More... | |
static ICLGeom_API void | placeCursor (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData) |
Place the cursor for rotational Origin. More... | |
Protected Attributes | |
MouseMappingTableEntry | mMouseMappingTable [qt::MAX_MOUSE_EVENT+1][2][2][2][2][2][2] |
Mouse mapping table: More... | |
MouseSensitivities | mMouseSensitivities [MAX_MOUSE_SENSITIVITY+1] |
mouse sensitivities More... | |
Camera | mCameraBackup |
backup of old camera More... | |
utils::Point32f | mAnchor |
starting mouse position for dragging More... | |
Scene * | mParentScene |
pointer to parent scene More... | |
int | mCameraIndex |
index of camera in scene More... | |
int | mKeyboardModifiersBackup |
backup of old keyboard modifiers More... | |
qt::GUI * | mGUI |
GUI for the adaption of scene properties. More... | |
Additional Inherited Members | |
Public Types inherited from icl::qt::MouseHandler | |
typedef void(* | mouse_handler) (const MouseEvent &event) |
mouse_handler function type More... | |
Public Slots inherited from icl::qt::MouseHandler | |
void | handleEvent (const MouseEvent &event) |
connected to the ICLWidget's signal mouseEventOccured More... | |
Protected Member Functions inherited from icl::qt::MouseHandler | |
MouseHandler () | |
This constructor can be called from derived classes. More... | |
Class providing a mouse handler for class scene.
Create your own mouse handler by inherting from this class and overloading function setMouseMappings().
Default mouse mappings for scene objects
Mouse sensitivity modifiers in combination with mouse actions
New mouse mappings
ICLGeom_API icl::geom::SceneMouseHandler::SceneMouseHandler | ( | const int | pCameraIndex, |
Scene * | pParentScene | ||
) |
Constructor.
pCameraIndex | index of camera in scene |
pParentScene | pointer to parent scene |
|
inline |
Copy constructor.
pSceneMouseHandler | source |
ICLGeom_API icl::geom::SceneMouseHandler::~SceneMouseHandler | ( | ) |
Destructor.
|
static |
Free view.
Vertical mouse movement: pitch. Horizontal mouse movement: yaw.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
pInverseX | inverse x-axis |
pInverseY | inverse y-axis |
|
inlinestatic |
Free view with normal axes.
Vertical mouse movement: pitch. Horizontal mouse movement: yaw.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
inlinestatic |
Free view with inversed axes.
Vertical mouse movement: pitch. Horizontal mouse movement: yaw.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
inlinestatic |
Free view with inversed x-axis.
Vertical mouse movement: pitch. Horizontal mouse movement: yaw.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
inlinestatic |
Free view with inversed y-axis.
Vertical mouse movement: pitch. Horizontal mouse movement: yaw.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
inline |
Get camera index.
|
inline |
Get parent scene.
|
inline |
Get mouse and wheel sensitivities (low, normal, high).
ICLGeom_API SceneMouseHandler& icl::geom::SceneMouseHandler::operator= | ( | const SceneMouseHandler & | pSceneMouseHandler | ) |
Assignment operator.
|
static |
Place the cursor for rotational Origin.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
virtual |
Process mouse event using mouse mapping table.
pMouseEvent | mouse event |
Reimplemented from icl::qt::MouseHandler.
Reimplemented in icl::physics::PhysicsMouseHandler.
|
static |
Roll and distance (camera movement forward and backward).
Vertical mouse movement: move camera along front vector. Horizontal mouse movement: roll camera.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
static |
Rotate around origin and correct camera orientation.
Vertical mouse movement: vertical rotation. Horizontal mouse movement: horizontal rotation.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
inline |
Set camera index.
pCameraIndex | new camera index |
ICLGeom_API void icl::geom::SceneMouseHandler::setMouseMapping | ( | const qt::MouseEventType | pMouseEventType, |
const bool | pLeftMouseButton, | ||
const bool | pMiddleMouseButton, | ||
const bool | pRightMouseButton, | ||
const bool | pShift, | ||
const bool | pControl, | ||
const bool | pAlt, | ||
MouseActionCallback | pMouseActionCallback, | ||
void * | pData = 0 |
||
) |
Set one mouse mapping.
pMouseEventType | type of mouse event |
pLeftMouseButton | left mouse button |
pMiddleMouseButton | middle mouse button |
pRightMouseButton | right mouse button |
pShift | shift |
pControl | control |
pAlt | alt |
pMouseActionCallback | function pointer that should be called |
pData | pointer to additional data |
|
virtual |
Set mouse mappings.
Inherit from this class and overload this function to define new mouse mappings.
|
inline |
Set parent scene.
ICLGeom_API void icl::geom::SceneMouseHandler::setSensitivities | ( | const float | pTranslation, |
const float | pRotation = 1.0 , |
||
const float | pMouse = 1.0 , |
||
const float | pWheel = 0.001 , |
||
const float | pModifier = 10.0 |
||
) |
Set mouse & wheel sensitivities, modifier factor and factors for rotation and translation.
pTranslation | sensitivity factor for translation (e.g. mParentScene->getMaxSceneDim()) |
pRotation | sensitivity factor for rotations (e.g. 1.0) |
pMouse | sensitivity of mouse movements (e.g. 1.0) |
pWheel | sensitivity of mouse wheel (e.g. 0.001) |
pModifier | factor to modify sensitivity (e.g. 10.0) |
|
static |
Strafe (camera movement up, down, left, right).
Vertical mouse movement: move camera along right vector. Horizontal mouse movement: move camera along up vector.
pMouseEvent | mouse event |
pCurrentMousePosition | current mouse position |
pDeltaMousePosition | delta compared to last mouse position |
pCamera | camera |
pData | pointer for additional data used to set sensitivity |
|
protected |
starting mouse position for dragging
|
protected |
backup of old camera
|
protected |
index of camera in scene
|
protected |
GUI for the adaption of scene properties.
|
protected |
backup of old keyboard modifiers
|
protected |
Mouse mapping table:
|
protected |
mouse sensitivities
|
protected |
pointer to parent scene