Class Index | File Index

Classes


Class Arc


Defined in: primitives.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Arc(x, y, radius, startAngle, endAngle, direction, styleFlag)
Draws an arc.
Field Summary
Field Attributes Field Name and Description
 
An {Array} of QuadCurves used to draw the arc
 
Adding a reference to the end point makes the transform code hugely cleaner
 
End angle.
 
The end angle, in radians
 
The end Point
 
The center Point of the circle
<inner>  
Accuracy.
 
Object type used for JSON deserialization
 
The radius of the circle
 
Start angle.
 
The start angle, in radians
 
The start Point
 
The Style of the arc
 
The style flag - see contructor's arguments
Method Summary
Method Attributes Method Name and Description
 
 
contains(thex, they)
 
equals(anotherArc)
 
 
Get the points of the Arc
<static>  
Arc.load(o)
Creates a {Arc} out of JSON parsed object
<static>  
Arc.loadArray(v)
Creates a {Arc} out of an Array of JSON parsed object
 
near(thex, they, theradius)
 
paint(context)
 
 
As we simulate an arc by {QuadCurve}s so we will collect all of them and add it to a element.
 
transform(matrix)
Class Detail
Arc(x, y, radius, startAngle, endAngle, direction, styleFlag)
Draws an arc. To allow easy transformations of the arc we will simulate the arc by a series of curves
Parameters:
{Number} x
- the X coordinates of the "imaginary" circle of which the arc is part of
{Number} y
- the Y coordinates of the "imaginary" circle of which the arc is part of
{Number} radius
- the radius of the arc
{Number} startAngle
- the degrees (not radians as in Canvas'specs) of the starting angle for this arc
{Number} endAngle
- the degrees (not radians as in Canvas'specs) of the starting angle for this arc
{Number} direction
- the direction of drawing. For now it's from startAngle to endAngle (anticlockwise). Not really used
{Number} styleFlag
(optional) - 1: close path between start of arc and end, 2: draw pie slice, line to center point, line to start point default: empty/0/anything else: just draw the arc TODO: make it a class constant
See:
http://stackoverflow.com/questions/2688808/drawing-quadratic-bezier-circles-with-a-given-radius-how-to-determine-control-po
Field Detail
curves
An {Array} of QuadCurves used to draw the arc

direction
Adding a reference to the end point makes the transform code hugely cleaner

endAngle
End angle. Required for dashedArc

endAngleRadians
The end angle, in radians

endPoint
The end Point

middle
The center Point of the circle

<inner> numControlPoints
Accuracy. It tells the story of how many QuadCurves we will use

oType
Object type used for JSON deserialization

radius
The radius of the circle

startAngle
Start angle. required for dashedArc

startAngleRadians
The start angle, in radians

startPoint
The start Point

style
The Style of the arc

styleFlag
The style flag - see contructor's arguments
Method Detail
clone()

contains(thex, they)
Parameters:
thex
they

equals(anotherArc)
Parameters:
anotherArc

getBounds()

{Array} getPoints()
Get the points of the Arc
Author: Zack.
Returns:
{Array} of {Point}s

<static> {Arc} Arc.load(o)
Creates a {Arc} out of JSON parsed object
Author: Alex Gheorghiu .
Parameters:
{JSONObject} o
- the JSON parsed object
Returns:
{Arc} a newly constructed Arc

<static> {Array} Arc.loadArray(v)
Creates a {Arc} out of an Array of JSON parsed object
Author: Alex Gheorghiu .
Parameters:
{Array} v
- an {Array} of JSON parsed objects
Returns:
{Array} of newly constructed Arcs

near(thex, they, theradius)
Parameters:
thex
they
theradius

paint(context)
Parameters:
context

toString()

toSVG()
As we simulate an arc by {QuadCurve}s so we will collect all of them and add it to a element. Note: We might use the SVG's arc command but what if the arc got distorted by a transformation?
Author: Alex .
See:
http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands
http://tutorials.jenkov.com/svg/path-element.html

transform(matrix)
Parameters:
matrix

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jun 09 2011 12:47:25 GMT+0300 (EEST)