ContRap-Libraries
Public Types | Public Member Functions | Protected Attributes

crp::Text2D Class Reference

Class Text2D represents a line of text. More...

#include <primitives.h>

Inheritance diagram for crp::Text2D:
crp::Primitive2D

Public Types

enum  Alignment { LEFT, CENTER, RIGHT }
 

Text alignment.

More...

Public Member Functions

 Text2D (double x=0.0, double y=0.0, const std::string &text="")
 Creates a new text.
virtual ~Text2D ()
 Destructor.
 Text2D (const Text2D &primitive)
 Copy constructor.
Text2Doperator= (const Text2D &primitive)
 Assignment operator.
virtual Type get_type () const
 Type of the primitive.
void set_alignment (Alignment alignment)
 Sets the text alignment.
Alignment get_alignment ()
 Returns the alignment.
virtual Primitive2Dget_copy ()
 Copies the current primitive.

Protected Attributes

Alignment alignment
 Text alignment.

Detailed Description

Class Text2D represents a line of text.


Member Enumeration Documentation

Text alignment.

Enumerator:
LEFT 
CENTER 
RIGHT 

Constructor & Destructor Documentation

crp::Text2D::Text2D ( double  x = 0.0,
double  y = 0.0,
const std::string &  text = "" 
) [inline]

Creates a new text.

Parameters:
xX-Coordinate
yY-Coordinate
textText to display
virtual crp::Text2D::~Text2D ( ) [inline, virtual]

Destructor.

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

Copy constructor.

Parameters:
primitivePrimitive to copy

Member Function Documentation

Alignment crp::Text2D::get_alignment ( ) [inline]

Returns the alignment.

Returns:
Alignment of the text
virtual Primitive2D* crp::Text2D::get_copy ( ) [inline, virtual]

Copies the current primitive.

Returns:
New copy of the current primitive

Implements crp::Primitive2D.

virtual Type crp::Text2D::get_type ( ) const [inline, virtual]

Type of the primitive.

Returns:
Type of the primitive

Implements crp::Primitive2D.

Text2D& crp::Text2D::operator= ( const Text2D primitive) [inline]

Assignment operator.

Parameters:
primitiveObject to assign
void crp::Text2D::set_alignment ( Alignment  alignment) [inline]

Sets the text alignment.

Parameters:
alignmentNew alignment

Field Documentation

Text alignment.


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