本文整理汇总了Java中com.vuforia.TrackerManager.getTracker方法的典型用法代码示例。如果您正苦于以下问题:Java TrackerManager.getTracker方法的具体用法?Java TrackerManager.getTracker怎么用?Java TrackerManager.getTracker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vuforia.TrackerManager
的用法示例。
在下文中一共展示了TrackerManager.getTracker方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onVuforiaUpdate
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public void onVuforiaUpdate(State state)
{
if (mSwitchDatasetAsap)
{
mSwitchDatasetAsap = false;
TrackerManager tm = TrackerManager.getInstance();
ObjectTracker ot = (ObjectTracker) tm.getTracker(ObjectTracker
.getClassType());
if (ot == null || mCurrentDataset == null
|| ot.getActiveDataSet() == null)
{
Log.d(LOGTAG, "Failed to swap datasets");
return;
}
doUnloadTrackersData();
doLoadTrackersData();
}
}
示例2: doLoadTrackersData
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public boolean doLoadTrackersData() {
// Get the image tracker:
TrackerManager trackerManager = TrackerManager.getInstance();
ObjectTracker imageTracker = (ObjectTracker) trackerManager.getTracker(ObjectTracker.getClassType());
if (imageTracker == null) {
Log.d(LOGTAG, "Failed to load tracking data set because the ImageTracker has not been initialized.");
return false;
}
// Create the data sets:
posterDataSet = imageTracker.createDataSet();
if (posterDataSet == null) {
Log.d(LOGTAG, "Failed to create a new tracking data.");
return false;
}
// Load the data sets:
if (!posterDataSet.load("StonesAndChips.xml", STORAGE_TYPE.STORAGE_APPRESOURCE)) {
Log.d(LOGTAG, "Failed to load data set.");
return false;
}
// Activate the data set:
if (!imageTracker.activateDataSet(posterDataSet)) {
Log.d(LOGTAG, "Failed to activate data set.");
return false;
}
Log.d(LOGTAG, "Successfully loaded and activated data set.");
return true;
}
示例3: doUnloadTrackersData
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public boolean doUnloadTrackersData() {
// Indicate if the trackers were unloaded correctly
boolean result = true;
// Get the image tracker:
TrackerManager trackerManager = TrackerManager.getInstance();
ObjectTracker imageTracker = (ObjectTracker) trackerManager
.getTracker(ObjectTracker.getClassType());
if (imageTracker == null) {
Log.d(LOGTAG, "Failed to destroy the tracking data set because the ImageTracker has not been initialized.");
return false;
}
if (posterDataSet != null) {
if (imageTracker.getActiveDataSet() == posterDataSet && !imageTracker.deactivateDataSet(posterDataSet)) {
Log.d(LOGTAG, "Failed to destroy the tracking data set StonesAndChips because the data set could not be deactivated.");
result = false;
} else if (!imageTracker.destroyDataSet(posterDataSet)) {
Log.d(LOGTAG, "Failed to destroy the tracking data set StonesAndChips.");
result = false;
}
posterDataSet = null;
}
return result;
}
示例4: doUnloadTrackersData
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public boolean doUnloadTrackersData()
{
// Indicate if the trackers were unloaded correctly
boolean result = true;
TrackerManager tManager = TrackerManager.getInstance();
ObjectTracker objectTracker = (ObjectTracker) tManager
.getTracker(ObjectTracker.getClassType());
if (objectTracker == null)
return false;
if (mCurrentDataset != null && mCurrentDataset.isActive())
{
if (objectTracker.getActiveDataSet().equals(mCurrentDataset)
&& !objectTracker.deactivateDataSet(mCurrentDataset))
{
result = false;
} else if (!objectTracker.destroyDataSet(mCurrentDataset))
{
result = false;
}
mCurrentDataset = null;
}
return result;
}
示例5: doUnloadTrackersData
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public boolean doUnloadTrackersData()
{
// Indicate if the trackers were unloaded correctly
boolean result = true;
// Get the image tracker:
TrackerManager trackerManager = TrackerManager.getInstance();
ObjectTracker objectTracker = (ObjectTracker) trackerManager
.getTracker(ObjectTracker.getClassType());
if (objectTracker == null)
{
Log.d(
LOGTAG,
"Failed to destroy the tracking data set because the ObjectTracker has not been initialized.");
return false;
}
if (dataSetStonesAndChips != null)
{
if (objectTracker.getActiveDataSet() == dataSetStonesAndChips
&& !objectTracker.deactivateDataSet(dataSetStonesAndChips))
{
Log.d(
LOGTAG,
"Failed to destroy the tracking data set StonesAndChips because the data set could not be deactivated.");
result = false;
} else if (!objectTracker.destroyDataSet(dataSetStonesAndChips))
{
Log.d(LOGTAG,
"Failed to destroy the tracking data set StonesAndChips.");
result = false;
}
dataSetStonesAndChips = null;
}
return result;
}
示例6: doLoadTrackersData
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public boolean doLoadTrackersData()
{
TrackerManager tManager = TrackerManager.getInstance();
ObjectTracker objectTracker = (ObjectTracker) tManager
.getTracker(ObjectTracker.getClassType());
if (objectTracker == null)
return false;
if (mCurrentDataset == null)
mCurrentDataset = objectTracker.createDataSet();
if (mCurrentDataset == null)
return false;
//Determine the storage type.
int storage_type;
String dataFile = mDatasetStrings.get(mCurrentDatasetSelectionIndex);
if(dataFile.startsWith(FILE_PROTOCOL)){
storage_type = STORAGE_TYPE.STORAGE_ABSOLUTE;
dataFile = dataFile.substring(FILE_PROTOCOL.length(), dataFile.length());
mDatasetStrings.set(mCurrentDatasetSelectionIndex, dataFile);
Log.d(LOGTAG, "Reading the absolute path: " + dataFile);
}else{
storage_type = STORAGE_TYPE.STORAGE_APPRESOURCE;
Log.d(LOGTAG, "Reading the path " + dataFile + " from the assets folder.");
}
if (!mCurrentDataset.load(
mDatasetStrings.get(mCurrentDatasetSelectionIndex), storage_type))
return false;
if (!objectTracker.activateDataSet(mCurrentDataset))
return false;
int numTrackables = mCurrentDataset.getNumTrackables();
for (int count = 0; count < numTrackables; count++)
{
Trackable trackable = mCurrentDataset.getTrackable(count);
if(isExtendedTrackingActive())
{
trackable.startExtendedTracking();
}
String obj_name = trackable.getName();
String name = "Current Dataset : " + obj_name;
trackable.setUserData(name);
Log.d(LOGTAG, "UserData:Set the following user data "
+ (String) trackable.getUserData());
}
return true;
}
示例7: doLoadTrackersData
import com.vuforia.TrackerManager; //导入方法依赖的package包/类
@Override
public boolean doLoadTrackersData()
{
// Get the image tracker:
TrackerManager trackerManager = TrackerManager.getInstance();
ObjectTracker objectTracker = (ObjectTracker) trackerManager
.getTracker(ObjectTracker.getClassType());
if (objectTracker == null)
{
Log.d(
LOGTAG,
"Failed to load tracking data set because the ObjectTracker has not been initialized.");
return false;
}
// Create the data sets:
dataSetStonesAndChips = objectTracker.createDataSet();
if (dataSetStonesAndChips == null)
{
Log.d(LOGTAG, "Failed to create a new tracking data.");
return false;
}
// Load the data sets:
if (!dataSetStonesAndChips.load("StonesAndChips.xml",
STORAGE_TYPE.STORAGE_APPRESOURCE))
{
Log.d(LOGTAG, "Failed to load data set.");
return false;
}
// Activate the data set:
if (!objectTracker.activateDataSet(dataSetStonesAndChips))
{
Log.d(LOGTAG, "Failed to activate data set.");
return false;
}
Log.d(LOGTAG, "Successfully loaded and activated data set.");
return true;
}