| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csSubRectangles::SubRect Class Reference

Sub-rectangle. More...

`#include <csgeom/subrec.h>`

List of all members.

## Protected Types
enum | AllocPos
enum | SplitType
typedef csBlockAllocator< SubRect > | SubRectAlloc
## Protected Member Functions
SubRect * | Alloc (int w, int h, const AllocInfo &ai, csRect &r)
| Do the actual allocation.
void | DecideBestSplit (const csRect &rect, int splitX, int splitY, SubRect::SplitType &splitType)
| Decide whether a H or V split is better.
void | Reclaim ()
| De-allocate.
void | TestAlloc (int w, int h, AllocInfo &ai)
| searches for the "ideal" position of a rectangle
void | TestCollapse ()
| Test whether both children are empty.
## Protected Attributes
csRect | allocedRect
SubRect * | children [2]
SubRect * | parent
csRect | rect
int | splitPos
SplitType | splitType
csSubRectangles * | superrect
## Friends
struct | AllocInfo
class | csBlockAllocator< SubRect >
class | csSubRectangles
## Classes
struct | AllocInfo

## Detailed Description

Sub-rectangle.

Definition at line 48 of file subrec.h.

## Member Function Documentation

SubRect* csSubRectangles::SubRect::Alloc | ( | int | w,
|  | int | h,
|  | const AllocInfo & | ai,
|  | csRect & | r |
| ) |  |  | `[protected]`

Do the actual allocation.

void csSubRectangles::SubRect::DecideBestSplit | ( | const csRect & | rect,
|  | int | splitX,
|  | int | splitY,
|  | SubRect::SplitType & | splitType |
| ) |  |  | `[protected]`

Decide whether a H or V split is better.

The better split is the one where the bigger chunk results.

void csSubRectangles::SubRect::Reclaim | ( |  | ) | `[protected]`

De-allocate.

void csSubRectangles::SubRect::TestAlloc | ( | int | w,
|  | int | h,
|  | AllocInfo & | ai |
| ) |  |  | `[protected]`

searches for the "ideal" position of a rectangle

void csSubRectangles::SubRect::TestCollapse | ( |  | ) | `[protected]`

Test whether both children are empty.

The documentation for this class was generated from the following file:

- csgeom/subrec.h