A persistent handle to the state of the whole augmented reality system at a given point in time.
A State can include:
There are two different ways to obtain a State, depending on if you want to access data via a Pull or Push model:
Both push and pull models can be used simultaneously, if you like. For example, you would typically want to use the Pull interface as part of your render loop, but you may want to simultaneously use the Push interface for other parts of the system, such as if you need access to state information as early as possible in order to do any other custom computer vision in addition to Vuforia.
Note, however, that in an application where the camera, renderer, and main loop are all running on separate threads, care must be taken to ensure that a consistent State object is used across the whole application.
The data associated with a given State instance remains valid as long as the State instance is retained, acting like a smart pointer to the underlying data. Vuforia will continue to run in the background but the retained State instance will not be updated, and will therefore become increasingly out of date over time.
Note that the timestamp of the Frame returned by getFrame() may not match the timestamp on the various returned TrackableResults. See StateUpdater for more details.
Public Member Functions | |
State () | |
Default constructor. More... | |
State (const State &other) | |
Copy constructor. More... | |
~State () | |
Destructor. More... | |
State & | operator= (const State &other) |
Thread safe assignment operator. More... | |
Frame | getFrame () const |
Get the Frame associated with this State. More... | |
const CameraCalibration * | getCameraCalibration () const |
Get the camera calibration for this State, if available. More... | |
const Illumination * | getIllumination () const |
Get illumination information for this State (if available). More... | |
const DeviceTrackableResult * | getDeviceTrackableResult () const |
Get the DeviceTrackableResult, if it exists. More... | |
List< const TrackableResult > | getTrackableResults () const |
Protected Attributes | |
StateData * | mData |
State | ( | ) |
Default constructor.
Copy constructor.
A State is a lightweight object which keeps internal smart pointers to its data.
Copying is therefore cheap, and recommended over using references.
~State | ( | ) |
Destructor.
Thread safe assignment operator.
A State is a lightweight object which keeps internal smart pointers to its data.
Copying is therefore cheap, and recommended over using references.
Frame getFrame | ( | ) | const |
Get the Frame associated with this State.
const CameraCalibration* getCameraCalibration | ( | ) | const |
const Illumination* getIllumination | ( | ) | const |
Get illumination information for this State (if available).
The returned object is only valid as long as the State object is valid. Do not keep a copy of the pointer!
const DeviceTrackableResult* getDeviceTrackableResult | ( | ) | const |
Get the DeviceTrackableResult, if it exists.
This is a convenience method that provides easy access to the DeviceTrackableResult, if a DeviceTracker has been started.
List<const TrackableResult> getTrackableResults | ( | ) | const |
|
protected |