#include <space.h>
Collaboration diagram for Space:
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 |
Box * | getBox (int const &) |
b_cit | begin (void) const |
b_cit | end (void) const |
Static Public Member Functions | |
static Space & | instance (void) |
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.
[in] | position | Distance along input axis. |
[in] | axis | Character code denoting axis of box index ('x','y','z'). |
int Space::indices2Index | ( | int const & | x, | |
int const & | y, | |||
int const & | z | |||
) | const |
int Space::screenIndex | ( | int | box_index, | |
char const * const | axis | |||
) | const |
Restrict box index to be within legal range.
[in] | box_index | Candidate box index. |
[in] | axis | Character code denoting axis of box index ('x','y','z'). |
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.
Record input face in each input box.
[in] | boxes | Boxes assigned to face. |
[in] | f | Face assigned to boxes. |
Calculate and return boxes in which input face lies.
[in] | f | Face of interest. |
[out] | boxes | Collection of boxes that fully contain face. |
Assemble collection of boxes that when taken together fully contain the input face bounding box.
[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.
[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.
[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.
[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.
[in] | axis | Requested direction 0,1,2,3,4,5 == -x,+x,-y,+y,-z,+z. |
Box * Space::getBox | ( | int const & | box_index | ) |
Return pointer to box at input index.
[in] | box_index | Index of box of interest. |
b_cit Space::begin | ( | void | ) | const |
Get an iterator pointing to the first box in space.
b_cit Space::end | ( | void | ) | const |
Get an iterator pointing to one past the last box in space.