SbOctTree(3)
๐ 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
- fedora 43: Coin4-devel 4.0.10-1.fc43 ยท BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 ยท BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 ยท BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 ยท BSD-3-Clause AND GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms