Manual Reference Source
public class | source

Measure

Extends:

Tool → Measure

The base class for mersure tools.

Constructor Summary

Public Constructor
public

constructor(name: string, viewer: Viewer3D)

Method Summary

Public Methods
public

Delete all resources in the measure tool

public

Get the length unit

public

setEnabled(enabled: boolean)

Enable/Diable the measure tool.

public

Set the line color of the measure tool.

public

Enable/Disable snapping.

public

setUnit(unit: string)

Set the length unit

Inherited Summary

From class Tool
public

addInput(input: *)

Add input to the tool

public

Destroy the tool and release all internal resources

public
public

setEnabled(enabled: boolean)

Enable/Disable the tool

Public Constructors

public constructor(name: string, viewer: Viewer3D) source

Constructor of the Tool class

Override:

Tool#constructor

Params:

NameTypeAttributeDescription
name string
viewer Viewer3D

Public Methods

public destroy() source

Delete all resources in the measure tool

Override:

Tool#destroy

public getUnit(): string source

Get the length unit

Return:

string

Can be either 'm', 'cm', 'feet' and 'inches'

public setEnabled(enabled: boolean) source

Enable/Diable the measure tool.

Override:

Tool#setEnabled

Params:

NameTypeAttributeDescription
enabled boolean

True if you want to enable the measure tool.

public setLineColor(color: Array<number>) source

Set the line color of the measure tool.

Params:

NameTypeAttributeDescription
color Array<number>

[r, g, b]

public setSnappingEnabled(enabled: boolean) source

Enable/Disable snapping.

Params:

NameTypeAttributeDescription
enabled boolean

True if you want sanpping to be enabled.

public setUnit(unit: string) source

Set the length unit

Params:

NameTypeAttributeDescription
unit string

Can be either 'm', 'cm', 'feet' and 'inches'