CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csSubRectangles2 Class Reference
[Geometry utilities]

A class managing allocations of sub-rectangles. More...

#include <csgeom/subrec2.h>

List of all members.

Public Member Functions

 csSubRectangles2 (const csRect &region)
 Allocate a new empty region with the given size.
 ~csSubRectangles2 ()
 Remove this region and sub-regions.
const csRectGetRectangle () const
 Get the rectangle for this region.
void Clear ()
 Free all rectangles in this region.
csSubRect2 * Alloc (int w, int h, csRect &rect)
 Allocate a new rectangle.
void Reclaim (csSubRect2 *subrect)
 Reclaim a subrectangle.
bool Grow (int newWidth, int newHeight)
 Increase the size of the region.
void Dump ()
 For debugging: dump all free rectangles.

Protected Attributes

csRect region
 Dimensions of this region.
csSubRect2 * root
 First empty region.


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 39 of file subrec2.h.


Constructor & Destructor Documentation

csSubRectangles2::csSubRectangles2 const csRect region  ) 
 

Allocate a new empty region with the given size.

csSubRectangles2::~csSubRectangles2  ) 
 

Remove this region and sub-regions.


Member Function Documentation

csSubRect2* csSubRectangles2::Alloc int  w,
int  h,
csRect rect
 

Allocate a new rectangle.

Returns 0 if there is no room

void csSubRectangles2::Clear  ) 
 

Free all rectangles in this region.

void csSubRectangles2::Dump  ) 
 

For debugging: dump all free rectangles.

const csRect& csSubRectangles2::GetRectangle  )  const [inline]
 

Get the rectangle for this region.

Definition at line 59 of file subrec2.h.

bool csSubRectangles2::Grow int  newWidth,
int  newHeight
 

Increase the size of the region.

You can only grow upwards.

void csSubRectangles2::Reclaim csSubRect2 *  subrect  ) 
 

Reclaim a subrectangle.


Member Data Documentation

csRect csSubRectangles2::region [protected]
 

Dimensions of this region.

Definition at line 44 of file subrec2.h.

csSubRect2* csSubRectangles2::root [protected]
 

First empty region.

Definition at line 46 of file subrec2.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1