10 #ifndef NAZARA_GUILLOTINEBINPACK_HPP 11 #define NAZARA_GUILLOTINEBINPACK_HPP 13 #include <Nazara/Prerequesites.hpp> 14 #include <Nazara/Math/Rect.hpp> 22 enum FreeRectChoiceHeuristic : int;
23 enum GuillotineSplitHeuristic : int;
34 void Expand(
unsigned int newWidth,
unsigned newHeight);
37 void FreeRectangle(
const Rectui& rect);
39 unsigned int GetHeight()
const;
40 float GetOccupancy()
const;
42 unsigned int GetWidth()
const;
44 bool Insert(
Rectui* rects,
unsigned int count,
bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod);
45 bool Insert(
Rectui* rects,
bool* flipped,
unsigned int count,
bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod);
46 bool Insert(
Rectui* rects,
bool* flipped,
bool* inserted,
unsigned int count,
bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod);
48 bool MergeFreeRectangles();
51 void Reset(
unsigned int width,
unsigned int height);
57 enum FreeRectChoiceHeuristic :
int 67 enum GuillotineSplitHeuristic :
int 70 SplitLongerLeftoverAxis,
74 SplitShorterLeftoverAxis
78 void SplitFreeRectAlongAxis(
const Rectui& freeRect,
const Rectui& placedRect,
bool splitHorizontal);
79 void SplitFreeRectByHeuristic(
const Rectui& freeRect,
const Rectui& placedRect, GuillotineSplitHeuristic method);
81 static int ScoreByHeuristic(
int width,
int height,
const Rectui& freeRect, FreeRectChoiceHeuristic rectChoice);
83 std::vector<Rectui> m_freeRectangles;
84 unsigned int m_height;
85 unsigned int m_usedArea;
90 #endif // NAZARA_GUILLOTINEBINPACK_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Core class that represents the "Guillotine problem", combination of the "Bin packing problem" and the...
Definition: GuillotineBinPack.hpp:19