All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Modules Pages
Loading...
Searching...
No Matches
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.
 
ObserverBehaviour EnableObservers (CloudRecoSearchResult result, GameObject gameObject)
 Enable this search result for tracking.
 
ObserverBehaviour EnableObservers (CloudRecoSearchResult result, string gameObjectName)
 Enable this search result for tracking.
 
IEnumerable< CloudRecoSearchResultGetResults ()
 Returns new search results.
 
void InitializeReco (string userAuth, string secretAuth)
 Starts initialization of the cloud-based recognition system.
 
void RegisterOnInitErrorEventHandler (Action< InitError > handler)
 Register for event that's called when an error is reported during initialization.
 
void RegisterOnInitializedEventHandler (Action< CloudRecoBehaviour > handler)
 Register for event that's called when the CloudRecoBehaviour has finished initializing.
 
void RegisterOnNewSearchResultEventHandler (Action< CloudRecoSearchResult > handler)
 Register for event that's called when a new search result is found.
 
void RegisterOnStateChangedEventHandler (Action< bool > handler)
 Register for event that's called when the RecoBehaviour starts or stops scanning.
 
void RegisterOnUpdateErrorEventHandler (Action< QueryError > handler)
 Register for event that's called when an error is reported while updating.
 
bool UnregisterOnInitErrorEventHandler (Action< InitError > handler)
 Unregister from event that's called when an error is reported during initialization.
 
bool UnregisterOnInitializedEventHandler (Action< CloudRecoBehaviour > handler)
 Unregister from event that's called when the CloudRecoBehaviour has finished initializing.
 
bool UnregisterOnNewSearchResultEventHandler (Action< CloudRecoSearchResult > handler)
 Unregister from event that's called when a new search result is found.
 
bool UnregisterOnStateChangedEventHandler (Action< bool > handler)
 Unregister from event that's called when the RecoBehaviour starts or stops scanning.
 
bool UnregisterOnUpdateErrorEventHandler (Action< QueryError > handler)
 Unregister from event that's called when an error is reported while updating.
 

Public Attributes

string AccessKey = ""
 The user's Cloud Recognition Client Access Key.
 
string SecretKey = ""
 The user's Cloud Recognition Client Secret Key.
 

Properties

bool CloudRecoInitialized [get]
 Whether cloud reco has been initialized yet.
 
bool RecoStarted [get]
 Whether cloud reco has started.
 
bool Requesting [get]
 Whether cloud reco is currently performing a request.
 
- Properties inherited from ObserverBehaviour
int? ID [get]
 The runtime Id of the Observer.
 
string TargetName [get]
 Name of the target of the Observer.
 
TargetStatus TargetStatus = TargetStatus.NotObserved [get]
 Current status information of the target.
 

Additional Inherited Members

- Events inherited from ObserverBehaviour
Action< ObserverBehaviourOnBehaviourDestroyed
 Triggered when this behaviour is destroyed. Can be used for script cleanup.
 
Action< ObserverBehaviour, TargetStatusOnTargetStatusChanged
 Triggered when the TargetStatus changes.
 

Detailed Description

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

Member Enumeration Documentation

◆ InitError

enum InitError

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

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,
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.

◆ EnableObservers() [2/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.

◆ 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.

◆ SecretKey

string SecretKey = ""

The user's Cloud Recognition Client Secret Key.

Property Documentation

◆ CloudRecoInitialized

bool CloudRecoInitialized
get

Whether cloud reco has been initialized yet.

◆ RecoStarted

bool RecoStarted
get

Whether cloud reco has started.

◆ Requesting

bool Requesting
get

Whether cloud reco is currently performing a request.