Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / fileformats / DinoUmlDiagramGraph.h
blob6c96449b6b281981638a72f4dd05b36156f4c6e6
1 /*
2 * $Revision: 2564 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-07 00:03:48 +0200 (Sa, 07. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Contains the class DinoUmlDiagramGraph which represents one
11 * particular diagram of the complete UML Model.
13 * Each diagram refers to the node and edge information of
14 * DinoUmlModelGraph. Essentially a diagram contains selected nodes
15 * and edges of the model provides with additional geometric
16 * information.
18 * \author Dino Ahr
20 * \par License:
21 * This file is part of the Open Graph Drawing Framework (OGDF).
23 * \par
24 * Copyright (C)<br>
25 * See README.txt in the root directory of the OGDF installation for details.
27 * \par
28 * This program is free software; you can redistribute it and/or
29 * modify it under the terms of the GNU General Public License
30 * Version 2 or 3 as published by the Free Software Foundation;
31 * see the file LICENSE.txt included in the packaging of this file
32 * for details.
34 * \par
35 * This program is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 * GNU General Public License for more details.
40 * \par
41 * You should have received a copy of the GNU General Public
42 * License along with this program; if not, write to the Free
43 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
44 * Boston, MA 02110-1301, USA.
46 * \see http://www.gnu.org/copyleft/gpl.html
47 ***************************************************************/
49 #ifdef _MSC_VER
50 #pragma once
51 #endif
53 #ifndef OGDF_DINO_UML_DIAGRAM_GRAPH_H
54 #define OGDF_DINO_UML_DIAGRAM_GRAPH_H
56 #include <ogdf/fileformats/DinoUmlModelGraph.h>
57 #include <ogdf/basic/String.h>
58 #include <ogdf/basic/SList.h>
60 namespace ogdf {
62 //---------------------------------------------------------
63 // D i n o U m l D i a g r a m G r a p h
64 //---------------------------------------------------------
65 /** Contains the class DinoUmlDiagramGraph which represents one
66 * particular diagram of the complete UML Model. Each diagram refers
67 * to the node and edge information of DinoUmlModelGraph. Essentially
68 * a diagram contains selected nodes and edges of the model provides
69 * with additional geometric information.
71 class OGDF_EXPORT DinoUmlDiagramGraph {
73 friend ostream &operator<<(ostream&, const DinoUmlDiagramGraph &);
75 public:
77 //---------------------------------------------------------
78 // U m l D i a g r a m T y p e
79 //---------------------------------------------------------
80 /** This enum type represents the different diagram types of UML.
82 enum UmlDiagramType{
83 classDiagram,
84 moduleDiagram,
85 sequenceDiagram,
86 collaborationDiagram,
87 componentDiagram,
88 unknownDiagram
90 }; // enum UmlDiagramType
92 private:
94 /** Reference to the model graph. */
95 const DinoUmlModelGraph &m_modelGraph;
97 /** The name of the diagram. */
98 String m_diagramName;
100 /** The type of diagram. */
101 UmlDiagramType m_diagramType;
103 /** This list holds pointer to the nodes contained in
104 * the represented diagram.
106 SList<NodeElement*> m_containedNodes;
108 /** This list holds pointer to the edges contained in
109 * the represented diagram.
111 SList<EdgeElement*> m_containedEdges;
113 /** This list contains the x-coordinates of the nodes
114 * contained in the represented diagram.
116 SList<double> m_x;
118 /** This list contains the y-coordinates of the nodes
119 * contained in the represented diagram.
121 SList<double> m_y;
123 /** This list contains the width of the nodes
124 * contained in the represented diagram.
126 SList<double> m_w;
128 /** This list contains the height of the nodes
129 * contained in the represented diagram.
131 SList<double> m_h;
133 public:
135 /** Constructor. */
136 DinoUmlDiagramGraph(const DinoUmlModelGraph &umlModelGraph,
137 UmlDiagramType diagramType,
138 String diagramName);
140 /** Destructor. */
141 ~DinoUmlDiagramGraph();
143 /** Adds a node with the given coordinates. */
144 void addNodeWithGeometry(NodeElement* node,
145 double x, double y, double w, double h);
147 /** Adds an edge. */
148 void addEdge(EdgeElement* edge);
150 /** Returns the name of the diagram. */
151 String getDiagramName() const{
152 return m_diagramName;
155 /** Returns the type of the diagram as string. */
156 String getDiagramTypeString() const;
158 /** Access to contained nodes. */
159 const SList<NodeElement*> &getNodes() const{
160 return m_containedNodes;
163 /** Access to contained edges. */
164 const SList<EdgeElement*> &getEdges() const{
165 return m_containedEdges;
168 /** Access to x-coordinates. */
169 const SList<double> &getX() const{
170 return m_x;
173 /** Access to y-coordinates. */
174 const SList<double> &getY() const{
175 return m_y;
178 /** Access to width. */
179 const SList<double> &getWidth() const{
180 return m_w;
183 /** Access to height. */
184 const SList<double> &getHeight() const{
185 return m_h;
188 }; // class DinoUmlDiagramGraph
190 /** Output operator for DinoUmlDiagramGraph. */
191 ostream &operator<<(ostream &os, const DinoUmlDiagramGraph &diagramGraph);
194 } // end namespace ogdf
196 #endif