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

An ND grid with a list of arbitrary objects (given by void pointers) More...

#include <GridSubdivision.h>

Public Types

typedef IntTuple Index
 
typedef std::vector< void * > ObjectSet
 
typedef bool(* QueryCallback) (void *obj)
 
typedef UNORDERED_MAP_TEMPLATE< Index, ObjectSet, IndexHashHashTable
 

Public Member Functions

 GridSubdivision (int numDims, Real h=1)
 
 GridSubdivision (const Vector &h)
 
size_t GetBucketCount () const
 
void SetBucketCount (size_t n)
 
void Insert (const Index &i, void *data)
 Inserts a new item. Important: this doesn't take ownership of the object.
 
bool Erase (const Index &i, void *data)
 Important: this method just removes the item from the hash, but does not delete its memory.
 
ObjectSet * GetObjectSet (const Index &i)
 
const ObjectSet * GetObjectSet (const Index &i) const
 
void Clear ()
 
void PointToIndex (const Vector &p, Index &i) const
 
void PointToIndex (const Vector &p, Index &i, Vector &u) const
 
void IndexBucketBounds (const Index &i, Vector &bmin, Vector &bmax) const
 
void GetRange (Index &imin, Index &imax) const
 
void GetRange (Vector &bmin, Vector &bmax) 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
 
void IndexItems (const Index &imin, const Index &imax, ObjectSet &objs) const
 
void BoxItems (const Vector &bmin, const Vector &bmax, ObjectSet &objs) const
 
void BallItems (const Vector &c, Real r, ObjectSet &objs) const
 
void SegmentItems (const Vector &a, const Vector &b, ObjectSet &objs) const
 

Public Attributes

Vector hinv
 
HashTable buckets
 

Detailed Description

An ND grid with a list of arbitrary objects (given by void pointers)


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