Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
UmlDiagramGraph.h
Go to the documentation of this file.
1
38#pragma once
39
40#include <ogdf/basic/Graph.h>
41#include <ogdf/basic/SList.h>
42#include <ogdf/basic/basic.h>
43
44#include <iosfwd>
45#include <string>
46
47namespace ogdf {
48class UmlModelGraph;
49
57 friend OGDF_EXPORT std::ostream& operator<<(std::ostream&, const UmlDiagramGraph&);
58
59public:
61 enum class UmlDiagramType {
62 classDiagram,
63 moduleDiagram,
64 sequenceDiagram,
65 collaborationDiagram,
66 componentDiagram,
67 unknownDiagram
68 };
69
70private:
73
76
79
84
89
94
99
104
109
110public:
112 UmlDiagramGraph(const UmlModelGraph& umlModelGraph, UmlDiagramType diagramType,
113 const string& diagramName);
114
117
119 void addNodeWithGeometry(node umlNode, double x, double y, double w, double h);
120
122 void addEdge(edge umlEdge);
123
125 const string& getDiagramName() const { return m_diagramName; }
126
128 const char* getDiagramTypeString() const;
129
131 const SList<node>& getNodes() const { return m_containedNodes; }
132
134 const SList<edge>& getEdges() const { return m_containedEdges; }
135
137 const SList<double>& getX() const { return m_x; }
138
140 const SList<double>& getY() const { return m_y; }
141
143 const SList<double>& getWidth() const { return m_w; }
144
146 const SList<double>& getHeight() const { return m_h; }
147};
148
149}
Includes declaration of graph class.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
Class for the representation of edges.
Definition Graph_d.h:364
Class for the representation of nodes.
Definition Graph_d.h:241
Singly linked lists (maintaining the length of the list).
Definition SList.h:845
Contains the class UmlDiagramGraph which represents one particular diagram of the complete UML Model.
UmlDiagramType
This enum type represents the different diagram types of UML. *‍/.
~UmlDiagramGraph()
Destructor.
SList< double > m_y
This list contains the y-coordinates of the nodes contained in the represented diagram.
string m_diagramName
The name of the diagram.
friend std::ostream & operator<<(std::ostream &, const UmlDiagramGraph &)
const SList< node > & getNodes() const
Access to contained nodes.
SList< double > m_x
This list contains the x-coordinates of the nodes contained in the represented diagram.
UmlDiagramGraph(const UmlModelGraph &umlModelGraph, UmlDiagramType diagramType, const string &diagramName)
Constructor.
void addNodeWithGeometry(node umlNode, double x, double y, double w, double h)
Adds a node with the given coordinates.
void addEdge(edge umlEdge)
Adds an edge.
SList< double > m_h
This list contains the height of the nodes contained in the represented diagram.
SList< edge > m_containedEdges
This list holds pointer to the edges contained in the represented diagram.
const string & getDiagramName() const
Returns the name of the diagram.
UmlDiagramType m_diagramType
The type of diagram.
SList< double > m_w
This list contains the width of the nodes contained in the represented diagram.
const SList< double > & getWidth() const
Access to width.
const SList< double > & getY() const
Access to y-coordinates.
SList< node > m_containedNodes
This list holds pointer to the nodes contained in the represented diagram.
const SList< double > & getHeight() const
Access to height.
const SList< edge > & getEdges() const
Access to contained edges.
const SList< double > & getX() const
Access to x-coordinates.
const char * getDiagramTypeString() const
Returns the type of the diagram as string.
const UmlModelGraph & m_modelGraph
Reference to the model graph.
This class represents the complete UML Model in a graph-like data structure.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.