MeasureComponent
Summary
2D Measures.
Constructor
MeasureComponent
Syntax
MeasureComponent
-
core
Summary
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_addOvertureIntersections
Syntax
_addOvertureIntersections
-
wall
-
intersections
Summary
Adds the overtures measures to the existing wall measures.
Parameters:
-
wall
WallStructureWall carrying the overtures.
-
intersections
BABYLON.Vector2Current wall measure
points
list.
_drawMeasureSlice
Syntax
Summary
Draws the measure of the distance between two points.
Parameters:
-
ctx
CanvasRenderingContext2D2D canvas context.
-
translation
BABYLON.Vector2The canvas translation.
-
zoom
NumberThe canvas zoom.
-
v1
BABYLON.Vector2Origin point.
-
v2
BABYLON.Vector2Ending point.
Returns:
The rounded value of the measure (in meters).
deleteMeasures
Syntax
deleteMeasures
-
measures
Summary
Duplicate measures are eliminated
Parameters:
-
measures
MeasureStructure[]Set of measures to merge.
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentdraw
Syntax
draw
-
ctx
-
translation
-
zoom
Summary
Draws all measures on the canvas.
Parameters:
-
ctx
CanvasRenderingContext2DThe 2D canvas context.
-
translation
BABYLON.Vector2The canvas translation.
-
zoom
NumberThe canvas zoom.
drawTmpWallMesure
Syntax
drawTmpWallMesure
-
ctx
-
translation
-
zoom
Summary
Draws the measure on the wall currently being drawn.
Parameters:
-
ctx
CanvasRenderingContext2D2D canvas context.
-
translation
BABYLON.Vector2The canvas translation.
-
zoom
NumberThe canvas zoom.
enable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.mergeMeasures
Syntax
mergeMeasures
-
measures
Summary
Merges the measures that can be merged (aligned and touching each other)
Parameters:
-
measures
MeasureStructure[]Set of measures to merge.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context