wnp.Symbols2D
Summary
Draw methods for standard 2D symbols
Constructor
wnp.Symbols2D
Syntax
wnp.Symbols2D
-
core
Summary
Parameters:
-
coreCoreThe main engine.
Item Index
Methods
Methods
_drawAllSymbols
Syntax
_drawAllSymbols
-
ctx
Summary
Debug function to draw all symbols
Parameters:
-
ctxCanvasRenderingContext2DThe canvas' context.
drawAngle
Syntax
drawAngle
-
ctx -
pos -
[zoom=1] -
radius -
angle0 -
angle1 -
clockwise
Summary
Draws an angle.
Parameters:
-
ctxCanvasRenderingContext2DThe context.
-
posObjectPosition
{x: ?, y: ?}. -
[zoom=1]Number optionalThe zoom level. Not taken into account for now.
-
radiusNumberRadius of the arc symbol.
-
angle0NumberAngle 0, based on the x-axis.
-
angle1NumberAngle 1, based on the x-axis.
-
clockwiseBooleanDirection of the arc.
drawArc
Syntax
drawArc
-
ctx -
point1 -
cp -
point2
Summary
Draws an arc set by a control point.
drawArrows
Syntax
drawArrows
-
ctx -
pos -
arrows -
distance -
angle
Summary
Draws arrows.
drawCancelGrip
Syntax
drawCancelGrip
-
ctx -
pos -
arrows -
[angle=0]
Summary
Draws a grip with a cancel icon at the end.
drawCheckGrip
Syntax
drawCheckGrip
-
ctx -
pos -
arrows -
[angle=0]
Summary
Draws a grip with a check icon at the end.
drawCursorCheck
Syntax
drawCursorCheck
-
ctx -
pos
Summary
Draws a check icon.
Parameters:
-
ctxCanvasRenderingContext2DThe context.
-
posObjectPosition
{x: ?, y: ?}.
drawGrip
Syntax
drawGrip
-
ctx -
pos -
arrows -
[angle=0]
Summary
Draws a grip.
drawGripSegment
Syntax
drawGripSegment
-
ctx -
point1 -
point2 -
arrows -
arrows -
[angle=0]
Summary
Draws a segment with grips.
Parameters:
-
ctxCanvasRenderingContext2DThe context.
-
point1ObjectPosition of the first point
{x: ?, y: ?}. -
point2ObjectPosition of the second point
{x: ?, y: ?}. -
arrowsArrayList of arrows to draw for the first grip [up, left, down, right]`.
-
arrowsArrayList of arrows to draw for the second grip [up, left, down, right]`.
-
[angle=0]Number optionalRotation.
drawMeasure
Syntax
drawMeasure
-
ctx -
point1 -
point2 -
text -
[color=wnp.Symbols2D.COLOR_ANNOTATION]
Summary
Draws a measure.
drawPoint
Syntax
drawPoint
-
ctx -
pos
Summary
Draws a simple point.
Parameters:
-
ctxCanvasRenderingContext2DThe context.
-
posObjectPosition
{x: ?, y: ?}.
drawPointHover
Syntax
drawPointHover
-
ctx -
pos -
[zoom=1]
Summary
Draws a point when it is hovered.
Properties
COLOR_ACTIVE_FILL
Syntax
COLOR_ACTIVE_FILL
String
Summary
COLOR_ACTIVE_FILL
Default: "rgba(137, 184, 8, 0.2)"
COLOR_ACTIVE_LARGEZONE_FILL
Syntax
COLOR_ACTIVE_LARGEZONE_FILL
String
Summary
COLOR_ACTIVE_LARGEZONE_FILL
Default: "rgba(137, 137, 137, 0.5)"
COLOR_ACTIVE_STROKE
Syntax
COLOR_ACTIVE_STROKE
String
Summary
COLOR_ACTIVE_STROKE
Default: "#89B808"
COLOR_ACTIVE_STROKE_DARKER
Syntax
COLOR_ACTIVE_STROKE_DARKER
String
Summary
COLOR_ACTIVE_STROKE_DARKER
Default: "#6C9104"
COLOR_INACTIVE_FILL
Syntax
COLOR_INACTIVE_FILL
String
Summary
COLOR_INACTIVE_FILL
Default: "rgba(90, 119, 119, 0.1)"
COLOR_INACTIVE_STROKE
Syntax
COLOR_INACTIVE_STROKE
String
Summary
COLOR_INACTIVE_STROKE
Default: "#777777"