CloudSpatialAnchorSession 類別

  • java.lang.Object
    • java.lang.AutoCloseable
      • com.microsoft.azure.spatialanchors.CloudSpatialAnchorSession

public class CloudSpatialAnchorSession

使用此類別來建立、尋找及管理空間錨點。

建構函式摘要

建構函式 Description
CloudSpatialAnchorSession()

使用預設組態初始化新的實例。

方法摘要

修飾詞與類型 方法與描述
void addAnchorLocatedListener(AnchorLocatedListener listener)

新增指定的接聽程式以接收 AnchorLocated 事件。 發生于判斷錨點的位置時。

void addErrorListener(SessionErrorListener listener)

加入指定的接聽程式以接收 Error 事件。 發生于會話無法繼續處理時。

void addLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener)

新增指定的接聽程式以接收 LocateAnchorsCompleted 事件。 發生于處理尋找錨點之監看員的所有結果時。

void addOnLogDebugListener(OnLogDebugListener listener)

新增指定的接聽程式以接收 OnLogDebug 事件。 發生于產生偵錯記錄訊息時。

void addSessionUpdatedListener(SessionUpdatedListener listener)

新增指定的接聽程式以接收 SessionUpdated 事件。 發生于更新所有會話狀態時。

void addTokenRequiredListener(TokenRequiredListener listener)

新增指定的接聽程式以接收 TokenRequired 事件。 當會話需要更新的存取權杖或驗證權杖時發生。

void addUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener)

新增指定的接聽程式以接收 UpdatedSensorFingerprintRequired 事件。 當會話向應用程式要求更新的感應器指紋時發生。

void close()

關閉此資源。

Future createAnchorAsync(final CloudSpatialAnchor anchor)

從指定的本機錨點和字串屬性建立新的保存空間錨點。 傳遞至這個方法的本機錨點必須具有有效的轉換。 請注意 Azure Spatial Anchors 所支援的某些平臺,例如 iOS 允許具有縮放元件 != 1.0 的轉換。 Azure Spatial Anchors SDK 不支援這類轉換,而且無法建立具有 ErrorAnchorTransformRigidity 錯誤碼的空間錨點。 錨點的任何縮放處理都必須在應用程式層級完成。

CloudSpatialAnchorWatcher createWatcher(AnchorLocateCriteria criteria)

建立新的 物件,以監看符合指定準則的錨點。

Future deleteAnchorAsync(final CloudSpatialAnchor anchor)

刪除保存的空間錨點。

void finalize()

當垃圾收集判斷物件沒有其他參考時,由物件上的垃圾收集行程呼叫。

Future<String> getAccessTokenWithAccountKeyAsync(final String accountKey)

從帳戶金鑰取得 Azure Spatial Anchors 存取權杖。

Future<String> getAccessTokenWithAuthenticationTokenAsync(final String authenticationToken)

從驗證權杖取得 Azure Spatial Anchors 存取權杖。

List<CloudSpatialAnchorWatcher> getActiveWatchers()

取得使用中監看員的清單。

Future<CloudSpatialAnchor> getAnchorPropertiesAsync(final String identifier)

取得指定識別碼的雲端空間錨點,即使尚未找到。

SessionConfiguration getConfiguration()

取得會話的組態資訊。 組態設定會在會話啟動時生效。

CloudSpatialAnchorSessionDiagnostics getDiagnostics()

取得會話的診斷設定,可用來收集和提交資料以進行疑難排解和改善。

PlatformLocationProvider getLocationProvider()

用來使用 [Coarse Relocalization] 建立和尋找錨點的位置提供者 (https://aka.ms/CoarseRelocalization) 。

SessionLogLevel getLogLevel()

會話記錄事件的記錄層級。

Future<List<String>> getNearbyAnchorIdsAsync(final NearDeviceCriteria criteria)

取得對應至指定準則之所有鄰近雲端空間錨點識別碼的清單。

Session getSession()

取得用來協助尋找錨點的追蹤會話。 這個屬性無法在 HoloLens 平臺上使用。

String getSessionId()

取得工作階段的唯一識別項。

Future<SessionStatus> getSessionStatusAsync()

取得物件,描述會話的狀態。

boolean getTelemetryEnabled()
void processFrame(Frame frame)

應用程式必須在需要每個畫面格處理的平臺上呼叫這個方法。 這個方法無法在 HoloLens 平臺上使用。

Future refreshAnchorPropertiesAsync(final CloudSpatialAnchor anchor)

重新整理指定之空間錨點的屬性。

void removeAnchorLocatedListener(AnchorLocatedListener listener)

移除指定的接聽程式以接收 AnchorLocated 事件。 發生于判斷錨點的位置時。

void removeErrorListener(SessionErrorListener listener)

移除指定的接聽程式以接收錯誤事件。 發生于會話無法繼續處理時。

void removeLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener)

