CloudSpatialAnchorSession 類別
- java.
lang. Object - java.
lang. AutoCloseable - com.
microsoft. azure. spatialanchors. CloudSpatialAnchorSession
- com.
- java.
public class CloudSpatialAnchorSession
使用此類別來建立、尋找及管理空間錨點。
建構函式摘要
建構函式 | Description |
---|---|
CloudSpatialAnchorSession() |
使用預設組態初始化新的實例。 |
方法摘要
建構函式詳細資料
CloudSpatialAnchorSession
public CloudSpatialAnchorSession()
使用預設組態初始化新的實例。
方法詳細資料
addAnchorLocatedListener
public void addAnchorLocatedListener(AnchorLocatedListener listener)
新增指定的接聽程式以接收 AnchorLocated 事件。 發生于判斷錨點的位置時。
Parameters:
addErrorListener
public void addErrorListener(SessionErrorListener listener)
加入指定的接聽程式以接收 Error 事件。 發生于會話無法繼續處理時。
Parameters:
addLocateAnchorsCompletedListener
public void addLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener)
新增指定的接聽程式以接收 LocateAnchorsCompleted 事件。 發生于處理尋找錨點之監看員的所有結果時。
Parameters:
addOnLogDebugListener
public void addOnLogDebugListener(OnLogDebugListener listener)
新增指定的接聽程式以接收 OnLogDebug 事件。 發生于產生偵錯記錄訊息時。
Parameters:
addSessionUpdatedListener
public void addSessionUpdatedListener(SessionUpdatedListener listener)
新增指定的接聽程式以接收 SessionUpdated 事件。 發生于更新所有會話狀態時。
Parameters:
addTokenRequiredListener
public void addTokenRequiredListener(TokenRequiredListener listener)
新增指定的接聽程式以接收 TokenRequired 事件。 當會話需要更新的存取權杖或驗證權杖時發生。
Parameters:
addUpdatedSensorFingerprintRequiredListener
public void addUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener)
新增指定的接聽程式以接收 UpdatedSensorFingerprintRequired 事件。 當會話向應用程式要求更新的感應器指紋時發生。
Parameters:
close
public void close()
關閉此資源。
createAnchorAsync
public Future createAnchorAsync(final CloudSpatialAnchor anchor)
從指定的本機錨點和字串屬性建立新的保存空間錨點。 傳遞至這個方法的本機錨點必須具有有效的轉換。 請注意 Azure Spatial Anchors 所支援的某些平臺,例如 iOS 允許具有縮放元件 != 1.0 的轉換。 Azure Spatial Anchors SDK 不支援這類轉換,而且無法建立具有 ErrorAnchorTransformRigidity 錯誤碼的空間錨點。 錨點的任何縮放處理都必須在應用程式層級完成。
Parameters:
createWatcher
public CloudSpatialAnchorWatcher createWatcher(AnchorLocateCriteria criteria)
建立新的 物件,以監看符合指定準則的錨點。
Parameters:
deleteAnchorAsync
public Future deleteAnchorAsync(final CloudSpatialAnchor anchor)
刪除保存的空間錨點。
Parameters:
finalize
protected void finalize()
當垃圾收集判斷物件沒有其他參考時,由物件上的垃圾收集行程呼叫。
getAccessTokenWithAccountKeyAsync
public Future
從帳戶金鑰取得 Azure Spatial Anchors 存取權杖。
Parameters:
getAccessTokenWithAuthenticationTokenAsync
public Future
從驗證權杖取得 Azure Spatial Anchors 存取權杖。
Parameters:
getActiveWatchers
public List
取得使用中監看員的清單。
getAnchorPropertiesAsync
public Future
取得指定識別碼的雲端空間錨點,即使尚未找到。
Parameters:
getConfiguration
public SessionConfiguration getConfiguration()
取得會話的組態資訊。 組態設定會在會話啟動時生效。
getDiagnostics
public CloudSpatialAnchorSessionDiagnostics getDiagnostics()
取得會話的診斷設定,可用來收集和提交資料以進行疑難排解和改善。
getLocationProvider
public PlatformLocationProvider getLocationProvider()
用來使用 [Coarse Relocalization] 建立和尋找錨點的位置提供者 (https://aka.ms/CoarseRelocalization) 。
getLogLevel
public SessionLogLevel getLogLevel()
會話記錄事件的記錄層級。
getNearbyAnchorIdsAsync
public Future<>
取得對應至指定準則之所有鄰近雲端空間錨點識別碼的清單。
Parameters:
getSession
public Session getSession()
取得用來協助尋找錨點的追蹤會話。 這個屬性無法在 HoloLens 平臺上使用。
getSessionId
public String getSessionId()
取得工作階段的唯一識別項。
getSessionStatusAsync
public Future
取得物件,描述會話的狀態。
getTelemetryEnabled
public boolean getTelemetryEnabled()
processFrame
public void processFrame(Frame frame)
應用程式必須在需要每個畫面格處理的平臺上呼叫這個方法。 這個方法無法在 HoloLens 平臺上使用。
Parameters:
refreshAnchorPropertiesAsync
public Future refreshAnchorPropertiesAsync(final CloudSpatialAnchor anchor)
重新整理指定之空間錨點的屬性。
Parameters:
removeAnchorLocatedListener
public void removeAnchorLocatedListener(AnchorLocatedListener listener)
移除指定的接聽程式以接收 AnchorLocated 事件。 發生于判斷錨點的位置時。
Parameters:
removeErrorListener
public void removeErrorListener(SessionErrorListener listener)
移除指定的接聽程式以接收錯誤事件。 發生于會話無法繼續處理時。
Parameters:
removeLocateAnchorsCompletedListener
public void removeLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener)
移除指定的接聽程式以接收 LocateAnchorsCompleted 事件。 發生于處理尋找錨點之監看員的所有結果時。
Parameters:
removeOnLogDebugListener
public void removeOnLogDebugListener(OnLogDebugListener listener)
移除指定的接聽程式以接收 OnLogDebug 事件。 發生于產生偵錯記錄訊息時。
Parameters:
removeSessionUpdatedListener
public void removeSessionUpdatedListener(SessionUpdatedListener listener)
移除指定的接聽程式以接收 SessionUpdated 事件。 發生于更新所有會話狀態時。
Parameters:
removeTokenRequiredListener
public void removeTokenRequiredListener(TokenRequiredListener listener)
移除指定的接聽程式以接收 TokenRequired 事件。 當會話需要更新的存取權杖或驗證權杖時發生。
Parameters:
removeUpdatedSensorFingerprintRequiredListener
public void removeUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener)
移除指定的接聽程式以接收 UpdatedSensorFingerprintRequired 事件。 當會話向應用程式要求更新的感應器指紋時發生。
Parameters:
reset
public void reset()
重設在此會話中擷取的環境資料;應用程式必須在追蹤遺失時呼叫這個方法。 在任何平臺上,呼叫 方法將會清除所有內部快取狀態。
setLocationProvider
public void setLocationProvider(PlatformLocationProvider value)
用來使用 [Coarse Relocalization] 建立和尋找錨點的位置提供者 (https://aka.ms/CoarseRelocalization) 。
Parameters:
setLogLevel
public void setLogLevel(SessionLogLevel value)
會話記錄事件的記錄層級。
Parameters:
setSession
public void setSession(Session value)
設定用來協助尋找錨點的追蹤會話。 這個屬性無法在 HoloLens 平臺上使用。
Parameters:
setTelemetryEnabled
public void setTelemetryEnabled(boolean value)
Parameters:
start
public void start()
開始擷取會話的環境資料。
stop
public void stop()
停止擷取會話的環境資料,並取消任何未完成的尋找作業。 環境資料會維護。
updateAnchorPropertiesAsync
public Future updateAnchorPropertiesAsync(final CloudSpatialAnchor anchor)
更新指定的空間錨點。
Parameters: