Class SpacePinBinder
Implementation of the IBinder interface, managing the relationship between space pins and cloud anchors.
Implements
Namespace: Microsoft.MixedReality.WorldLocking.ASA
Assembly: cs.temp.dll.dll
Syntax
public class SpacePinBinder : MonoBehaviour, IBinder
Fields
SpacePinIdKey
The key for the key-value pair in the space pin/cloud anchor properties identifying the space pin id in the value.
Declaration
public static readonly string SpacePinIdKey
Field Value
| Type | Description |
|---|---|
| String |
Properties
IsReady
If the binder is ready to execute tasks.
Declaration
public bool IsReady { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Remarks
Reasons not be be ready include initialization not complete, or already busy on another task.
Name
The name of this binder.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
PublisherStatus
The current status of the publisher.
Declaration
public ReadinessStatus PublisherStatus { get; }
Property Value
| Type | Description |
|---|---|
| ReadinessStatus |
SearchRadius
Distance (roughly) to search from device when looking for cloud anchors using coarse relocation.
Declaration
public float SearchRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
SpacePins
Declaration
public IReadOnlyCollection<SpacePinASA> SpacePins { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<SpacePinASA> |
Methods
AddSpacePin(SpacePinASA)
Add a space pin to the list of managed pins.
Declaration
public bool AddSpacePin(SpacePinASA spacePin)
Parameters
| Type | Name | Description |
|---|---|---|
| SpacePinASA | spacePin | Pin to add. |
Returns
| Type | Description |
|---|---|
| Boolean | True if not already there but added. |
Clear()
Delete all known (bound) cloud anchors from the cloud, and erase their bindings.
Declaration
public async Task<bool> Clear()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True on success. |
Remarks
Bound space pins are unaffected, but will no longer be bound.
CreateBinding(String, String)
Set the cloud anchor id associated with this space pin.
Declaration
public bool CreateBinding(string spacePinId, string cloudAnchorId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | spacePinId | Name of the space pin to be bound to this cloud id. |
| String | cloudAnchorId | Cloud id to be bound to the space pin. |
Returns
| Type | Description |
|---|---|
| Boolean | False if space pin is unknown. Space pin must be registered before being bound. |
Remarks
A space pin must be bound to a cloud anchor id before it can be downloaded.
Download()
Pull down cloud anchors for all known bindings, and apply them to the bound space pins.
Declaration
public async Task<bool> Download()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True on success. |
GetBindings()
Known bindings between space pins and cloud anchors.
Declaration
public IReadOnlyList<SpacePinCloudBinding> GetBindings()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<SpacePinCloudBinding> |
Publish()
Publish all active space pins to the cloud.
Declaration
public async Task<bool> Publish()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True on success. |
Remarks
Space pins which are previously published in this session, i.e. that have a binding to a cloud anchor, will have that cloud anchor deleted first, and a new binding created to the newly published cloud anchor. To be publishable, a SpacePin must have an ILocalPeg created from CreateLocalPeg(String, Pose). The SpacePinASA manages this automatically.
Publish(SpacePinASA)
Publish the spacePin.
Declaration
public async Task<bool> Publish(SpacePinASA spacePin)
Parameters
| Type | Name | Description |
|---|---|---|
| SpacePinASA | spacePin | SpacePinASA to publish |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True on success. |
Remarks
It may be this should be a private member.
Purge()
Find all cloud anchors in the area, delete them, and release their bindings.
Declaration
public async Task<bool> Purge()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True on success. |
RemoveBinding(String)
Erase a binding between a space pin and its corresponding cloud anchor.
Declaration
public bool RemoveBinding(string spacePinId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | spacePinId | Space pin to unbind. |
Returns
| Type | Description |
|---|---|
| Boolean | True if found and unbound. |
Remarks
Neither the space pin nor the cloud anchor are affected by this, but will be independent of one another after.
RemoveSpacePin(String)
Remove the space pin binding associated with this SpacePin.
Declaration
public bool RemoveSpacePin(string spacePinId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | spacePinId | Space pin id of binding to remove. |
Returns
| Type | Description |
|---|---|
| Boolean | True if found and removed. |
Remarks
Any binding between this pin and a cloud anchor is also severed.
Search()
Search for cloud anchors in the area, download them, and apply to associated space pins.
Declaration
public async Task<bool> Search()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True on success |
UnPin()
Declaration
public void UnPin()