移除指定的接聽程式以接收 LocateAnchorsCompleted 事件。 發生于處理尋找錨點之監看員的所有結果時。

void removeOnLogDebugListener(OnLogDebugListener listener)

移除指定的接聽程式以接收 OnLogDebug 事件。 發生于產生偵錯記錄訊息時。

void removeSessionUpdatedListener(SessionUpdatedListener listener)

移除指定的接聽程式以接收 SessionUpdated 事件。 發生于更新所有會話狀態時。

void removeTokenRequiredListener(TokenRequiredListener listener)

移除指定的接聽程式以接收 TokenRequired 事件。 當會話需要更新的存取權杖或驗證權杖時發生。

void removeUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener)

移除指定的接聽程式以接收 UpdatedSensorFingerprintRequired 事件。 當會話向應用程式要求更新的感應器指紋時發生。

void reset()

重設在此會話中擷取的環境資料;應用程式必須在追蹤遺失時呼叫這個方法。 在任何平臺上,呼叫 方法將會清除所有內部快取狀態。

void setLocationProvider(PlatformLocationProvider value)

用來使用 [Coarse Relocalization] 建立和尋找錨點的位置提供者 (https://aka.ms/CoarseRelocalization) 。

void setLogLevel(SessionLogLevel value)

會話記錄事件的記錄層級。

void setSession(Session value)

設定用來協助尋找錨點的追蹤會話。 這個屬性無法在 HoloLens 平臺上使用。

void setTelemetryEnabled(boolean value)
void start()

開始擷取會話的環境資料。

void stop()

停止擷取會話的環境資料,並取消任何未完成的尋找作業。 環境資料會維護。

Future updateAnchorPropertiesAsync(final CloudSpatialAnchor anchor)

更新指定的空間錨點。

建構函式詳細資料

CloudSpatialAnchorSession

public CloudSpatialAnchorSession()

使用預設組態初始化新的實例。

方法詳細資料

addAnchorLocatedListener

public void addAnchorLocatedListener(AnchorLocatedListener listener)

新增指定的接聽程式以接收 AnchorLocated 事件。 發生于判斷錨點的位置時。

Parameters:

listener

addErrorListener

public void addErrorListener(SessionErrorListener listener)

加入指定的接聽程式以接收 Error 事件。 發生于會話無法繼續處理時。

Parameters:

listener

addLocateAnchorsCompletedListener

public void addLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener)

新增指定的接聽程式以接收 LocateAnchorsCompleted 事件。 發生于處理尋找錨點之監看員的所有結果時。

Parameters:

listener

addOnLogDebugListener

public void addOnLogDebugListener(OnLogDebugListener listener)

新增指定的接聽程式以接收 OnLogDebug 事件。 發生于產生偵錯記錄訊息時。

Parameters:

listener

addSessionUpdatedListener

public void addSessionUpdatedListener(SessionUpdatedListener listener)

新增指定的接聽程式以接收 SessionUpdated 事件。 發生于更新所有會話狀態時。

Parameters:

listener

addTokenRequiredListener

public void addTokenRequiredListener(TokenRequiredListener listener)

新增指定的接聽程式以接收 TokenRequired 事件。 當會話需要更新的存取權杖或驗證權杖時發生。

Parameters:

listener

addUpdatedSensorFingerprintRequiredListener

public void addUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener)

新增指定的接聽程式以接收 UpdatedSensorFingerprintRequired 事件。 當會話向應用程式要求更新的感應器指紋時發生。

Parameters:

listener

close

public void close()

關閉此資源。

createAnchorAsync

public Future createAnchorAsync(final CloudSpatialAnchor anchor)

從指定的本機錨點和字串屬性建立新的保存空間錨點。 傳遞至這個方法的本機錨點必須具有有效的轉換。 請注意 Azure Spatial Anchors 所支援的某些平臺,例如 iOS 允許具有縮放元件 != 1.0 的轉換。 Azure Spatial Anchors SDK 不支援這類轉換,而且無法建立具有 ErrorAnchorTransformRigidity 錯誤碼的空間錨點。 錨點的任何縮放處理都必須在應用程式層級完成。

Parameters:

anchor - 要保存的錨點。

createWatcher

public CloudSpatialAnchorWatcher createWatcher(AnchorLocateCriteria criteria)

建立新的 物件,以監看符合指定準則的錨點。

Parameters:

criteria - 要監看錨點的準則。

deleteAnchorAsync

public Future deleteAnchorAsync(final CloudSpatialAnchor anchor)

刪除保存的空間錨點。

Parameters:

anchor - 要刪除的錨點。

finalize

protected void finalize()

當垃圾收集判斷物件沒有其他參考時,由物件上的垃圾收集行程呼叫。

