25 PGWaitBar(
const std::string &name) :
PGItem(name)
86 return PGItem::cull_callback(trav, data);
94 setup(PN_stdfloat width, PN_stdfloat height, PN_stdfloat range) {
99 set_frame(-0.5f * width, 0.5f * width, -0.5f * height, 0.5f * height);
101 PN_stdfloat bevel = 0.05f;
107 style.
set_type(PGFrameStyle::T_bevel_in);
111 style.
set_type(PGFrameStyle::T_bevel_out);
126 if (_bar_state == state) {
134 if ((_value != 0.0f) && (_range != 0.0f)) {
140 const LVecBase2 &width = style.get_width();
143 LVecBase4 bar_frame(frame[0] + width[0],
146 frame[3] - width[1]);
149 PN_stdfloat frac = _value / _range;
150 frac = std::max(std::min(frac, (PN_stdfloat)1.0), (PN_stdfloat)0.0);
151 bar_frame[1] = bar_frame[0] + frac * (bar_frame[1] - bar_frame[0]);
A basic node of the scene graph or data graph.
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_width(PN_stdfloat x, PN_stdfloat y)
Sets the width parameter, which has meaning only for certain frame types.
PGFrameStyle get_frame_style(int state)
Returns the kind of frame that will be drawn behind the item when it is in the indicated state.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
This is the base class for all the various kinds of gui widget objects.
int get_state() const
Returns the "state" of this particular PGItem.
bool is_empty() const
Returns true if the NodePath contains no nodes.
void set_type(Type type)
Sets the basic type of frame.
void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
Sets the bounding rectangle of the item, in local coordinates.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual PandaNode * make_copy() const
Returns a newly-allocated Node that is a shallow copy of this one.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
void setup(PN_stdfloat width, PN_stdfloat height, PN_stdfloat range)
Creates a PGWaitBar with the indicated dimensions, with the indicated maximum range.
void set_frame_style(int state, const PGFrameStyle &style)
Changes the kind of frame that will be drawn behind the item when it is in the indicated state.
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a)
Sets the dominant color of the frame.
NodePath generate_into(const NodePath &parent, const LVecBase4 &frame, int sort=0)
Generates geometry representing a frame of the indicated size, and parents it to the indicated node,...
This is a particular kind of PGItem that draws a little bar that fills from left to right to indicate...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Similar to MutexHolder, but for a light reentrant mutex.
void set_state(int state)
Sets the "state" of this particular PGItem.
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
void clear_state_def(int state)
Resets the NodePath assigned to the indicated state to its initial default, with only a frame represe...
const LVecBase4 & get_frame() const
Returns the bounding rectangle of the item.
TypeHandle is the identifier used to differentiate C++ class types.
get_state_def
Returns the Node that is the root of the subgraph that will be drawn when the PGItem is in the indica...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...