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>
39 
40 namespace ogdf {
41 namespace energybased {
42 namespace fmmm {
43 
46 class MAARPacking {
48 
49 public:
50  MAARPacking();
51  ~MAARPacking();
52 
57  void pack_rectangles_using_Best_Fit_strategy(List<Rectangle>& R, double aspect_ratio,
58  FMMMOptions::PreSort presort, FMMMOptions::TipOver allow_tipping_over,
59  double& aspect_ratio_area, double& bounding_rectangles_area);
60 
61 private:
62  double area_height;
63  double area_width;
64 
65 
68 
71 
75  List<ListIterator<PackingRowInfo>>& row_of_rectangle, PQueue& total_width_of_row);
76 
77 
83  FMMMOptions::TipOver allow_tipping_over, double aspect_ratio, double& aspect_ratio_area,
84  PQueue& total_width_of_row);
85 
86 
90  List<ListIterator<PackingRowInfo>>& row_of_rectangle,
91  ListIterator<PackingRowInfo> B_F_item, PQueue& total_width_of_row);
92 
93 
98  List<ListIterator<PackingRowInfo>>& row_of_rectangle,
99  List<ListIterator<Rectangle>>& rectangle_order);
100 
103 
106  double calculate_aspect_ratio_area(double w, double h, double r);
107 
111  bool better_tipp_rectangle_in_new_row(Rectangle r, double aspect_ratio,
112  FMMMOptions::TipOver allow_tipping_over, double& best_area);
113 
117  bool better_tipp_rectangle_in_this_row(Rectangle r, double aspect_ratio,
118  FMMMOptions::TipOver allow_tipping_over, PackingRowInfo B_F_row, double& best_area);
119 
124 };
125 
126 }
127 }
128 }
ogdf::energybased::fmmm::PackingRowInfo
Helping data structure for MAARPacking.
Definition: PackingRowInfo.h:41
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
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.
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:271
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:13
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: DfsMakeBiconnected.h:40
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:63
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:51
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:46
ogdf::energybased::fmmm::MAARPacking::area_height
double area_height
total height of the packing area
Definition: MAARPacking.h:62
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...