Antkeeper
0.0.1
|
Packs 2D rectangles. More...
#include <rect-pack.hpp>
Public Types | |
using | scalar_type = T |
Scalar type. More... | |
using | node_type = rect_pack_node< T > |
Node type. More... | |
Public Member Functions | |
rect_pack (scalar_type w, scalar_type h) | |
Creates a rect pack and sets the bounds of the root node. More... | |
rect_pack () | |
Creates an empty rect pack. More... | |
void | resize (scalar_type w, scalar_type h) |
Clears the pack and resizes the root node bounds. More... | |
void | clear () |
Clear the pack, deallocating all nodes. More... | |
const node_type * | pack (scalar_type w, scalar_type h) |
Packs a rect into the rect pack. More... | |
const node_type & | get_root () const |
Returns a reference to the root node. More... | |
Packs 2D rectangles.
Definition at line 60 of file rect-pack.hpp.
using geom::rect_pack< T >::node_type = rect_pack_node<T> |
Node type.
Definition at line 67 of file rect-pack.hpp.
using geom::rect_pack< T >::scalar_type = T |
Scalar type.
Definition at line 64 of file rect-pack.hpp.
geom::rect_pack< T >::rect_pack | ( | scalar_type | w, |
scalar_type | h | ||
) |
Creates a rect pack and sets the bounds of the root node.
w | Width of the root node. |
h | Height of the root node. |
Definition at line 116 of file rect-pack.hpp.
geom::rect_pack< T >::rect_pack |
Creates an empty rect pack.
Definition at line 122 of file rect-pack.hpp.
void geom::rect_pack< T >::clear |
Clear the pack, deallocating all nodes.
Definition at line 134 of file rect-pack.hpp.
|
inline |
Returns a reference to the root node.
Definition at line 148 of file rect-pack.hpp.
const rect_pack< T >::node_type * geom::rect_pack< T >::pack | ( | scalar_type | w, |
scalar_type | h | ||
) |
Packs a rect into the rect pack.
w | Width of the rect. |
h | Height of the rect. |
nullptr
if the rect could not be packed. Definition at line 142 of file rect-pack.hpp.
void geom::rect_pack< T >::resize | ( | scalar_type | w, |
scalar_type | h | ||
) |
Clears the pack and resizes the root node bounds.
w | New width of the root node. |
h | New height of the root node. |
Definition at line 127 of file rect-pack.hpp.