42 PGItem *PGItem::_focus_item =
nullptr;
50 is_right(
const LVector2 &v1,
const LVector2 &v2) {
51 return (v1[0] * v2[1] - v1[1] * v2[0]) > 0;
58 PGItem(
const string &name) :
76 if (_notify !=
nullptr) {
77 _notify->remove_item(
this);
81 nassertv(_region->_item ==
this);
82 _region->_item =
nullptr;
85 if (_focus_item ==
this) {
86 _focus_item =
nullptr;
94 PGItem(
const PGItem ©) :
97 _has_frame(copy._has_frame),
103 , _sounds(copy._sounds)
109 _region->set_name(copy._region->get_name());
112 size_t num_state_defs = copy._state_defs.size();
113 _state_defs.reserve(num_state_defs);
114 for (
size_t i = 0; i < num_state_defs; ++i) {
118 StateDef &old_sd = (StateDef &)(copy._state_defs[i]);
119 old_sd._frame.remove_node();
120 old_sd._frame_stale =
true;
123 new_sd._root = old_sd._root.copy_to(
NodePath());
124 new_sd._frame_style = old_sd._frame_style;
126 _state_defs.push_back(new_sd);
147 transform_changed() {
149 PandaNode::transform_changed();
150 if (_notify !=
nullptr) {
151 _notify->item_transform_changed(
this);
161 draw_mask_changed() {
163 PandaNode::draw_mask_changed();
164 if (_notify !=
nullptr) {
165 _notify->item_draw_mask_changed(
this);
195 has_frame = _has_frame && ((_flags & F_active) != 0);
199 if (state >= 0 && (
size_t)state < _state_defs.size()) {
200 StateDef &state_def = _state_defs[state];
201 if (!state_def._root.is_empty()) {
202 if (state_def._frame_stale) {
206 state_def_root = state_def._root.node();
217 if (trav->
is_exact_type(PGCullTraverser::get_class_type())) {
219 DCAST_INTO_R(pg_trav, trav,
true);
221 const LMatrix4 &transform = data.get_net_transform(trav)->get_mat();
226 int bin_index = data._state->get_bin_index();
230 CullBinManager::BinType bin_type = bin_manager->
get_bin_type(bin_index);
231 if (bin_type == CullBinManager::BT_fixed) {
234 sort = data._state->get_draw_order();
236 }
else if (bin_type == CullBinManager::BT_unsorted) {
239 sort = pg_trav->_sort_index;
240 pg_trav->_sort_index++;
249 int bin_sort = bin_manager->
get_bin_sort(data._state->get_bin_index());
256 sort = (bin_sort << 16) | ((sort + 0x8000) & 0xffff);
260 data._state->get_attrib(clip);
261 data._state->get_attrib(scissor);
262 if (activate_region(transform, sort, clip, scissor)) {
268 if (state_def_root !=
nullptr) {
286 is_renderable()
const {
297 int &internal_vertices,
299 Thread *current_thread)
const {
301 int num_vertices = 0;
307 if (btype == BoundingVolume::BT_default) {
311 if (btype == BoundingVolume::BT_sphere) {
324 for (
int i = 0; i < (int)_state_defs.size(); i++) {
328 child_volumes.push_back(node->get_bounds(current_thread));
329 num_vertices += node->get_nested_vertices(current_thread);
334 const BoundingVolume **child_end = child_begin + child_volumes.size();
336 bound->around(child_begin, child_end);
338 internal_bounds = bound;
339 internal_vertices = num_vertices;
350 StateDefs::iterator di;
351 for (di = _state_defs.begin(); di != _state_defs.end(); ++di) {
355 CPT(
RenderState) child_state = node_state->compose(child->get_state());
368 xform(
const LMatrix4 &mat) {
371 LPoint3 ll(_frame[0], 0.0f, _frame[2]);
372 LPoint3 ur(_frame[1], 0.0f, _frame[3]);
375 _frame.set(ll[0], ur[0], ll[2], ur[2]);
378 StateDefs::iterator di;
379 for (di = _state_defs.begin(); di != _state_defs.end(); ++di) {
389 if ((*di)._frame_style.xform(mat)) {
390 (*di)._frame_stale =
true;
393 mark_internal_bounds_stale();
404 activate_region(
const LMatrix4 &transform,
int sort,
413 LPoint3 ll = LPoint3::rfu(_frame[0], 0.0f, _frame[2]) * transform;
414 LPoint3 lr = LPoint3::rfu(_frame[1], 0.0f, _frame[2]) * transform;
415 LPoint3 ul = LPoint3::rfu(_frame[0], 0.0f, _frame[3]) * transform;
416 LPoint3 ur = LPoint3::rfu(_frame[1], 0.0f, _frame[3]) * transform;
417 LVector3 up = LVector3::up();
428 LVector3 right = LVector3::right();
447 points.push_back(LPoint2(ll[right_axis], ll[up_axis]));
448 points.push_back(LPoint2(lr[right_axis], lr[up_axis]));
449 points.push_back(LPoint2(ur[right_axis], ur[up_axis]));
450 points.push_back(LPoint2(ul[right_axis], ul[up_axis]));
453 for (
int i = 0; i < num_on_planes; ++i) {
455 LPlane plane = DCAST(
PlaneNode, plane_path.
node())->get_plane();
456 plane.xform(plane_path.get_net_transform()->
get_mat());
461 clip_frame(points, plane);
464 if (points.empty()) {
469 ClipPoints::iterator pi;
471 frame.set((*pi)[0], (*pi)[0], (*pi)[1], (*pi)[1]);
473 while (pi != points.end()) {
474 frame[0] = min(frame[0], (*pi)[0]);
475 frame[1] = max(frame[1], (*pi)[0]);
476 frame[2] = min(frame[2], (*pi)[1]);
477 frame[3] = max(frame[3], (*pi)[1]);
482 frame.set(min(min(ll[right_axis], lr[right_axis]), min(ul[right_axis], ur[right_axis])),
483 max(max(ll[right_axis], lr[right_axis]), max(ul[right_axis], ur[right_axis])),
484 min(min(ll[up_axis], lr[up_axis]), min(ul[up_axis], ur[up_axis])),
485 max(max(ll[up_axis], lr[up_axis]), max(ul[up_axis], ur[up_axis])));
492 frame.set(max(frame[0], sf[0] * 2.0f - 1.0f),
493 min(frame[1], sf[1] * 2.0f - 1.0f),
494 max(frame[2], sf[2] * 2.0f - 1.0f),
495 min(frame[3], sf[3] * 2.0f - 1.0f));
496 if (frame[1] <= frame[0] || frame[3] <= frame[2]) {
502 _region->set_frame(frame);
504 _region->set_sort(sort);
505 _region->set_active(
true);
509 _frame_inv_xform.invert_from(transform);
523 if (pgui_cat.is_debug()) {
525 << *
this <<
"::enter_region(" << param <<
")\n";
533 if (_notify !=
nullptr) {
534 _notify->item_enter(
this, param);
547 if (pgui_cat.is_debug()) {
549 << *
this <<
"::exit_region(" << param <<
")\n";
557 if (_notify !=
nullptr) {
558 _notify->item_exit(
this, param);
573 if (pgui_cat.is_debug()) {
575 << *
this <<
"::within_region(" << param <<
")\n";
583 if (_notify !=
nullptr) {
584 _notify->item_within(
this, param);
595 if (pgui_cat.is_debug()) {
597 << *
this <<
"::without_region(" << param <<
")\n";
605 if (_notify !=
nullptr) {
606 _notify->item_without(
this, param);
617 if (pgui_cat.is_debug()) {
619 << *
this <<
"::focus_in()\n";
626 if (_notify !=
nullptr) {
627 _notify->item_focus_in(
this);
638 if (pgui_cat.is_debug()) {
640 << *
this <<
"::focus_out()\n";
647 if (_notify !=
nullptr) {
648 _notify->item_focus_out(
this);
659 if (pgui_cat.is_debug()) {
661 << *
this <<
"::press(" << param <<
", " << background <<
")\n";
676 if (_notify !=
nullptr) {
677 _notify->item_press(
this, param);
688 if (pgui_cat.is_debug()) {
690 << *
this <<
"::release(" << param <<
", " << background <<
")\n";
700 if (_notify !=
nullptr) {
701 _notify->item_release(
this, param);
711 if (pgui_cat.is_debug()) {
713 << *
this <<
"::keystroke(" << param <<
", " << background <<
")\n";
735 if (pgui_cat.is_debug()) {
737 << *
this <<
"::candidate(" << param <<
", " << background <<
")\n";
755 if (pgui_cat.is_debug()) {
757 << *
this <<
"::move(" << param <<
")\n";
760 if (_notify !=
nullptr) {
761 _notify->item_move(
this, param);
770 BackgroundFocus::const_iterator fi;
771 for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) {
774 item->
press(param,
true);
784 BackgroundFocus::const_iterator fi;
785 for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) {
798 BackgroundFocus::const_iterator fi;
799 for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) {
812 BackgroundFocus::const_iterator fi;
813 for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) {
860 if (_focus_item !=
this) {
861 if (_focus_item !=
nullptr) {
873 if (_focus_item ==
this) {
875 _focus_item =
nullptr;
883 _region->set_keyboard(focus);
898 _flags |= F_background_focus;
899 bool inserted = _background_focus.insert(
this).second;
904 _flags &= ~F_background_focus;
905 size_t num_erased = _background_focus.erase(
this);
906 nassertv(num_erased == 1);
920 get_num_state_defs()
const {
922 return _state_defs.size();
933 if (state < 0 || state >= (
int)_state_defs.size()) {
936 return (!_state_defs[state]._root.is_empty());
946 if (state < 0 || state >= (
int)_state_defs.size()) {
950 _state_defs[state]._root =
NodePath();
951 _state_defs[state]._frame =
NodePath();
952 _state_defs[state]._frame_stale =
true;
954 mark_internal_bounds_stale();
969 mark_internal_bounds_stale();
981 if (state < 0 || state >= (
int)_state_defs.size()) {
984 return _state_defs[state]._frame_style;
996 NodePath &root = do_get_state_def(state);
999 _state_defs[state]._frame_style = style;
1000 _state_defs[state]._frame_stale =
true;
1002 mark_internal_bounds_stale();
1010 set_sound(
const string &event,
AudioSound *sound) {
1012 _sounds[event] = sound;
1019 clear_sound(
const string &event) {
1021 _sounds.erase(event);
1029 get_sound(
const string &event)
const {
1031 Sounds::const_iterator si = _sounds.find(event);
1032 if (si != _sounds.end()) {
1033 return (*si).second;
1043 has_sound(
const string &event)
const {
1045 return (_sounds.count(event) != 0);
1047 #endif // HAVE_AUDIO 1056 if (_text_node ==
nullptr) {
1057 _text_node =
new TextNode(
"pguiText");
1058 _text_node->set_text_color(0.0f, 0.0f, 0.0f, 1.0f);
1062 _text_node->set_align(TextNode::A_left);
1071 play_sound(
const string &event) {
1074 Sounds::const_iterator si = _sounds.find(event);
1075 if (si != _sounds.end()) {
1079 #endif // HAVE_AUDIO 1094 reduce_region(LVecBase4 &frame,
PGItem *obscurer)
const {
1099 LVecBase4 oframe = get_relative_frame(obscurer);
1103 LVecBase4 right(max(frame[0], oframe[1]), frame[1], frame[2], frame[3]);
1104 LVecBase4 left(frame[0], min(frame[1], oframe[0]), frame[2], frame[3]);
1105 LVecBase4 above(frame[0], frame[1], max(frame[2], oframe[3]), frame[3]);
1106 LVecBase4 below(frame[0], frame[1], frame[2], min(frame[3], oframe[2]));
1109 const LVecBase4 *largest = &right;
1110 PN_stdfloat largest_area = compute_area(*largest);
1111 compare_largest(largest, largest_area, &left);
1112 compare_largest(largest, largest_area, &above);
1113 compare_largest(largest, largest_area, &below);
1124 get_relative_frame(
PGItem *item)
const {
1133 const LVecBase4 &orig_frame = item->
get_frame();
1134 LMatrix4 transform = item_np.
get_mat(this_np);
1139 LPoint3 ll(orig_frame[0], 0.0f, orig_frame[2]);
1140 LPoint3 lr(orig_frame[1], 0.0f, orig_frame[2]);
1141 LPoint3 ul(orig_frame[0], 0.0f, orig_frame[3]);
1142 LPoint3 ur(orig_frame[1], 0.0f, orig_frame[3]);
1143 ll = ll * transform;
1144 lr = lr * transform;
1145 ul = ul * transform;
1146 ur = ur * transform;
1148 return LVecBase4(min(min(ll[0], lr[0]), min(ul[0], ur[0])),
1149 max(max(ll[0], lr[0]), max(ul[0], ur[0])),
1150 min(min(ll[2], lr[2]), min(ul[2], ur[2])),
1151 max(max(ll[2], lr[2]), max(ul[2], ur[2])));
1159 mouse_to_local(
const LPoint2 &mouse_point)
const {
1164 return inv_transform->
get_mat().xform_point(LVector3::rfu(mouse_point[0], 0, mouse_point[1]));
1173 mark_frames_stale();
1174 if (_notify !=
nullptr) {
1175 _notify->item_frame_changed(
this);
1187 do_get_state_def(
int state) {
1188 slot_state_def(state);
1190 if (_state_defs[state]._root.is_empty()) {
1192 _state_defs[state]._root =
NodePath(
"state_" + format_string(state));
1193 _state_defs[state]._frame_stale =
true;
1196 if (_state_defs[state]._frame_stale) {
1197 update_frame(state);
1200 return _state_defs[state]._root;
1207 slot_state_def(
int state) {
1208 while (state >= (
int)_state_defs.size()) {
1209 _state_defs.push_back(StateDef());
1217 update_frame(
int state) {
1219 if (state >= 0 && state < (
int)_state_defs.size()) {
1220 _state_defs[state]._frame.remove_node();
1225 _state_defs[state]._frame_stale =
false;
1229 NodePath &root = do_get_state_def(state);
1230 _state_defs[state]._frame =
1231 _state_defs[state]._frame_style.generate_into(root, _frame);
1240 mark_frames_stale() {
1241 StateDefs::iterator di;
1242 for (di = _state_defs.begin(); di != _state_defs.end(); ++di) {
1244 (*di)._frame.remove_node();
1245 (*di)._frame_stale =
true;
1247 mark_internal_bounds_stale();
1258 clip_frame(ClipPoints &source_points,
const LPlane &plane)
const {
1259 if (source_points.empty()) {
1265 if (!plane.intersects_plane(from3d, delta3d, LPlane(LVector3(0, 1, 0), LPoint3::zero()))) {
1268 if (plane.dist_to_plane(LPoint3::zero()) < 0.0) {
1278 LPoint2 from2d(from3d[0], from3d[2]);
1279 LVector2 delta2d(delta3d[0], delta3d[2]);
1281 PN_stdfloat a = -delta2d[1];
1282 PN_stdfloat b = delta2d[0];
1283 PN_stdfloat c = from2d[0] * delta2d[1] - from2d[1] * delta2d[0];
1291 ClipPoints new_points;
1292 new_points.reserve(source_points.size() + 1);
1294 LPoint2 last_point(source_points.back());
1295 bool last_is_in =
is_right(last_point - from2d, delta2d);
1296 bool all_in = last_is_in;
1297 ClipPoints::const_iterator pi;
1298 for (pi = source_points.begin(); pi != source_points.end(); ++pi) {
1299 LPoint2 this_point(*pi);
1300 bool this_is_in =
is_right(this_point - from2d, delta2d);
1304 bool crossed_over = (this_is_in != last_is_in);
1308 LVector2 d = this_point - last_point;
1309 PN_stdfloat denom = (a * d[0] + b * d[1]);
1311 PN_stdfloat t = -(a * last_point[0] + b * last_point[1] + c) / denom;
1312 LPoint2 p = last_point + t * d;
1314 new_points.push_back(p);
1315 last_is_in = this_is_in;
1321 new_points.push_back(this_point);
1326 last_point = this_point;
1329 source_points.swap(new_points);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_background_focus() const
Returns whether background_focus is currently enabled.
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This specialization on MouseWatcherParameter allows us to tag on additional elements to events for th...
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
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.
bool is_exact_type(TypeHandle handle) const
Returns true if the current object is the indicated type exactly.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class for all the various kinds of gui widget objects.
An optional parameter associated with an event.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_empty() const
Returns true if the NodePath contains no nodes.
static void background_release(const MouseWatcherParameter ¶m)
Calls release() on all the PGItems with background focus.
bool get_active() const
Returns whether the PGItem is currently active for mouse events.
std::string get_focus_in_event() const
Returns the event name that will be thrown when the item gets the keyboard focus.
int get_bin_sort(int bin_index) const
Returns the sort order of the bin with the indicated bin_index (where bin_index was retrieved by get_...
bool has_state_def(int state) const
Returns true if get_state_def() has ever been called for the indicated state (thus defining a render ...
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
virtual void without_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse moves completely outside the boundaries o...
This defines a bounding sphere, consisting of a center and a radius.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An interface for simplifying ("flattening") scene graphs by eliminating unneeded nodes and collapsing...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
virtual void enter_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse enters the region.
virtual void focus_out()
This is a callback hook function, called whenever the widget loses the keyboard focus.
This functions similarly to a LightAttrib.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath instance_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Adds the referenced node of the NodePath as a child of the referenced node of the indicated other Nod...
std::string get_enter_event() const
Returns the event name that will be thrown when the item is active and the mouse enters its frame,...
std::string get_press_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer, Thread *current_thread)
The recursive implementation of prepare_scene().
void traverse(const NodePath &root)
Begins the traversal from the indicated node.
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
static CullBinManager * get_global_ptr()
Returns the pointer to the global CullBinManager object.
static NodePath any_path(PandaNode *node, Thread *current_thread=Thread::get_current_thread())
Returns a new NodePath that represents any arbitrary path from the root to the indicated node.
This is our own Panda specialization on the default STL vector.
bool is_right(const LVector2 &v1, const LVector2 &v2)
Returns true if the 2-d v1 is to the right of v2.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
std::string get_exit_event() const
Returns the event name that will be thrown when the item is active and the mouse exits its frame,...
bool has_notify() const
Returns true if there is an object configured to be notified when the PGItem changes,...
std::string get_keystroke_event() const
Returns the event name that will be thrown when the item is active and any key is pressed by the user...
bool is_keyrepeat() const
Returns true if the button-down even was generated due to keyrepeat, or false if it was an original b...
virtual void focus_in()
This is a callback hook function, called whenever the widget gets the keyboard focus.
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.
ButtonHandle get_button() const
Returns the mouse or keyboard button associated with this event.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void set_focus(bool focus)
Sets whether the PGItem currently has keyboard focus.
std::string get_focus_out_event() const
Returns the event name that will be thrown when the item loses the keyboard focus.
NodePath instance_to_state_def(int state, const NodePath &path)
Parents an instance of the bottom node of the indicated NodePath to the indicated state index.
This is a specialization of CullTraverser for use within the pgui system.
get_num_on_planes
Returns the number of planes that are enabled by the attribute.
static void background_press(const MouseWatcherParameter ¶m)
Calls press() on all the PGItems with background focus.
PGItemNotify * get_notify() const
Returns the object which will be notified when the PGItem changes, if any.
virtual void release(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever a mouse or keyboard button previously depressed wit...
get_bounds_type
Returns the bounding volume type set with set_bounds_type().
This is a specialization on MouseWatcherRegion, to add a bit more fields that are relevant to the PG ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static TextNode * get_text_node()
Returns the TextNode object that will be used by all PGItems to generate default labels given a strin...
bool get_focus() const
Returns whether the PGItem currently has focus for keyboard events.
virtual void within_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse moves within the boundaries of the region...
Similar to MutexHolder, but for a light reentrant mutex.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
std::string get_repeat_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
get_frame
Returns the left, right, bottom, top coordinates of the scissor frame.
void apply_attribs(PandaNode *node, int attrib_types=~(TT_clip_plane|TT_cull_face|TT_apply_texture_color))
Walks the scene graph, accumulating attribs of the indicated types, applying them to the vertices,...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
virtual void move(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever a mouse is moved while within the region.
PandaNode * node() const
Returns the referenced node of the path.
get_on_plane
Returns the nth plane enabled by the attribute, sorted in render order.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A thread; that is, a lightweight process.
void set_background_focus(bool focus)
Sets the background_focus flag for this item.
The primary interface to this module.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void clear_state_def(int state)
Resets the NodePath assigned to the indicated state to its initial default, with only a frame represe...
virtual void candidate(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever the user highlights an option in the IME window.
bool has_frame() const
Returns true if the item has a bounding rectangle; see set_frame().
virtual void keystroke(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever the user presses a key.
NodePath find_path_to(PandaNode *node) const
Searches for the indicated node below this node and returns the shortest NodePath that connects them.
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
void add_region(MouseWatcherRegion *region)
Adds the indicated region to the set of regions in the group.
const DrawMask & get_camera_mask() const
Returns the visibility mask from the camera viewing the scene.
This restricts rendering to within a rectangular region of the scene, without otherwise affecting the...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const LVecBase4 & get_frame() const
Returns the bounding rectangle of the item.
std::string get_release_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
TypeHandle is the identifier used to differentiate C++ class types.
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
const TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
This is a global object that maintains the collection of named CullBins in the world.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void exit_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse exits the region.
std::string get_within_event() const
Returns the event name that will be thrown when the item is active and the mouse moves within the bou...
std::string get_without_event() const
Returns the event name that will be thrown when the item is active and the mouse moves completely out...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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,...
virtual void set_active(bool active)
Sets whether the PGItem is active for mouse watching.
A node that contains a plane.
static void background_candidate(const MouseWatcherParameter ¶m)
Calls candidate() on all the PGItems with background focus.
virtual void press(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever a mouse or keyboard button is depressed while the m...
static void background_keystroke(const MouseWatcherParameter ¶m)
Calls keystroke() on all the PGItems with background focus.
BinType get_bin_type(int bin_index) const
Returns the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() ...