GTK+ IOStream
Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
|
#include <CairoArrow.H>
Public Member Functions | |
CairoArrow (void) | |
CairoArrow (cairo_t *cr, float xBase, float yBase, float xPoint, float yPoint, float headToLengthRatio, float width, bool closed, bool filled) | |
void | draw (cairo_t *cr, float xBase, float yBase, float xPoint, float yPoint, float headToLengthRatio, float width, bool closed, bool filled) |
virtual | ~CairoArrow () |
Private Member Functions | |
void | findArrowHeadPoints (float xBase, float yBase, float xPoint, float yPoint, float headToLengthRatio, float width) |
Private Attributes | |
float | xSide1 |
float | xSide2 |
The arrow head side 1. More... | |
float | ySide1 |
float | ySide2 |
The arrow head side 2. More... | |
float | vecX |
float | vecY |
The shaft vector transposed to the origin. More... | |
Given a Cairo context, draw an arrow.
Arrows can be of three types, line arrows, closed head arrows and filled head arrows. The arrows are specified by a base (x,y) and point (x,y). The arrow head is specified by a fraction of the shaft size. The arrow head width is specified in pixels.
Definition at line 30 of file CairoArrow.H.
|
inline |
This constructor does nothing.
Allows instantiation and usage like so :
Definition at line 68 of file CairoArrow.H.
|
inline |
Construct an arrow by calculating the head points and then use cairo to stroke or fill.
The Cairo context which is passed in should already be configured for line width and colour. This medthod is good if you want to draw one arrow :
cr | The cairo context to draw in |
xBase | The x arrow shaft base ordinate |
yBase | The y arrow shaft base co-ordinate |
xPoint | The x arrow shaft point ordinate |
yPoint | The y arrow shaft point co-ordinate |
headToLengthRatio | The fraction of the shaft length to be taken up by the arrow head |
width | The width of the arrow |
closed | Close the arrow head (draw a triangle) |
filled | Fill the arrow head |
Definition at line 87 of file CairoArrow.H.
|
inlinevirtual |
Definition at line 125 of file CairoArrow.H.
|
inline |
Construct an arrow by calculating the head points and then use cairo to stroke or fill
The Cairo context which is passed in should already be configured for line width and colour
cr | The cairo context to draw in |
xBase | The x arrow shaft base ordinate |
yBase | The y arrow shaft base co-ordinate |
xPoint | The x arrow shaft point ordinate |
yPoint | The y arrow shaft point co-ordinate |
headToLengthRatio | The fraction of the shaft length to be taken up by the arrow head |
width | The width of the arrow |
closed | Close the arrow head (draw a triangle) |
filled | Fill the arrow head |
Definition at line 103 of file CairoArrow.H.
|
inlineprivate |
Given an arrow shaft, the width and ratio of the head, find the arrow head points.
The ratio is how much as a fraction of the shaft size should be consumed by the arrow head. The arrow head side points are derived using the orthogonal unit vector to the shaft vector.
xBase | The x arrow shaft base ordinate |
yBase | The y arrow shaft base co-ordinate |
xPoint | The x arrow shaft point ordinate |
yPoint | The y arrow shaft point co-ordinate |
headToLengthRatio | The fraction of the shaft length to be taken up by the arrow head |
width | The width of the arrow |
Definition at line 45 of file CairoArrow.H.
|
private |
Definition at line 33 of file CairoArrow.H.
|
private |
The shaft vector transposed to the origin.
Definition at line 33 of file CairoArrow.H.
|
private |
Definition at line 31 of file CairoArrow.H.
|
private |
The arrow head side 1.
Definition at line 31 of file CairoArrow.H.
|
private |
Definition at line 32 of file CairoArrow.H.
|
private |
The arrow head side 2.
Definition at line 32 of file CairoArrow.H.