wnp.Symbols2D
Summary
Draw methods for standard 2D symbols
Constructor
wnp.Symbols2D
Syntax
wnp.Symbols2D
-
core
Summary
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_drawAllSymbols
Syntax
_drawAllSymbols
-
ctx
Summary
Debug function to draw all symbols
Parameters:
-
ctx
CanvasRenderingContext2DThe canvas' context.
drawAngle
Syntax
drawAngle
-
ctx
-
pos
-
[zoom=1]
-
radius
-
angle0
-
angle1
-
clockwise
Summary
Draws an angle.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
. -
[zoom=1]
Number optionalThe zoom level. Not taken into account for now.
-
radius
NumberRadius of the arc symbol.
-
angle0
NumberAngle 0, based on the x-axis.
-
angle1
NumberAngle 1, based on the x-axis.
-
clockwise
BooleanDirection 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:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{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:
-
ctx
CanvasRenderingContext2DThe context.
-
point1
ObjectPosition of the first point
{x: ?, y: ?}
. -
point2
ObjectPosition of the second point
{x: ?, y: ?}
. -
arrows
ArrayList of arrows to draw for the first grip [up, left, down, right]`.
-
arrows
ArrayList 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:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{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"