Panda3D
|
This is a particular kind of PGItem that draws a little bar that fills from left to right to indicate a slow process gradually completing, like a traditional "wait, loading" bar. More...
#include "pgWaitBar.h"
Public Member Functions | |
PGWaitBar (const string &name="") | |
virtual bool | cull_callback (CullTraverser *trav, CullTraverserData &data) |
This function will be called during the cull traversal to perform any additional operations that should be performed at cull time. | |
virtual TypeHandle | force_init_type () |
PGFrameStyle | get_bar_style () const |
Returns the kind of frame that is drawn on top of the WaitBar to represent the amount completed. | |
PN_stdfloat | get_percent () const |
Returns the percentage complete. | |
PN_stdfloat | get_range () const |
Returns the value at which the WaitBar indicates 100%. | |
virtual TypeHandle | get_type () const |
PN_stdfloat | get_value () const |
Returns the current value of the bar. | |
virtual PandaNode * | make_copy () const |
Returns a newly-allocated Node that is a shallow copy of this one. | |
void | set_bar_style (const PGFrameStyle &style) |
Sets the kind of frame that is drawn on top of the WaitBar to represent the amount completed. | |
void | set_range (PN_stdfloat range) |
Sets the value at which the WaitBar indicates 100%. | |
void | set_value (PN_stdfloat value) |
Sets the current value of the bar. | |
void | setup (PN_stdfloat width, PN_stdfloat height, PN_stdfloat range) |
Creates a PGWaitBar with the indicated dimensions, with the indicated maximum range. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
PGWaitBar (const PGWaitBar ©) |
This is a particular kind of PGItem that draws a little bar that fills from left to right to indicate a slow process gradually completing, like a traditional "wait, loading" bar.
Definition at line 29 of file pgWaitBar.h.
bool PGWaitBar::cull_callback | ( | CullTraverser * | trav, |
CullTraverserData & | data | ||
) | [virtual] |
This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.
Note that this function will *not* be called unless set_cull_callback() is called in the constructor of the derived class. It is necessary to call set_cull_callback() to indicated that we require cull_callback() to be called.
By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.
The return value is true if this node should be visible, or false if it should be culled.
Reimplemented from PGItem.
Definition at line 100 of file pgWaitBar.cxx.
PGFrameStyle PGWaitBar::get_bar_style | ( | ) | const [inline] |
Returns the kind of frame that is drawn on top of the WaitBar to represent the amount completed.
Definition at line 94 of file pgWaitBar.I.
PN_stdfloat PGWaitBar::get_percent | ( | ) | const [inline] |
Returns the percentage complete.
Definition at line 69 of file pgWaitBar.I.
PN_stdfloat PGWaitBar::get_range | ( | ) | const [inline] |
Returns the value at which the WaitBar indicates 100%.
Definition at line 34 of file pgWaitBar.I.
PN_stdfloat PGWaitBar::get_value | ( | ) | const [inline] |
Returns the current value of the bar.
Definition at line 58 of file pgWaitBar.I.
PandaNode * PGWaitBar::make_copy | ( | ) | const [virtual] |
void PGWaitBar::set_bar_style | ( | const PGFrameStyle & | style | ) | [inline] |
Sets the kind of frame that is drawn on top of the WaitBar to represent the amount completed.
Definition at line 81 of file pgWaitBar.I.
Referenced by setup().
void PGWaitBar::set_range | ( | PN_stdfloat | range | ) | [inline] |
Sets the value at which the WaitBar indicates 100%.
Definition at line 22 of file pgWaitBar.I.
void PGWaitBar::set_value | ( | PN_stdfloat | value | ) | [inline] |
Sets the current value of the bar.
This should range between 0 and get_range().
Definition at line 46 of file pgWaitBar.I.
void PGWaitBar::setup | ( | PN_stdfloat | width, |
PN_stdfloat | height, | ||
PN_stdfloat | range | ||
) |
Creates a PGWaitBar with the indicated dimensions, with the indicated maximum range.
Definition at line 113 of file pgWaitBar.cxx.
References PGItem::clear_state_def(), set_bar_style(), PGFrameStyle::set_color(), PGItem::set_frame(), PGItem::set_frame_style(), PGItem::set_state(), PGFrameStyle::set_type(), and PGFrameStyle::set_width().