ContRap-Libraries
Public Member Functions | Protected Attributes

crp::Triangle2D Class Reference

Class Triangle2D represents a triangle. More...

#include <primitives.h>

Inheritance diagram for crp::Triangle2D:
crp::Primitive2D

Public Member Functions

 Triangle2D (const SPtr< Point2D > &a, const SPtr< Point2D > &b, const SPtr< Point2D > &c)
 Creates a new triangle.
virtual ~Triangle2D ()
 Destructor.
 Triangle2D (const Triangle2D &primitive)
 Copy constructor.
Triangle2Doperator= (const Triangle2D &primitive)
 Assignment operator.
virtual Type get_type () const
 Type of the primitive.
const SPtr< Point2D > & get_corner_a ()
 Returns the three corner points of the triangle.
const SPtr< Point2D > & get_corner_b ()
 Returns the three corner points of the triangle.
const SPtr< Point2D > & get_corner_c ()
 Returns the three corner points of the triangle.
virtual Primitive2Dget_copy ()
 Copies the current primitive.

Protected Attributes

SPtr< Point2Dcorners [3]
 Directions of the other points of the triangle.

Detailed Description

Class Triangle2D represents a triangle.


Constructor & Destructor Documentation

crp::Triangle2D::Triangle2D ( const SPtr< Point2D > &  a,
const SPtr< Point2D > &  b,
const SPtr< Point2D > &  c 
) [inline]

Creates a new triangle.

Parameters:
aCoordinates of the first point
bCoordinates of the second point
cCoordinates of the third point
virtual crp::Triangle2D::~Triangle2D ( ) [inline, virtual]

Destructor.

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

Copy constructor.

Parameters:
primitivePrimitive to copy

Member Function Documentation

virtual Primitive2D* crp::Triangle2D::get_copy ( ) [inline, virtual]

Copies the current primitive.

Returns:
New copy of the current primitive

Implements crp::Primitive2D.

const SPtr<Point2D>& crp::Triangle2D::get_corner_a ( ) [inline]

Returns the three corner points of the triangle.

Returns:
First point of the triangle
const SPtr<Point2D>& crp::Triangle2D::get_corner_b ( ) [inline]

Returns the three corner points of the triangle.

Returns:
Second point of the triangle
const SPtr<Point2D>& crp::Triangle2D::get_corner_c ( ) [inline]

Returns the three corner points of the triangle.

Returns:
Third point of the triangle
virtual Type crp::Triangle2D::get_type ( ) const [inline, virtual]

Type of the primitive.

Returns:
Type of the primitive

Implements crp::Primitive2D.

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

Assignment operator.

Parameters:
primitiveObject to assign

Field Documentation

SPtr<Point2D> crp::Triangle2D::corners[3] [protected]

Directions of the other points of the triangle.


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