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