LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::patternDraw< T > Class Template Reference

Object for drawing lines and points in a lti::matrix with support for line and fill patterns. More...

#include <ltiPatternDraw.h>

Inheritance diagram for lti::patternDraw< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::patternDraw< T >:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

template<class T>
class lti::patternDraw< T >

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.


Constructor & Destructor Documentation

template<class T >
lti::patternDraw< T >::patternDraw (  ) 

default constructor

template<class T >
lti::patternDraw< T >::~patternDraw (  ) 

destructor


Member Function Documentation

template<class T >
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 >.

template<class 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 >.

template<class 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 >.

template<class 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 >.

template<class T >
const char* lti::patternDraw< T >::getTypeName (  )  const [virtual]

get name of this type

Reimplemented from lti::draw< T >.

template<class 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 >.

template<class 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 >.

template<class 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.

template<class T >
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.

Parameters:
x x-coordinate of the pixel to be set.
y y-coordinate of the pixel to be set.
template<class T >
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.

Parameters:
pat pattern for filling areas.

Reimplemented from lti::drawBase< T >.

template<class 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.

Parameters:
x x-coordinate of the pixel to be set.
y y-coordinate of the pixel to be set.
template<class T >
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.

Parameters:
pat pattern for drawing lines.

Reimplemented from lti::drawBase< T >.

template<class 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 >.


Member Data Documentation

template<class T >
bool lti::patternDraw< T >::filling [protected]

Flag which tells us if we are currently filling an area using 2D drawing primitives.

template<class T >
int lti::patternDraw< T >::pixcount [protected]

The pixel count for drawing lines.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:40 2010 for LTI-Lib by Doxygen 1.6.1