Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Polyline.h
Go to the documentation of this file.
1
31#pragma once
32
33#ifdef OGDF_INCLUDE_CGAL
34
37
38namespace ogdf {
39namespace internal {
40namespace gcm {
41namespace geometry {
42
43template<typename Kernel>
44class Polyline_t : public std::vector<Point_t<Kernel>> {
45private:
46public:
47 Bbox bbox() const {
48 Bbox b = this->front().bbox();
49 for (auto& p : *this) {
50 b += p.bbox();
51 }
52 return b;
53 }
54
55 bool is_degenerate() const {
56 bool degenerate = false;
57 for (std::size_t i = 0; i + 1 < this->size() && !degenerate; ++i) {
58 degenerate = (*this)[i] == (*this)[i + 1];
59 }
60 return degenerate;
61 }
62};
63
64template<typename kernel>
65std::ostream& operator<<(std::ostream& os, const Polyline_t<kernel>& pl) {
66 for (auto& p : pl) {
67 os << p << ", ";
68 }
69
70 return os;
71}
72
73}
74}
75}
76}
77
78#endif
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
Definition Array.h:978