MP5
Photomosaic
|
Point class: represents a point in Dim dimensional space. More...
#include <point.h>
Classes | |
class | MineAction |
class | MineAction_DoNothingImpl |
Public Member Functions | |
Point (double arr[Dim]) | |
template<typename T > | |
Point (T x,...) | |
template<typename T > | |
Point (T x0, T x1, T x2) | |
Point & | operator= (const Point &other) |
double | operator[] (int index) const |
Gets the value of the Point object in the given dimension (index). More... | |
double & | operator[] (int index) |
Gets the value of the Point object in the given dimension (index). More... | |
bool | operator== (const Point< Dim > p) const |
bool | operator!= (const Point< Dim > p) const |
bool | operator< (const Point< Dim > p) const |
Compares whether the given Point is smaller than the current Point. More... | |
bool | operator<= (const Point< Dim > p) const |
bool | operator> (const Point< Dim > p) const |
bool | operator>= (const Point< Dim > p) const |
void | set (int index, double val) |
void | print (std::ostream &out=std::cout) const |
bool | isMine () const |
Point (double arr[Dim], bool isMine, const MineAction *mineAction) | |
Private Attributes | |
double | vals [Dim] |
bool | isMine_ = false |
MineAction_DoNothingImpl | MineAction_DoNothing |
const MineAction * | mineAction_ = &MineAction_DoNothing |
Point class: represents a point in Dim dimensional space.
double Point< Dim >::operator[] | ( | int | index | ) | const |
double & Point< Dim >::operator[] | ( | int | index | ) |
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)
index | The dimension of the Point to grab. |