33#ifdef OGDF_INCLUDE_CGAL
38# include <CGAL/Line_2.h>
46template<
typename kernel>
47using Line_t = CGAL::Line_2<kernel>;
49template<
typename kernel>
50inline bool turn(
const Line_t<kernel>& l1,
const Line_t<kernel>& l2) {
51 return turn(l1.to_vector(), l2.to_vector());
54template<
typename kernel>
55inline bool left_turn(
const Line_t<kernel>& l1,
const Line_t<kernel>& l2) {
56 return left_turn(l1.to_vector(), l2.to_vector());
59template<
typename kernel>
60inline bool right_turn(
const Line_t<kernel>& l1,
const Line_t<kernel>& l2) {
61 return right_turn(l1.to_vector(), l2.to_vector());
64template<
typename kernel>
65inline bool turn(
const Line_t<kernel>& l,
const Point_t<kernel>& p) {
66 return turn(l.to_vector(), p - l.point(0));
69template<
typename kernel>
70inline bool left_turn(
const Line_t<kernel>& l,
const Point_t<kernel>& p) {
71 return left_turn(l.to_vector(), p - l.point(0));
74template<
typename kernel>
75inline bool right_turn(
const Line_t<kernel>& l,
const Point_t<kernel>& p) {
76 return right_turn(l.to_vector(), p - l.point(0));
79template<
typename kernel>
80inline Point_t<kernel> intersect(
const Line_t<kernel>& l1,
const Line_t<kernel>& l2) {
83 auto result = CGAL::intersection(l1, l2);
85 return Point_t<kernel>(std::numeric_limits<unsigned int>::max(),
86 std::numeric_limits<unsigned int>::max());
90 if (boost::get<Line_t<kernel>>(&*result)) {
91 auto s = boost::get<Line_t<kernel>>(&*result);
void intersection(Graph &G1, const Graph &G2, const NodeArray< node > &nodeMap, bool directed=false)
Computes the intersection of G1 and G2.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.