1 /** \file 2 * \brief GraphML related enums and string conversion functions. 3 * 4 * \author Łukasz Hanuszczak 5 * 6 * \par License: 7 * This file is part of the Open Graph Drawing Framework (OGDF). 8 * 9 * \par 10 * Copyright (C)<br> 11 * See README.md in the OGDF root directory for details. 12 * 13 * \par 14 * This program is free software; you can redistribute it and/or 15 * modify it under the terms of the GNU General Public License 16 * Version 2 or 3 as published by the Free Software Foundation; 17 * see the file LICENSE.txt included in the packaging of this file 18 * for details. 19 * 20 * \par 21 * This program is distributed in the hope that it will be useful, 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 * GNU General Public License for more details. 25 * 26 * \par 27 * You should have received a copy of the GNU General Public 28 * License along with this program; if not, see 29 * http://www.gnu.org/copyleft/gpl.html 30 */ 31 32 #pragma once 33 34 #include <ogdf/basic/Graph.h> 35 #include <ogdf/basic/GraphAttributes.h> 36 #include <ogdf/basic/HashArray.h> 37 #include <string> 38 39 namespace ogdf { 40 namespace graphml { 41 42 enum class Attribute { 43 NodeLabel = 0, 44 EdgeLabel, 45 46 X, Y, Z, 47 Width, Height, 48 Size, // Gephi compatibility (size = max(width, height)). 49 Shape, 50 51 NodeLabelX, 52 NodeLabelY, 53 NodeLabelZ, 54 55 NodeStrokeColor, 56 NodeStrokeType, 57 NodeStrokeWidth, 58 EdgeStrokeColor, 59 EdgeStrokeType, 60 EdgeStrokeWidth, 61 ClusterStroke, 62 NodeFillPattern, 63 NodeFillBackground, 64 R, G, B, // Gephi compatibility (fill compounds). 65 66 NodeWeight, 67 EdgeWeight, 68 69 NodeType, 70 EdgeType, 71 72 NodeId, 73 Template, 74 75 EdgeArrow, 76 EdgeSubGraph, 77 EdgeBends, 78 79 Unknown // Has to be the last one! 80 }; 81 82 std::string toString(const Attribute &attr); 83 std::string toString(const Shape &shape); 84 std::string toString(const EdgeArrow &arrow); 85 std::string toString(const Graph::NodeType &type); 86 std::string toString(const Graph::EdgeType &type); 87 88 Attribute toAttribute(const std::string &str); 89 Shape toShape(const std::string &str); 90 EdgeArrow toArrow(const std::string &str); 91 Graph::NodeType toNodeType(const std::string &str); 92 Graph::EdgeType toEdgeType(const std::string &str); 93 94 } 95 } 96