CrystalSpace

Public API Reference

CS::SubRectangles::SubRect Class Reference

Sub-rectangle. More...

#include <csgeom/subrec.h>

List of all members.

Protected Types

enum  AllocPos { ALLOC_INVALID = -1, ALLOC_RIGHT, ALLOC_BELOW, ALLOC_NEW }
enum  SplitType { SPLIT_UNSPLIT, SPLIT_H, SPLIT_V }
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.
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.
bool IsReclaimed () const
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.

Protected Attributes

SubRect * children [2]
SubRect * parent
int splitPos
SplitType splitType
SubRectangles * superrect

Friends

struct AllocInfo
class csBlockAllocator< SubRect >
class SubRectangles
class SubRectanglesCompact

Classes

struct  AllocInfo


Detailed Description

Sub-rectangle.

Definition at line 54 of file subrec.h.


Member Enumeration Documentation

Enumerator:
ALLOC_INVALID 
ALLOC_RIGHT 
ALLOC_BELOW 
ALLOC_NEW 

Definition at line 71 of file subrec.h.

Enumerator:
SPLIT_UNSPLIT 
SPLIT_H 
SPLIT_V 

Definition at line 65 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:
Generated for Crystal Space 1.2.1 by doxygen 1.5.3