SbOctTree(3)

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

🌸 NAME 🌸

okay so bestie, meet SbOctTree β€” the SbOctTree class defines a generic oct tree for fast geometry searches. she's giving spatial-indexing main character energy and we're obsessed πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/SbOctTree.h>

πŸŽ€ Public Member Functions πŸŽ€

SbOctTree (const SbBox3f &bbox, const SbOctTreeFuncs &itemfuncs, const int maxitemspernode=64)
~SbOctTree ()
void addItem (void *const item)
void removeItem (void *const item)
void findItems (const SbVec3f &pos, SbList< void * > &destarray, const SbBool removeduplicates=TRUE) const
void findItems (const SbBox3f &box, SbList< void * > &destarray, const SbBool removeduplicates=TRUE) const
void findItems (const SbSphere &sphere, SbList< void * > &destarray, const SbBool removeduplicates=TRUE) const
void findItems (const SbPlane *const planes, const int numplanes, SbList< void * > &destarray, const SbBool removeduplicates=TRUE) const
const SbBox3f & getBoundingBox (void) const
void clear (void)
void debugTree (FILE *fp)

πŸ¦‹ Detailed Description πŸ¦‹

The SbOctTree class defines a generic oct tree for fast geometry searches. periodt.

🫢 lowkey important: be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. so if you're porting old code, this one's a Coin-exclusive girly, no cap.

🧚 Constructor & Destructor Documentation 🧚

SbOctTree::SbOctTree (const SbBox3f & bbox, const SbOctTreeFuncs & itemfuncs, const int maxitems = 64)

Constructor. that's it, that's the whole vibe β€” she's born ✨

SbOctTree::~SbOctTree ()

Destructor. she's logging off πŸ’€


πŸ‘‘ Member Function Documentation πŸ‘‘

void SbOctTree::addItem (void *const item)

Adds an item to this oct tree. drop it in, she'll hold onto it for you 🫢

void SbOctTree::removeItem (void *const item)

Removes the item from the octtree. The octtree will not be modified/simplified even when all items are removed. so like… she'll forget the item but she will NOT tidy up after herself. the structure stays, the item's just gone πŸ™ˆ

void SbOctTree::findItems (const SbVec3f & pos, SbList< void * > & destarray, const SbBool removeduplicates = TRUE) const

Finds all items which contains the point pos. Items are returned in destarray.

If removeduplicates is TRUE (the default), destarray will not contain duplicate items. This is not an optimized process, so if you're looking for speed you should set this to FALSE and do your own postprocessing of the array of returned items. like, the dedupe is convenient but it is NOT the fast path, bestie β€” know that.

⚠️ warning bestie, this one's real: note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes. literally mysterious crashes. not cute. 🚨

void SbOctTree::findItems (const SbBox3f & box, SbList< void * > & destarray, const SbBool removeduplicates = TRUE) const

Finds all items inside box. Items are returned in destarray.

If removeduplicates is TRUE (the default), destarray will not contain duplicate items. This is not an optimized process, so if you're looking for speed you should set this to FALSE and do your own postprocessing of the array of returned items.

⚠️ same warning, still real: note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes.

void SbOctTree::findItems (const SbSphere & sphere, SbList< void * > & destarray, const SbBool removeduplicates = TRUE) const

Finds all items inside sphere. Items are returned in destarray.

If removeduplicates is TRUE (the default), destarray will not contain duplicate items. This is not an optimized process, so if you're looking for speed you should set this to FALSE and do your own postprocessing of the array of returned items.

⚠️ yep, the DLL warning again: note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes.

void SbOctTree::findItems (const SbPlane *const planes, const int numplanes, SbList< void * > & destarray, const SbBool removeduplicates = TRUE) const

Finds all items inside planes. The method SbPlane::isInHalfSpace() should be used, and only items which are (partly) inside all planes are returned. Items are returned in destarray. yes β€” partly counts, she's not gatekeeping 🌈

If removeduplicates is TRUE (the default), destarray will not contain duplicate items. This is not an optimized process, so if you're looking for speed you should set this to FALSE and do your own postprocessing of the array of returned items.

⚠️ and one more time for the people in the back: note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes.

const SbBox3f & SbOctTree::getBoundingBox (void ) const

Returns a bounding box enclosing all the elements in the tree. This is just the same bounding box which was supplied to the constructor. no glow-up, no transformation β€” same box, fr fr πŸ“¦

void SbOctTree::clear (void )

Restores this oct tree to an empty oct tree. The bounding box will still be the same though. so she's emotionally reset but her foundation? untouched πŸ’–


πŸ¦‹ Author πŸ¦‹

Generated automatically by Doxygen for Coin from the source code. (not a human, just a little robot doing her best πŸ€–βœ¨)


okay that's the whole page bestie, you ate it, go index some geometry πŸ’…

🌸 this has been SbOctTree(3) from the Library Functions Manual β€” Coin, Version 3.1.3, and yes that footer date vibe is just us waving bye at the bottom of the page πŸŽ€ bye pookie 🫢

πŸ“¦ where this page comes from