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

lti::linePattern Class Reference

Line pattern class. More...

#include <ltiGraphicsPattern.h>

Inheritance diagram for lti::linePattern:
Inheritance graph
[legend]
Collaboration diagram for lti::linePattern:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 linePattern ()
 linePattern (const ivector &d, int o)
 linePattern (const linePattern &o)
virtual ~linePattern ()
virtual rectangle getBoundingBox () const
bool isSet (int i) const
void getDash (ivector &d, int &o) const
linePatterncopy (const linePattern &other)
linePatternoperator= (const linePattern &other)
virtual objectclone () const
virtual void clear ()
virtual bool write (ioHandler &handler, const bool complete=true) const
virtual bool read (ioHandler &handler, const bool complete=true)

Static Public Member Functions

static linePatterncreateDashed (int d)

Detailed Description

Line pattern class.

A line pattern is simply an array of T, encoding "on" and "off", and an offset, which determines the start. Example:

 int p1[4]={2,3,1,2};
 ivector p(4,p1);
 int offset=0;
 linePattern<int> pat(p,offset);

Then applying this pattern to a line drawing will result in the following line:

 **   *  **   *  **   *  ** ...

Constructor & Destructor Documentation

lti::linePattern::linePattern (  ) 

Default constructor.

Creates a pattern for a continous line.

lti::linePattern::linePattern ( const ivector d,
int  o 
)

Constructor.

Constructs a line pattern with the given dash intervals and the given offset.

Parameters:
d vector containing the dash definition
o the dash offset
lti::linePattern::linePattern ( const linePattern o  ) 

Copy constructor.

virtual lti::linePattern::~linePattern (  )  [virtual]

Destructor.


Member Function Documentation

virtual void lti::linePattern::clear (  )  [virtual]

Resets this pattern to its default state.

Implements lti::graphicsPattern.

virtual object* lti::linePattern::clone (  )  const [virtual]

create a clone of this pointList

Returns:
a pointer to a copy of this pointList

Implements lti::graphicsPattern.

linePattern& lti::linePattern::copy ( const linePattern other  ) 

assigment operator.

copy the contents of other in this object.

Parameters:
other the source pointList to be copied.

Reimplemented from lti::graphicsPattern.

Referenced by operator=().

static linePattern* lti::linePattern::createDashed ( int  d  )  [static]

This method returns a line pattern suitable for dashed lines.

Parameters:
d the width of the intervals.
virtual rectangle lti::linePattern::getBoundingBox (  )  const [virtual]

Returns the bounding box of this pattern.

This is not really useful except that the returned rectangle's width gives the length of one pattern.

Implements lti::graphicsPattern.

void lti::linePattern::getDash ( ivector d,
int &  o 
) const [inline]

Vector-oriented draw functors can use this method to obtain the dash definition.

Parameters:
d here the dash definition is returned
o will receive the offset of the pattern
bool lti::linePattern::isSet ( int  i  )  const [inline]

This is the main application function for pixel-base draw functors.

The method should be called with an argument denoting the number of pixel that is supposed to be drawn. The method then returns true if the pixel is permitted by the pattern, or not.

Parameters:
i the index of the pixel to be drawn.

References lti::genericVector< T >::at().

linePattern& lti::linePattern::operator= ( const linePattern other  )  [inline]

assigment operator (alias for copy(other)).

Parameters:
other the pointList to be copied
Returns:
a reference to the actual pointList

Reimplemented from lti::graphicsPattern.

References copy().

virtual bool lti::linePattern::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

read the pattern from the given ioHandler

Reimplemented from lti::graphicsPattern.

virtual bool lti::linePattern::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

write the pattern to the given ioHandler

Reimplemented from lti::graphicsPattern.


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

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