Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Public Attributes | List of all members
Mezzanine::Triangle2D Class Reference

A geometry math class for expressing a triangle in 2D space. More...

#include <triangle.h>

+ Collaboration diagram for Mezzanine::Triangle2D:

Public Member Functions

 Triangle2D ()
 Blank constructor.
 
 Triangle2D (const Vector2 &A, const Vector2 &B, const Vector2 &C)
 Descriptive constructor. More...
 
Vector2operator[] (const Whole &Index)
 Gets the point in this triangle corresponding to the specified index.

Exceptions
Ifthe index passed in is greater than 2, a PARAMETERS_RANGE_EXCEPTION will be thrown.
More...
 
const Vector2operator[] (const Whole &Index) const
 Gets the point in this triangle corresponding to the specified index.

Exceptions
Ifthe index passed in is greater than 2, a PARAMETERS_RANGE_EXCEPTION will be thrown.
More...
 

Public Attributes

Vector2 PointA
 The first point in space making the triangle.
 
Vector2 PointB
 The second point in space making the triangle.
 
Vector2 PointC
 The third point in space making the triangle.
 

Detailed Description

A geometry math class for expressing a triangle in 2D space.

Definition at line 53 of file triangle.h.

Constructor & Destructor Documentation

Mezzanine::Triangle2D::Triangle2D ( const Vector2 A,
const Vector2 B,
const Vector2 C 
)

Descriptive constructor.

Parameters
AThe first point in space making the triangle.
BThe second point in space making the triangle.
CThe third point in space making the triangle.

Definition at line 124 of file triangle.cpp.

Member Function Documentation

Vector2 & Mezzanine::Triangle2D::operator[] ( const Whole Index)

Gets the point in this triangle corresponding to the specified index.

Exceptions
Ifthe index passed in is greater than 2, a PARAMETERS_RANGE_EXCEPTION will be thrown.

Parameters
IndexThe index of the point to retrieve.
Returns
Returns a reference to a Vector2 containing the position of the specified point.

Definition at line 133 of file triangle.cpp.

const Vector2 & Mezzanine::Triangle2D::operator[] ( const Whole Index) const

Gets the point in this triangle corresponding to the specified index.

Exceptions
Ifthe index passed in is greater than 2, a PARAMETERS_RANGE_EXCEPTION will be thrown.

Parameters
IndexThe index of the point to retrieve.
Returns
Returns a const reference to a Vector2 containing the position of the specified point.

Definition at line 146 of file triangle.cpp.


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