Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / src / fileformats / DinoUmlModelGraph.cpp
blob45f068d4b1cdb29e39c72e41af2e11c306f1c644
1 /*
2 * $Revision: 2565 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-07 17:14:54 +0200 (Sa, 07. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Implementation of the class DinoUmlModelGraph
12 * \author Dino Ahr
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
44 #include <ogdf/fileformats/DinoUmlModelGraph.h>
47 namespace ogdf {
50 // C o n s t r u c t o r
52 DinoUmlModelGraph::DinoUmlModelGraph(){
54 // Initialize arrays
55 m_nodeLabel.init(*this);
56 m_eType.init(*this,Graph::association);
57 m_vType.init(*this,Graph::vertex);
62 // D e s t r u c t o r
64 DinoUmlModelGraph::~DinoUmlModelGraph(){
66 // ??? Destroy arrays
70 // o u t p u t O p e r a t o r for DinoUmlModelGraph
72 ostream &operator<<(ostream &os, const DinoUmlModelGraph &modelGraph)
74 // Header
75 os << "\n--- UmlModelGraph ---\n" << endl;
77 // Traverse graph
79 // Nodes
80 NodeElement *v;
81 os << "Classes/Interfaces:\n" << endl;
82 forall_nodes(v,modelGraph) {
83 os << "\t" << modelGraph.getNodeLabel(v) << endl;
86 // Edges
87 EdgeElement *e;
88 os << "\nRelations:\n" << endl;
89 forall_edges(e,modelGraph) {
90 os << "\t";
92 if (modelGraph.type(e) == Graph::association){
93 os << "Association between ";
95 if (modelGraph.type(e) == Graph::generalization){
96 os << "Generalization between ";
98 if (modelGraph.type(e) == Graph::dependency){
99 os << "Dependency between ";
102 os << modelGraph.getNodeLabel(e->source()) << " and "
103 << modelGraph.getNodeLabel(e->target()) << endl;
106 return os;
108 } // <<
111 } // namespace ogdf