# OpenGraph DrawingFramework

v. 2023.09 (Elderberry)

Searching...
No Matches
MDMFLengthAttribute.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/basic.h>
35
36namespace ogdf {
37namespace embedder {
38
46public:
48 MDMFLengthAttribute() { a = b = 0; }
49
51 MDMFLengthAttribute(int _a, int _b = 0) : a(_a), b(_b) { }
52
55
58
60 a = x.a;
61 b = x.b;
62 return *this;
63 }
64
66 a += x.a;
67 b += x.b;
68 return *this;
69 }
70
72 a -= x.a;
73 b -= x.b;
74 return *this;
75 }
76
77 //the two components:
78 int a;
79 int b;
80};
81
82inline bool operator==(const MDMFLengthAttribute& x, const MDMFLengthAttribute& y) {
83 return x.a == y.a && x.b == y.b;
84}
85
86inline bool operator!=(const MDMFLengthAttribute& x, const MDMFLengthAttribute& y) {
87 return !(x == y);
88}
89
90inline bool operator<(const MDMFLengthAttribute& x, const MDMFLengthAttribute& y) {
91 return x.a < y.a || (x.a == y.a && x.b < y.b);
92}
93
94inline bool operator>(const MDMFLengthAttribute& x, const MDMFLengthAttribute& y) { return y < x; }
95
96inline bool operator>=(const MDMFLengthAttribute& x, const MDMFLengthAttribute& y) {
97 return !(x < y);
98}
99
100inline bool operator<=(const MDMFLengthAttribute& x, const MDMFLengthAttribute& y) {
101 return !(y < x);
102}
103
105 x += y;
106 return x;
107}
108
110 x -= y;
111 return x;
112}
113
114inline std::ostream& operator<<(std::ostream& s, const MDMFLengthAttribute& x) {
115 s << x.a << ", " << x.b;
116 return s;
117}
118
119}
120}
Basic declarations, included by all source files.
MDMFLengthAttribute & operator-=(const MDMFLengthAttribute &x)
MDMFLengthAttribute(int _a, int _b=0)
Converting constructor from int, default second is 0.
MDMFLengthAttribute(const MDMFLengthAttribute &x)
Copy constructor.
MDMFLengthAttribute()
Default constructor for (0, 0)
MDMFLengthAttribute & operator+=(const MDMFLengthAttribute &x)
MDMFLengthAttribute & operator=(const MDMFLengthAttribute &x)
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
bool operator>=(const MDMFLengthAttribute &x, const MDMFLengthAttribute &y)
bool operator>(const MDMFLengthAttribute &x, const MDMFLengthAttribute &y)
bool operator!=(const MDMFLengthAttribute &x, const MDMFLengthAttribute &y)
MDMFLengthAttribute operator+(MDMFLengthAttribute x, const MDMFLengthAttribute &y)
bool operator==(const MDMFLengthAttribute &x, const MDMFLengthAttribute &y)
bool operator<(const MDMFLengthAttribute &x, const MDMFLengthAttribute &y)
std::ostream & operator<<(std::ostream &s, const MDMFLengthAttribute &x)
MDMFLengthAttribute operator-(MDMFLengthAttribute x, const MDMFLengthAttribute &y)
bool operator<=(const MDMFLengthAttribute &x, const MDMFLengthAttribute &y)
The namespace for all OGDF objects.