# MouseWatcherGroup

from pandac.PandaModules import MouseWatcherGroup

Class : MouseWatcherGroup
Description : This represents a collection of MouseWatcherRegions that may be managed as a group.

## Inheritance:

MouseWatcherGroup: ReferenceCount
ReferenceCount: MemoryBase
MemoryBase:

## Methods of MouseWatcherGroup:

addRegion
clearRegions
findRegion
getClassType
getNumRegions
getRegion
hasRegion
hideRegions
output
removeRegion
setColor
showRegions
updateRegions
write

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

addRegion void MouseWatcherGroup::add_region(MouseWatcherRegion *region); Description: 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 void MouseWatcherGroup::clear_regions(void); Description: Removes all the regions from the group.

findRegion MouseWatcherRegion *MouseWatcherGroup::find_region(string const &name) const; Description: 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.

getClassType static TypeHandle MouseWatcherGroup::get_class_type(void); Undocumented function.

getNumRegions int MouseWatcherGroup::get_num_regions(void) const; Description: Returns the number of regions in the group.

getRegion MouseWatcherRegion *MouseWatcherGroup::get_region(int n) const; Description: 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.

hasRegion bool MouseWatcherGroup::has_region(MouseWatcherRegion *region) const; Description: Returns true if the indicated region has already been added to the MouseWatcherGroup, false otherwise.

hideRegions void MouseWatcherGroup::hide_regions(void); Description: Stops the visualization created by a previous call to show_regions().

output void MouseWatcherGroup::output(ostream &out) const; Description:

removeRegion bool MouseWatcherGroup::remove_region(MouseWatcherRegion *region); Description: 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.

setColor void MouseWatcherGroup::set_color(LVecBase4f const &color); Description: Specifies the color used to draw the region rectangles for the regions visualized by show_regions().

showRegions void MouseWatcherGroup::show_regions(NodePath const &render2d, string const &bin_name, int draw_order); Description: 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.

updateRegions void MouseWatcherGroup::update_regions(void); Description: Refreshes the visualization created by show_regions().

write void MouseWatcherGroup::write(ostream &out, int indent_level = (0)) const; Description:

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: 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.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: 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; plus, we don't have a virtual destructor anyway.) 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.