ShapeRenderer Class
Represent the Shape Renderer. It's used to calculate the shape ink rendering in HTML5 canvas
Constructor
ShapeRenderer
(
-
context
Parameters:
-
contextObject
Item Index
Methods
- _drawArrowHead
- _drawCharacter
- _drawEllipseArc
- _drawLine
- _drawRectangle
- _drawShapeEllipse
- _drawShapeLine
- _drawShapePrimitive
- _drawShapeRecognized
- _drawStroke
- _phi
- clear
- drawComponent
- drawComponents
- drawRecognitionResult
- drawShapeNotRecognized
- drawShapePrimitive
- drawShapes
- drawShapeSegment
- getShowBoundingBoxes
- setShowBoundingBoxes
Methods
_drawArrowHead
(
private
-
headPoint -
angle -
length -
context -
parameters
Draw an arrow head on context
Parameters:
-
headPointPoint -
angleNumber -
lengthNumber -
contextObjectThe canvas 2d context
-
parametersPenParameters
_drawCharacter
(
private
-
character -
context -
parameters
Draw character component
Parameters:
-
characterCharacterInputComponent -
contextObject -
parametersPenParameters
_drawEllipseArc
(
Point[]
private
-
centerPoint -
maxRadius -
minRadius -
orientation -
startAngle -
sweepAngle -
context -
parameters
Draw an ellipse arc on context
Parameters:
-
centerPointPoint -
maxRadiusNumber -
minRadiusNumber -
orientationString -
startAngleNumber -
sweepAngleNumber -
contextObjectThe canvas 2d context
-
parametersPenParameters
Returns:
_drawLine
(
private
-
p1 -
p2 -
context -
parameters
Draw a line on context
Parameters:
-
p1Point -
p2Point -
contextObjectThe canvas 2d context
-
parametersPenParameters
_drawRectangle
(
private
-
rectangle -
context -
parameters
Draw a rectangle on context
Parameters:
-
rectangleRectangle -
contextObject -
parametersPenParameters
_drawShapeEllipse
(
private
-
shapeEllipse -
context -
parameters
Draw shape ellipse
Parameters:
-
shapeEllipseShapeEllipse -
contextObject -
parametersPenParameters
_drawShapeLine
(
private
-
shapeLine -
context -
parameters
Draw shape line
Parameters:
-
shapeLineShapeLine -
contextObject -
parametersPenParameters
_drawShapePrimitive
(
private
-
primitive -
context -
parameters
Draw shape primitive
Parameters:
-
primitiveAbstractShapePrimitive -
contextObject -
parametersPenParameters
_drawShapeRecognized
(
private
-
shapeRecognized -
context -
parameters
This method allow you to draw recognized shape
Parameters:
-
shapeRecognizedShapeRecognized -
contextObject -
parametersPenParameters
_drawStroke
(
private
-
stroke -
context -
parameters
Draw stroke component
Parameters:
-
strokeStrokeComponent -
contextObject -
parametersPenParameters
_phi
(
Number
private
-
angle
Clamp an angle into the range [-PI, +PI]
Parameters:
-
angleNumber
Returns:
Number:
clear
()
Clear the recognition context
drawRecognitionResult
(
-
components -
document
Draw shape recognition result on HTML5 canvas
Parameters:
-
componentsAbstractComponent[] -
documentShapeDocument
drawShapeNotRecognized
(
-
components -
inkRanges
This method allow you to draw not recognized shape
Parameters:
-
componentsAbstractComponent[] -
inkRangesShapeInkRange[]
drawShapes
(
-
components -
shapes
Draw the shapes
Parameters:
-
componentsAbstractComponent[] -
shapesShapeSegment[]
drawShapeSegment
(
-
components -
segment
Draw shape segment
Parameters:
-
componentsAbstractComponent[] -
segmentShapeSegment
getShowBoundingBoxes
()
Boolean
This property is use to show or not show the bounding box
Returns:
Boolean:
setShowBoundingBoxes
(
-
showBoundingBoxes
Set the show state of bounding box
Parameters:
-
showBoundingBoxesBoolean
