Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
icl::geom::GridSceneObject Class Reference

SceneObject specialization for grid like objects. More...

#include <GridSceneObject.h>

Inheritance diagram for icl::geom::GridSceneObject:
icl::geom::SceneObject

List of all members.

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
VecgetNode (int x, int y)
 returns node at given x/y grid position
const VecgetNode (int x, int y) const
 returns node at given x/y grid position (const)
VecgetNode (const utils::Point &p)
 returns node at given grid position
const VecgetNode (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

Detailed Description

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.


Constructor & Destructor Documentation

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


Member Function Documentation

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)

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)

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


Member Data Documentation

grid width

grid height


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines