CS::SubRectanglesCompact Class Reference
A variation of SubRectangles that tries to place rectangles in a rectangular fashion. More...
#include <csgeom/subrec.h>
Inheritance diagram for CS::SubRectanglesCompact:
Public Member Functions | |
SubRect * | Alloc (int w, int h, csRect &rect) |
Allocate a new rectangle. | |
SubRect * | AllocNoGrow (int w, int h, csRect &rect) |
Allocate a rectangle but don't attempt growing to fit. | |
void | Clear () |
Free all rectangles in this region. | |
bool | GetGrowPO2 () const |
Return whether growing to PO2 dimensions is enabled. | |
const csRect & | GetMaximumRectangle () const |
Return the upper limit of the rectangle. | |
void | SetGrowPO2 (bool growPO2) |
Enable growing to PO2 dimensions. |
Detailed Description
A variation of SubRectangles that tries to place rectangles in a rectangular fashion.
This means all allocated rectangles are attempted to be placed compactly in a rectangle in the upper left corner, where as the normal SubRectangles quickly "expands" in the X and Y directions.
This variation is useful if the rectangle you fill is an upper limit but the covered area should be as small as possible. It has slightly more overhead than the normal SubRectangles, though.
- Remarks:
- works best if bigger rectangles are inserted first. The malus from not doing so is bigger than the CS::SubRectangles one.
Definition at line 257 of file subrec.h.
Member Function Documentation
void CS::SubRectanglesCompact::Clear | ( | ) | [virtual] |
Free all rectangles in this region.
Reimplemented from CS::SubRectangles.
bool CS::SubRectanglesCompact::GetGrowPO2 | ( | ) | const [inline] |
const csRect& CS::SubRectanglesCompact::GetMaximumRectangle | ( | ) | const [inline] |
void CS::SubRectanglesCompact::SetGrowPO2 | ( | bool | growPO2 | ) | [inline] |
The documentation for this class was generated from the following file:
- csgeom/subrec.h
Generated for Crystal Space 2.0 by doxygen 1.6.1