Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
GML.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/graphics.h>
36
37#include <cstddef>
38#include <string>
39#include <string_view>
40
41namespace ogdf {
42
43namespace gml {
44
45enum class ObjectType {
50 ListEnd,
51 Key,
52 Eof,
53 Error,
54};
55
56enum class Key {
57 Id,
58 Label,
59 Creator,
60 Name,
61 Graph,
62 Version,
64 Node,
65 Edge,
67 X,
68 Y,
69 Z,
70 W,
71 H,
72 Type,
73 Width,
74 Source,
75 Target,
76 Arrow,
77 Outline,
78 Point,
79 Bends,
82 Fill,
83 FillBg,
84 Cluster,
85 Root,
86 Vertex,
87 Color,
88 Height,
89 Stipple,
90 Pattern,
93 Weight, // Used for node weight and edge double weight
96};
97
98
99std::string toString(const Key& attr);
100std::string toString(const EdgeArrow& arrow);
101std::string toString(const Graph::NodeType& type);
102
103Key toKey(const std::string& str);
104EdgeArrow toArrow(const std::string& str);
105Graph::NodeType toNodeType(const std::string& str);
106
107}
108}
109
110// Implement hash for gml::Key so we can use it as a key in unordered_map.
111namespace std {
112template<>
113struct hash<ogdf::gml::Key> {
114 std::size_t operator()(const ogdf::gml::Key& t) const { return size_t(t); }
115};
116}
Includes declaration of graph class.
NodeType
The type of nodes.
Definition Graph_d.h:909
Declaration of basic types for graphics.
EdgeArrow
Types for edge arrows.
Definition graphics.h:145
std::string toString(const Key &attr)
Graph::NodeType toNodeType(const std::string &str)
ObjectType
Definition GML.h:45
EdgeArrow toArrow(const std::string &str)
Key toKey(const std::string &str)
The namespace for all OGDF objects.
Definition GML.h:111
std::size_t operator()(const ogdf::gml::Key &t) const
Definition GML.h:114