SbOctTree(3)

๐Ÿ“ฆ
version 4.0.10 ยท 4 versions
, in fedora 43, fedora 44

๐Ÿ’– NAME ๐Ÿ’–

SbOctTree โ€” bestie, this class defines a generic octree for fast geometry searches. yes fr, it's giving spatial-indexing main character energy ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

#include <Inventor/SbOctTree.h>

๐ŸŒธ Public Member Functions ๐ŸŒธ

okay so here's the whole roster, no cap:

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 ๐Ÿซถ

SbOctTree defines a generic octree for fast geometry searches. it's literally a tree that goes octo mode so you don't have to check every single item every single time. iconic behavior honestly ๐Ÿ’…

โš ๏ธ 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 out here porting ancient SGI code, this one's not gonna be there for you ๐Ÿ˜ญ

๐ŸŽ€ Constructor & Destructor Documentation ๐ŸŽ€

๐Ÿ’œ SbOctTree::SbOctTree (const SbBox3f & bbox, const SbOctTreeFuncs & itemfuncs, const int maxitems = 64)

Constructor. it does the construction thing, bestie. โœจ

๐Ÿ’œ SbOctTree::~SbOctTree ()

Destructor. say bye bye ๐Ÿ‘‹


๐ŸŒˆ Member Function Documentation ๐ŸŒˆ

โญ void SbOctTree::addItem (void *const item)

Adds an item to this octree. put it in, slay ๐Ÿ“

โญ void SbOctTree::removeItem (void *const item)

Removes the item from the octree. heads up tho: the octree will not be modified/simplified even when all items are removed. so like, it stays shaped the way it is, it doesn't shrink back down. no take-backs on the structure, only on the contents ๐Ÿ’€

โญ 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 post processing of the array of returned items. yes queen, DIY it ๐Ÿซก

๐Ÿ˜ญ 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 are 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. so like... genuinely make sure of this. not a drill. mysterious crashes are the worst kind fr fr ๐Ÿ’€

โญ 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 post processing of the array of returned items.

๐Ÿ˜ญ 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 are 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. ๐Ÿ”ฎ round lil search, adorable

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 post processing of the array of returned items.

๐Ÿ˜ญ 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 are 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 (partially) inside all planes are returned. Items are returned in destarray. โœˆ๏ธ like slicing through space with a stack of planes, we love a multi-plane moment

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 post processing of the array of returned items.

๐Ÿ˜ญ 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 are 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. and plot twist โ€” this is just the same bounding box which was supplied to the constructor. so it's not recalculated or anything, it's the O.G. box, still serving looks ๐Ÿ’…

โญ void SbOctTree::clear (void )

Restores this octree to an empty octree. the bounding box will still be the same though. so like, empty vibes, same frame ๐ŸŒธ


๐Ÿ‘‘ Author ๐Ÿ‘‘

Generated automatically by Doxygen for Coin from the source code. yeah, the robots wrote it, we just made it cute ๐Ÿงš


and that's the whole page, bestie ๐ŸŽ€ this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, straight from the Coin manual โ€” mwah, go build something iconic with it ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from