MeasurementAPI#

Interface MeasurementAPI

These functions allow the creation of Measurements.

Example


// Get the context
const context : ContextAPI = webvis.getContext();

// Define a point target
const pointTarget : webvis.MeasurementTarget<MeasurementTargetClass.POINT> =
{
class: webvis.MeasurementTargetClass.POINT,
value: [ 0, 0, 0 ]
};

// Define a plane target
const planeTarget : webvis.MeasurementTarget<MeasurementTargetClass.PLANE> =
{
class: webvis.MeasurementTargetClass.PLANE,
value: [ 1, 0, 0, 1 ]
}

// Create a new single Measurement
const singleMeasurementID : number = context.createMeasurement(
webvis.MeasurementType.SINGLE,
[ pointTarget ],
{ enabled: true }
);

// Create a double Measurement between a point and a plane
const doubleMeasurementID : number = context.createMeasurement(
webvis.MeasurementType.MULTIPLE,
[ pointTarget, planeTarget ],
{ enabled: true }
);

Hierarchy

Methods

  • Changes one or more properties of a Measurement with the specified id.

    Parameters

    • measurementID: number

      The id of the Measurement you want to change.

    • properties: MeasurementProperties

      The properties of the Measurement you want change.

    Returns MeasurementProperties

    An Object with the changed Properties.

  • Creates a new Measurement.

    Type Parameters

    Parameters

    Returns number

    The ID of the created Measurement.

  • Returns number[]

    The IDs of all available Measurements.

  • Removes the Measurement from the scene and all related Snapshots.

    Parameters

    • measurementID: number
    • Optional safe: boolean

      Performs a safe remove which interrupt the removal process if the Measurement is part of one or more Snapshots.

    Returns RemoveState

  • Returns the MeasurementProperties for the specified Measurement id.

    Parameters

    • measurementID: number

      The id of the Measurement you want to request the data for.

    Returns Promise<MeasurementProperties>

    The requested Measurement properties.