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
| csSubRectangles::csSubRectangles | ( | const csRect & | region | ) |
Allocate a new empty region with the given size.
| csSubRectangles::~csSubRectangles | ( | ) |
Remove this region and sub-regions.
Member Function Documentation
Allocate a new rectangle.
Returns 0 if there is no room
| void csSubRectangles::Clear | ( | ) |
Free all rectangles in this region.
| void csSubRectangles::Dump | ( | ) |
For debugging: dump all free rectangles.
| const csRect& csSubRectangles::GetRectangle | ( | ) | const [inline] |
| bool csSubRectangles::Grow | ( | int | newWidth, | |
| int | newHeight | |||
| ) |
Increase the size of the region.
You can only grow upwards.
| void csSubRectangles::Reclaim | ( | SubRect * | subrect | ) |
Reclaim a subrectangle, meaning, the space occupied by the subrect can be reused by subsequent Alloc() calls.
Member Data Documentation
csArray<SubRect*> csSubRectangles::leaves [protected] |
csRect csSubRectangles::region [protected] |
SubRect* csSubRectangles::root [protected] |
The documentation for this class was generated from the following file:
- csgeom/subrec.h
Generated for Crystal Space by doxygen 1.4.7
