SoBoundingBoxCache(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

πŸ’– 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 &centerpoint)
  • const SbXfBox3f & getBox () const
  • const SbBox3f & getProjectedBox () const
  • SbBool isCenterSet () const
  • const SbVec3f & getCenter () const
  • SbBool 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) const
  • const SoElement * getInvalidElement (const SoState *const state) const
  • void 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