Changeset View
Changeset View
Standalone View
Standalone View
src/part/DotGraphParsingHelper.h
Show All 13 Lines | 1 | /* This file is part of KGraphViewer. | |||
---|---|---|---|---|---|
14 | along with this program; if not, write to the Free Software | 14 | along with this program; if not, write to the Free Software | ||
15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
16 | 02110-1301, USA | 16 | 02110-1301, USA | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef DOT_GRAPHPARSINGHELPER_H | 19 | #ifndef DOT_GRAPHPARSINGHELPER_H | ||
20 | #define DOT_GRAPHPARSINGHELPER_H | 20 | #define DOT_GRAPHPARSINGHELPER_H | ||
21 | 21 | | |||
22 | #include <map> | | |||
23 | #include <list> | 22 | #include <list> | ||
23 | #include <map> | ||||
24 | #include <string> | 24 | #include <string> | ||
25 | 25 | | |||
26 | namespace KGraphViewer | 26 | namespace KGraphViewer | ||
27 | { | 27 | { | ||
28 | class DotGraph; | 28 | class DotGraph; | ||
29 | class GraphSubgraph; | 29 | class GraphSubgraph; | ||
30 | class GraphNode; | 30 | class GraphNode; | ||
31 | class GraphEdge; | 31 | class GraphEdge; | ||
32 | class GraphElement; | 32 | class GraphElement; | ||
33 | 33 | | |||
34 | struct DotGraphParsingHelper | 34 | struct DotGraphParsingHelper { | ||
35 | { | | |||
36 | typedef std::map< std::string, std::string > AttributesMap; | 35 | typedef std::map<std::string, std::string> AttributesMap; | ||
37 | 36 | | |||
38 | DotGraphParsingHelper(); | 37 | DotGraphParsingHelper(); | ||
39 | 38 | | |||
40 | void createnode(const std::string& nodeid); | 39 | void createnode(const std::string &nodeid); | ||
41 | void createsubgraph(); | 40 | void createsubgraph(); | ||
42 | void setgraphattributes(); | 41 | void setgraphattributes(); | ||
43 | void setsubgraphattributes(); | 42 | void setsubgraphattributes(); | ||
44 | void setnodeattributes(); | 43 | void setnodeattributes(); | ||
45 | void setedgeattributes(); | 44 | void setedgeattributes(); | ||
46 | void setattributedlist(); | 45 | void setattributedlist(); | ||
47 | void createedges(); | 46 | void createedges(); | ||
48 | void edgebound(const std::string& bound) {edgebounds.push_back(bound);} | 47 | void edgebound(const std::string &bound) | ||
48 | { | ||||
49 | edgebounds.push_back(bound); | ||||
50 | } | ||||
49 | void finalactions(); | 51 | void finalactions(); | ||
50 | void setgraphelementattributes(GraphElement* ge, const AttributesMap& attributes); | 52 | void setgraphelementattributes(GraphElement *ge, const AttributesMap &attributes); | ||
51 | 53 | | |||
52 | std::string attrid; | 54 | std::string attrid; | ||
53 | std::string valid; | 55 | std::string valid; | ||
54 | std::string attributed; | 56 | std::string attributed; | ||
55 | std::string subgraphid; | 57 | std::string subgraphid; | ||
56 | 58 | | |||
57 | unsigned int uniq; | 59 | unsigned int uniq; | ||
58 | 60 | | |||
59 | AttributesMap attributes; | 61 | AttributesMap attributes; | ||
60 | AttributesMap graphAttributes; | 62 | AttributesMap graphAttributes; | ||
61 | AttributesMap nodesAttributes; | 63 | AttributesMap nodesAttributes; | ||
62 | AttributesMap edgesAttributes; | 64 | AttributesMap edgesAttributes; | ||
63 | std::list< AttributesMap > graphAttributesStack; | 65 | std::list<AttributesMap> graphAttributesStack; | ||
64 | std::list< AttributesMap > nodesAttributesStack; | 66 | std::list<AttributesMap> nodesAttributesStack; | ||
65 | std::list< AttributesMap > edgesAttributesStack; | 67 | std::list<AttributesMap> edgesAttributesStack; | ||
66 | 68 | | |||
67 | std::list< std::string > edgebounds; | 69 | std::list<std::string> edgebounds; | ||
68 | 70 | | |||
69 | unsigned int z; | 71 | unsigned int z; | ||
70 | unsigned int maxZ; | 72 | unsigned int maxZ; | ||
71 | 73 | | |||
72 | DotGraph* graph; | 74 | DotGraph *graph; | ||
73 | 75 | | |||
74 | GraphSubgraph* gs; | 76 | GraphSubgraph *gs; | ||
75 | GraphNode* gn; | 77 | GraphNode *gn; | ||
76 | GraphEdge* ge; | 78 | GraphEdge *ge; | ||
77 | }; | 79 | }; | ||
78 | 80 | | |||
79 | } | 81 | } | ||
80 | 82 | | |||
81 | #endif | 83 | #endif | ||
82 | | ||||
83 | | ||||
84 | |