getAccessTokenWithAccountKeyAsync

public Future getAccessTokenWithAccountKeyAsync(final String accountKey)

從帳戶金鑰取得 Azure Spatial Anchors 存取權杖。

Parameters:

accountKey - 帳戶金鑰。

getAccessTokenWithAuthenticationTokenAsync

public Future getAccessTokenWithAuthenticationTokenAsync(final String authenticationToken)

從驗證權杖取得 Azure Spatial Anchors 存取權杖。

Parameters:

authenticationToken - 驗證權杖。

getActiveWatchers

public List getActiveWatchers()

取得使用中監看員的清單。

getAnchorPropertiesAsync

public Future getAnchorPropertiesAsync(final String identifier)

取得指定識別碼的雲端空間錨點,即使尚未找到。

Parameters:

identifier - 要尋找的識別碼。

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<>> getNearbyAnchorIdsAsync(final NearDeviceCriteria criteria)

取得對應至指定準則之所有鄰近雲端空間錨點識別碼的清單。

Parameters:

criteria - 搜尋準則。

getSession

public Session getSession()

取得用來協助尋找錨點的追蹤會話。 這個屬性無法在 HoloLens 平臺上使用。

getSessionId

public String getSessionId()

取得工作階段的唯一識別項。

getSessionStatusAsync

public Future getSessionStatusAsync()

取得物件,描述會話的狀態。

getTelemetryEnabled

public boolean getTelemetryEnabled()

processFrame

public void processFrame(Frame frame)

應用程式必須在需要每個畫面格處理的平臺上呼叫這個方法。 這個方法無法在 HoloLens 平臺上使用。

Parameters:

frame - 要處理的 AR 框架。

refreshAnchorPropertiesAsync

public Future refreshAnchorPropertiesAsync(final CloudSpatialAnchor anchor)

重新整理指定之空間錨點的屬性。

Parameters:

anchor - 要重新整理的錨點。

removeAnchorLocatedListener

public void removeAnchorLocatedListener(AnchorLocatedListener listener)

移除指定的接聽程式以接收 AnchorLocated 事件。 發生于判斷錨點的位置時。

Parameters:

listener

removeErrorListener

public void removeErrorListener(SessionErrorListener listener)

移除指定的接聽程式以接收錯誤事件。 發生于會話無法繼續處理時。

Parameters:

listener

removeLocateAnchorsCompletedListener

public void removeLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener)

移除指定的接聽程式以接收 LocateAnchorsCompleted 事件。 發生于處理尋找錨點之監看員的所有結果時。

Parameters:

listener

removeOnLogDebugListener

public void removeOnLogDebugListener(OnLogDebugListener listener)

移除指定的接聽程式以接收 OnLogDebug 事件。 發生于產生偵錯記錄訊息時。

Parameters:

listener

removeSessionUpdatedListener

public void removeSessionUpdatedListener(SessionUpdatedListener listener)

移除指定的接聽程式以接收 SessionUpdated 事件。 發生于更新所有會話狀態時。

Parameters:

listener

removeTokenRequiredListener

public void removeTokenRequiredListener(TokenRequiredListener listener)

移除指定的接聽程式以接收 TokenRequired 事件。 當會話需要更新的存取權杖或驗證權杖時發生。

Parameters:

listener

removeUpdatedSensorFingerprintRequiredListener

public void removeUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener)

移除指定的接聽程式以接收 UpdatedSensorFingerprintRequired 事件。 當會話向應用程式要求更新的感應器指紋時發生。

Parameters:

listener

reset

public void reset()

重設在此會話中擷取的環境資料;應用程式必須在追蹤遺失時呼叫這個方法。 在任何平臺上,呼叫 方法將會清除所有內部快取狀態。

setLocationProvider

public void setLocationProvider(PlatformLocationProvider value)

用來使用 [Coarse Relocalization] 建立和尋找錨點的位置提供者 (https://aka.ms/CoarseRelocalization) 。

Parameters:

value - 新值。

setLogLevel

public void setLogLevel(SessionLogLevel value)

會話記錄事件的記錄層級。

Parameters:

value - 新值。

setSession

public void setSession(Session value)

設定用來協助尋找錨點的追蹤會話。 這個屬性無法在 HoloLens 平臺上使用。

Parameters:

value - 新值。

setTelemetryEnabled

public void setTelemetryEnabled(boolean value)

Parameters:

value

start

public void start()

開始擷取會話的環境資料。

stop

public void stop()

停止擷取會話的環境資料,並取消任何未完成的尋找作業。 環境資料會維護。

updateAnchorPropertiesAsync

public Future updateAnchorPropertiesAsync(final CloudSpatialAnchor anchor)

更新指定的空間錨點。

Parameters:

anchor - 要更新的錨點。

適用於