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