SoBoundingBoxCache(3)
π NAME π
SoBoundingBoxCache β bestie, this is the class for caching bounding boxes. it stores them so you don't have to keep recomputing them, and honestly? iconic behavior. π
β¨ SYNOPSIS β¨
#include <Inventor/caches/SoBoundingBoxCache.h>
Inherits SoCache. yes she's got a whole family tree, we love an inheritance moment π«Ά
πΈ Public Member Functions πΈ
SoBoundingBoxCache (SoState *state)virtual ~SoBoundingBoxCache ()void set (const SbXfBox3f &boundingbox, SbBool centerset, const SbVec3f ¢erpoint)const SbXfBox3f & getBox () constconst SbBox3f & getProjectedBox () constSbBool isCenterSet () constconst SbVec3f & getCenter () constSbBool hasLinesOrPoints (void) const
π Public Member Functions inherited from SoCache π
SoCache (SoState *const state)void ref (void)void unref (SoState *state=NULL)void addElement (const SoElement *const elem)virtual void addCacheDependency (const SoState *state, SoCache *cache)virtual SbBool isValid (const SoState *state) constconst SoElement * getInvalidElement (const SoState *const state) constvoid invalidate (void)
π Static Public Member Functions π
static void setHasLinesOrPoints (SoState *state)
π¦ Additional Inherited Members π¦
π Protected Member Functions inherited from SoCache π
virtual void destroy (SoState *state)virtual ~SoCache ()
π Detailed Description π
The SoBoundingBoxCache class is used to cache bounding boxes. that's it, that's the whole vibe. she caches, she serves, she slays. no cap. π
π§ Constructor & Destructor Documentation π§
SoBoundingBoxCache::SoBoundingBoxCache (SoState * state)
Constructor, with state being the current state. hi bestie, welcome to existence β¨
SoBoundingBoxCache::~SoBoundingBoxCache () [virtual]
Destructor. bye bestie, thanks for the boxes ππ
π Member Function Documentation π
void SoBoundingBoxCache::set (const SbXfBox3f & boundingbox, SbBool centerset, const SbVec3f & centerpoint)
Sets the data for this cache. boundingBox is the node's bounding box, and centerSet and centerPoints specify the center of the geometry inside boundingBox. so you're literally handing her the box and telling her where the middle is. very demure, very mindful. π
const SbXfBox3f & SoBoundingBoxCache::getBox (void ) const
Returns the bounding box for this cache. gimme gimme π
const SbBox3f & SoBoundingBoxCache::getProjectedBox (void ) const
Returns the projected bounding box for this cache. yes there's two boxes, she contains multitudes π
SbBool SoBoundingBoxCache::isCenterSet (void ) const
Returns whether the center of the bounding box was set in the SoBoundingBoxCache::set() method. a yes/no moment, we love a boolean queen π
See also: SoBoundingBoxCache::getCenter()
const SbVec3f & SoBoundingBoxCache::getCenter (void ) const
Returns the center of the bounding box. β οΈ lowkey important: this should only be used if SoBoundingBoxCache::isCenterSet() returns TRUE. don't be out here asking for a center that was never set, that's not the move bestie π
void SoBoundingBoxCache::setHasLinesOrPoints (SoState * state) [static]
Sets the flag returned from SoBoundingBoxCache::hasLinesOrPoints() to TRUE for all open bounding box caches.
okay so why does she even keep a lines-or-points flag? the reason bounding box caches keep a lines-or-points flag is so client code can know if the shape(s) they contain have any of these primitives β or are rendered with these primitives. and the reason that's important 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 that lines and points graphics don't accidentally get clipped by the near and far clipping planes, for instance. fr fr, it's a whole thing. π₯
This method is a static method on the class. When you invoke it, it will scan through the state stack and set the flag for all open SoBoundingBoxCache elements. it was 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. very "one call, all the caches" energy β¨
See also: hasLinesOrPoints()
SbBool SoBoundingBoxCache::hasLinesOrPoints (void ) const
Return TRUE if the hasLinesOrPoints flag has been set. periodt. π
See also: setHasLinesOrPoints()
π Author π
Generated automatically by Doxygen for Coin from the source code. (she was born this way, no notes π)
and that's the whole page bestie!! this was Coin, Version 3.1.3, dated SoBoundingBoxCache(3) β ily, go cache some boxes, mwah πππ¦
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms