csSubRectangles Class Reference
[Geometry utilities]
A class managing allocations of sub-rectangles.
More...
#include <csgeom/subrec.h>
Public Member Functions | |
SubRect * | Alloc (int w, int h, csRect &rect) |
Allocate a new rectangle. | |
void | Clear () |
Free all rectangles in this region. | |
csSubRectangles (const csRect ®ion) | |
Allocate a new empty region with the given size. | |
void | Dump () |
For debugging: dump all free rectangles. | |
const csRect & | GetRectangle () const |
Get the rectangle for this region. | |
bool | Grow (int newWidth, int newHeight) |
Increase the size of the region. | |
void | Reclaim (SubRect *subrect) |
Reclaim a subrectangle, meaning, the space occupied by the subrect can be reused by subsequent Alloc() calls. | |
~csSubRectangles () | |
Remove this region and sub-regions. | |
Protected Member Functions | |
void | AddLeaf (SubRect *sr) |
SubRect * | AllocSubrect () |
void | RemoveLeaf (SubRect *sr) |
Protected Attributes | |
SubRect::SubRectAlloc | alloc |
csArray< SubRect * > | leaves |
Leaves of the region tree. | |
csRect | region |
Dimensions of this region. | |
SubRect * | root |
Root of the region tree. | |
Friends | |
class | SubRect |
Classes | |
class | SubRect |
Sub-rectangle. More... |
Detailed Description
A class managing allocations of sub-rectangles.i.e. this class represents a rectangular region from which a client can allocate smaller rectangles until the region is full.
Definition at line 42 of file subrec.h.
Constructor & Destructor Documentation
|
Allocate a new empty region with the given size.
|
|
Remove this region and sub-regions.
|
Member Function Documentation
|
Allocate a new rectangle. Returns 0 if there is no room |
|
Free all rectangles in this region.
|
|
For debugging: dump all free rectangles.
|
|
Get the rectangle for this region.
|
|
Increase the size of the region. You can only grow upwards. |
|
Reclaim a subrectangle, meaning, the space occupied by the subrect can be reused by subsequent Alloc() calls.
|
Member Data Documentation
|
Leaves of the region tree.
|
|
Dimensions of this region.
|
|
Root of the region tree.
|
The documentation for this class was generated from the following file:
- csgeom/subrec.h
Generated for Crystal Space by doxygen 1.4.6