MeasureHandler
Index
Constructors
constructor
Constructor
Parameters
_bimApi: BimApi
Returns MeasureHandler
Accessors
publicisLaserPreviewActive
true
if activateLaserPreview has been called.false
if not called or if either deactivateLaserPreview or dispose is called.Returns boolean
Methods
publicactivateLaserPreview
Creates and updates laser preview on canvas upon mouse move, by means of createOrUpdateLaserPreview.
Returns void
publicclear
Removes all measurements and deactivates laser preview. Also removes coordinate trackers for labels if present.
Returns void
publiccreateOrUpdateLaserPreview
Gets the pointer positions on screen and finds where the geometry is hit. From that intersection on the geometry it creates a preview laser measurement. This method can be run for every frame or activated using activateLaserPreview.
Returns undefined | Ray
publiccreateWallLaser
This method adds a visual measurement to viewer from a intersection on the geometry.
Parameters
id: unknown
String for identifying a unique measurement.
laserOrigin: Intersection
The origin position of the measurement, including surface normal to project ray for finding endpoint of distance to measure.
labelDistanceFromOrigin: number = 0.75
Value between 0 and 1 to describe in percent distance from origin along the ray to use as label coordinate anchor. Default 0.75 (75%).
optionalonLabelUpdate: LabelUpdateHandler
If this optional callback is provided it tracks the position calculated from labelDistanceFromOrigin and tells where the coordinate is in screen space.
Returns undefined | Ray
publicdeactivateLaserPreview
Deactivates and removes laser preview on canvas upon mouse move.
Returns void
publicdispose
Removes all measurements and deactivates laser preview. Also removes coordinate trackers for labels if present.
Returns void
publicremoveWallLaser
Removes a measurement by its ID.
Parameters
id: unknown
of measurement to be removed.
Returns boolean
true
if wall laser was removed. ´false´ if it did not exist.
Contains methods to add, remove and preview distance measurement.