Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
GexfParser.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
38
40
41#include <memory>
42#include <sstream>
43#include <unordered_map>
44
45namespace ogdf {
46
47namespace gexf {
48
49
50class Parser {
51private:
52 std::istream& m_is;
53
56
57 std::unordered_map<std::string, node> m_nodeId;
58 std::unordered_map<std::string, cluster> m_clusterId;
59
60 std::unordered_map<std::string, std::string> m_nodeAttr, m_edgeAttr;
61
62 bool init();
69
70 static void error(const pugi::xml_node tag, const std::string& msg);
71
72public:
73 explicit Parser(std::istream& is);
74
75 bool read(Graph& G);
77 bool read(Graph& G, ClusterGraph& C);
79};
80
81}
82}
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Representation of clusters in a clustered graph.
Stores additional attributes of a clustered graph (like layout information).
Representation of clustered graphs.
Class for the representation of edges.
Definition Graph_d.h:300
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
Class for the representation of nodes.
Definition Graph_d.h:177
std::unordered_map< std::string, std::string > m_nodeAttr
Definition GexfParser.h:60
static void error(const pugi::xml_node tag, const std::string &msg)
std::unordered_map< std::string, node > m_nodeId
Definition GexfParser.h:57
bool readAttributes(GraphAttributes &GA, edge e, const pugi::xml_node edgeTag)
bool read(Graph &G, ClusterGraph &C)
pugi::xml_node m_edgesTag
Definition GexfParser.h:55
bool readNodes(Graph &G, GraphAttributes *GA)
bool readCluster(Graph &G, ClusterGraph &C, ClusterGraphAttributes *CA, cluster rootCluster, const pugi::xml_node rootTag)
bool read(Graph &G, GraphAttributes &GA)
bool readEdges(Graph &G, ClusterGraph *C, GraphAttributes *GA)
bool read(Graph &G, ClusterGraph &C, ClusterGraphAttributes &CA)
bool read(Graph &G)
std::unordered_map< std::string, cluster > m_clusterId
Definition GexfParser.h:58
pugi::xml_node m_graphTag
Definition GexfParser.h:55
std::unordered_map< std::string, std::string > m_edgeAttr
Definition GexfParser.h:60
bool readAttributes(GraphAttributes &GA, node v, const pugi::xml_node nodeTag)
Parser(std::istream &is)
pugi::xml_document m_xml
Definition GexfParser.h:54
pugi::xml_node m_nodesTag
Definition GexfParser.h:55
std::istream & m_is
Definition GexfParser.h:52
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.