SbHeap(3)
π SbHeap(3) β NAME π
SbHeap β bestie, it's the SbHeap class, a generic heap class. That's the whole vibe. β¨
πΈ SYNOPSIS πΈ
#include <Inventor/SbHeap.h>
π Public Member Functions π
SbHeap (const SbHeapFuncs &SbHeapFuncs, const int initsize=1024)
~SbHeap ()
void emptyHeap (void)
int size (void) const
int add (void *obj)
void remove (const int pos)
void remove (void *obj)
void * extractMin ()
void * getMin ()
void * operator[] (const int idx)
void newWeight (void *obj, int hpos=-1)
SbBool buildHeap (SbBool(*progresscb)(float percentage, void *data)=NULL, void *data=NULL)
SbBool traverseHeap (SbBool(*func)(void *, void *), void *userdata) const
π¦ Detailed Description π¦
okay so. The SbHeap class is a generic heap class. That's it, that's the description. π
FIXME: write doc π β yeah, the docs are not giving what they need to give here, bestie. Not me exposing the upstream TODO but here we are.
Note: SbHeap is an extension versus the Open Inventor API. So it's not vanilla Open Inventor, it's Coin doing its own lil thing. iykyk. β
π Constructor & Destructor Documentation π
π SbHeap::SbHeap (const SbHeapFuncs & hFuncs, const int initsize = 1024)
Constructor, periodt. hFuncs is the set of functions that tell the heap how to modify and return info about the heap object. initsize is the initial number of allocated elements β so like, how much room it gets to start with. π«Ά
This array will automatically grow when necessary, no cap. But listen: if you already know roughly how many elements the heap is gonna hold, supply it so you can dodge some reallocs. Slay. β¨
π SbHeap::~SbHeap (void )
Destructor. It's over, it's done, the heap has left the chat. π
π Member Function Documentation π
π§ void SbHeap::emptyHeap (void )
Removes all the elements from the heap. Everything. Gone. Clean slate energy. π
π int SbHeap::size (void ) const
Returns the number of elements in the heap. Just the count, bestie. π’
β¨ int SbHeap::add (void * obj)
Adds an element to the heap. Returns the element's heap position β hold onto that number, it's the receipts. π
πΈ void SbHeap::remove (const int idx)
Removes an element from the heap. Bye bestie π
π¦ void SbHeap::remove (void * obj)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Same energy, different signature. π€
π void * SbHeap::extractMin (void )
Returns and removes the first element in the heap, or NULL if the heap is empty. Note that it does both β it takes the min and dips. π₯
π void * SbHeap::getMin (void )
Returns the first element in the heap, or NULL if the heap is empty. This one peeks, it doesn't remove. Look but don't touch. π
π void * SbHeap::operator[] (const int idx)
Returns the heap element at index idx in the heap. Array-style access, iconic. β
π void SbHeap::newWeight (void * obj, int hpos = -1)
Fixes the heap if necessary when the element at hpos has changed weight. If you already know the element's heap position, you can supply it in hpos. Save the lookup, treat yourself. π
π SbBool SbHeap::buildHeap (SbBool(* progresscb )(float percentage, void *data) = NULL, void * data = NULL)
Builds a heap out of a randomly ordered data-structure. Unruly input goes in, tidy heap comes out. progresscb gets a percentage and your data, and defaults to NULL β same for data. β¨
π«Ά SbBool SbHeap::traverseHeap (SbBool(* func )(void *, void *), void * userdata) const
Traverses each heap element, and calls func for each element. You bring the function, it brings the elements, and userdata rides along. π
π Author π
Generated automatically by Doxygen for Coin from the source code. The robots wrote the bio, we just gave it a makeover. π€π
and that's a wrap, bestie!! πβ¨ This lil masterpiece is Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it's filed under SbHeap(3). mwah, go build a heap, you got this π«Άπ
π¦ 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