1.3 class arc

An arc object is a graphical object that represents part of an ellipse. An arc is a subclass of class joint and thus may have arrows at either end. Arcs may be used to construct piecharts as well as to display a bounded connection line.

The basic representation of an arc consists of

arc->position Position of the center
arc->size Width and height of the ellipse
arc->start_angle Degrees of starting angle
arc->size_angle Degrees of angle (> 0 and < 0)
arc->close Describes how the arc is closed

This basic specification is satisfactory for the specification of pie-charts. The method arc->points is useful for creating bounded lines from one point to another. The method arc->connect_angle is useful to relate two lines with an arc (like in and/or trees).

1.3.1 Instance variables

arc <- close: {none,pie_slice,chord}
Determines how the arc is closed and filled if arc->fill does not equal @nil.
none
Only the arc is visible
chord
The arc and a straight line from arc<-start to arc<-end are displayed
pie_slice
The arc and two start lines from arc<-start and arc<-end to arc<-position are displayed.
arc <- fill: colour|{foreground,background}*
Image used to fill the arc. When @nil, the arc is not filled. The behaviour of this method is dependent of the value of arc->close:

arc <- position: point
The arc->position describes the center of the ellipse the arc is part of.
arc <- size: size
The arc->size describes the width and height of the ellipse the arc is part of. Note that (currently) the axes of the ellipse are always horizontal and vertical.
arc <- size_angle: num
Describes the angle in degrees of the ellipse segment. Positive values are counter clockwise.
arc <- start_angle: num
Describes the starting angle of the arc in degrees. 0 degrees denotes 3 o'clock. Positive values are anti-clockwise.

The position of the starting point may be requested with arc<-start.

1.3.2 Send methods

arc ->compute:
Compute the graphical<-area from the principal representation. The graphical<-area is defined to be the bounding box of the arc.
arc ->connect_angle: line, line
Connect two lines with an arc. The arc->position of the arc will be located are the line<-intersection of the two lines. The arc<-start_angle will make the arc start at the first line. The arc<-size_angle will connect it to the second line.

This method may be used to paint and/or trees.

arc ->end_angle: num
@see arc->start_angle
arc ->geometry: x=[int], y=[int], width=[int], height=[int]
Only the X and Y parameters are used to move the arc.
arc ->initialise: radius=[int], start=[num], size=[num]
Create an arc from its radius (setting arc->size), arc->start_angle and arc->size_angle. Both angles are in degrees and measured counter-clockwise.

The default radius is determined by arc.radius. The default arc->start_angle is 0 and the default arc->size_angle is 90.

arc ->points: start_x=int, start_y=int, end_x=int, end_y=int, curvature=int
Create a bounded connection between two points. The first 4 integers describe x1,y1 and x2, y2. The last value specifies the number of pixels the line is bounded.
arc ->radius: int
Specifies both graphical->width and graphical->height.
arc ->start_angle: num
@see arc->end_angle

1.3.3 Get methods

arc <-end: -> point
End-point of the arc.
arc <-radius: -> int
Equivalent to graphical<-width

Bugs: Not properly defined if graphical<-width is not equal to graphical<-height

arc <-start: -> point
Start position of the arc.