@openhps/geospatial
    Preparing search index...

    Class SymbolicSpace<T>

    A symbolic space can be used to indicate an abstract space with a boundary. It is an extended ReferenceSpace with boundaries.

    A symbolic space is a ReferenceSpace, and is therefore not directly as a position. It indicates a symbolic space and provides several utilities. Both a hierarchical structure and graph connection can be used to connect symbolic spaces together.

    Creating a symbolic space requires a generic position type. This type indicates how the symbolic position should be interpreted.

    Optionally, the space can be initialized with a display name.

    const lobby = new SymbolicSpace<Absolute2DPosition>("Main lobby");
    const floor = new SymbolicSpace<Absolute2DPosition>("Floor 3");

    The parent space uses a wrapper for the ReferenceSpace.parentUID.

    lobby.parent = floor;
    

    In addition, the parent is also treated as the base reference space.

    Boundaries can be set of a symbolic space. Both 2D and 3D polygons are supported.

    // Triangle boundary
    lobby.setBounds([
    new Absolute2DPosition(2, 2),
    new Absolute2DPosition(5, 5),
    new Absolute2DPosition(8, 8)
    ]);

    Positioning of boundaries is always relative to the parent (i.e. if the floor shifts position, you do not have to change the lobby boundaries).

    Symbolic spaces provide several boundary utilities.

    lobby.isInside(new Absolute2DPosition(4, 4)); // true
    lobby.isInside(new Absolute2DPosition(1, 1)); // false

    The centroid is determined using the boundaries, this will be the position that is used.

    Converting an absolute position to a symbolic space does not provide a single result. Similar to geocoders, the results are sorted based on their probability.

    For this, we make use of the [[SymbolicSpaceService]]. This service acts as the data store for symbolic spaces.

    
    

    Converting a symbolic space to a position uses the centroid that is calculated from the boundaries.

    const object = new DataObject("mvdewync", "Maxim");
    const position = lobby.toPosition();

    Type Parameters

    • T extends AbsolutePosition

    Hierarchy (View Summary)

    Index
    centroid: AbsolutePosition
    connectedSpaces: Map<Vector3, string> = ...
    coordinates: Vector3[] = []
    createdTimestamp: number

    Created timestamp

    displayName: string

    Object display name

    origin: AbsolutePosition
    parentUID: string
    positionConstructor: new () => T
    priority: number = 0
    uid: string

    Object identifier

    Unique object identifier

    • get angularVelocity(): AngularVelocity

      Returns AngularVelocity

    • set angularVelocity(velocity: AngularVelocity): void

      Parameters

      • velocity: AngularVelocity

      Returns void

    • get linearVelocity(): LinearVelocity

      Returns LinearVelocity

    • set linearVelocity(velocity: LinearVelocity): void

      Parameters

      • velocity: LinearVelocity

      Returns void

    • get orientation(): Orientation

      Get the orientation of the object relative to the global reference space

      Returns Orientation

    • set orientation(orientation: Orientation): void

      Set the orientation of the object relative to the global reference space

      Parameters

      • orientation: Orientation

      Returns void

    • get position(): AbsolutePosition

      Get the current absolute position of the object relative to the global reference space

      Returns AbsolutePosition

      Absolute position of data object

    • set position(position: AbsolutePosition): void

      Set the current absolute position of the object relative to the global reference space

      Parameters

      • position: AbsolutePosition

      Returns void

    • get relativePositions(): RelativePosition<any, Unit>[]

      Get relative positions

      Returns RelativePosition<any, Unit>[]

      Array of relative positions

    • set relativePositions(relativePostions: RelativePosition<any, Unit>[]): void

      Parameters

      • relativePostions: RelativePosition<any, Unit>[]

      Returns void

    • get rotationQuaternion(): Quaternion

      Returns Quaternion

    • set rotationQuaternion(quaternion: Quaternion): void

      Parameters

      • quaternion: Quaternion

      Returns void

    • get scaleMatrix(): Matrix4

      Get the transformation matrix for scaling

      Returns Matrix4

      Transformation matrix

    • set scaleMatrix(matrix: Matrix4): void

      Parameters

      • matrix: Matrix4

      Returns void

    • get transformationMatrix(): Matrix4

      Returns Matrix4

    • set transformationMatrix(matrix: Matrix4): void

      Parameters

      • matrix: Matrix4

      Returns void

    • get translationMatrix(): Matrix4

      Returns Matrix4

    • set translationMatrix(matrix: Matrix4): void

      Parameters

      • matrix: Matrix4

      Returns void

    • get velocity(): Velocity

      Returns Velocity

    • set velocity(velocity: Velocity): void

      Parameters

      • velocity: Velocity

      Returns void

    • Add a relative position to this data object

      Parameters

      • relativePosition: RelativePosition<any>

        Relative position to add

      Returns this

      Data object instance

    • Bind the data object to a service

      Parameters

      • service: DataService<string, SymbolicSpace<T>>

        Service to bind it to

      Returns DataObjectBinding<SymbolicSpace<T>>

      Data object binding with a service

    • Clone the data object

      Type Parameters

      Parameters

      • OptionaldataType: Constructor<T>

        Data type to clone to

      Returns T

      Cloned data object

    • Get the current absolute position of the object

      Parameters

      • OptionalreferenceSpace: TransformationSpace

        Reference space to transform it to

      Returns AbsolutePosition

      Position of the data object

    • Get relative position of a specified object

      Parameters

      • referenceObjectUID: string

        Reference object identifier

      • Optionaltype: string

        Constructor type of the relative position

      Returns RelativePosition<any>

      Relative position to reference object

    • Get relative positions for a different target

      Parameters

      • OptionalreferenceObjectUID: string

        Reference object identifier

      Returns RelativePosition<any, Unit>[]

      Array of relative positions for the reference object

    • Parameters

      • referenceObjectUID: string

      Returns boolean

    • Check if a position lies within a symbolic location

      Parameters

      • position: AbsolutePosition

        Absolute position to check

      Returns boolean

      Point inside boundaries

    • Parameters

      • left: number
      • right: number
      • bottom: number
      • top: number
      • near: number
      • far: number

      Returns ReferenceSpace

    • Transform perspective

      Parameters

      • left: number

        Farthest left on the x-axis

      • right: number

        Farthest right on the x-axis

      • bottom: number

        Farthest down on the y-axis

      • top: number

        Farthest up on the y-axis

      • near: number

        Distance to the near clipping plane along the -Z axis

      • far: number

        Distance to the far clipping plane along the -Z axis

      Returns ReferenceSpace

      Reference space instance

    • Parameters

      • unit: LengthUnit

      Returns ReferenceSpace

    • Parameters

      • referenceObjectUID: string

      Returns void

    • Returns ReferenceSpace

    • Parameters

      • r: Quaternion

      Returns ReferenceSpace

    • Parameters

      • r: Euler

      Returns ReferenceSpace

    • Parameters

      • r: AxisAngle

      Returns ReferenceSpace

    • Parameters

      • r: { pitch: number; roll: number; unit?: AngleUnit; yaw: number }

      Returns ReferenceSpace

    • Parameters

      • r: { order?: EulerOrder; unit?: AngleUnit; x: number; y: number; z: number }

      Returns ReferenceSpace

    • Parameters

      • r: number[]

      Returns ReferenceSpace

    • Parameters

      • kX: number
      • kY: number
      • OptionalkZ: number

      Returns ReferenceSpace

    • Set a parent object to the data object

      Parameters

      • object: string | DataObject

        Data object or UID to add as parent

      Returns this

      instance

    • Set the current absolute position of the object

      Parameters

      • position: AbsolutePosition

        Position to set

      • OptionalreferenceSpace: TransformationSpace

        Reference space

      Returns this

      Data object instance

    • Set the unique identifier of this object

      Parameters

      • uid: string

        Unique Identifier

      Returns this

      Data object instance

    • Convert the symbolic space to GeoJSON

      Parameters

      • Optionalflat: boolean

        Flat GeoJSON

      Returns any

      GeoJSON

    • Transform a position

      Type Parameters

      • In extends AbsolutePosition
      • Out extends AbsolutePosition = In

      Parameters

      • position: In

        Position to transform

      • Optionaloptions: SpaceTransformationOptions

        Transformation options

      Returns Out

      Transformed position

    • Parameters

      • dX: number
      • dY: number
      • OptionaldZ: number

      Returns ReferenceSpace

    • Update parent reference spaces

      Parameters

      • service: DataService<string, SymbolicSpace<T>>

        Service to use for updating

      Returns Promise<void>

      Update promise

    • Create a reference space from another object

      Parameters

      • object: DataObject

        Reference space

      Returns ReferenceSpace