Helper class to ease the managing of virtual input and injecting it to the touchscreen samples.
More...
#include <MultiWidgets/VirtualInput.hpp>
Helper class to ease the managing of virtual input and injecting it to the touchscreen samples.
Keeps track of a collection of VirtualObject's. Does not accept VirtualFinger because they are handled by keeping track to the VirtualHand's owning the fingers.
- Examples:
- VirtualInputExample.cpp.
| MultiWidgets::VirtualInput::VirtualInput |
( |
bool |
autoSynthesize = true | ) |
|
|
explicit |
| bool MultiWidgets::VirtualInput::empty |
( |
| ) |
const |
Is there any managed objects.
- Returns
- True if this contains some managed VirtualObjects.
Part of the simple API for generating and managing hands with single finger.
Creates hand with single finger so that the finger is placed in the given location.
- Parameters
-
| loc | Location for the finger. |
- Returns
- Id of the finger that is used as a key in updateFinger- and fingerUp-functions.
- See Also
- updateFinger, fingerUp
| void MultiWidgets::VirtualInput::fingerUp |
( |
long |
id | ) |
|
Part of the simple API for generating and managing hands with single finger.
Removes the finger created by fingerDown.
- Parameters
-
| id | Id of the finger (the one returned by fingerDown). |
- See Also
- fingerDown, fingerUp
Gets the managed VirtualHand that has given id.
- Parameters
-
- Returns
- Shared pointer to the hand. nullptr if there does not exist hand with the given id.
Gets the managed VirtualMarker that has given id.
- Parameters
-
| id | Id of the queried marker |
- Returns
- Shared pointer to the marker. nullptr if there does not exist marker with the given id.
Gets the managed VirtualObject has given id.
- Parameters
-
| id | Id of the queried object |
- Returns
- Shared pointer to the object. nullptr if there does not exist object with the given id.
Gets the managed VirtualPen that has given id.
- Parameters
-
- Returns
- Shared pointer to the pen. nullptr if there does not exist pen with the given id.
| void MultiWidgets::VirtualInput::injectToSamples |
( |
MultiTouch::Screen & |
touchScreen, |
|
|
size_t |
sampleBegin, |
|
|
size_t |
sampleEnd |
|
) |
| |
Injects data of the VirtualObject's that are managed by this instance to the given touchscreen's samples.
Calls injectToSamples for each managed object.
- Parameters
-
| touchScreen | The synthesized input is injected to this touchscreen's samples |
| sampleBegin | Index of the first sample to handle |
| sampleEnd | Index of the last sample (inclusive) to handle |
- See Also
- VirtualObject::injectToSamples
- Note
- All the objects that are at the moment managed by this class are injected into samples of touchscreen.
| long MultiWidgets::VirtualInput::markerDown |
( |
Nimble::Vector2f |
loc, |
|
|
uint64_t |
code |
|
) |
| |
Part of the simple API for generating and managing markers.
Creates marker that is placed in the given location.
- Parameters
-
| loc | Location for the marker. |
| code | Code of the marker. |
- Returns
- Id of the marker that is used as a key in updateMarker- and markerUp-functions.
- See Also
- updateMarker, markerUp
| void MultiWidgets::VirtualInput::markerUp |
( |
long |
id | ) |
|
Part of the simple API for generating and managing markers.
Updates the location of the marker created by markerDown.
- Parameters
-
| id | Id of the marker (the one returned by markerDown). |
- See Also
- markerDown, markerUp
Part of the simple API for generating and managing pens.
Creates pen that is placed in the given location.
- Parameters
-
- Returns
- Id of the pen that is used as a key in updatePen- and penUp-functions.
- See Also
- updatePen, penUp
| void MultiWidgets::VirtualInput::penUp |
( |
long |
id | ) |
|
Part of the simple API for generating and managing pens.
Removes the pen created by penDown.
- Parameters
-
| id | Id of the pen (the one returned by penDown). |
- See Also
- penDown, penUp
| void MultiWidgets::VirtualInput::removeObject |
( |
long |
id | ) |
|
Removes the managed object with given id from internal data structures.
- Parameters
-
| od | Id of the object to be removed |
- Examples:
- VirtualInputExample.cpp.
Part of the simple API for generating and managing hands with single finger.
Updates the location of the finger created by fingerDown.
- Parameters
-
| id | Id of the finger (the one returned by fingerDown). |
| loc | New location for the finger. |
- See Also
- fingerDown, fingerUp
Part of the simple API for generating and managing markers.
Updates the location of the marker created by markerDown.
- Parameters
-
| id | Id of the marker (the one returned by markerDown). |
| loc | New location for the marker. |
- See Also
- markerDown, markerUp
Part of the simple API for generating and managing pens.
Updates the location of the pen created by penDown.
- Parameters
-
| id | Id of the pen (the one returned by penDown). |
| loc | New location for the pen. |
- See Also
- penDown, penUp