Manage finger and hand focus/grab information. More...
#include <MultiWidgets/GrabManager.hpp>
Public Member Functions | |
| Nimble::Vector2 | averageTrackedObjectLocation (const TrackedObjectIds &ids, bool searchHistory, bool *ok=0) const |
| Calculates the average location of a set of tracked objects. More... | |
| size_t | clippedObjectCount () const |
| Get the number of objects available Returns the number of objects that have not been clipped away by the clipping regions. More... | |
| size_t | clippedObjectCount (MultiTouch::TrackedObjectType type) const |
| Get the number of objects with given type available Returns the number of objects that have not been clipped away by the clipping regions. More... | |
| int | currentSampleNumber () const |
| Get the current input sample index. More... | |
| Radiant::TimeStamp | currentTime () const |
| Get absolute time-stamp for currently processed input sample. More... | |
| MultiTouch::Finger | findFinger (MultiTouch::TrackedObject::Id id, bool searchHistory=false) const |
| Find the finger with given id from the current input sample. More... | |
| MultiTouch::Hand | findHand (MultiTouch::TrackedObject::Id id, bool searchHistory=false) const |
| Find the hand with given id from the current input sample. More... | |
| MultiTouch::Marker | findMarker (MultiTouch::TrackedObject::Id id, bool searchHistory=false) const |
| Find the marker with given id from the current input sample. More... | |
| MultiTouch::Pen | findPen (MultiTouch::TrackedObject::Id id, bool searchHistory=false) const |
| Find the pen with given id from the current input sample. More... | |
| MultiTouch::TrackedObject | findTrackedObject (MultiTouch::TrackedObject::Id id, bool searchHistory=false) const |
| Find the tracked object with given id from the current input sample. More... | |
| MultiWidgets::TrackedObjectArray | findTrackedObjects (const MultiWidgets::TrackedObjectIds &ids, bool searchHistory=false) const |
| Find tracked objects with given ids. More... | |
| virtual void | finish () |
| Finish should be called after passing this input frame to your Widgets. More... | |
| MultiTouch::TrackedObject | getClippedObject (int index) const |
| Returns the ith tracked object after clipping. | |
| void | grab (MultiTouch::TrackedObject::Id id, InputGrabber *grabber) |
| Notifies the GrabManager that something has grabbed a tracked object. | |
| InputGrabber * | grabber (MultiTouch::TrackedObject::Id id) const |
| Finds InputGrabbed for given TrackedObject. More... | |
| GrabManager (MultiTouch::Screen &screen) | |
| Constructs a new GrabManager for the given touchscreen. | |
| Nimble::Vector2f | initFingerTipLocation (MultiTouch::TrackedObject::Id fingerId, bool *found=0) |
| Finds the initial finger tip location, i.e. More... | |
| Nimble::Vector2f | latestFingerTipLocation (MultiTouch::TrackedObject::Id fingerId, bool *found=0) const |
| Finds the latest finger tip location. More... | |
| Nimble::Vector2f | latestTrackedObjectLocation (MultiTouch::TrackedObject::Id trackedObjectId, bool *found=0) const |
| Finds the latest tracked object location. More... | |
| void | popClipRegion () |
| Pops a clip region from the clip stack. | |
| void | popWidget (ViewWidget *w) |
| Removes the top-most ViewWidget from the view widget path. More... | |
| void | popWidget (Widget *w) |
| Pop a Widget from the widget path. More... | |
| virtual void | prepare () |
| Prepare should be called for each input frame after the current sample has been set and before actually passing the input to any Widget. More... | |
| MultiTouch::Sample | prevSample () const |
| Returns the previous touchscreen sample. | |
| void | pushClipRegion (Nimble::SizeF size) |
| Push a clip-rectangle into the clip stack. More... | |
| void | pushWidget (ViewWidget *w) |
| Push a ViewWidget into the view widget path. More... | |
| void | pushWidget (Widget *w) |
| Push a Widget into the widget path. More... | |
| size_t | recursionDepth () const |
| Returns the current recursion depth. More... | |
| size_t | recursionLimit () const |
| Returns the recursion limit. More... | |
| MultiTouch::Sample | sample () const |
| Returns the current touchscreen sample. | |
| void | setRecursionDepth (size_t depth) |
| Sets the recursion depth. More... | |
| void | setRecursionLimit (size_t limit) |
| Set the maximum recursion depth for input processing. More... | |
| void | setSample (int sample) |
| Sets the current touchscreen sample number. | |
| long | sinceLastDetection (MultiTouch::TrackedObject::Id id) const |
| Calculate when a tracked object was last detected. More... | |
| MultiTouch::Screen & | touchScreen () const |
| Returns a reference to the touch-screen input. | |
| void | ungrab (MultiTouch::TrackedObject::Id id, InputGrabber *grabber) |
| Notifies the GrabManager that something has ungrabbed a tracked object. | |
| const WidgetPath & | viewWidgetPath () const |
| Returns the current view widget path. More... | |
| const WidgetPath & | widgetPath () const |
| Returns the current widget path. More... | |
Public Member Functions inherited from Luminous::Transformer | |
| void | leftMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the left with the given matrix The end result is equivalent to: More... | |
| void | popTransform () |
| Pops the top matrix from the stack. | |
| Nimble::Vector2 | project (const Nimble::Vector2 &) const |
| Apply the current transformation matrix on a 2D vector. | |
| void | pushTransform () |
| Push a new matrix to the stack, just copying the current top. | |
| void | pushTransform (const Nimble::Matrix4 &m) |
| Push the given matrix to the stack pushTransform(m) has the same effect as: More... | |
| void | pushTransform (const Nimble::Matrix3 &m) |
| void | pushTransformLeftMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the left with the given matrix and push the result into the stack. | |
| void | pushTransformLeftMul (const Nimble::Matrix3 &m) |
| void | pushTransformRightMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the right with the given matrix and push the result into the stack. | |
| void | pushTransformRightMul (const Nimble::Matrix3 &m) |
| void | resetTransform () |
| Clears the stack so it only contains an identity matrix. | |
| void | rightMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the right with the given matrix The end result is equivalent to: More... | |
| void | setTransform (const Nimble::Matrix4 &m) |
| Replaces the top matrix with the given matrix. More... | |
| size_t | stackSize () const |
| Get the size of the transform stack. More... | |
| const Nimble::Matrix4 & | transform () const |
| Get the top matrix of the stack. | |
| Nimble::Matrix3 | transform3 () const |
| Get the top matrix of the stack as 3x3-matrix. | |
| Transformer () | |
| Creates an empty transformation stack. | |
| Nimble::Vector2 | unproject (const Nimble::Vector2 &) const |
| Apply inverse of the current transformation matrix on a 2D vector. | |
| virtual | ~Transformer () |
| Deletes the transformation stack. | |
Additional Inherited Members | |
Protected Member Functions inherited from Luminous::Transformer | |
| virtual void | beforeTransformChange () |
| This function gets called just before the transformation matrix is changed. More... | |
Protected Attributes inherited from Luminous::Transformer | |
|
std::stack< Nimble::Matrix4, std::vector< Nimble::Matrix4 > > | m_stack |
| The transformation stack. | |
Manage finger and hand focus/grab information.
GrabManager handles all the things that are needed to keep track of which fingers and hands have been grabbed by widgets.
It also handles input clipping that is required by MultiWidgets::ViewWidget.
| Nimble::Vector2 MultiWidgets::GrabManager::averageTrackedObjectLocation | ( | const TrackedObjectIds & | ids, |
| bool | searchHistory, | ||
| bool * | ok = 0 |
||
| ) | const |
Calculates the average location of a set of tracked objects.
| ids | The list of object ids to be looked at |
| searchHistory | Go through the history if the object is no longer present |
| ok | If non-null, then the boolean is set to true if at least one object was found |
| size_t MultiWidgets::GrabManager::clippedObjectCount | ( | ) | const |
Get the number of objects available Returns the number of objects that have not been clipped away by the clipping regions.
| size_t MultiWidgets::GrabManager::clippedObjectCount | ( | MultiTouch::TrackedObjectType | type | ) | const |
Get the number of objects with given type available Returns the number of objects that have not been clipped away by the clipping regions.
| int MultiWidgets::GrabManager::currentSampleNumber | ( | ) | const |
Get the current input sample index.
| Radiant::TimeStamp MultiWidgets::GrabManager::currentTime | ( | ) | const |
Get absolute time-stamp for currently processed input sample.
| MultiTouch::Finger MultiWidgets::GrabManager::findFinger | ( | MultiTouch::TrackedObject::Id | id, |
| bool | searchHistory = false |
||
| ) | const |
Find the finger with given id from the current input sample.
| id | finger id to search for |
| searchHistory | if true, searches the input history for latest occurrence |
| MultiTouch::Hand MultiWidgets::GrabManager::findHand | ( | MultiTouch::TrackedObject::Id | id, |
| bool | searchHistory = false |
||
| ) | const |
Find the hand with given id from the current input sample.
| id | hand id to search for |
| searchHistory | if true, searches the input history for latest occurrence |
| MultiTouch::Marker MultiWidgets::GrabManager::findMarker | ( | MultiTouch::TrackedObject::Id | id, |
| bool | searchHistory = false |
||
| ) | const |
Find the marker with given id from the current input sample.
| id | marker id to search for |
| searchHistory | if true, searches the input history for latest occurrence |
| MultiTouch::Pen MultiWidgets::GrabManager::findPen | ( | MultiTouch::TrackedObject::Id | id, |
| bool | searchHistory = false |
||
| ) | const |
Find the pen with given id from the current input sample.
| id | pen id to search for |
| searchHistory | if true, searches the input history for latest occurrence |
| MultiTouch::TrackedObject MultiWidgets::GrabManager::findTrackedObject | ( | MultiTouch::TrackedObject::Id | id, |
| bool | searchHistory = false |
||
| ) | const |
Find the tracked object with given id from the current input sample.
| id | object id to search for |
| searchHistory | if true, searches the input history for latest occurrence |
| MultiWidgets::TrackedObjectArray MultiWidgets::GrabManager::findTrackedObjects | ( | const MultiWidgets::TrackedObjectIds & | ids, |
| bool | searchHistory = false |
||
| ) | const |
Find tracked objects with given ids.
| ids | ids to search for |
| searchHistory | if true, searches the input history for latest occurrence |
|
virtual |
Finish should be called after passing this input frame to your Widgets.
| InputGrabber* MultiWidgets::GrabManager::grabber | ( | MultiTouch::TrackedObject::Id | id | ) | const |
Finds InputGrabbed for given TrackedObject.
| id | id of TrackedObject |
| Nimble::Vector2f MultiWidgets::GrabManager::initFingerTipLocation | ( | MultiTouch::TrackedObject::Id | fingerId, |
| bool * | found = 0 |
||
| ) |
Finds the initial finger tip location, i.e.
the point where the finger was first detected. The returned coordinate value is multiplied by the current transformation matrix. If the finger is not found, then 0,0 is returned.
| fingerId | finger id | |
| [out] | found | indicates if the finger was found |
| Nimble::Vector2f MultiWidgets::GrabManager::latestFingerTipLocation | ( | MultiTouch::TrackedObject::Id | fingerId, |
| bool * | found = 0 |
||
| ) | const |
Finds the latest finger tip location.
The returned coordinate value is multiplied by the current transformation matrix. If the finger is not found, then 0,0 is returned.
| fingerId | finger id | |
| [out] | found | indicates if the finger was found |
| Nimble::Vector2f MultiWidgets::GrabManager::latestTrackedObjectLocation | ( | MultiTouch::TrackedObject::Id | trackedObjectId, |
| bool * | found = 0 |
||
| ) | const |
Finds the latest tracked object location.
The returned coordinate value is multiplied by the current transformation matrix. If the object is not found, then 0,0 is returned.
| trackedObjectId | object id | |
| [out] | found | indicates if the object was found |
| void MultiWidgets::GrabManager::popWidget | ( | ViewWidget * | w | ) |
Removes the top-most ViewWidget from the view widget path.
| w | should be the view widget currently on top |
| void MultiWidgets::GrabManager::popWidget | ( | Widget * | w | ) |
Pop a Widget from the widget path.
| w | should be the view widget currently on top |
|
virtual |
Prepare should be called for each input frame after the current sample has been set and before actually passing the input to any Widget.
| void MultiWidgets::GrabManager::pushClipRegion | ( | Nimble::SizeF | size | ) |
Push a clip-rectangle into the clip stack.
The rect spans the coordinates [0,0]-[size] and is transformed to screen coordinates by the inverse of the matrix stack in GrabManager.
| size | size of the clip region |
| void MultiWidgets::GrabManager::pushWidget | ( | ViewWidget * | w | ) |
| void MultiWidgets::GrabManager::pushWidget | ( | Widget * | w | ) |
Push a Widget into the widget path.
| w | widget to push |
| size_t MultiWidgets::GrabManager::recursionDepth | ( | ) | const |
Returns the current recursion depth.
| size_t MultiWidgets::GrabManager::recursionLimit | ( | ) | const |
Returns the recursion limit.
| void MultiWidgets::GrabManager::setRecursionDepth | ( | size_t | depth | ) |
| void MultiWidgets::GrabManager::setRecursionLimit | ( | size_t | limit | ) |
Set the maximum recursion depth for input processing.
Recursive processing may occur when MultiWidgets::ViewWidget is used to create recursive loops in the widget hierarchy. The limit is used to prevent infinite recursion.
| limit | maximum recursion depth |
| long MultiWidgets::GrabManager::sinceLastDetection | ( | MultiTouch::TrackedObject::Id | id | ) | const |
Calculate when a tracked object was last detected.
| id | id to search for |
| const WidgetPath& MultiWidgets::GrabManager::viewWidgetPath | ( | ) | const |
Returns the current view widget path.
The path contains all ViewWidgets through which input has been propagated. This path is used to avoid feeding input more than once to a single widget when there are multiple views in a scene.
| const WidgetPath& MultiWidgets::GrabManager::widgetPath | ( | ) | const |
Returns the current widget path.
This path contains all widgets through which input has been propagated. This path is used by Widget::bringToTop to determine which depths to modify when a widget must be brought on top.