#include <Dimension.h>
Public Member Functions | |
Dimension (int size=100, bool normalized=false) | |
Dimension (const Dimension &d) | |
The copy-constructor:. | |
Dimension & | operator= (const Dimension &d) |
~Dimension () | |
the destructor | |
int | getSize () |
Return the number of elements in this finite, discrete dimension object. | |
void | setSize (int dsize) |
Set the number of elements in this finite, discrete dimension object. | |
bool | getNormalized () |
Is this dimension a ring or a strand?. | |
void | setNormalized (bool normal) |
Set or unset the normalization in this dimension. | |
bool | isOutOfBounds (int coordinate) |
int | getPos (int coordinate) |
This type of objects represent one dimension (an axe in the "picture"), and can be normalized, like a ring, or with bounds a strand.
Dimension::Dimension | ( | int | size = 100 , |
|
bool | normalized = false | |||
) | [inline] |
the constructor, creates a object, with a given size (100 default) and type of bounds (default with bounds)
bool Dimension::getNormalized | ( | ) | [inline] |
Is this dimension a ring or a strand?.
If this method return a true this dimension is a ring, false is a strand.
int Dimension::getPos | ( | int | coordinate | ) | [inline] |
this method is to return the position in the dimension, in base of the coordinate, only has sense to call it if the dim is normalized, but sometimes you want generic code and call it anyway so you have to call isOutOfBounds(int coordinate) method before call this method to avoid a bug
bool Dimension::isOutOfBounds | ( | int | coordinate | ) | [inline] |
this method is to know if a coordinate is outside of the bounds, returns true is the ordinate is out of the bounds false other way
Overwrite the = operator to avoid problems when you forget initialize whit the constructor
void Dimension::setNormalized | ( | bool | normal | ) | [inline] |
Set or unset the normalization in this dimension.
If is set true the dimension is a ring if not (false) is a strand.