SbHeap(3)
π SbHeap(3) π
okay bestie, pull up a chair, we're doing the SbHeap page from section 3 of the manual β it lives in the library functions manual and it's literally the generic heap class. yes. a heap. the data structure. she's iconic, she's generic, and she's about to be your new obsession. π«Ά
β¨ NAME β¨
SbHeap β the SbHeap class is a generic heap class. that's it, 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 π¦
the SbHeap class is a generic heap class. no cap, that's the whole pitch. β¨
FIXME: write doc
(yes bestie the docs really do say that. not me reading the source and finding a to-do note π she's a work in progress and honestly? relatable.)
Note: SbHeap is an extension versus the Open Inventor API. so if you're out here comparing her to vanilla Open Inventor, know that she's extra. she's built different. periodt. π
π Constructor & Destructor Documentation π
π SbHeap::SbHeap (const SbHeapFuncs & hFuncs, const int initsize = 1024)
Constructor time!! π hFuncs is the plug β it specifies the functions for modifying and returning information about the heap object. meanwhile initsize specifies the initial number of allocated elements.
the way that this array will automatically grow when necessaryβ¦ like she's got your back, she scales. but lowkey, if you already know approximately how many elements the heap will contain, you should totally supply this to avoid some reallocs. future you will thank present you. π«Ά
π SbHeap::~SbHeap (void )
Destructor. she's done, she's logging off, cleanup complete. bye bestie π
π Member Function Documentation π
π
void SbHeap::emptyHeap (void )
Removes all the elements from the heap. full reset. clean slate. it's giving fresh start energy. β¨
π
int SbHeap::size (void ) const
Returns the number of elements in the heap. how many girls are in the group chat, basically. π’
π
int SbHeap::add (void * obj)
Adds an element to the heap. and it returns the element's heap position β so you know exactly where she landed. iconic behaviour, honestly. π
π
void SbHeap::remove (const int idx)
Removes an element from the heap. by index. bye diva π
π
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. so like, same girl, different door. πͺ
π
void * SbHeap::extractMin (void )
Returns and removes the first element in the heap β or NULL if the heap is empty. she's leaving and taking the title with her. main character exit. πͺβ¨
π
void * SbHeap::getMin (void )
Returns the first element in the heap β or NULL if the heap is empty. she's still here, you're just looking respectfully. π
π
void * SbHeap::operator[] (const int idx)
Returns the heap element at index idx in the heap. peek-a-boo, here's your element. π
π
void SbHeap::newWeight (void * obj, int hpos = -1)
Fixes the heap if necessary when the element at hpos has changed weight. glow-up detected, must re-sort. π«
if you already know the element's heap position, you can supply it in hpos β save yourself the lookup, queen. π
π
SbBool SbHeap::buildHeap (SbBool(* progresscb )(float percentage, void *data) = NULL, void * data = NULL)
Builds heap out of randomly ordered data-structure. chaotic pile of data in, actual heap out. it's giving organizational makeover montage. π§
π
SbBool SbHeap::traverseHeap (SbBool(* func )(void *, void *), void * userdata) const
Traverses each heap element, and calls func for each element. every single one gets a little visit. so thorough, so attentive, we love a methodical queen. πΈ
π Author π
Generated automatically by Doxygen for Coin from the source code. so like, not a human author, a robot did her makeup. and she ate. π
reminder bestie: SbHeap is an extension versus the Open Inventor API β so don't go looking for her in the OG spec, she's Coin's bonus round. π
and that's the whole page, bestie!! π«Ά this was Coin, Version 3.1.3, and you just read SbHeap(3) β section 3 of the library functions manual, fr fr. go build a heap and slay. ππβ¨
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms