C API Unity API
Unity API Reference (Version 10.22.5)
CloudRecoBehaviour Class Reference

This is the main behaviour class that encapsulates cloud recognition behaviour. More...

Inheritance diagram for CloudRecoBehaviour:
ObserverBehaviour VuforiaMonoBehaviour

Classes

class  CloudRecoSearchResult
 CloudReco search result that contains all known data of a specific search result More...
 

Public Types

enum  InitError {
  NONE = 0x0,
  INTERNAL = 0x1,
  AUTOACTIVATION_FAILED = 0x2,
  FEATURE_NOT_SUPPORTED = 0x3,
  SERVICE_MISSING_AUTHENTICATION = 0x4,
  NO_NETWORK_CONNECTION = 0x5,
  SERVICE_NOT_AVAILABLE = 0x6
}
 
enum  QueryError {
  NONE = 0x0,
  AUTHORIZATION_FAILED = 0x01,
  PROJECT_SUSPENDED = 0x02,
  NO_NETWORK_CONNECTION = 0x03,
  SERVICE_NOT_AVAILABLE = 0x04,
  BAD_FRAME_QUALITY = 0x05,
  UPDATE_SDK = 0x06,
  TIMESTAMP_OUT_OF_RANGE = 0x07,
  REQUEST_TIMEOUT = 0x08
}
 Status codes for the Cloud Reco query errors More...
 

Public Member Functions

void ClearObservers (bool destroyGameObjects=true)
 Clears all targets enabled for observers More...
 
ObserverBehaviour EnableObservers (CloudRecoSearchResult result, string gameObjectName)
 Enable this search result for tracking. More...
 
ObserverBehaviour EnableObservers (CloudRecoSearchResult result, GameObject gameObject)
 Enable this search result for tracking. More...
 
IEnumerable< CloudRecoSearchResultGetResults ()
 Returns new search results More...
 
void InitializeReco (string userAuth, string secretAuth)
 Starts initialization of the cloud-based recognition system. More...
 
void RegisterOnInitErrorEventHandler (Action< InitError > handler)
 Register for event that's called when an error is reported during initialization More...
 
void RegisterOnInitializedEventHandler (Action< CloudRecoBehaviour > handler)
 Register for event that's called when the CloudRecoBehaviour has finished initializing More...
 
void RegisterOnNewSearchResultEventHandler (Action< CloudRecoSearchResult > handler)
 Register for event that's called when a new search result is found More...
 
void RegisterOnStateChangedEventHandler (Action< bool > handler)
 Register for event that's called when the RecoBehaviour starts or stops scanning More...
 
void RegisterOnUpdateErrorEventHandler (Action< QueryError > handler)
 Register for event that's called when an error is reported while updating More...
 
bool UnregisterOnInitErrorEventHandler (Action< InitError > handler)
 Unregister from event that's called when an error is reported during initialization More...
 
bool UnregisterOnInitializedEventHandler (Action< CloudRecoBehaviour > handler)
 Unregister from event that's called when the CloudRecoBehaviour has finished initializing More...
 
bool UnregisterOnNewSearchResultEventHandler (Action< CloudRecoSearchResult > handler)
 Unregister from event that's called when a new search result is found More...
 
bool UnregisterOnStateChangedEventHandler (Action< bool > handler)
 Unregister from event that's called when the RecoBehaviour starts or stops scanning More...
 
bool UnregisterOnUpdateErrorEventHandler (Action< QueryError > handler)
 Unregister from event that's called when an error is reported while updating More...
 

Public Attributes

string AccessKey = ""
 The user's Cloud Recognition Client Access Key More...
 
bool CloudRecoInitialized => mObserver != null
 Whether cloud reco has been initialized yet. More...
 
bool RecoStarted => mObserver != null && mObserver.Activated
 Whether cloud reco has started More...
 
bool Requesting => mCloudImageTargetObserver.Requesting
 Whether cloud reco is currently performing a request. More...
 
string SecretKey = ""
 The user's Cloud Recognition Client Secret Key More...
 
- Public Attributes inherited from ObserverBehaviour
int ID => mObserver?.Id
 The runtime Id of the Observer More...
 
string TargetName => mTrackableName
 Name of the target of the Observer More...
 

Additional Inherited Members

- Properties inherited from ObserverBehaviour
TargetStatus TargetStatus [get]
 Current status information of the target More...
 
- Events inherited from ObserverBehaviour
Action< ObserverBehaviourOnBehaviourDestroyed
 Triggered when this behaviour is destroyed. Can be used for script cleanup More...
 
Action< ObserverBehaviour, TargetStatusOnTargetStatusChanged
 Triggered when the TargetStatus changes More...
 

Detailed Description

This is the main behaviour class that encapsulates cloud recognition behaviour.

Member Enumeration Documentation

◆ InitError

enum InitError
strong

Status codes returned by the CloudRecoObserver creation

Enumerator
NONE 

No error

INTERNAL 

An internal error occurred while creating the Cloud Reco

AUTOACTIVATION_FAILED 

Observer auto-activation failed

FEATURE_NOT_SUPPORTED 

Feature is not supported by the current license

SERVICE_MISSING_AUTHENTICATION 

Missing authentication details (user authentication or authentication secret)

NO_NETWORK_CONNECTION 

No network connection

SERVICE_NOT_AVAILABLE 

Service is not available

◆ QueryError

enum QueryError
strong

Status codes for the Cloud Reco query errors

Enumerator
NONE 

No error

AUTHORIZATION_FAILED 

Credentials are wrong or outdated

PROJECT_SUSPENDED 

The specified project was suspended

NO_NETWORK_CONNECTION 

Device has no network connection

SERVICE_NOT_AVAILABLE 

Server not found, down or overloaded

BAD_FRAME_QUALITY 

Low frame quality has been continuously observed

UPDATE_SDK 

SDK Version outdated

TIMESTAMP_OUT_OF_RANGE 

Client/Server clocks too far away

REQUEST_TIMEOUT 

No response to network request after timeout

Member Function Documentation

◆ ClearObservers()

void ClearObservers ( bool  destroyGameObjects = true)
inline

Clears all targets enabled for observers

Destroys all Observers that have been created via EnableObserving().

◆ EnableObservers() [1/2]

ObserverBehaviour EnableObservers ( CloudRecoSearchResult  result,
string  gameObjectName 
)
inline

Enable this search result for tracking.

Activates an Observer for local detection and tracking of this target. returns a new ImageTargetBehaviour attached to a new game object with the given name. Note that this call may result in an earlier Observer that was enabled for tracking to be destroyed, including its ObserverBehaviour. Thus it is not advised to hold a reference to an earlier created Observer after calling EnableTracking again.

◆ EnableObservers() [2/2]

ObserverBehaviour EnableObservers ( CloudRecoSearchResult  result,
GameObject  gameObject 
)
inline

Enable this search result for tracking.

Activates an Observer for local detection and tracking of this target. If the given game object has no ImageTargetBehaviour, a new one will be created. Note that this call may result in an earlier Observer that was enabled for tracking to be destroyed, including its ObserverBehaviour. Thus it is not advised to hold a reference to an earlier created Observer after calling EnableTracking again.

◆ GetResults()

IEnumerable<CloudRecoSearchResult> GetResults ( )
inline

Returns new search results

Earlier search result instances are destroyed

◆ InitializeReco()

void InitializeReco ( string  userAuth,
string  secretAuth 
)
inline

Starts initialization of the cloud-based recognition system.

Pass in the user/password for authenticating with the cloud reco server.

◆ RegisterOnInitErrorEventHandler()

void RegisterOnInitErrorEventHandler ( Action< InitError handler)
inline

Register for event that's called when an error is reported during initialization

◆ RegisterOnInitializedEventHandler()

void RegisterOnInitializedEventHandler ( Action< CloudRecoBehaviour handler)
inline

Register for event that's called when the CloudRecoBehaviour has finished initializing

◆ RegisterOnNewSearchResultEventHandler()

void RegisterOnNewSearchResultEventHandler ( Action< CloudRecoSearchResult handler)
inline

Register for event that's called when a new search result is found

◆ RegisterOnStateChangedEventHandler()

void RegisterOnStateChangedEventHandler ( Action< bool >  handler)
inline

Register for event that's called when the RecoBehaviour starts or stops scanning

◆ RegisterOnUpdateErrorEventHandler()

void RegisterOnUpdateErrorEventHandler ( Action< QueryError handler)
inline

Register for event that's called when an error is reported while updating

◆ UnregisterOnInitErrorEventHandler()

bool UnregisterOnInitErrorEventHandler ( Action< InitError handler)
inline

Unregister from event that's called when an error is reported during initialization

◆ UnregisterOnInitializedEventHandler()

bool UnregisterOnInitializedEventHandler ( Action< CloudRecoBehaviour handler)
inline

Unregister from event that's called when the CloudRecoBehaviour has finished initializing

◆ UnregisterOnNewSearchResultEventHandler()

bool UnregisterOnNewSearchResultEventHandler ( Action< CloudRecoSearchResult handler)
inline

Unregister from event that's called when a new search result is found

◆ UnregisterOnStateChangedEventHandler()

bool UnregisterOnStateChangedEventHandler ( Action< bool >  handler)
inline

Unregister from event that's called when the RecoBehaviour starts or stops scanning

◆ UnregisterOnUpdateErrorEventHandler()

bool UnregisterOnUpdateErrorEventHandler ( Action< QueryError handler)
inline

Unregister from event that's called when an error is reported while updating

Member Data Documentation

◆ AccessKey

string AccessKey = ""

The user's Cloud Recognition Client Access Key

◆ CloudRecoInitialized

bool CloudRecoInitialized => mObserver != null

Whether cloud reco has been initialized yet.

◆ RecoStarted

bool RecoStarted => mObserver != null && mObserver.Activated

Whether cloud reco has started

◆ Requesting

bool Requesting => mCloudImageTargetObserver.Requesting

Whether cloud reco is currently performing a request.

◆ SecretKey

string SecretKey = ""

The user's Cloud Recognition Client Secret Key