Panda3D
pgTop.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pgTop.I
10  * @author drose
11  * @date 2002-03-13
12  */
13 
14 /**
15  *
16  */
17 INLINE PGTop::
18 PGTop(const PGTop &copy) :
19  PandaNode(copy),
20  _watcher(copy._watcher),
21  _start_sort(copy._start_sort)
22 {
23 }
24 
25 /**
26  * Returns the MouseWatcher pointer that the PGTop object registers its PG
27  * items with, or NULL if the MouseWatcher has not yet been set.
28  */
29 INLINE MouseWatcher *PGTop::
31  return _watcher;
32 }
33 
34 /**
35  * Returns the MouseWatcherGroup pointer that the PGTop object registers its
36  * PG items with, or NULL if the MouseWatcher has not yet been set.
37  */
39 get_group() const {
40  return _watcher_group;
41 }
42 
43 /**
44  * Specifies the sort index that is assigned during the traversal to the first
45  * PGItem that is discovered during traversal. Subsequent PGItems will be
46  * assigned consecutively higher sort indexes.
47  *
48  * This number is used by the MouseWatcher system to rank the clickable mouse
49  * regions in the same order in which the items are rendered, so that items on
50  * top will receive mouse priority.
51  *
52  * Normally, it makes the most sense to leave this initial value at its
53  * default value of 0, unless you need the PGItems to have a particular sort
54  * value with respect to some other objects in the scene (particularly with a
55  * second PGTop node).
56  */
57 INLINE void PGTop::
58 set_start_sort(int start_sort) {
59  _start_sort = start_sort;
60 }
61 
62 /**
63  * Returns the sort index that is assigned during the traversal to the first
64  * PGItem that is discovered during traversal. See set_start_sort().
65  */
66 INLINE int PGTop::
67 get_start_sort() const {
68  return _start_sort;
69 }
70 
71 
72 /**
73  * Adds the indicated region to the set of regions in the group.
74  */
75 INLINE void PGTop::
77  nassertv(_watcher_group != nullptr);
78  _watcher_group->add_region(region);
79 }
The "top" node of the new Panda GUI system.
Definition: pgTop.h:38
This TFormer maintains a list of rectangular regions on the screen that are considered special mouse ...
Definition: mouseWatcher.h:61
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
This represents a collection of MouseWatcherRegions that may be managed as a group.
MouseWatcher * get_mouse_watcher() const
Returns the MouseWatcher pointer that the PGTop object registers its PG items with,...
Definition: pgTop.I:30
void set_start_sort(int start_sort)
Specifies the sort index that is assigned during the traversal to the first PGItem that is discovered...
Definition: pgTop.I:58
This is the class that defines a rectangular region on the screen for the MouseWatcher.
int get_start_sort() const
Returns the sort index that is assigned during the traversal to the first PGItem that is discovered d...
Definition: pgTop.I:67
void add_region(MouseWatcherRegion *region)
Adds the indicated region to the set of regions in the group.
Definition: pgTop.I:76
MouseWatcherGroup * get_group() const
Returns the MouseWatcherGroup pointer that the PGTop object registers its PG items with,...
Definition: pgTop.I:39