DLLineShape Class Reference

An object to represent a line segment. More...

#include <DLLineShape.h>

Inheritance diagram for DLLineShape:

DLShape List of all members.

Public Member Functions

 DLLineShape ()
 DLLineShape (const DLLineShape &orig)
const DLLineShapeoperator= (const DLLineShape &right)
 DLLineShape (const DLPoint &pp1, const DLPoint &pp2)
 DLLineShape (int x1, int y1, int x2, int y2)
virtual ~DLLineShape ()
void dlDrawShape (DLImage *image)
DLPoint dlGetFirstPoint () const
void dlSetFirstPoint (const DLPoint &pt)
DLPoint dlGetSecondPoint () const
void dlSetSecondPoint (const DLPoint &pt)

Protected Attributes

DLPoint p1
 First point.
DLPoint p2
 Second point.

Detailed Description

An object to represent a line segment.

DLLineShape is a shape object that represents a line by its two endpoints. The DLLineShape object can also be used to draw the line segment it represents onto a DLImage with a particular color.

Typical usage:

 // load an image
 DLImage myImage("myfile.tif");
 // define the point
 DLLineShape line(1,1, 20,40);
 //Set the line color
 line.dlSetLineColor(DLColor(DL_BLANCHEDALMOND));
 //Draws the line onto a DLImage
 line.dlDrawShape(&myImage);

Definition at line 29 of file DLLineShape.h.


Constructor & Destructor Documentation

DLLineShape::DLLineShape (  ) 

Default DLLineShape Constructor

DLLineShape::DLLineShape ( const DLLineShape orig  ) 

DLLineShape Copy Constructor

Parameters:
orig DLLineShape to be copied

DLLineShape::DLLineShape ( const DLPoint pp1,
const DLPoint pp2 
) [inline]

Constructs a DLLineShape using its two endpoints.

Parameters:
pp1 first point in the line
pp2 second point in the line

Definition at line 56 of file DLLineShape.h.

References p1, p2, DLPoint::x, and DLPoint::y.

DLLineShape::DLLineShape ( int  x1,
int  y1,
int  x2,
int  y2 
) [inline]

Constructs a DLLineShape using its two endpoints.

Parameters:
x1 column, or x-coordinate of first point
y1 row, or y-coordinate of first point
x2 column, or x-coordinate of second point
y2 row, or y-coordinate of second point

Definition at line 66 of file DLLineShape.h.

References p1, p2, DLPoint::x, and DLPoint::y.

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

Default DLLineShape Destructor

Definition at line 72 of file DLLineShape.h.


Member Function Documentation

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

Assignment operator

Parameters:
right DLLineShape to be copied

void DLLineShape::dlDrawShape ( DLImage image  )  [virtual]

Draws the line shape onto a DLImage

Parameters:
image DLImage to draw onto, passed by pointer (see above code example)

Implements DLShape.

DLPoint DLLineShape::dlGetFirstPoint (  )  const

Get the first point

Returns:
DLPoint

void DLLineShape::dlSetFirstPoint ( const DLPoint pt  ) 

Set Point 1

Parameters:
pt first point of the line

DLPoint DLLineShape::dlGetSecondPoint (  )  const

Get the second point

Returns:
DLPoint

void DLLineShape::dlSetSecondPoint ( const DLPoint pt  ) 

Set Point 2

Parameters:
pt point2


Member Data Documentation

DLPoint DLLineShape::p1 [protected]

First point.

Definition at line 107 of file DLLineShape.h.

Referenced by DLLineShape().

DLPoint DLLineShape::p2 [protected]

Second point.

Definition at line 109 of file DLLineShape.h.

Referenced by DLLineShape().


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