CS::SubRectangles::SubRect Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Protected Member Functions | Friends
CS::SubRectangles::SubRect Class Reference

Sub-rectangle. More...

`#include <csgeom/subrec.h>`

List of all members.

## 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.
const csRect & | GetAllocedRect () const
| Return the area allocated from this subrectangle.
const csRect & | GetRect () const
| Return the area this subrectangle covers.
bool | IsEmpty () const
| Test if allocated area is empty.
void | MakeEmpty ()
| Clear allocated area.
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.
## Friends
class | csBlockAllocator< SubRect >

## Detailed Description

Sub-rectangle.

Definition at line 54 of file subrec.h.

## Member Function Documentation

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

Do the actual allocation.

void CS::SubRectangles::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.

const csRect& CS::SubRectangles::SubRect::GetAllocedRect | ( |  | ) | const`[inline, protected]`

Return the area allocated from this subrectangle.

Definition at line 103 of file subrec.h.

const csRect& CS::SubRectangles::SubRect::GetRect | ( |  | ) | const`[inline, protected]`

Return the area this subrectangle covers.

Definition at line 101 of file subrec.h.

bool CS::SubRectangles::SubRect::IsEmpty | ( |  | ) | const`[inline, protected]`

Test if allocated area is empty.

Definition at line 108 of file subrec.h.

void CS::SubRectangles::SubRect::MakeEmpty | ( |  | ) | `[inline, protected]`

Clear allocated area.

Definition at line 105 of file subrec.h.

void CS::SubRectangles::SubRect::Reclaim | ( |  | ) | `[protected]`

De-allocate.

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

searches for the "ideal" position of a rectangle

void CS::SubRectangles::SubRect::TestCollapse | ( |  | ) | `[protected]`

Test whether both children are empty.

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

- csgeom/subrec.h