Set up State-Based Model Targets in C++ by configuring a ModelTargetObserver. See the Model Target API Overview for creating and managing Model Targets.
Get the observation status and status info of the currently active Model Target state using vuModelTargetObservationGetStateInfo():
VuObserver*observer;intlistSize;// Create state info listVuModelTargetStateInfoList*list=nullptr;vuModelTargetStateInfoListCreate(&list);// Get and parse the state list from the Model Target ObservervuModelTargetObserverGetAvailableStateInfos(observer,list);// Get the number of elements in the state info listvuModelTargetStateInfoListGetSize(list,&listSize);for(autoi=0;i<listSize;i++){VuModelTargetStateInfostateInfo;vuModelTargetStateInfoListGetElement(list,i,&stateInfo);if(strlen(stateInfo.stateName)>0){// Do something}}
// Set the active Model Target state. This call should be followed by // vuGuideViewGetImage() to update the Guide View, if usedconstchar*stateName="stateName";vuModelTargetObserverSetActiveStateName(observer,stateName);
Destroy the state info list after use to free up memory: