Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ConvexHull.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/basic.h>
35#include <ogdf/basic/geometry.h>
36
37#include <vector>
38
39namespace ogdf {
40class GraphAttributes;
41class MultilevelGraph;
42
44
50private:
51 bool sameDirection(const DPoint& start, const DPoint& end, const DPoint& s, const DPoint& e) const;
52
53 // calculates a convex hull very quickly but only works with cross-free Polygons!
54 DPolygon conv(const DPolygon& poly) const;
55
56 // Calculates the Part of the convex hull that is left of line start-end
57 // /a points should only contain points that really are left of the line.
58 void leftHull(std::vector<DPoint> points, DPoint& start, DPoint& end, DPolygon& hullPoly) const;
59
60
61public:
64
65 DPoint calcNormal(const DPoint& start, const DPoint& end) const;
66 double leftOfLine(const DPoint& normal, const DPoint& point, const DPoint& pointOnLine) const;
67
68 DPolygon call(std::vector<DPoint> points) const;
71};
72
73}
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
Computes the convex hull of a set of points or a layout.
Definition ConvexHull.h:49
double leftOfLine(const DPoint &normal, const DPoint &point, const DPoint &pointOnLine) const
DPolygon call(MultilevelGraph &MLG) const
bool sameDirection(const DPoint &start, const DPoint &end, const DPoint &s, const DPoint &e) const
DPoint calcNormal(const DPoint &start, const DPoint &end) const
DPolygon call(std::vector< DPoint > points) const
void leftHull(std::vector< DPoint > points, DPoint &start, DPoint &end, DPolygon &hullPoly) const
DPolygon call(GraphAttributes &GA) const
DPolygon conv(const DPolygon &poly) const
Polygons with real coordinates.
Definition geometry.h:989
Stores additional attributes of a graph (like layout information).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.