SbBSPTree(3)
π SbBSPTree(3) π
okay bestie, sit down, hydrate, and let me tell you about SbBSPTree from the Coin manual, page 3. it's giving spatial data structures, it's giving O(log(n)) slay, it's giving binary space partitioning container. yes queen. π
β¨ NAME β¨
SbBSPTree β the class that literally provides a binary space partitioning container. that's it. that's the vibe. πΈ
β¨ SYNOPSIS β¨
first things first, you gotta invite it in:
#include <Inventor/SbBSPTree.h>
π Public Member Functions π
here's the whole friend group, in order, no cap:
SbBSPTree (const int maxnodepts=64, const int initsize=4)
~SbBSPTree ()
int numPoints () const
SbVec3f getPoint (const int idx) const
void getPoint (const int idx, SbVec3f &pt) const
void * getUserData (const int idx) const
void setUserData (const int idx, void *const data)
int addPoint (const SbVec3f &pt, void *const userdata=NULL)
int removePoint (const SbVec3f &pt)
void removePoint (const int idx)
int findPoint (const SbVec3f &pos) const
int findClosest (const SbVec3f &pos) const
void clear (const int initsize=4)
void findPoints (const SbSphere &sphere, SbIntList &array) const
int findClosest (const SbSphere &sphere, SbIntList &array) const
const SbBox3f & getBBox () const
const SbVec3f * getPointsArrayPtr () const
void findPoints (const SbSphere &sphere, SbList< int > &array) const
int findClosest (const SbSphere &sphere, SbList< int > &array) const
π Detailed Description π
SbBSPTree is the class that provides a binary space partitioning container. iconic behavior honestly.
so what does it actually do? it organizes your searches for 3D points or normals in a set in O(log(n)) time. that's the whole point. fast lookups, no scrolling, no crying. β¨
Note: SbBSPTree is an extension to the original Open Inventor API. so like, it's a Coin bonus, a little extra sprinkle. π§
π¦ Constructor & Destructor Documentation π¦
SbBSPTree::SbBSPTree (const int maxnodepts = 64, const int initsize = 4)
the constructor, aka the glow-up moment. β¨
maxnodeptsβ the max number of points a node can hold before it must split. default is64.initsizeβ how many points get allocated initially in the growable points array. default is4.
and bestie, listen: if you know roughly how many points you're gonna throw into this tree, pass it in initsize. it helps the performance. fr fr. do it for your future self. π«Ά
SbBSPTree::~SbBSPTree ()
the destructor. frees the used memory. clean up after yourself, we love a tidy queen. π
π Member Function Documentation π
int SbBSPTree::numPoints () const
returns the number of points in the BSP tree. simple. elegant. we stan. π
SbVec3f SbBSPTree::getPoint (const int idx) const
returns the point at index idx.
See also: SbBSPTree::numPoints()
void SbBSPTree::getPoint (const int idx, SbVec3f & pt) const
okay so this is an overloaded member function, provided for convenience. it differs from the function above only in what argument(s) it accepts. same energy, different signature. π
void * SbBSPTree::getUserData (const int idx) const
returns the user data for the point at index idx.
See also: SbBSPTree::addPoint(), SbBSPTree::numPoints()
void SbBSPTree::setUserData (const int idx, void *const data)
sets the user data for the point at index idx to data.
See also: SbBSPTree::addPoint(), SbBSPTree::numPoints()
int SbBSPTree::addPoint (const SbVec3f & pt, void *const data = NULL)
adds a new point pt to the BSP tree, and returns the index to the new point. the user data for that point gets set to data.
heads up though: if the point already exists in the BSP tree, the index to the old point gets returned instead β and the user data for that point will not be changed. no overwriting, no drama. π
See also: SbBSPTree::findPoint()
int SbBSPTree::removePoint (const SbVec3f & pt)
removes the point with coordinates pt, and returns the index to the removed point. if no point with those coordinates could be found, -1 is returned. sad girl hours. π
void SbBSPTree::removePoint (const int idx)
removes the point at index idx.
See also: SbBSPTree::numPoints()
int SbBSPTree::findPoint (const SbVec3f & pos) const
will search the tree, and return the index to the point with coordinates matching pos. if no such point can be found, -1 is returned.
int SbBSPTree::findClosest (const SbVec3f & pos) const
this is an overloaded member function, provided for convenience. it differs from the above function only in what argument(s) it accepts. β¨
void SbBSPTree::clear (const int initsize = 4)
will empty all points from the BSP tree. total reset, fresh start, main character energy. π
void SbBSPTree::findPoints (const SbSphere & sphere, SbIntList & array) const
will return indices to all points inside sphere.
Since: Coin 2.3
int SbBSPTree::findClosest (const SbSphere & sphere, SbIntList & arr) const
will return the index to the point closest to the center of sphere. indices to all points inside the sphere get returned in arr. if no points can be found inside the sphere, -1 is returned.
Since: Coin 2.3
const SbBox3f & SbBSPTree::getBBox () const
will return the bounding box of all points in the BSP tree. it's giving organized. it's giving contained. π¦β¨
const SbVec3f * SbBSPTree::getPointsArrayPtr (void ) const
returns a pointer to the array of points inserted into the BPS tree. (yes, the original says BPS. we don't question the ancestors, we just report faithfully. π)
void SbBSPTree::findPoints (const SbSphere & sphere, SbList< int > & array) const
WARNING: Please don't use this function. it can cause hard to find bugs on the Windows platform if your application is linked against a different CRT than your Coin DLL. ππ
use void findPoints(const SbSphere &sphere, SbIntList & array) instead. bestie, I'm begging you. π
int SbBSPTree::findClosest (const SbSphere & sphere, SbList< int > & arr) const
WARNING: Please don't use this function. it can cause hard to find bugs on the Windows platform if your application is linked against a different CRT than your Coin DLL. ππ
use int findClosest(const SbSphere &sphere, SbIntList & arr) instead. periodt. π
πΈ Author πΈ
generated automatically by Doxygen for Coin from the source code. not me being a bot-authored baddie. π€π
and that's the whole page, bestie!! π«Ά this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it's the SbBSPTree(3) manual page β so go forth, partition that binary space, and stay iconic. πβ¨ππ¦π
π¦ 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