#include <DLLineShape.h>
Inheritance diagram for DLLineShape:
Public Member Functions | |
DLLineShape () | |
DLLineShape (const DLLineShape &orig) | |
const DLLineShape & | operator= (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. |
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.
DLLineShape::DLLineShape | ( | ) |
Default DLLineShape Constructor
DLLineShape::DLLineShape | ( | const DLLineShape & | orig | ) |
DLLineShape Copy Constructor
orig | DLLineShape to be copied |
Constructs a DLLineShape using its two endpoints.
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.
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.
const DLLineShape& DLLineShape::operator= | ( | const DLLineShape & | right | ) |
Assignment operator
right | DLLineShape to be copied |
void DLLineShape::dlDrawShape | ( | DLImage * | image | ) | [virtual] |
void DLLineShape::dlSetFirstPoint | ( | const DLPoint & | pt | ) |
Set Point 1
pt | first point of the line |
void DLLineShape::dlSetSecondPoint | ( | const DLPoint & | pt | ) |
Set Point 2
pt | point2 |
DLPoint DLLineShape::p1 [protected] |
DLPoint DLLineShape::p2 [protected] |