Image Component Library (ICL)
|
SceneObject specialization for grid like objects. More...
#include <GridSceneObject.h>
Public Member Functions | |
GridSceneObject (int nXCells, int nYCells, const std::vector< Vec > &allGridPoints, bool lines=true, bool quads=true) throw (utils::ICLException) | |
creates a GridSceneObject with a given set of vertices | |
GridSceneObject (int nXCells, int nYCells, const Vec &origin, const Vec &dx, const Vec &dy, bool lines=true, bool quads=true) throw (utils::ICLException) | |
creates a GridSceneObject where the grid is a regular grid in 3D space | |
int | getIdx (int x, int y) const |
returns the node index of given node x/y position | |
Vec & | getNode (int x, int y) |
returns node at given x/y grid position | |
const Vec & | getNode (int x, int y) const |
returns node at given x/y grid position (const) | |
Vec & | getNode (const utils::Point &p) |
returns node at given grid position | |
const Vec & | getNode (const utils::Point &p) const |
returns node at given grid position (const) | |
utils::Size | getSize () const |
returns grid dimension (nXCells * nYCells) | |
int | getWidth () const |
returns grid width | |
int | getHeight () const |
returns grid height | |
Private Member Functions | |
void | init (int nXCells, int nYCells, const std::vector< Vec > &allGridPoints, bool lines, bool quads) throw (utils::ICLException) |
internal initialization method | |
Private Attributes | |
int | nXCells |
grid width | |
int | nYCells |
grid height |
SceneObject specialization for grid like objects.
The GridSceneObject implements a 2D grid in 3D space. The grid consits of 2D array of normal vectors. All attributes remain default SceneObject attributs. The grid cells are created as quads.
icl::geom::GridSceneObject::GridSceneObject | ( | int | nXCells, |
int | nYCells, | ||
const std::vector< Vec > & | allGridPoints, | ||
bool | lines = true , |
||
bool | quads = true |
||
) | throw (utils::ICLException) |
creates a GridSceneObject with a given set of vertices
Note: allGridPoints must have nXCells + nYCells elements and its elements must be ordered in row-major order
icl::geom::GridSceneObject::GridSceneObject | ( | int | nXCells, |
int | nYCells, | ||
const Vec & | origin, | ||
const Vec & | dx, | ||
const Vec & | dy, | ||
bool | lines = true , |
||
bool | quads = true |
||
) | throw (utils::ICLException) |
creates a GridSceneObject where the grid is a regular grid in 3D space
the grid nodes are created automatically: node(x,y) = origin + x*dx + y*dy
int icl::geom::GridSceneObject::getHeight | ( | ) | const [inline] |
returns grid height
int icl::geom::GridSceneObject::getIdx | ( | int | x, |
int | y | ||
) | const [inline] |
returns the node index of given node x/y position
Vec& icl::geom::GridSceneObject::getNode | ( | int | x, |
int | y | ||
) | [inline] |
returns node at given x/y grid position
const Vec& icl::geom::GridSceneObject::getNode | ( | int | x, |
int | y | ||
) | const [inline] |
returns node at given x/y grid position (const)
Vec& icl::geom::GridSceneObject::getNode | ( | const utils::Point & | p | ) | [inline] |
returns node at given grid position
const Vec& icl::geom::GridSceneObject::getNode | ( | const utils::Point & | p | ) | const [inline] |
returns node at given grid position (const)
utils::Size icl::geom::GridSceneObject::getSize | ( | ) | const [inline] |
returns grid dimension (nXCells * nYCells)
int icl::geom::GridSceneObject::getWidth | ( | ) | const [inline] |
returns grid width
void icl::geom::GridSceneObject::init | ( | int | nXCells, |
int | nYCells, | ||
const std::vector< Vec > & | allGridPoints, | ||
bool | lines, | ||
bool | quads | ||
) | throw (utils::ICLException) [private] |
internal initialization method
int icl::geom::GridSceneObject::nXCells [private] |
grid width
int icl::geom::GridSceneObject::nYCells [private] |
grid height