Space Class Reference

#include <space.h>

Collaboration diagram for Space:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int location2Index (double const &, char const *const) const
int indices2Index (int const &, int const &, int const &) const
int screenIndex (int, char const *const) const
void boundWorld (void)
void partitionSpace (void)
void clearFacesFromBoxes (void)
void addFaceToBoxes (vec_bp &, Face *const)
void calculateBoxesInWhichFaceLies (Face const *const, vec_bp &) const
void getBoxesForFaceBoundingBox (Face const *const, vec_bp &) const
void writeSummary (std::ostream &)
void getBoxesFromPosition (vector3 const &, vector3 const &, vec_bp &) const
void getBoxesFromIndices (int const *const, int const *const, vec_bp &) const
double getWorld (int const &) const
BoxgetBox (int const &)
b_cit begin (void) const
b_cit end (void) const

Static Public Member Functions

static Spaceinstance (void)

Member Function Documentation

Space & Space::instance ( void   )  [static]

int Space::location2Index ( double const &  position,
char const * const  axis 
) const

Convert a position along a principal axis into the box index along the same axis that contains the position.

Parameters:
[in] position Distance along input axis.
[in] axis Character code denoting axis of box index ('x','y','z').
Returns:
Box index along input axis containing input position.

int Space::indices2Index ( int const &  x,
int const &  y,
int const &  z 
) const

Convert trio of box indices into an index for box vector, b.

Parameters:
[in] x Box index for x axis.
[in] y Box index for y axis.
[in] z Box index for z axis.
Returns:
Box vector, b, index.

int Space::screenIndex ( int  box_index,
char const * const  axis 
) const

Restrict box index to be within legal range.

Parameters:
[in] box_index Candidate box index.
[in] axis Character code denoting axis of box index ('x','y','z').
Returns:
Box index guaranteed to be legal value.

void Space::boundWorld ( void   ) 

Calculate and record limits of model along each prinicpal axis.

void Space::partitionSpace ( void   ) 

Partition region of space described by bounding box of model into boxes and store as Box class.

void Space::clearFacesFromBoxes ( void   ) 

Clear all face pointers from all boxes.

void Space::addFaceToBoxes ( vec_bp boxes,
Face * const  f 
)

Record input face in each input box.

Parameters:
[in] boxes Boxes assigned to face.
[in] f Face assigned to boxes.

void Space::calculateBoxesInWhichFaceLies ( Face const * const  f,
vec_bp boxes 
) const

Calculate and return boxes in which input face lies.

Parameters:
[in] f Face of interest.
[out] boxes Collection of boxes that fully contain face.

void Space::getBoxesForFaceBoundingBox ( Face const * const  f,
vec_bp boxes 
) const

Assemble collection of boxes that when taken together fully contain the input face bounding box.

Parameters:
[in] f Face of interest.
[out] boxes Collection of boxes that fully contain face bounding box.

void Space::writeSummary ( std::ostream &  target  ) 

Write description and summary of this class to output stream.

Parameters:
[in] target Pre-initialized output stream.

void Space::getBoxesFromPosition ( vector3 const &  point1,
vector3 const &  point2,
vec_bp box_pointers 
) const

Get collection of box pointers that contains the rectangular region described by two input coordinates.

Parameters:
[in] point1 One corner of rectangular region of interest.
[in] point2 Other corner of rectangular region of interest.
[out] box_pointers Collection of box pointers that contains region of interest.

void Space::getBoxesFromIndices ( int const * const  old_indices,
int const * const  new_indices,
vec_bp box_pointers 
) const

Collect and return box pointers contained in a new box index range and not already described by old index range.

Parameters:
[in] old_indices Old box indices to be ignored; if NULL do nothing,
[in] new_indices New box indices of itnerest.
[out] box_pointers Collected boxes.

double Space::getWorld ( int const &  axis  )  const

Return the world limit along input axis.

Parameters:
[in] axis Requested direction 0,1,2,3,4,5 == -x,+x,-y,+y,-z,+z.
Returns:
World limit along ith axis.

Box * Space::getBox ( int const &  box_index  ) 

Return pointer to box at input index.

Parameters:
[in] box_index Index of box of interest.
Returns:
Box with input index.

b_cit Space::begin ( void   )  const

Get an iterator pointing to the first box in space.

Returns:
Iterator pointing to the first interecting face.

b_cit Space::end ( void   )  const

Get an iterator pointing to one past the last box in space.

Returns:
Iterator pointing to one past the last box in space.


The documentation for this class was generated from the following files:
Generated on Sun Aug 3 14:17:31 2008 for meshmorph by  doxygen 1.5.1