latest version v1.9 - last update 10 Apr 2010 |
Object for drawing lines and points in a lti::matrix with support for line and fill patterns. More...
#include <ltiPatternDraw.h>
Public Member Functions | |
patternDraw () | |
~patternDraw () | |
const char * | getTypeName () const |
void | line (const int fx, const int fy, const int tx, const int ty) |
void | verticalLine (const int x, const int y1, const int y2) |
void | horizontalLine (const int x1, const int x2, const int y) |
void | circle (const point &p1, const int r, const bool &filled=false) |
void | ellipse (const point &p1, const int aX, const int aY, const bool &filled=false) |
void | ellipse (const point &p1, const int aX, const int aY, const float &angle, const bool &filled=false) |
void | box (const int x1, const int y1, const int x2, const int y2, const bool &filled=false) |
virtual void | setLinePattern (const linePattern &pat) |
virtual void | setFillPattern (const fillPattern &pat) |
Protected Member Functions | |
void | setLineElement (const int x, const int y) |
void | setFillElement (const int x, const int y) |
void | setElement (const int x, const int y) |
Protected Attributes | |
int | pixcount |
bool | filling |
Object for drawing lines and points in a lti::matrix with support for line and fill patterns.
This means that drawing lines and filled areas is a little slower than the methods of the draw class.
lti::patternDraw< T >::patternDraw | ( | ) |
default constructor
lti::patternDraw< T >::~patternDraw | ( | ) |
destructor
void lti::patternDraw< T >::box | ( | const int | x1, | |
const int | y1, | |||
const int | x2, | |||
const int | y2, | |||
const bool & | filled = false | |||
) | [virtual] |
Draws a box.
Reimplemented from lti::draw< T >.
void lti::patternDraw< T >::circle | ( | const point & | p1, | |
const int | r, | |||
const bool & | filled = false | |||
) | [virtual] |
draw a circle with circle center 'p1' and radius 'r'
Reimplemented from lti::draw< T >.
void lti::patternDraw< T >::ellipse | ( | const point & | p1, | |
const int | aX, | |||
const int | aY, | |||
const float & | angle, | |||
const bool & | filled = false | |||
) | [virtual] |
draw an ellipse with center 'p1' and main axes 'aX' and 'aY'
Reimplemented from lti::draw< T >.
void lti::patternDraw< T >::ellipse | ( | const point & | p1, | |
const int | aX, | |||
const int | aY, | |||
const bool & | filled = false | |||
) | [virtual] |
draw an ellipse with center 'p1' and main axes 'aX' and 'aY'
Reimplemented from lti::draw< T >.
const char* lti::patternDraw< T >::getTypeName | ( | ) | const [virtual] |
get name of this type
Reimplemented from lti::draw< T >.
void lti::patternDraw< T >::horizontalLine | ( | const int | x1, | |
const int | x2, | |||
const int | y | |||
) | [virtual] |
Draws a horizontal line from (x1,y) to (x2,y).
Reimplemented from lti::draw< T >.
void lti::patternDraw< T >::line | ( | const int | fx, | |
const int | fy, | |||
const int | tx, | |||
const int | ty | |||
) | [virtual] |
Draw a line from the point (fx,fy) to point (tx,ty).
The "last point" will be defined with the last "set", "line" or "lineTo" method.
Reimplemented from lti::draw< T >.
void lti::patternDraw< T >::setElement | ( | const int | x, | |
const int | y | |||
) | [inline, protected] |
Sets a pixel accordings to the current fill or line pattern, depending on the value of filling.
void lti::patternDraw< T >::setFillElement | ( | const int | x, | |
const int | y | |||
) | [inline, protected] |
Set pixel at x,y in the color set by setColor; also considers the current fill pattern.
x | x-coordinate of the pixel to be set. | |
y | y-coordinate of the pixel to be set. |
virtual void lti::patternDraw< T >::setFillPattern | ( | const fillPattern & | pat | ) | [virtual] |
Sets the pattern for filling areas.
All subsequenly filled areas will be filled with the given pattern. The default pattern is a homogenouos fill.
pat | pattern for filling areas. |
Reimplemented from lti::drawBase< T >.
void lti::patternDraw< T >::setLineElement | ( | const int | x, | |
const int | y | |||
) | [inline, protected] |
Set pixel at x,y in the color set by setColor; also considers the current line pattern.
x | x-coordinate of the pixel to be set. | |
y | y-coordinate of the pixel to be set. |
virtual void lti::patternDraw< T >::setLinePattern | ( | const linePattern & | pat | ) | [virtual] |
Sets the pattern for drawing lines.
All subsequent lines will be drawn in the given pattern. The default is the continuous line.
pat | pattern for drawing lines. |
Reimplemented from lti::drawBase< T >.
void lti::patternDraw< T >::verticalLine | ( | const int | x, | |
const int | y1, | |||
const int | y2 | |||
) | [virtual] |
Draws a vertical line from (x1,y) to (x2,y).
Reimplemented from lti::draw< T >.
bool lti::patternDraw< T >::filling [protected] |
Flag which tells us if we are currently filling an area using 2D drawing primitives.
int lti::patternDraw< T >::pixcount [protected] |
The pixel count for drawing lines.