KrisLibrary  1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
Geometry::Grid Class Reference

A gridding of n-dimensional space. More...

#include <Grid.h>

Public Types

typedef IntTuple Index
 
typedef bool(* QueryCallback) (const Index &index)
 Called for each cell in the query, return false to stop enumerating.
 

Public Member Functions

 Grid (int numDims, Real h=1)
 
 Grid (const Vector &h)
 
void PointToIndex (const Vector &p, Index &i) const
 
void PointToIndex (const Vector &p, Index &i, Vector &u) const
 
void CellBounds (const Index &i, Vector &bmin, Vector &bmax) const
 
void CellCorner (const Index &index, Vector &bmin) const
 
void CellCenter (const Index &index, Vector &c) const
 
bool IndexQuery (const Index &imin, const Index &imax, QueryCallback f) const
 
bool BoxQuery (const Vector &bmin, const Vector &bmax, QueryCallback f) const
 
bool BallQuery (const Vector &c, Real r, QueryCallback f) const
 
bool SegmentQuery (const Vector &a, const Vector &b, QueryCallback f) const
 

Public Attributes

Vector h
 

Detailed Description

A gridding of n-dimensional space.

Each dimension k is divided into uniform divisions of size h(k). A cell of the grid is indexed by a Grid::Index, a vector of ints. The grid cell at 0 is (0,0,...,0), and each increment in a dimension k shifts the cell by h(k) units.


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