C++ Java Unity
C++ Reference
ObjectTracker Class Referenceabstract

Detailed Description

A type of Tracker that tracks objects in the real world.

An ObjectTracker tracks all target types that inherit from ObjectTarget (for a full list, refer to the inheritance tree diagram for ObjectTarget).

The data for these Trackable instances is stored in DataSet instances, which are owned and managed by the ObjectTracker.

The ObjectTracker class provides methods for creating, activating and deactivating DataSets.

Note
Calls to activateDataSet() and deactivateDataSet() should be avoided while the ObjectTracker is actively processing a frame, as such calls will block until the ObjectTracker has finished.

If you do need to call these methods during execution, the suggested way of doing so is via the UpdateCallback mechanism, as the callback is done at a point where the ObjectTracker is guaranteed to be idle. Alternatively, the ObjectTracker can be explicitly stopped and then restarted. However this is a very expensive operation.

Inheritance diagram for ObjectTracker:
Tracker NonCopyable

Public Types

enum  TargetFinderType { CLOUD_RECO }
 The type of Target finder to return. More...
 

Public Member Functions

virtual DataSetcreateDataSet ()=0
 Create an empty DataSet. More...
 
virtual bool destroyDataSet (DataSet *dataset)=0
 Destroy the given DataSet and release allocated resources. More...
 
virtual bool activateDataSet (DataSet *dataset)=0
 Activate the given DataSet. More...
 
virtual bool deactivateDataSet (DataSet *dataset)=0
 Deactivate the given DataSet. More...
 
virtual List< DataSetgetActiveDataSets ()=0
 Provides access to the list of currently active active datasets. More...
 
virtual RuntimeImageSourcegetRuntimeImageSource ()=0
 Get the RuntimeImageSource for the current session. More...
 
virtual TargetFindergetTargetFinder (TargetFinderType type=CLOUD_RECO)=0
 Get the TargetFinder for the current scene. More...
 
- Public Member Functions inherited from Tracker
virtual Type getType () const =0
 Get the Type of this instance (may be a subclass of Tracker). More...
 
virtual bool isOfType (Type type) const =0
 Get whether this Tracker instance's type equals or has been derived from the given type. More...
 
virtual bool start ()=0
 Start the Tracker. More...
 
virtual void stop ()=0
 Stop the Tracker. More...
 
virtual ~Tracker ()
 

Static Public Member Functions

static Type getClassType ()
 Returns the Type for class 'ObjectTracker'. More...
 
- Static Public Member Functions inherited from Tracker
static Type getClassType ()
 Get the Type for class 'Tracker'. More...
 

Member Enumeration Documentation

The type of Target finder to return.

Enum describing the different TargetFinder types that Vuforia can return

Enumerator
CLOUD_RECO 

A TargetFinder to recognize ImageTargets using cloud-based image recognition.

Member Function Documentation

static Type getClassType ( )
static

Returns the Type for class 'ObjectTracker'.

virtual DataSet* createDataSet ( )
pure virtual

Create an empty DataSet.

Returns
the new instance on success, NULL otherwise.

Use destroyDataSet() to destroy a DataSet that is no longer needed.

virtual bool destroyDataSet ( DataSet dataset)
pure virtual

Destroy the given DataSet and release allocated resources.

Returns
true on success, or false if the DataSet is active.
virtual bool activateDataSet ( DataSet dataset)
pure virtual

Activate the given DataSet.

Returns
true if the DataSet was successfully activated, otherwise false (check application log for failure details).
Note
To activate a dataset, you should use one of these 3 supported mechanisms:
  • initialization time: activate it before starting the tracker,
  • run time: if you have started the tracker, activate the dataset in the UpdateCallback,
  • run time: if you have started the tracker, stop the tracker first, activate the dataset, then restart the tracker.
virtual bool deactivateDataSet ( DataSet dataset)
pure virtual

Deactivate the given DataSet.

Returns
true if the DataSet was successfully deactivated, otherwise false (e.g. because the DataSet is not currently active) (check application log for failure details).
Note
To deactivate a dataset, you should use one of these 3 supported mechanisms:
  • deinitialization time: deactivate it after stopping the tracker,
  • run time: if you have started the tracker, deactivate the dataset in the UpdateCallback,
  • run time: if you have started the tracker, stop the tracker first, deactivate the dataset, then restart the tracker.
virtual List<DataSet> getActiveDataSets ( )
pure virtual

Provides access to the list of currently active active datasets.

virtual RuntimeImageSource* getRuntimeImageSource ( )
pure virtual

Get the RuntimeImageSource for the current session.

This RuntimeImageSource instance should be reused to create multiple image targets.

Returns
The RuntimeImageSource that should be used if you want to generate ImageTargets at runtime from external image sources (e.g. file, raw buffer).
virtual TargetFinder* getTargetFinder ( TargetFinderType  type = CLOUD_RECO)
pure virtual

Get the TargetFinder for the current scene.

Parameters
typeThe type of the TargetFinder to be returned.
Returns
The requested TargetFinder.