Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DistanceMeasurementsPlugin

Viewer plugin for measuring point-to-point distances.

Hierarchy

  • Plugin
    • DistanceMeasurementsPlugin

Index

Constructors

Properties

id: string

ID for this Plugin, unique within its Viewer.

viewer: Viewer

The Viewer that contains this Plugin.

Accessors

  • get control(): DistanceMeasurementsControl
  • get labelMinAxisLength(): number
  • set labelMinAxisLength(arg: number): void
  • get measurements(): {}

Methods

  • clear(): void
  • createMeasurement(params?: { axisVisible?: boolean; color?: string; id: string; origin: { entity: Entity; worldPos: number[] }; originVisible?: boolean; target: { entity: Entity; worldPos: number[] }; targetVisible?: boolean; visible?: boolean; wireVisible?: boolean }): DistanceMeasurement
  • Creates a {@link DistanceMeasurement}.

    The DistanceMeasurement is then registered by {@link DistanceMeasurement.id} in DistanceMeasurementsPlugin.measurements.

    Parameters

    • Optional params: { axisVisible?: boolean; color?: string; id: string; origin: { entity: Entity; worldPos: number[] }; originVisible?: boolean; target: { entity: Entity; worldPos: number[] }; targetVisible?: boolean; visible?: boolean; wireVisible?: boolean }

      {@link DistanceMeasurement} configuration.

      • Optional axisVisible?: boolean
      • Optional color?: string
      • id: string

        Unique ID to assign to {@link DistanceMeasurement.id}. The DistanceMeasurement will be registered by this in DistanceMeasurementsPlugin.measurements and {@link Scene.components}. Must be unique among all components in the Viewer.

      • origin: { entity: Entity; worldPos: number[] }
        • entity: Entity
        • worldPos: number[]
      • Optional originVisible?: boolean
      • target: { entity: Entity; worldPos: number[] }
        • entity: Entity
        • worldPos: number[]
      • Optional targetVisible?: boolean
      • Optional visible?: boolean
      • Optional wireVisible?: boolean

    Returns DistanceMeasurement

    The new {@link DistanceMeasurement}.

  • destroy(): void
  • destroyMeasurement(id: string): void
  • error(msg: string): void
  • Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • fire(event: string, value: any): void
  • Fires an event at this Plugin.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    Returns void

  • log(msg: string): void
  • Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • on(event: "measurementCreated", callback: (measurement: DistanceMeasurement) => void): void
  • on(event: "measurementDestroyed", callback: (measurement: DistanceMeasurement) => void): void
  • Fires when a measurement is created.

    Parameters

    • event: "measurementCreated"

      The measurementCreated event

    • callback: (measurement: DistanceMeasurement) => void

      Callback fired on the event

        • (measurement: DistanceMeasurement): void
        • Parameters

          • measurement: DistanceMeasurement

          Returns void

    Returns void

  • Fires when a measurement is destroyed.

    Parameters

    • event: "measurementDestroyed"

      The measurementDestroyed event

    • callback: (measurement: DistanceMeasurement) => void

      Callback fired on the event

        • (measurement: DistanceMeasurement): void
        • Parameters

          • measurement: DistanceMeasurement

          Returns void

    Returns void

  • warn(msg: string): void
  • Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

Generated using TypeDoc