// This method updates the respective Trackable appearance (e.g. // aspect ratio and texture) with data set data. public override void ApplyDataSetAppearance() { // Prefabs should not be editable if (QCARUtilities.GetPrefabType(mTarget) == PrefabType.Prefab) { return; } IEditorCylinderTargetBehaviour ctb = (CylinderTargetBehaviour)mTarget; ConfigData.CylinderTargetData ctConfig; if (TrackableInDataSet(ctb.TrackableName, ctb.DataSetName)) { ConfigData dataSetData = ConfigDataManager.Instance.GetConfigData(ctb.DataSetName); dataSetData.GetCylinderTarget(ctb.TrackableName, out ctConfig); } else { // If the Trackable has been removed from the data set we reset it to default. ConfigData dataSetData = ConfigDataManager.Instance.GetConfigData(QCARUtilities.GlobalVars.DEFAULT_DATA_SET_NAME); dataSetData.GetCylinderTarget(QCARUtilities.GlobalVars.DEFAULT_TRACKABLE_NAME, out ctConfig); ctb.SetDataSetPath(QCARUtilities.GlobalVars.DEFAULT_DATA_SET_NAME); ctb.SetNameForTrackable(QCARUtilities.GlobalVars.DEFAULT_TRACKABLE_NAME); } //update geometry based on properties from dataset CylinderTargetEditor.UpdateAspectRatio(ctb, ctConfig); }
public override void ApplyDataSetProperties() { if (QCARUtilities.GetPrefabType(base.mTarget) != PrefabType.Prefab) { ConfigData.CylinderTargetData data; IEditorCylinderTargetBehaviour mTarget = (CylinderTargetAbstractBehaviour)base.mTarget; if (this.TrackableInDataSet(mTarget.TrackableName, mTarget.DataSetName)) { ConfigDataManager.Instance.GetConfigData(mTarget.DataSetName).GetCylinderTarget(mTarget.TrackableName, out data); } else { ConfigDataManager.Instance.GetConfigData("--- EMPTY ---").GetCylinderTarget("--- EMPTY ---", out data); mTarget.SetDataSetPath("--- EMPTY ---"); mTarget.SetNameForTrackable("--- EMPTY ---"); } CylinderTargetEditor.UpdateScale(mTarget, data.sideLength); } }