# MeasurementsTool

This extension provides basic configurable measurement capabilities. The tool is autonomous, and is able to create measurements on it's own.

WARNING

This extension requires and active ICameraProvider extension implementation.

#

Accessors

activeMeasurement enabled options selectedMeasurement

#

Methods

removeMeasurement clearMeasurements

#

Typedefs

Measurement MeasurementOptions MeasurementType

#

Constants

DefaultMeasurementsOptions

#

Accessors

# activeMeasurement

get activeMeasurement(): Measurement
1

Gets the currently ongoing measurement. Null if there is none.

Returns: Measurement

# enabled

get enabled(): boolean
set enabled(value: boolean)
1
2

Enables/disables the extension.

Returns: boolean

# options

get options(): MeasurementOptions
set options(value: MeasurementOptions)
1
2

Gets and sets the extension options.

Returns: MeasurementOptions

# selectedMeasurement

get selectedMeasurement(): Measurement
1

Gets the currently selected measurement. Null if there is none.

Returns: Measurement

#

Methods

# removeMeasurement

removeMeasurement(): void
1

Removes any currently ongoing measurements.

Returns: void

# clearMeasurements

clearMeasurements(): void
1

Removes all measurements, including finished or ongoing now.

Returns: void

#

Typedefs

# Measurement

abstract class Measurement extends Object3D
1

Abstract class for all measurement types.

# MeasurementOptions

interface MeasurementOptions {
  visible: boolean;
  type?: MeasurementType;
  vertexSnap?: boolean;
  units?: string;
  precision?: number;
}
1
2
3
4
5
6
7

The options for newly created measurements.

  • visible: If the measurements are visible
  • optional type: Current measurement type to create
  • optional vertexSnap: Should the cursor snap to the nearest vertex
  • optional units: The measurement units
  • optional precision: The number of decimals to be displayed

Returns: void

# MeasurementType

enum MeasurementType {
  PERPENDICULAR,
  POINTTOPOINT,
}
1
2
3
4

Measurement types.

Returns: void

#

Constants

# DefaultMeasurementsOptions

const DefaultMeasurementsOptions = {
  visible: true,
  type: MeasurementType.POINTTOPOINT,
  vertexSnap: true,
  units: "m",
  precision: 2,
};
1
2
3
4
5
6
7

The default extension options.