Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Rectangle.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/geometry.h>
35
36#include <iostream>
37
38namespace ogdf {
39namespace energybased {
40namespace fmmm {
41
45class Rectangle {
47 friend std::ostream& operator<<(std::ostream& output, const Rectangle& A) {
48 output << "width: " << A.width << " height: " << A.height
49 << " old dlc_position: " << A.old_down_left_corner_position
50 << " new dlc_position: " << A.new_down_left_corner_position
51 << " coponenet_index: " << A.component_index;
52 if (A.tipped_over) {
53 output << " is tipped_over";
54 }
55 return output;
56 }
57
59 friend std::istream& operator>>(std::istream& input, Rectangle& A) {
60 input >> A.width;
61 return input;
62 }
63
64public:
76
86
88
90
91 void set_width(double w) { width = w; }
92
93 void set_height(double h) { height = h; }
94
96
98
100
102
103 double get_width() const { return width; }
104
105 double get_height() const { return height; }
106
107 int get_component_index() const { return component_index; }
108
109 bool is_tipped_over() const { return tipped_over; }
110
111private:
114 double width;
115 double height;
119};
120
121}
122}
123}
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
T m_y
The y-coordinate.
Definition geometry.h:79
T m_x
The x-coordinate.
Definition geometry.h:78
Helping data structure for packing rectangles; The width, height and the position of the down left co...
Definition Rectangle.h:45
DPoint new_down_left_corner_position
new calculated down left corner of ...
Definition Rectangle.h:113
friend std::ostream & operator<<(std::ostream &output, const Rectangle &A)
Outputstream for Rectangle.
Definition Rectangle.h:47
void set_component_index(int comp_index)
Definition Rectangle.h:95
friend std::istream & operator>>(std::istream &input, Rectangle &A)
Inputstream for Rectangle.
Definition Rectangle.h:59
int component_index
the index of the related connected component
Definition Rectangle.h:116
DPoint old_down_left_corner_position
down left corner of the tight surround.
Definition Rectangle.h:112
void set_new_dlc_position(DPoint dlc_pos)
Definition Rectangle.h:89
bool tipped_over
indicates if this rectangle has been tipped over in the packing step
Definition Rectangle.h:117
double width
width of the surround.
Definition Rectangle.h:114
double height
height of the surround.
Definition Rectangle.h:115
void set_old_dlc_position(DPoint dlc_pos)
Definition Rectangle.h:87
void set_rectangle(double w, double h, double old_dlc_x_pos, double old_dlc_y_pos, int comp_index)
Definition Rectangle.h:77
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.