tbx
0.7.3
|
Class to represent a dash pattern for lines. More...
#include <drawpath.h>
Public Member Functions | |
DrawDashPattern (int start, int *dashes, int count) | |
Construct a dash pattern from an array of dashes. More... | |
DrawDashPattern (int start, int dash=1, int count=2) | |
Construct a dash pattern initialised to equal sized dashes. More... | |
void | start (int value) |
Set the distance into the dash pattern of start. More... | |
int | start () const |
Get the distance into the dash pattern of start. More... | |
int | count () const |
Get the number of elements in the dash pattern. | |
int & | operator[] (int index) |
Get reference to a dash element. More... | |
int | operator[] (int index) const |
Get value of a dash element. More... | |
Friends | |
class | DrawPath |
Class to represent a dash pattern for lines.
Each element specifies a distance to draw in the present state. The pattern starts with the draw on, and alternates off and on for each successive element. If it reaches the end of the pattern while drawing the line, then it will restart at the beginning.
If the number of elements is odd, then the elements will alternate on or off with each pass through the pattern: so the first element will be on the first pass, off the second pass, on the third pass, and so on.
|
inline |
Construct a dash pattern from an array of dashes.
start | distance into dash pattern to start in user coordinates |
dashes | array of integers specify the length of each on/off. |
count | number of elements in the dash pattern |
|
inline |
Construct a dash pattern initialised to equal sized dashes.
start | distance into dash pattern to start in user coordinates |
dash | integer specifying the length of each on/off. Default 1. |
count | number of elements in the dash pattern. Default 2. |
|
inline |
Get reference to a dash element.
index | 0 based index of dash element |
|
inline |
Get value of a dash element.
index | 0 based index of dash element |
|
inline |
Set the distance into the dash pattern of start.
value | distance into the dash pattern of the start in user units |
|
inline |
Get the distance into the dash pattern of start.