DLShape Class Reference

Abstract base class for all shape types. More...

#include <DLShape.h>

Inheritance diagram for DLShape:

DLLineShape DLRectShape List of all members.

Constructors, Destructors & Operators

 DLShape ()
 DLShape (const DLShape &orig)
virtual ~DLShape ()
const DLShapeoperator= (const DLShape &right)

Public Types

enum  DLLineStyle { DL_SOLID, DL_DASH }

Public Member Functions

virtual void dlDrawShape (DLImage *image)=0
Set Methods
void dlSetLineColor (const DLColor &color)
void dlSetLineStyle (int thickness)
void dlSetLineThickness (int thickness)
void dlSetDashStyle (DLShape::DLLineStyle DashStyle)
void dlSetDashLength (int length)
void dlSetFillColor (const DLColor &color)
void dlSetFillOff ()
Get Methods
DLColor dlGetLineColor (void) const
int dlGetLineStyle (void) const
int dlGetLineThickness (void) const
DLShape::DLLineStyle dlGetDashStyle (void)
int dlGetDashLength (void)
DLColor dlGetFillColor (void)

Protected Attributes

DLColor lineColor
 line color
DLColor fillColor
 color used to fill shape when drawing
DLShape::DLLineStyle lineStyle
 line style: dashed or solid
int dashLength
 if dashed, length of dash
int lineThickness
 the thickness of the drawing line
bool fillShape

Detailed Description

Abstract base class for all shape types.

It provides the common functions/interfaces that all derived shape objects must implement.

Definition at line 26 of file DLShape.h.


Member Enumeration Documentation

enum DLShape::DLLineStyle

Line types: dashed or solid. This is used to indicate the type of line to use when drawing a shape.

Enumerator:
DL_SOLID 
DL_DASH 

Definition at line 35 of file DLShape.h.


Constructor & Destructor Documentation

DLShape::DLShape (  ) 

Default DLShape Constructor

DLShape::DLShape ( const DLShape orig  ) 

DLShape Copy Constructor

Parameters:
orig DLShape to be copied

virtual DLShape::~DLShape (  )  [inline, virtual]

Default DLShape Destructor

Definition at line 54 of file DLShape.h.


Member Function Documentation

const DLShape& DLShape::operator= ( const DLShape right  ) 

Assignment operator

Parameters:
right DLShape to be copied

void DLShape::dlSetLineColor ( const DLColor color  ) 

Set the line color for drawing a shape onto a DLImage.

Parameters:
color line color

void DLShape::dlSetLineStyle ( int  thickness  )  [inline]

Set the thickness of the line used when drawing the shape onto a DLImage.

Parameters:
thickness thickness of the line. Must be > 0
Deprecated:
Use DLShape::dlSetLineThickness instead
This is in Phase One of the Documented Deprecation Process

Definition at line 79 of file DLShape.h.

References DL_CRITICAL, and lineThickness.

void DLShape::dlSetLineThickness ( int  thickness  )  [inline]

Definition at line 85 of file DLShape.h.

References lineThickness.

void DLShape::dlSetDashStyle ( DLShape::DLLineStyle  DashStyle  )  [inline]

Set whether the line will be drawn solid or dashed.

Parameters:
DashStyle line style

Definition at line 90 of file DLShape.h.

References lineStyle.

void DLShape::dlSetDashLength ( int  length  )  [inline]

Set the length of the dashes and spaces when line is dashed. Default is 5

Parameters:
length 

Definition at line 96 of file DLShape.h.

References dashLength.

void DLShape::dlSetFillColor ( const DLColor color  ) 

Set the fill color for the shape object. The fill color is used to fill in the interior of the shape when drawn onto a DLImage.

Parameters:
color fill color

void DLShape::dlSetFillOff (  )  [inline]

Tell the shape to not fill itself. Turns off fillShape

Definition at line 109 of file DLShape.h.

References fillShape.

DLColor DLShape::dlGetLineColor ( void   )  const [inline]

Get line color

Returns:
Line color

Definition at line 119 of file DLShape.h.

References lineColor.

int DLShape::dlGetLineStyle ( void   )  const [inline]

Get line thickness

Returns:
line thickness
Deprecated:
Use DLShape::dlGetLineThickness instead
This is in Phase One of the Documented Deprecation Process

Definition at line 127 of file DLShape.h.

References DL_CRITICAL, and lineThickness.

int DLShape::dlGetLineThickness ( void   )  const [inline]

Get line thickness

Returns:
line thickness

Definition at line 136 of file DLShape.h.

References lineThickness.

DLShape::DLLineStyle DLShape::dlGetDashStyle ( void   )  [inline]

Get dash style

Returns:
DLLineStyle

Definition at line 141 of file DLShape.h.

References lineStyle.

int DLShape::dlGetDashLength ( void   )  [inline]

Get dash length

Returns:
int length

Definition at line 147 of file DLShape.h.

References dashLength.

DLColor DLShape::dlGetFillColor ( void   )  [inline]

Get fill color

Returns:
DLColor

Definition at line 153 of file DLShape.h.

References fillColor.

virtual void DLShape::dlDrawShape ( DLImage image  )  [pure virtual]

Draws the shape onto an image. Example:

 DLImage i("test.tif");
 DLRectShape box(5,5,30,50);
 box.dlDrawShape(&i);
Parameters:
image DLImage to draw onto

Implemented in DLLineShape, and DLRectShape.


Member Data Documentation

DLColor DLShape::lineColor [protected]

line color

Definition at line 170 of file DLShape.h.

Referenced by dlGetLineColor().

DLColor DLShape::fillColor [protected]

color used to fill shape when drawing

Definition at line 173 of file DLShape.h.

Referenced by dlGetFillColor().

DLShape::DLLineStyle DLShape::lineStyle [protected]

line style: dashed or solid

Definition at line 180 of file DLShape.h.

Referenced by dlGetDashStyle(), and dlSetDashStyle().

int DLShape::dashLength [protected]

if dashed, length of dash

Definition at line 183 of file DLShape.h.

Referenced by dlGetDashLength(), and dlSetDashLength().

int DLShape::lineThickness [protected]

the thickness of the drawing line

Definition at line 186 of file DLShape.h.

Referenced by dlGetLineStyle(), dlGetLineThickness(), dlSetLineStyle(), and dlSetLineThickness().

bool DLShape::fillShape [protected]

A flag to indicate to the draw function whether to fill in the shape with the color indicated by fillColor when drawing the shape.

Definition at line 192 of file DLShape.h.

Referenced by dlSetFillOff().


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

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007