Extends the Vector class with support for generating polygons.
The VectorPolygon class provides support for three different types of vector:
To create a polyline, set the Closed field to false
.
To create a line, set the Closed field to false
and set only two points (X1,Y1) and (X2,Y2)
The VectorPolygon class consists of the following fields:
Access | Name | Type | Comment | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Closed | INT | If true , the polygon will be closed between the start and end points. | ||||||||||||||||
Set the Closed field to | ||||||||||||||||||
PathLength | INT | Calibrates the user agent's distance-along-a-path calculations with that of the author. | ||||||||||||||||
The author's computation of the total length of the path, in user units. This value is used to calibrate the user agent's own distance-along-a-path calculations with that of the author. The user agent will scale all distance-along-a-path computations by the ratio of PathLength to the user agent's own computed value for total path length. This feature potentially affects calculations for text on a path, motion animation and various stroke operations. | ||||||||||||||||||
Points | STRING | A series of (X,Y) coordinates that define the polygon. | ||||||||||||||||
The Points field can be set with a series of | ||||||||||||||||||
PointsArray | APTR [] | A series of numbered pairs that define the polygon. | ||||||||||||||||
The PointsArray field can be set with a VectorPoint array that defines the shape of a polygon. A minimum of two points is required for the shape to be valid. The VectorPoint structure consists of the following fields:
| ||||||||||||||||||
TotalPoints | INT | The total number of coordinates defined in the Points field. | ||||||||||||||||
TotalPoints is a read-only field value that reflects the total number of coordinates that have been set in the Points array. The minimum value is 2. | ||||||||||||||||||
X1 | DOUBLE | Defines the X coordinate of the first point. | ||||||||||||||||
This field defines the X coordinate of the first point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line. By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage. | ||||||||||||||||||
X2 | DOUBLE | Defines the X coordinate of the second point. | ||||||||||||||||
This field defines the X coordinate of the second point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line. By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage. | ||||||||||||||||||
Y1 | DOUBLE | Defines the Y coordinate of the first point. | ||||||||||||||||
This field defines the Y coordinate of the first point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line. By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage. | ||||||||||||||||||
Y2 | DOUBLE | Defines the Y coordinate of the second point. | ||||||||||||||||
This field defines the Y coordinate of the second point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line. By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage. |
Structure for the VectorPolygon PointsArray field.
Field | Type | Description |
---|---|---|
X | DOUBLE | The X coordinate of this point. |
Y | DOUBLE | The Y coordinate of this point. |
XScaled | UBYTE | TRUE if the X value is scaled to its viewport (between 0 and 1.0). |
YScaled | UBYTE | TRUE if the Y value is scaled to its viewport (between 0 and 1.0). |
Class Info | |
---|---|
ID | ID_VECTORPOLYGON |
Category | Graphics |
Include | modules/vectorpolygon.h |
Version | 1 |