This represents a collection of
MouseWatcherRegionsthat may be managed as a group. This is the base class for both
MouseWatcher, and exists so that we don’t have to make
ReferenceCountmore than once.
void add_region(PointerTo<MouseWatcherRegion> region)
Adds the indicated region to the set of regions in the group. It is no longer an error to call this for the same region more than once.
Removes all the regions from the group.
MouseWatcherRegion *find_region(std::string const &name) const
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.
std::size_t get_num_regions(void) const
Returns the number of regions in the group.
MouseWatcherRegion *get_region(std::size_t n) const
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.
bool has_region(MouseWatcherRegion *region) const
Returns true if the indicated region has already been added to the
MouseWatcherBase, false otherwise.
bool is_sorted(void) const
Returns true if the group has already been sorted, false otherwise.
void output(std::ostream &out) const
bool remove_region(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.
void set_color(LColor const &color)
Specifies the color used to draw the region rectangles for the regions visualized by
void show_regions(NodePath const &render2d, std::string const &bin_name, int draw_order)
Sorts all the regions in this group into pointer order.
void write(std::ostream &out, int indent_level = 0) const
- void add_region(PointerTo<MouseWatcherRegion> region)