33#ifdef OGDF_INCLUDE_CGAL
61template<
typename Kernel_,
typename Graph_>
66 using Node =
typename Graph::Node;
67 using Edge =
typename Graph::Edge;
69 using Point = geometry::Point_t<Kernel>;
70 using LineSegment = geometry::LineSegment_t<Kernel>;
107 inline void clear() {
118 inline void set_point(
const Node& v,
const Point& p) {
119 OGDF_ASSERT((
size_t)v->index() <= g.max_node_index());
131 inline Point& operator[](
const Node& v) {
136 inline Point operator[](
const Node& v)
const {
return get_point(v); }
142 inline geometry::Bbox bbox()
const {
143 double xmin = std::numeric_limits<double>::infinity();
144 double ymin = std::numeric_limits<double>::infinity();
149 for (Node v : g.nodes()) {
156template<
typename Kernel,
typename Graph,
typename EdgeList>
160 using Node =
typename Graph::Node;
161 using Edge =
typename Graph::Edge;
162 using Point =
typename geometry::Point_t<Kernel>;
165 std::vector<Point> map;
167 for (
const Point& p : nodes) {
171 for (
const std::tuple<unsigned int, unsigned int, unsigned int>&
edge :
edge_list) {
181 OGDF_ASSERT(!e || e->graphOf() == &g.get_ogdf_graph());
186template<
typename Kernel,
typename Graph,
typename EdgeList>
190 using Edge =
typename Graph::Edge;
193 for (
const std::tuple<unsigned int, unsigned int, unsigned int>&
edge :
edge_list) {
194 unsigned int source = std::get<0>(
edge);
195 unsigned int target = std::get<1>(
edge);
199 auto u = g.add_node();
200 d.set_point(u, nodes[source]);
201 node_map.insert(std::make_pair(source, u));
204 auto u = g.add_node();
205 d.set_point(u, nodes[target]);
206 node_map.insert(std::make_pair(target, u));
210 for (
const std::tuple<unsigned int, unsigned int, unsigned int>&
edge :
edge_list) {
222 OGDF_ASSERT(!e || e->graphOf() == &g.get_ogdf_graph());
227template<
typename Kernel,
typename Graph,
typename EdgeList>
231 std::map<unsigned int, typename Graph::Node>
node_map;
235template<
typename Kernel,
typename Graph>
236std::tuple<datastructure::NodeVector<typename Graph::Node, Graph>,
237 datastructure::EdgeVector<typename Graph::Edge, Graph>>
239 using Node =
typename Graph::Node;
240 using Edge =
typename Graph::Edge;
242 datastructure::NodeVector<Node, Graph>
node_map(original);
243 datastructure::EdgeVector<Edge, Graph>
edge_map(original);
245 for (
auto v : original.nodes()) {
246 node_map[v] = copy.add_node(original.get_point(v));
249 for (
auto e : original.edges()) {
256template<
typename Kernel,
typename Graph>
259 OGDF_ASSERT(&
d.get_graph().get_ogdf_graph() == &ga.constGraph());
260 for (
auto v :
d.get_graph().nodes()) {
261 geometry::Point_t<Kernel> p(ga.x(v), ga.y(v));
266template<
typename Kernel,
typename Graph>
268 GraphAttributes& ga) {
269 OGDF_ASSERT(&
d.get_graph().get_ogdf_graph() == &ga.constGraph());
270 for (
auto v :
d.get_graph().nodes()) {
271 auto p =
d.get_point(v);
272 ga.x(v) = CGAL::to_double(p.x());
273 ga.y(v) = CGAL::to_double(p.y());
Declaration and implementation of EdgeArray class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declares class GraphIO which provides access to all graph read and write functionality.
Generator for visualizing graphs using the XML-based SVG format.
EdgeElement * edge
The type of edges.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.