Class Rect2D is a rectangle representation.
More...
#include <primitives.h>
Public Member Functions |
| | Rect2D (double start_x=0.0, double start_y=0.0, double end_x=0.0, double end_y=0.0) |
| | Creates a new rectangle.
|
| | Rect2D (const Rect2D &primitive) |
| | Copy constructor.
|
| Rect2D & | operator= (const Rect2D &primitive) |
| | Assignment operator.
|
| virtual Type | get_type () const |
| | Type of the primitive.
|
| double | get_end_x () const |
| | Returns the x-Coordinate.
|
| double | get_end_y () const |
| | Returns the y-Coordinate.
|
| double | get_width () const |
| | Returns the width.
|
| double | get_height () const |
| | Returns the height.
|
| void | set_width (double width) |
| | Sets the width of the rect.
|
| void | set_height (double height) |
| | Sets the height of the rect.
|
| void | set_end (double x, double y) |
| | Sets the opposite position to the start point.
|
| virtual Primitive2D * | get_copy () |
| | Copies the current primitive.
|
Protected Attributes |
| double | dx |
| | Displacement of the rectangle.
|
| double | dy |
Detailed Description
Class Rect2D is a rectangle representation.
Constructor & Destructor Documentation
| crp::Rect2D::Rect2D |
( |
double |
start_x = 0.0, |
|
|
double |
start_y = 0.0, |
|
|
double |
end_x = 0.0, |
|
|
double |
end_y = 0.0 |
|
) |
| [inline] |
Creates a new rectangle.
- Parameters:
-
| start_x | X-Coordinate of the start point |
| start_y | Y-Coordinate of the start point |
| end_x | X-Coordinate of the end point |
| end_y | Y-Coordinate of the end point |
| crp::Rect2D::Rect2D |
( |
const Rect2D & |
primitive | ) |
[inline] |
Copy constructor.
- Parameters:
-
| primitive | Primitive to copy |
Member Function Documentation
| virtual Primitive2D* crp::Rect2D::get_copy |
( |
| ) |
[inline, virtual] |
Copies the current primitive.
- Returns:
- New copy of the current primitive
Implements crp::Primitive2D.
| double crp::Rect2D::get_end_x |
( |
| ) |
const [inline] |
Returns the x-Coordinate.
- Returns:
- x-Coordinate
| double crp::Rect2D::get_end_y |
( |
| ) |
const [inline] |
Returns the y-Coordinate.
- Returns:
- y-Coordinate
| double crp::Rect2D::get_height |
( |
| ) |
const [inline] |
| virtual Type crp::Rect2D::get_type |
( |
| ) |
const [inline, virtual] |
Type of the primitive.
- Returns:
- Type of the primitive
Implements crp::Primitive2D.
| double crp::Rect2D::get_width |
( |
| ) |
const [inline] |
| Rect2D& crp::Rect2D::operator= |
( |
const Rect2D & |
primitive | ) |
[inline] |
Assignment operator.
- Parameters:
-
| void crp::Rect2D::set_end |
( |
double |
x, |
|
|
double |
y |
|
) |
| [inline] |
Sets the opposite position to the start point.
- Parameters:
-
| x | New X-Coordinate |
| y | New Y-Coordinate |
| void crp::Rect2D::set_height |
( |
double |
height | ) |
[inline] |
Sets the height of the rect.
- Parameters:
-
| void crp::Rect2D::set_width |
( |
double |
width | ) |
[inline, virtual] |
Field Documentation
Displacement of the rectangle.
The documentation for this class was generated from the following file: