Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

MAARPacking.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/List.h>
40 
41 namespace ogdf {
42 namespace energybased {
43 namespace fmmm {
44 
47 class MAARPacking {
49 
50 public:
51  MAARPacking();
52  ~MAARPacking();
53 
58  void pack_rectangles_using_Best_Fit_strategy(List<Rectangle>& R, double aspect_ratio,
59  FMMMOptions::PreSort presort, FMMMOptions::TipOver allow_tipping_over,
60  double& aspect_ratio_area, double& bounding_rectangles_area);
61 
62 private:
63  double area_height;
64  double area_width;
65 
66 
69 
72 
76  List<ListIterator<PackingRowInfo>>& row_of_rectangle, PQueue& total_width_of_row);
77 
78 
84  FMMMOptions::TipOver allow_tipping_over, double aspect_ratio, double& aspect_ratio_area,
85  PQueue& total_width_of_row);
86 
87 
91  List<ListIterator<PackingRowInfo>>& row_of_rectangle,
92  ListIterator<PackingRowInfo> B_F_item, PQueue& total_width_of_row);
93 
94 
99  List<ListIterator<PackingRowInfo>>& row_of_rectangle,
100  List<ListIterator<Rectangle>>& rectangle_order);
101 
104 
107  double calculate_aspect_ratio_area(double w, double h, double r);
108 
112  bool better_tipp_rectangle_in_new_row(Rectangle r, double aspect_ratio,
113  FMMMOptions::TipOver allow_tipping_over, double& best_area);
114 
118  bool better_tipp_rectangle_in_this_row(Rectangle r, double aspect_ratio,
119  FMMMOptions::TipOver allow_tipping_over, PackingRowInfo B_F_row, double& best_area);
120 
125 };
126 
127 }
128 }
129 }
ogdf::energybased::fmmm::PackingRowInfo
Helping data structure for MAARPacking.
Definition: PackingRowInfo.h:41
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
PriorityQueue.h
Priority queue interface wrapping various heaps.
ogdf::energybased::fmmm::MAARPacking::tipp_over
Rectangle tipp_over(ListIterator< Rectangle > rect_item)
Tipps *rect_item over, by newly calculatting its width, height, and old_dlc values (Coordinates of th...
ogdf::FMMMOptions::PreSort
PreSort
Specifies how connected components are sorted before the packing algorithm is applied.
Definition: FMMMOptions.h:80
PackingRowInfo.h
Declaration of class PackingRowInfo.
Set.h
Declaration of class Set.
ogdf::energybased::fmmm::MAARPacking::find_Best_Fit_insert_position
ListIterator< PackingRowInfo > find_Best_Fit_insert_position(ListIterator< Rectangle > rect_item, FMMMOptions::TipOver allow_tipping_over, double aspect_ratio, double &aspect_ratio_area, PQueue &total_width_of_row)
Finds the Best Fit insert positions of *rect_item and returns the corresp. ListIterator in P or nullp...
ogdf::energybased::fmmm::MAARPacking::presort_rectangles_by_width
void presort_rectangles_by_width(List< Rectangle > &R)
Sorts elemets of R with momotonously decreasing width.
ogdf::pq_internal::PrioritizedQueue
Defines a queue for handling prioritized elements.
Definition: PriorityQueue.h:269
ogdf::energybased::fmmm::MAARPacking::calculate_bounding_rectangles_area
double calculate_bounding_rectangles_area(List< Rectangle > &R)
Returns the area of the bounding rectangles in R.
r
int r[]
Definition: hierarchical-ranking.cpp:8
ogdf::energybased::fmmm::Rectangle
Helping data structure for packing rectangles; The width, height and the position of the down left co...
Definition: Rectangle.h:45
ogdf::FMMMOptions::TipOver
TipOver
Specifies in which case it is allowed to tip over drawings of connected components.
Definition: FMMMOptions.h:73
ogdf::energybased::fmmm::MAARPacking::better_tipp_rectangle_in_new_row
bool better_tipp_rectangle_in_new_row(Rectangle r, double aspect_ratio, FMMMOptions::TipOver allow_tipping_over, double &best_area)
Returns true if the aspect_ratio_area of the acual packing becomes better, when tipping r over bevore...
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
Rectangle.h
Declaration of class Rectangle.
ogdf::energybased::fmmm::MAARPacking::B_F_insert_rectangle
void B_F_insert_rectangle(Rectangle r, List< PackingRowInfo > &P, List< ListIterator< PackingRowInfo >> &row_of_rectangle, ListIterator< PackingRowInfo > B_F_item, PQueue &total_width_of_row)
Inserts r into the row with corresponding ListIterator B_F_item and updates total_width_of_row.
ogdf::energybased::fmmm::MAARPacking::presort_rectangles_by_height
void presort_rectangles_by_height(List< Rectangle > &R)
Sorts elemets of R with momotonously dedreasing height.
ogdf::energybased::fmmm::MAARPacking::area_width
double area_width
total width of the packing area
Definition: MAARPacking.h:64
List.h
Declaration of doubly linked lists and iterators.
ogdf::energybased::fmmm::MAARPacking::better_tipp_rectangle_in_this_row
bool better_tipp_rectangle_in_this_row(Rectangle r, double aspect_ratio, FMMMOptions::TipOver allow_tipping_over, PackingRowInfo B_F_row, double &best_area)
Returns true if the aspect_ratio_area of the acual packing becomes better, when tipping r over bevore...
ogdf::energybased::fmmm::MAARPacking::~MAARPacking
~MAARPacking()
destructor
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:46
ogdf::energybased::fmmm::MAARPacking::export_new_rectangle_positions
void export_new_rectangle_positions(List< PackingRowInfo > &P, List< ListIterator< PackingRowInfo >> &row_of_rectangle, List< ListIterator< Rectangle >> &rectangle_order)
The information in P and row_of_rectangle are used to generate the new down left coordinates of the r...
ogdf::energybased::fmmm::MAARPacking::calculate_aspect_ratio_area
double calculate_aspect_ratio_area(double w, double h, double r)
Calculate the aspect ratio area of a rectangle with width w and height h and the given aspect ratio r...
ogdf::energybased::fmmm::MAARPacking::B_F_insert_rectangle_in_new_row
void B_F_insert_rectangle_in_new_row(Rectangle r, List< PackingRowInfo > &P, List< ListIterator< PackingRowInfo >> &row_of_rectangle, PQueue &total_width_of_row)
Creates a new empty row in P and inserts r into this row (by updating P, row_of_rectangle and total_w...
ogdf::energybased::fmmm::MAARPacking::MAARPacking
MAARPacking()
constructor
ogdf::energybased::fmmm::MAARPacking
data structure for packing rectangles within an area of a desired aspect ratio without overlappings; ...
Definition: MAARPacking.h:47
ogdf::energybased::fmmm::MAARPacking::area_height
double area_height
total height of the packing area
Definition: MAARPacking.h:63
FMMMOptions.h
Declaration of Fast Multipole Multilevel Method (FM^3) options.
ogdf::energybased::fmmm::MAARPacking::pack_rectangles_using_Best_Fit_strategy
void pack_rectangles_using_Best_Fit_strategy(List< Rectangle > &R, double aspect_ratio, FMMMOptions::PreSort presort, FMMMOptions::TipOver allow_tipping_over, double &aspect_ratio_area, double &bounding_rectangles_area)
The rectangles in R are packed using the First Fit tiling stratey (precisely the new down left corner...