wnp.Symbols2D Class
Draw methods for standard 2D symbols
Constructor
wnp.Symbols2D
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_drawAllSymbols
-
ctx
Debug function to draw all symbols
Parameters:
-
ctx
CanvasRenderingContext2DThe canvas' context.
drawAngle
-
ctx
-
pos
-
[zoom=1]
-
radius
-
angle0
-
angle1
-
clockwise
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
-
ctx
-
point1
-
cp
-
point2
Draws an arc set by a control point.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
point1
ObjectPosition of the first point
{x: ?, y: ?}
. -
cp
ObjectPosition of the control point
{x: ?, y: ?}
. -
point2
ObjectPosition of the second point
{x: ?, y: ?}
.
drawArrows
-
ctx
-
pos
-
arrows
-
distance
-
angle
Draws arrows.
Parameters:
-
ctx
CanvasRenderingContext2DThe canvas' context.
-
pos
ObjectPosition
{x: ?, y: ?}
. -
arrows
ArrayList of arrows to draw [up, left, down, right]`.
-
distance
NumberDistance des flèches par rapport au centre définit par
pos
. -
angle
Number(optionnel) Rotation angle.
drawCancelGrip
-
ctx
-
pos
-
arrows
-
[angle=0]
Draws a grip with a cancel icon at the end.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
. -
arrows
ArrayList of arrows to draw [up, left, down, right]`.
-
[angle=0]
Number optionalRotation angle.
drawCheckGrip
-
ctx
-
pos
-
arrows
-
[angle=0]
Draws a grip with a check icon at the end.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
. -
arrows
ArrayList of arrows to draw [up, left, down, right]`.
-
[angle=0]
Number optionalRotation.
drawCursorCheck
-
ctx
-
pos
Draws a check icon.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
.
drawGrip
-
ctx
-
pos
-
arrows
-
[angle=0]
Draws a grip.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
. -
arrows
ArrayList of arrows to draw [up, left, down, right]`.
-
[angle=0]
Number optionalRotation.
drawGripSegment
-
ctx
-
point1
-
point2
-
arrows
-
arrows
-
[angle=0]
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
-
ctx
-
point1
-
point2
-
text
-
[color=wnp.Symbols2D.COLOR_ANNOTATION]
Draws a measure.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
point1
ObjectPosition of the first point
{x: ?, y: ?}
. -
point2
ObjectPosition of the second point
{x: ?, y: ?}
. -
text
StringText displayed at the center of the measure.
-
[color=wnp.Symbols2D.COLOR_ANNOTATION]
String optionalColor.
drawPoint
-
ctx
-
pos
Draws a simple point.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
.
drawPointHover
-
ctx
-
pos
-
[zoom=1]
Draws a point when it is hovered.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
pos
ObjectPosition
{x: ?, y: ?}
. -
[zoom=1]
Number optionalThe zoom level.
drawSegment
-
ctx
-
point1
-
point2
Draws a segment.
Parameters:
-
ctx
CanvasRenderingContext2DThe context.
-
point1
ObjectPosition of the first point
{x: ?, y: ?}
. -
point2
ObjectPosition of the second point
{x: ?, y: ?}
.