ContRap-Libraries
Public Member Functions | Protected Attributes

crp::Line2D Class Reference

Class Line2D is a line representation. More...

#include <primitives.h>

Inheritance diagram for crp::Line2D:
crp::Primitive2D

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.
Line2Doperator= (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 Primitive2Dget_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_xX-Coordinate of the start point
start_yY-Coordinate of the start point
end_xX-Coordinate of the end point
end_yY-Coordinate of the end point
virtual crp::Line2D::~Line2D ( ) [inline, virtual]

Destructor.

crp::Line2D::Line2D ( const Line2D primitive) [inline]

Copy constructor.

Parameters:
primitivePrimitive 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:
primitiveObject to assign
void crp::Line2D::set_end ( double  x,
double  y 
) [inline]

Sets the end position of the line.

Parameters:
xNew X-Coordinate
yNew Y-Coordinate

Field Documentation

double crp::Line2D::dx [protected]

Displacement of the line.

double crp::Line2D::dy [protected]

The documentation for this class was generated from the following file: