MP5
Photomosaic
Point< Dim > Class Template Reference

Point class: represents a point in Dim dimensional space. More...

#include "point.h"

Public Member Functions

virtual double operator[] (int index) const
 Gets the value of the Point object in the given dimension (index). More...
 
virtual double & operator[] (int index)
 Gets the value of the Point object in the given dimension (index). More...
 
bool operator< (const Point< Dim > p) const
 Compares whether the given Point is smaller than the current Point. More...
 

Detailed Description

template<int Dim>
class Point< Dim >

Point class: represents a point in Dim dimensional space.

Author
Matt Sachtler
Date
Spring 2009

Member Function Documentation

template<int Dim>
double Point< Dim >::operator[] ( int  index) const
virtual

Gets the value of the Point object in the given dimension (index).

This function is const so we don't modify Points using this function.

Parameters
indexThe dimension of the Point to grab.
Returns
The value of the Point in the indexth dimension.
template<int Dim>
double & Point< Dim >::operator[] ( int  index)
virtual

Gets the value of the Point object in the given dimension (index).

This is the non-const version, so it can be used to modify Points like so:

Point<3> a(1, 2, 3);
a[0] = 4; // a is now (4, 2, 3)
Parameters
indexThe dimension of the Point to grab.
Returns
The value of the Point in the indexth dimension, by reference (so that it may be modified).
template<int Dim>
bool Point< Dim >::operator< ( const Point< Dim >  p) const

Compares whether the given Point is smaller than the current Point.

Parameters
pThe other point to compare with.
Returns
A boolean value indicating whether the current Point is smaller than the provided Point p.

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