Core class that represents the "Guillotine problem", combination of the "Bin packing problem" and the "cutting stock".
More...
|
enum | FreeRectChoiceHeuristic : int {
RectBestAreaFit,
RectBestLongSideFit,
RectBestShortSideFit,
RectWorstAreaFit,
RectWorstLongSideFit,
RectWorstShortSideFit
} |
|
enum | GuillotineSplitHeuristic : int {
SplitLongerAxis,
SplitLongerLeftoverAxis,
SplitMaximizeArea,
SplitMinimizeArea,
SplitShorterAxis,
SplitShorterLeftoverAxis
} |
|
|
enum FreeRectChoiceHeuristic int enum GuillotineSplitHeuristic int | GuillotineBinPack () |
| Constructs a GuillotineBinPack object by default.
|
|
| GuillotineBinPack (unsigned int width, unsigned int height) |
| Constructs a GuillotineBinPack object with width and height. More...
|
|
| GuillotineBinPack (const Vector2ui &size) |
| Constructs a GuillotineBinPack object with area. More...
|
|
| GuillotineBinPack (const GuillotineBinPack &)=default |
|
| GuillotineBinPack (GuillotineBinPack &&)=default |
|
void | Clear () |
| Clears the content.
|
|
void | Expand (unsigned int newWidth, unsigned newHeight) |
| Expands the content. More...
|
|
void | Expand (const Vector2ui &newSize) |
| Expands the content. More...
|
|
void | FreeRectangle (const Rectui &rect) |
| Frees the rectangle. More...
|
|
unsigned int | GetHeight () const |
| Gets the height. More...
|
|
float | GetOccupancy () const |
| Gets percentage of occupation. More...
|
|
Vector2ui | GetSize () const |
| Gets the size of the area. More...
|
|
unsigned int | GetWidth () const |
| Gets the width. More...
|
|
bool | Insert (Rectui *rects, unsigned int count, bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod) |
| Inserts rectangles in the area. More...
|
|
bool | Insert (Rectui *rects, bool *flipped, unsigned int count, bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod) |
| Inserts rectangles in the area. More...
|
|
bool | Insert (Rectui *rects, bool *flipped, bool *inserted, unsigned int count, bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod) |
| Inserts rectangles in the area. More...
|
|
bool | MergeFreeRectangles () |
| Merges free rectangles together. More...
|
|
void | Reset () |
| Resets the area.
|
|
void | Reset (unsigned int width, unsigned int height) |
| Resets the area. More...
|
|
void | Reset (const Vector2ui &size) |
| Resets the area. More...
|
|
GuillotineBinPack & | operator= (const GuillotineBinPack &)=default |
|
GuillotineBinPack & | operator= (GuillotineBinPack &&)=default |
|
Core class that represents the "Guillotine problem", combination of the "Bin packing problem" and the "cutting stock".
◆ GuillotineBinPack() [1/2]
Nz::GuillotineBinPack::GuillotineBinPack |
( |
unsigned int |
width, |
|
|
unsigned int |
height |
|
) |
| |
◆ GuillotineBinPack() [2/2]
Nz::GuillotineBinPack::GuillotineBinPack |
( |
const Vector2ui & |
size | ) |
|
◆ Expand() [1/2]
void Nz::GuillotineBinPack::Expand |
( |
unsigned int |
newWidth, |
|
|
unsigned |
newHeight |
|
) |
| |
Expands the content.
- Parameters
-
newWidth | New width for the expansion |
newHeight | New height for the expansion |
- See also
- Expand
◆ Expand() [2/2]
void Nz::GuillotineBinPack::Expand |
( |
const Vector2ui & |
newSize | ) |
|
Expands the content.
- Parameters
-
newSize | New area for the expansion |
- See also
- Expand
◆ FreeRectangle()
void Nz::GuillotineBinPack::FreeRectangle |
( |
const Rectui & |
rect | ) |
|
Frees the rectangle.
- Parameters
-
◆ GetHeight()
unsigned int Nz::GuillotineBinPack::GetHeight |
( |
| ) |
const |
Gets the height.
- Returns
- Height of the area
◆ GetOccupancy()
float Nz::GuillotineBinPack::GetOccupancy |
( |
| ) |
const |
Gets percentage of occupation.
- Returns
- Percentage of the already occupied area
◆ GetSize()
Vector2ui Nz::GuillotineBinPack::GetSize |
( |
| ) |
const |
Gets the size of the area.
- Returns
- Size of the area
◆ GetWidth()
unsigned int Nz::GuillotineBinPack::GetWidth |
( |
| ) |
const |
Gets the width.
- Returns
- Width of the area
◆ Insert() [1/3]
bool Nz::GuillotineBinPack::Insert |
( |
Rectui * |
rects, |
|
|
unsigned int |
count, |
|
|
bool |
merge, |
|
|
FreeRectChoiceHeuristic |
rectChoice, |
|
|
GuillotineSplitHeuristic |
splitMethod |
|
) |
| |
Inserts rectangles in the area.
- Returns
- true if each rectangle could be inserted
- Parameters
-
rects | List of rectangles |
count | Count of rectangles |
merge | Merge possible |
rectChoice | Heuristic to use to free |
splitMethod | Heuristic to use to split |
◆ Insert() [2/3]
bool Nz::GuillotineBinPack::Insert |
( |
Rectui * |
rects, |
|
|
bool * |
flipped, |
|
|
unsigned int |
count, |
|
|
bool |
merge, |
|
|
FreeRectChoiceHeuristic |
rectChoice, |
|
|
GuillotineSplitHeuristic |
splitMethod |
|
) |
| |
Inserts rectangles in the area.
- Returns
- true if each rectangle could be inserted
- Parameters
-
rects | List of rectangles |
flipped | List of flipped rectangles |
count | Count of rectangles |
merge | Merge possible |
rectChoice | Heuristic to use to free |
splitMethod | Heuristic to use to split |
◆ Insert() [3/3]
bool Nz::GuillotineBinPack::Insert |
( |
Rectui * |
rects, |
|
|
bool * |
flipped, |
|
|
bool * |
inserted, |
|
|
unsigned int |
count, |
|
|
bool |
merge, |
|
|
FreeRectChoiceHeuristic |
rectChoice, |
|
|
GuillotineSplitHeuristic |
splitMethod |
|
) |
| |
Inserts rectangles in the area.
- Returns
- true if each rectangle could be inserted
- Parameters
-
rects | List of rectangles |
flipped | List of flipped rectangles |
flipped | List of inserted rectangles |
count | Count of rectangles |
merge | Merge possible |
rectChoice | Heuristic to use to free |
splitMethod | Heuristic to use to split |
◆ MergeFreeRectangles()
bool Nz::GuillotineBinPack::MergeFreeRectangles |
( |
| ) |
|
Merges free rectangles together.
- Returns
- true if there was a merge (and thus if a merge is still possible)
◆ Reset() [1/2]
void Nz::GuillotineBinPack::Reset |
( |
unsigned int |
width, |
|
|
unsigned int |
height |
|
) |
| |
Resets the area.
- Parameters
-
◆ Reset() [2/2]
void Nz::GuillotineBinPack::Reset |
( |
const Vector2ui & |
size | ) |
|
Resets the area.
- Parameters
-
The documentation for this class was generated from the following files: