Generic rect packer class. Implements an algorithm to pack rects into groups efficiently. More...
#include <rect_packer.h>
Classes | |
struct | AllocatedRect |
Public Types | |
enum | AllocationPolicy { create_new_group, search_previous_groups, fail_if_full } |
Allocation policy. More... | |
Public Member Functions | |
virtual AllocatedRect | add (const Size &size)=0 |
Allocate space for another rect. More... | |
virtual AllocationPolicy | allocation_policy () const =0 |
Returns the allocation policy. More... | |
virtual int | group_count () const =0 |
Returns the amount of rects used by group. More... | |
virtual Size | max_group_size () const =0 |
Returns the max group size. More... | |
virtual int | rect_count (unsigned int group_index=0) const =0 |
Returns the amount of rects in a group. More... | |
virtual int | total_rect_count () const =0 |
Returns the total amount of rects. More... | |
Static Public Member Functions | |
static std::shared_ptr< RectPacker > | create (const Size &max_group_size, AllocationPolicy policy=create_new_group) |
Constructs a rect group. More... | |
Generic rect packer class. Implements an algorithm to pack rects into groups efficiently.
|
pure virtual |
Allocate space for another rect.
|
pure virtual |
Returns the allocation policy.
|
static |
Constructs a rect group.
|
pure virtual |
Returns the amount of rects used by group.
|
pure virtual |
Returns the max group size.
|
pure virtual |
Returns the amount of rects in a group.
|
pure virtual |
Returns the total amount of rects.