# 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 CameraController extension implementation.
# Accessors
activeMeasurement | enabled | options | selectedMeasurement |
---|
# Methods
removeMeasurement | clearMeasurements |
---|
# Typedefs
Measurement | MeasurementOptions | MeasurementType |
---|
# Constants
DefaultMeasurementsOptions |
---|
# Accessors
# activeMeasurement
get activeMeasurement(): Measurement
Gets the currently ongoing measurement. Null if there is none.
Returns: Measurement
# enabled
get enabled(): boolean
set enabled(value: boolean)
2
Enables/disables the extension.
Returns: boolean
# options
get options(): MeasurementOptions
set options(value: MeasurementOptions)
2
Gets and sets the extension options.
Returns: MeasurementOptions
# selectedMeasurement
get selectedMeasurement(): Measurement
Gets the currently selected measurement. Null if there is none.
Returns: Measurement
# Methods
# removeMeasurement
removeMeasurement(): void
Removes any currently ongoing measurements.
Returns: void
# clearMeasurements
clearMeasurements(): void
Removes all measurements, including finished or ongoing now.
Returns: void
# Typedefs
# Measurement
abstract class Measurement extends Object3D
Abstract class for all measurement types.
# MeasurementOptions
interface MeasurementOptions {
visible: boolean;
type?: MeasurementType;
vertexSnap?: boolean;
units?: string;
precision?: number;
}
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,
}
2
3
4
Measurement types.
Returns: void
# Constants
# DefaultMeasurementsOptions
const DefaultMeasurementsOptions = {
visible: true,
type: MeasurementType.POINTTOPOINT,
vertexSnap: true,
units: "m",
precision: 2,
};
2
3
4
5
6
7
The default extension options.