ScaleMeasurement
Class in @bimworks/viewer3d.
API catalogue · @bimworks/viewer3d · Class
class ScaleMeasurementThe two clicks of a drawing's scale (Measuring.startScaleMeasurement)
Inheritance and interfaces#
Members#
| Member | Kind | Description |
|---|---|---|
| constructor | Method | inheritedFrom: PathMeasurement.constructor |
| refused | Property | The last click that placed nothing, and why: on a model that is no drawing (vid null when it hit no model), or on another drawing than the first point's or t… |
| committedLength | Method | inheritedFrom: PathMeasurement.committedLength |
| constrain | Method | inheritedFrom: PathMeasurement.constrain |
| coordinate1 | Method | The first point in the measurement frame, a copy; null before it is placed |
| coordinate2 | Method | The second point in the measurement frame, a copy; null before it is placed |
| coordinates | Method | inheritedFrom: PathMeasurement.coordinates |
| editable | Method | Whether the points of this measurement can be dragged to a new position after it has been finalized (default true). Supported for area, path and point measur… |
| editable | Method | inheritedFrom: PathMeasurement.editable |
| editState | Method | The point being dragged (see editable): its index, whether it moved yet, and the measurement's value before the drag as its label shows it. Null when no poin… |
| finished | Method | inheritedFrom: PathMeasurement.finished |
| id | Method | Get the unique identifier of this measurement inheritedFrom: PathMeasurement.id |
| length | Method | inheritedFrom: PathMeasurement.length |
| normal | Method | inheritedFrom: PathMeasurement.normal |
| pointCount | Method | inheritedFrom: PathMeasurement.pointCount |
| snapsToVertices | Method | inheritedFrom: PathMeasurement.snapsToVertices |
| vid | Method | The drawing the points lie on; null before the first point |
| canFinish | Method | inheritedFrom: PathMeasurement.canFinish |
| getViewFitPoints | Method | inheritedFrom: PathMeasurement.getViewFitPoints |
| isHovered | Method | inheritedFrom: PathMeasurement.isHovered |
| isSelected | Method | inheritedFrom: PathMeasurement.isSelected |
| remove | Method | inheritedFrom: PathMeasurement.remove |
| undoPoint | Method | Remove the last placed point while this measurement is being taken, see Measuring.undoLastPoint inheritedFrom: PathMeasurement.undoPoint |
constructor#
constructor()inheritedFrom: PathMeasurement.constructor
refused#
public refused: { reason: "not-a-drawing" | "other-drawing"; vid: string | null } | nullThe last click that placed nothing, and why: on a model that is no drawing (vid null when it hit no model), or on another drawing than the first point's or the one asked for. null after a point is placed
committedLength#
public committedLength(): numberinheritedFrom: PathMeasurement.committedLength
Returns#
The length of the placed points in millimeters, without the segment that follows the cursor while measuring
constrain#
public constrain(): booleaninheritedFrom: PathMeasurement.constrain
Returns#
Whether this measure is constrained
coordinate1#
The first point in the measurement frame, a copy; null before it is placed
coordinate2#
The second point in the measurement frame, a copy; null before it is placed
coordinates#
inheritedFrom: PathMeasurement.coordinates
Returns#
An array of the coordinates of the path
editable#
public editable(): booleanWhether the points of this measurement can be dragged to a new position after it has been finalized (default true). Supported for area, path and point measurements, and for the laser, which is dragged as a whole by its instrument (a click on it selects it instead); the other types have no draggable points. The points show a pointer cursor on hover; while dragging, vertex snapping applies as during measuring (Shift temporarily disables it) and the label (area/length/position) is updated in realtime. Dropping the point fires the committed listener event, Escape cancels the drag
inheritedFrom: PathMeasurement.editable
editable#
public editable(editable: boolean): voidinheritedFrom: PathMeasurement.editable
Parameters#
| Name | Type | Description |
|---|---|---|
editable |
boolean |
editState#
public editState(): { index: number | null; moved: boolean; originalText: string | null } | nullThe point being dragged (see editable): its index, whether it moved yet, and the measurement's value before the drag as its label shows it. Null when no point is dragged. A right-click during the drag puts the point back, like Escape. For a laser, index is the beam end dragged along its beam (0-2 the ends along the axes, 3-5 those opposite), null while it moves as a whole by its instrument; originalText is null
inheritedFrom: PathMeasurement.editState
finished#
public finished(): booleaninheritedFrom: PathMeasurement.finished
Returns#
Whether this measurement is finished
id#
public id(): numberGet the unique identifier of this measurement
inheritedFrom: PathMeasurement.id
length#
public length(): numberinheritedFrom: PathMeasurement.length
Returns#
The total length of this measured path, always in millimeters
normal#
inheritedFrom: PathMeasurement.normal
Returns#
The normal of the first coordinate
pointCount#
public pointCount(): numberinheritedFrom: PathMeasurement.pointCount
Returns#
The points placed so far while this measurement is being taken (objects picked, for an object distance)
snapsToVertices#
public snapsToVertices(): booleaninheritedFrom: PathMeasurement.snapsToVertices
Returns#
Whether the points of this measurement snap to vertices and edges (point, length, area, angle)
vid#
public vid(): string | nullThe drawing the points lie on; null before the first point
canFinish#
public canFinish(): booleaninheritedFrom: PathMeasurement.canFinish
Returns#
Whether finish() would complete this measurement now (enough points for a length or an area)
getViewFitPoints#
inheritedFrom: PathMeasurement.getViewFitPoints
Returns#
The points (viewer measurement coordinates) a camera fit on this measurement encloses, or null when it has none yet
isHovered#
public isHovered(): booleaninheritedFrom: PathMeasurement.isHovered
Returns#
Whether this measurement is hovered
isSelected#
public isSelected(): booleaninheritedFrom: PathMeasurement.isSelected
Returns#
Whether this measurement is selected
remove#
public remove(): voidinheritedFrom: PathMeasurement.remove
Returns#
Remove this Measurement
undoPoint#
public undoPoint(): booleanRemove the last placed point while this measurement is being taken, see Measuring.undoLastPoint
inheritedFrom: PathMeasurement.undoPoint
Returns#
Whether a point was taken back