Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

UmlToGraphConverter.h
Go to the documentation of this file.
1 
35 #pragma once
36 
40 #include <ogdf/uml/UMLGraph.h>
41 
42 namespace ogdf {
43 
63 
64 private:
67 
70 
75 
81 
83  enum class PredefinedInfoIndex {
84  xmi = 0,
85  xmiContent,
86  xmiId,
87  umlModel,
88  umlNamespaceOwnedElement,
89  umlClass,
90  name,
91  umlGeneralization,
92  child,
93  parent,
94  umlAssociation,
95  umlAssociationConnection,
96  umlAssociationEnd,
97  type,
98  umlDiagram,
99  rootUmlDiagramElement,
100  umlDiagramElement,
101  geometry,
102  subject,
103  umlPackage,
104  umlInterface,
105  umlDependency,
106  client,
107  supplier,
108  diagramType,
109  classDiagram,
110  moduleDiagram,
111 
112  nextPredefinedInfoIndex
113  };
114 
126 
131 
132 public:
146  explicit UmlToGraphConverter(istream &is);
147 
155 
159  const UmlModelGraph &getModelGraph() const {
160  return *m_modelGraph;
161  }
162 
167  return m_diagramGraphs;
168  }
169 
174  return m_diagramGraphsInUMLGraphFormat;
175  }
176 
180  void printDiagramsInUMLGraphFormat(ofstream &os);
181 
185  void printIdToNodeMappingTable(ofstream &os);
186 
187 private:
193  void initializePredefinedInfoIndices();
194 
203  bool createModelGraph(UmlModelGraph &modelGraph);
204 
218  bool traversePackagesAndInsertClassifierNodes(
219  const XmlTagObject &currentRootTag,
220  const string &currentPackageName,
221  UmlModelGraph &modelGraph);
222 
234  bool insertSpecificClassifierNodes(
235  const XmlTagObject &currentRootTag,
236  const string currentPackageName,
237  int desiredClassifier,
238  UmlModelGraph &modelGraph);
239 
252  bool traversePackagesAndInsertAssociationEdges(
253  const XmlTagObject &currentRootTag,
254  UmlModelGraph &modelGraph);
255 
268  bool traversePackagesAndInsertGeneralizationEdges(
269  const XmlTagObject &currentRootTag,
270  UmlModelGraph &modelGraph);
271 
272 
281  bool insertDependencyEdges(
282  const XmlTagObject &currentRootTag,
283  UmlModelGraph &modelGraph);
284 
293  bool createDiagramGraphs();
294 
302  bool createDiagramGraphsInUMLGraphFormat(SList<UMLGraph*> &diagramGraphsInUMLGraphFormat);
303 }; // class UmlToGraphConverter
304 
305 } // end namespace ogdf
PredefinedInfoIndex
Predefined info indices for known tag and attribute names.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Hashing< int, edge > m_idToEdge
Maps string info to edge.
Declaration of class UMLGraph.
Singly linked lists (maintaining the length of the list).
Definition: SList.h:777
SList< UmlDiagramGraph * > m_diagramGraphs
The set of graphs which represent special diagrams contained in the model.
const SList< UMLGraph * > & getDiagramGraphsInUMLGraphFormat() const
Access to the diagrams graphs in UMLGraph format.
Contains the struct declarations XmlAttributeObject, XmlTagObject and the class XmlParser.
This struct represents a node in the XML parse tree.
Definition: XmlParser.h:104
const UmlModelGraph & getModelGraph() const
Access to model graph.
Hashing< int, node > m_idToNode
Maps string info to node.
const SList< UmlDiagramGraph * > & getDiagramGraphs() const
Access to diagram graphs.
SList< UMLGraph * > m_diagramGraphsInUMLGraphFormat
This list contains the set of graphs of the list m_diagramGraphs in UMLGraph format.
XmlParser * m_xmlParser
The parser used for parsing the input file.
UmlModelGraph * m_modelGraph
The graph which represents the complete UML model.
This class represents the complete UML Model in a graph-like data structure.
Definition: UmlModelGraph.h:41
Contains the class UmlDiagramGraph which represents one particular diagram of the complete UML Model...
This class parses the XML input file and builds up a parse tree with linked elements XMLTagObject and...
Definition: XmlParser.h:269
Hashing with chaining and table doubling.
Definition: Hashing.h:264
The namespace for all OGDF objects.
This class performs all necessary steps to obtain a model graph and diagram graphs from the input fil...
Contains the class UmlModelGraph which represents the complete UML Model in a graph like data structu...