#include <DLRectShape.h>
Inheritance diagram for DLRectShape:
Public Member Functions | |
DLRectShape () | |
DLRectShape (const DLRectShape &orig) | |
const DLRectShape & | operator= (const DLRectShape &right) |
DLRectShape (int x1, int y1, int w1, int h1) | |
DLRectShape (const DLZone &z) | |
DLRectShape (const DLPoint &upperleft, const DLPoint &lowerright) | |
virtual | ~DLRectShape () |
void | dlDrawShape (DLImage *image) |
int | dlGetX () const |
int | dlGetY () const |
int | dlGetWidth () const |
int | dlGetHeight () const |
void | dlSetX (int xPoint) |
void | dlSetY (int yPoint) |
void | dlSetHeight (int height) |
void | dlSetWidth (int width) |
Protected Attributes | |
int | x |
position of rectangle, X coordinate | |
int | y |
position of rectangle, Y coordinate | |
int | w |
width of rectangle | |
int | h |
height of rectangle |
DLRectShape is a shape object that represents a rectangle by a point (x,y) representing its origin, or upper-left corner, and its width and height. The DLRectShape object can also be used to draw a rectangle onto a DLImage with a desired line color and fill color.
Typical usage:
// load an image DLImage myImage("myfile.tif"); // define the point DLRectShape rect(1,1, 20,40); //Set the line and fill color to DL_BLANCHEDALMOND rect.dlSetLineColor(DLColor(DL_BLANCHEDALMOND)); rect.dlSetFillColor(DLColor(DL_BLANCHEDALMOND)); //Draws the rectangle onto a DLImage rect.dlDrawShape(&myImage);
Definition at line 31 of file DLRectShape.h.
DLRectShape::DLRectShape | ( | ) | [inline] |
Default DLRectShape constructor
Definition at line 38 of file DLRectShape.h.
DLRectShape::DLRectShape | ( | const DLRectShape & | orig | ) |
DLRectShape Copy Constructor
orig | DLRectShape to be copied |
DLRectShape::DLRectShape | ( | int | x1, | |
int | y1, | |||
int | w1, | |||
int | h1 | |||
) | [inline] |
DLRectShape constructor. It takes a point on the image for the rectangle origin, and width and height.
x1 | column, or x-coordinate of the point | |
y1 | row, or y-coordinate of the point | |
w1 | width of rectangle | |
h1 | height of rectangle |
Definition at line 59 of file DLRectShape.h.
DLRectShape::DLRectShape | ( | const DLZone & | z | ) | [inline] |
DLRectShape constructor. It takes a DLZone and will construct a drawable Rectangle shape based on the details of the DLZone
z | DLZone containing Recatangle Shape Information |
Definition at line 67 of file DLRectShape.h.
References DLZone::dlGetZoneHeight(), DLZone::dlGetZoneOrigin(), DLZone::dlGetZoneWidth(), h, w, DLPoint::x, x, DLPoint::y, and y.
DLRectShape constructor. It takes two DLPoints detailing the upperleft and lower right points of the Rectangle to be created
upperleft | DLPoint containing upperleft point of the DLRectShape | |
lowerright | DLPoint containing lowerright point of the DLRectShape |
Definition at line 81 of file DLRectShape.h.
References h, w, DLPoint::x, x, DLPoint::y, and y.
virtual DLRectShape::~DLRectShape | ( | ) | [inline, virtual] |
Default DLRectShape Destructor
Definition at line 92 of file DLRectShape.h.
const DLRectShape& DLRectShape::operator= | ( | const DLRectShape & | right | ) |
Assignment operator
right | DLRectShape to be copied |
void DLRectShape::dlDrawShape | ( | DLImage * | image | ) | [virtual] |
Draws the rectangle shape onto an image
image | image to draw onto, passed by pointer (see above code example) |
Implements DLShape.
int DLRectShape::dlGetX | ( | ) | const [inline] |
Get X
Definition at line 105 of file DLRectShape.h.
References x.
int DLRectShape::dlGetY | ( | ) | const [inline] |
Get Y
Definition at line 110 of file DLRectShape.h.
References y.
int DLRectShape::dlGetWidth | ( | ) | const [inline] |
Get Width
Definition at line 115 of file DLRectShape.h.
References w.
int DLRectShape::dlGetHeight | ( | ) | const [inline] |
Get Height
Definition at line 120 of file DLRectShape.h.
References h.
void DLRectShape::dlSetX | ( | int | xPoint | ) | [inline] |
Set rectangle's origin, or upper-left point.
xPoint | column, or x-coordinate of the rectangle's origin |
Definition at line 126 of file DLRectShape.h.
References x.
void DLRectShape::dlSetY | ( | int | yPoint | ) | [inline] |
Set rectangle's origin, or upper-left point.
yPoint | row, or y-coordinate of the rectangle's origin |
Definition at line 131 of file DLRectShape.h.
References y.
void DLRectShape::dlSetHeight | ( | int | height | ) | [inline] |
Set height
height | new height of rectangle |
Definition at line 136 of file DLRectShape.h.
References h.
void DLRectShape::dlSetWidth | ( | int | width | ) | [inline] |
int DLRectShape::x [protected] |
position of rectangle, X coordinate
Definition at line 141 of file DLRectShape.h.
Referenced by dlGetX(), DLRectShape(), and dlSetX().
int DLRectShape::y [protected] |
position of rectangle, Y coordinate
Definition at line 147 of file DLRectShape.h.
Referenced by dlGetY(), DLRectShape(), and dlSetY().
int DLRectShape::w [protected] |
width of rectangle
Definition at line 149 of file DLRectShape.h.
Referenced by dlGetWidth(), and DLRectShape().
int DLRectShape::h [protected] |
height of rectangle
Definition at line 151 of file DLRectShape.h.
Referenced by dlGetHeight(), DLRectShape(), and dlSetHeight().