The soboundingboxcache class is used to cache bounding boxes.
#include <Inventor/caches/SoBoundingBoxCache.h>
Inherits SoCache.
SoBoundingBoxCache (SoState *state)
virtual ~SoBoundingBoxCache ()
void set (const SbXfBox3f &boundingbox, SbBool centerset, const SbVec3f ¢erpoint)
const SbXfBox3f & getBox () const
const SbBox3f & getProjectedBox () const
SbBool isCenterSet () const
const SbVec3f & getCenter () const
SbBool hasLinesOrPoints (void) const
static void setHasLinesOrPoints (SoState *state)
The SoBoundingBoxCache class is used to cache bounding boxes.
Constructor with state being the current state.
Destructor.
Sets the data for this cache. boundingBox is the node's bounding box, centerSet and centerPoints specifies the center of the geometry inside boundingBox.
Returns the bounding box for this cache.
Returns the projected bounding box for this cache.
Returns whether the center of the bounding box was set in the SoBoundingBoxCache::set() method.
See also:
SoBoundingBoxCache::getCenter()
Returns the center of the bounding box. Should only be used if SoBoundingBoxCache::isCenterSet() returns TRUE.
Sets the flag returned from SoBoundingBoxCache::hasLinesOrPoints() to TRUE for all open bounding box caches.
The reason bounding box caches keep a lines-or-points flag is to make it known to client code if the shape(s) they contain have any of these primitives -- or are rendered with these primitives. The reason this is important to know for the client code is because it might need to add an 'epsilon' slack value to the calculated bounding box to account for smoothing / anti-aliasing effects in the renderer, so lines and points graphics is not accidently clipped by near and far clipping planes, for instance.
This method is a static method on the class. It will upon invocation scan through the state stack and set the flag for all open SoBoundingBoxCache elements. It has been made to work like this so it can easily be invoked on all current bounding box cache instances from the SoShape-type nodes using lines and / or point primitives.
See also:
hasLinesOrPoints()
Return TRUE if the hasLinesOrPoints flag has been set.
See also:
setHasLinesOrPoints()
Generated automatically by Doxygen for Coin from the source code.