// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.SpatialAwareness { public interface IMixedRealitySpatialAwarenessSystem : IMixedRealityEventSystem { /// /// Gets the parent object to which all spatial awareness GameObjects are to be parented. /// GameObject SpatialAwarenessObjectParent { get; } /// /// Creates the a parent, that is a child of the Spatial Awareness System parent so that the scene hierarchy does not get overly cluttered. /// /// /// The GameObject to which spatial awareness objects will be parented. /// /// /// This method is to be called by implementations of the interface, not by application code. It /// is used to enable observations to be grouped by observer. /// GameObject CreateSpatialAwarenessObservationParent(string name); /// /// Generates a new source identifier for an implementation. /// /// The source identifier to be used by the implementation. /// /// This method is to be called by implementations of the interface, not by application code. /// uint GenerateNewSourceId(); /// /// Typed representation of the ConfigurationProfile property. /// MixedRealitySpatialAwarenessSystemProfile SpatialAwarenessSystemProfile { get; } /// /// Gets the collection of registered data providers. /// /// /// Read only copy of the list of registered observers. /// [Obsolete("GetObservers will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProviders instead")] IReadOnlyList GetObservers(); /// /// Get the collection of registered observers of the specified type. /// /// The desired spatial awareness observer type (ex: ) /// /// Readonly copy of the list of registered observers that implement the specified type. /// [Obsolete("GetObservers will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProviders instead")] IReadOnlyList GetObservers() where T : IMixedRealitySpatialAwarenessObserver; /// /// Get the that is registered under the specified name. /// /// The friendly name of the observer. /// /// The requested observer, or null if one cannot be found. /// /// /// If more than one observer is registered under the specified name, the first will be returned. /// [Obsolete("GetObserver will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProvider instead")] IMixedRealitySpatialAwarenessObserver GetObserver(string name); /// /// Get the observer that is registered under the specified name matching the specified type. /// /// The desired spatial awareness observer type (ex: ) /// The friendly name of the observer. /// /// The requested observer, or null if one cannot be found. /// /// /// If more than one observer is registered under the specified name, the first will be returned. /// [Obsolete("GetObserver will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProvider instead")] T GetObserver(string name = null) where T : IMixedRealitySpatialAwarenessObserver; /// /// Starts / restarts all spatial observers of the specified type. /// void ResumeObservers(); /// /// Starts / restarts all spatial observers of the specified type. /// /// The desired spatial awareness observer type (ex: ) void ResumeObservers() where T : IMixedRealitySpatialAwarenessObserver; /// /// Starts / restarts the spatial observer registered under the specified name matching the specified type. /// /// The desired spatial awareness observer type (ex: ) /// The friendly name of the observer. void ResumeObserver(string name) where T : IMixedRealitySpatialAwarenessObserver; /// /// Stops / pauses all spatial observers. /// void SuspendObservers(); /// /// Stops / pauses all spatial observers of the specified type. /// void SuspendObservers() where T : IMixedRealitySpatialAwarenessObserver; /// /// Stops / pauses the spatial observer registered under the specified name matching the specified type. /// /// The desired spatial awareness observer type (ex: ) /// The friendly name of the observer. void SuspendObserver(string name) where T : IMixedRealitySpatialAwarenessObserver; /// /// Clears all registered observers' observations. /// void ClearObservations(); /// /// Clears the observations of the specified observer. /// /// The observer type. /// The name of the observer. void ClearObservations(string name = null) where T : IMixedRealitySpatialAwarenessObserver; } }