Standard 3D view interaction.
|
|
| Interaction3D (InteractiveView &view) |
| |
|
void | reset (bool animate) |
| |
| void | reset () override |
| | Calls reset(true)
|
| |
|
void | setSceneCenter (const vec3 ¢er) |
| |
|
void | setTranslation (double tx, double ty, double tz) |
| | Set translation in degrees.
|
| |
|
void | translation (double &tx, double &ty, double &tz) |
| | Get translation in degrees.
|
| |
|
void | setRotation (double rx, double ry, double rz) |
| | Set rotation in degrees.
|
| |
|
void | rotation (double &rx, double &ry, double &rz) |
| | Get rotation in degrees.
|
| |
|
void | setSensitivity (double sensitivityTranslation, double sensitivityRotation, double sensitivityDepth=-1) |
| | Set sensitivity, i.e. the factor by which the mouse movement is multiplied to obtain the movement in 3D space.
|
| |
|
void | sensitivity (double &sensitivityTranslation, double &sensitivityRotation, double &sensitivityDepth) const |
| | Get sensitivity, i.e. the factor by which the mouse movement is multiplied to obtain the movement in 3D space.
|
| |
| bool | sceneEvent (QEvent *event) override |
| | Modify the translation and rotation parameters based on the mouse events.
|
| |
|
mat4 | transformation () const |
| | Return the transformation according to the current interaction state.
|
| |
|
void | setTransformation (const mat4 &mat) |
| |
| | ViewInteraction (InteractiveView &view) |
| | Instantiate a new ViewInteraction that contains already basic actions for the view.
|
| |
| void | contextMenuCreate (QMenu &m) override |
| | Create context menu entries.
|
| |
|
virtual void | setViewActionMap (ViewActionMap *m) |
| | Sets the action mapping of this view. If nullptr, will default to the global one.
|
| |
|
virtual ViewActionMap * | viewActionMap () |
| | Returns the local view action map for this view interaction, if any has been set.
|
| |
| void | setMouseActionSpeed (ViewActionType action, double speed) |
| | Setters for the speed of a mouse (touch) action.
|
| |
|
void | setTouchActionSpeed (ViewActionType action, double speed) |
| |
|
double | mouseActionSpeed (ViewActionType action) const |
| | Getters for the speed of a mouse (touch) action, return the default value if the action is not found in the map.
|
| |
|
double | touchActionSpeed (ViewActionType action) const |
| |
|
bool | matchMappedActions (ViewActionType viewAction, Qt::MouseButton button, Qt::KeyboardModifiers modifiers) const |
| | Returns true if the MouseAction defined by button and modifiers is registered for the viewAction.
|
| |
| virtual void | createCustomViewActionMap () |
| | Must be used to override the global view action mapper This method can be overridden in order to define a custom default mapping between view actions and user mouse events Example code for the overridden method:
|
| |
|
virtual void | openContextMenu (QPoint pos, QPoint globalPos, Qt::KeyboardModifiers modifiers) |
| |
|
void | setUseContextMenu (bool use) |
| | Set if the context menu must be created or not.
|
| |
|
bool | useContextMenu () const |
| | Specifies if the view creates context menu entries or not. Default value is false.
|
| |
|
| static bool | addMappedViewAction (ViewActionType viewAction, Qt::MouseButton button, Qt::KeyboardModifiers modifiers) |
| |
|
static bool | removeMappedViewAction (ViewActionType viewAction, Qt::MouseButton button, Qt::KeyboardModifiers modifiers) |
| | Removes mapping from viewAction to MouseAction defined by button and modifiers Returns true if removing succeeds, or false if this mapping does not exists.
|
| |
|
static void | resetActionMapping () |
| | Loads the default view interaction mapping.
|
| |
|
static const ViewActionMap & | globalViewActionMap () |
| | Const access to the global view action mapper.
|
| |
|
static void | setGlobalViewActionMap (const ViewActionMap &map) |
| | Sets the global view action map.
|
| |
|
static bool | hasConflicts (const ViewActionMap &actionMap, std::vector< std::pair< ViewActionType, ViewActionType > > &conflictingActions) |
| | Checks if the mapping defined in actionMap has any conflicts.
|
| |
|
static const std::unordered_map< ViewActionType, QString > | viewActionsName |
| |
|
static const std::unordered_map< Qt::MouseButton, QString > | mouseButtonsName |
| |
|
void | contextMenuEvaluate (QAction *action) override |
| | Evaluate action chosen in context menu or by shortcut.
|
| |
| virtual void | contextMenuEvaluate (QAction *) |
| | Evaluate action chosen in context menu or by shortcut.
|
| |
|
static ViewActionMap | viewActionMapGlobal |
| | Global mapping between view actions and user mouse events (only mouse and keyboard modifiers now, touch and gestures must be supported too)
|
| |