Panda3D
Public Member Functions | Static Public Member Functions

MouseWatcherGroup Class Reference

This represents a collection of MouseWatcherRegions that may be managed as a group. More...

Inheritance diagram for MouseWatcherGroup:
ReferenceCount MemoryBase MouseWatcher

List of all members.

Public Member Functions

 addRegion (MouseWatcherRegion region)
 Adds the indicated region to the set of regions in the group.
 clearRegions ()
 Removes all the regions from the group.
MouseWatcherRegion findRegion (string name)
 Returns a pointer to the first region found with the indicated name.
int getNumRegions ()
 Returns the number of regions in the group.
int getRefCount ()
 Returns the current reference count.
MouseWatcherRegion getRegion (int n)
 Returns the nth region of the group; returns NULL if there is no nth region.
list getRegions ()
bool hasRegion (MouseWatcherRegion region)
 Returns true if the indicated region has already been added to the MouseWatcherGroup, false otherwise.
 hideRegions ()
 Stops the visualization created by a previous call to show_regions().
bool isSorted ()
 Returns true if the group has already been sorted, false otherwise.
 output (ostream out)
 ref ()
 Explicitly increments the reference count.
bool removeRegion (MouseWatcherRegion region)
 Removes the indicated region from the group.
 setColor (VBase4 const color)
 Specifies the color used to draw the region rectangles for the regions visualized by show_regions().
 showRegions (NodePath const render2d, string bin_name, int draw_order)
 Enables the visualization of all of the regions handled by this MouseWatcherGroup.
 sortRegions ()
 Sorts all the regions in this group into pointer order.
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
bool unref ()
 Explicitly decrements the reference count.
 updateRegions ()
 Refreshes the visualization created by show_regions().
 write (ostream out, int indent_level)
 write (ostream out)

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This represents a collection of MouseWatcherRegions that may be managed as a group.


Member Function Documentation

addRegion ( MouseWatcherRegion  region)

Adds the indicated region to the set of regions in the group.

It is an error to add the same region to the set more than once.

clearRegions ( )

Removes all the regions from the group.

MouseWatcherRegion findRegion ( string  name)

Returns a pointer to the first region found with the indicated name.

If multiple regions share the same name, the one that is returned is indeterminate.

static TypeHandle getClassType ( ) [static]

Reimplemented from ReferenceCount.

Reimplemented in MouseWatcher.

int getNumRegions ( )

Returns the number of regions in the group.

int getRefCount ( ) [inherited]

Returns the current reference count.

MouseWatcherRegion getRegion ( int  n)

Returns the nth region of the group; returns NULL if there is no nth region.

Note that this is not thread-safe; another thread might have removed the nth region before you called this method.

list getRegions ( )
bool hasRegion ( MouseWatcherRegion  region)

Returns true if the indicated region has already been added to the MouseWatcherGroup, false otherwise.

hideRegions ( )

Stops the visualization created by a previous call to show_regions().

bool isSorted ( )

Returns true if the group has already been sorted, false otherwise.

output ( ostream  out)
ref ( ) [inherited]

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

bool removeRegion ( MouseWatcherRegion  region)

Removes the indicated region from the group.

Returns true if it was successfully removed, or false if it wasn't there in the first place.

Reimplemented in MouseWatcher.

setColor ( VBase4 const  color)

Specifies the color used to draw the region rectangles for the regions visualized by show_regions().

showRegions ( NodePath const  render2d,
string  bin_name,
int  draw_order 
)

Enables the visualization of all of the regions handled by this MouseWatcherGroup.

The supplied NodePath should be the root of the 2-d scene graph for the window.

sortRegions ( )

Sorts all the regions in this group into pointer order.

bool testRefCountIntegrity ( ) [inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

bool testRefCountNonzero ( ) [inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

bool unref ( ) [inherited]

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.

updateRegions ( )

Refreshes the visualization created by show_regions().

write ( ostream  out)
write ( ostream  out,
int  indent_level 
)
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties