Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csRectRegion Class Reference

A rect region is a class that implements splittable 2d rectangles. More...

#include <csrectrg.h>

List of all members.

Public Methods

 csRectRegion ()
 Constructor.

 ~csRectRegion ()
 Destructor.

void Include (csRect &rect)
 Add a rect to this region; may cause unions, but will not adjance (see csRect).

void Exclude (csRect &rect)
 Exclude a rect from this region; may cause splitting. NOTE: broken!!!

void ClipTo (csRect &clip)
 Clips everything in the region to the borders given.

int Count ()
 Returns the number of rectangles in this region.

csRectRectAt (int i)
 Returns the rect at a specific index.

void makeEmpty ()
 Resets the region count to zero.


Protected Methods

void pushRect (csRect const &)
 Pushes a new rect into the region, increases buffer if necessary.

void deleteRect (int)
 Removes a rect from the region.

void fragmentRect (csRect &, csRect &, int mode)
 Controls fragmentContainedRect, used to perform all-side clipping and edge intersection.

void nkSplit (csRect &r1, csRect &r2)
void fragmentContainedRect (csRect &r1, csRect &r2)
 Work method fragments rects properly when they intersect.

void markForGather ()
 Marks the current region insertion point for gather.

void gatherFragments ()
 Gathers all regions since the mark into the fragment buffer.


Protected Attributes

csRectregion
 The pointer the list of regions.

int region_count
 The number of regions currently stored.

int region_max
 The size of the region buffer (in rects).

csRect fragment [FRAGMENT_BUFFER_SIZE]
 The fragment buffer, used for performing fragment operations.

int gather_mark
 The gather marker.


Detailed Description

A rect region is a class that implements splittable 2d rectangles.

The region may be composed of one or more rectangles that do not need to occupy the same area. The idea being that you need to be able to have a number of disparate rectangular regions for updates. This class uses csRect for nearly all rectangle operations.

To use you can Include and Exclude rectangles from this region. When finished, this class will have a list of optimal rectangles that occupy a region. If used properly, it will result in faster overall painting performance, since several areas will not require overwriting.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000