• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

rocs/RocsCore

  • sources
  • kde-4.12
  • kdeedu
  • rocs
  • RocsCore
  • DataStructures
  • Graph
GraphStructure.h
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright 2011 Tomaz Canabrava <tomaz.canabrava@gmail.com>
4  Copyright 2011 Wagner Reck <wagner.reck@gmail.com>
5  Copyright 2011-2012 Andreas Cord-Landwehr <cola@uni-paderborn.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef GRAPHSTRUCTURE_H
22 #define GRAPHSTRUCTURE_H
23 
24 #include "rocs_graphstructure_export.h"
25 #include "DataStructure.h"
26 
27 namespace Rocs
28 {
29 class ROCS_GRAPHSTRUCTURE_EXPORT GraphStructure : public DataStructure
30 {
31  Q_OBJECT
32  Q_PROPERTY(QString name READ name WRITE setName)
33 
34 public:
35  typedef enum {
36  Graph,
37  Multigraph
38  } GRAPH_TYPE;
39 
40  //to avoid hide some methods
41  using DataStructure::remove;
42  using DataStructure::createPointer;
43  using DataStructure::createData;
44 
45  static DataStructurePtr create(Document *parent);
46  static DataStructurePtr create(DataStructurePtr other, Document *parent);
47 
48  explicit GraphStructure(Document* parent = 0);
49  ~GraphStructure();
50  void importStructure(DataStructurePtr other);
51 
60  PointerPtr createPointer(DataPtr from, DataPtr to, int pointerType);
61 
69  DataPtr createData(const QString& name, int dataType);
70 
75  GRAPH_TYPE graphType() const;
76 
77  bool multigraph() const;
78 
84  QMap<QString, QString> pluginProperties() const;
85 
91  void setPluginProperty(const QString& identifier, const QString& property);
92 
103  QMap<DataPtr,PointerList> dijkstraShortestPaths(DataPtr from);
104 
109  Q_INVOKABLE QScriptValue nodes();
110 
116  Q_INVOKABLE QScriptValue nodes(int type);
117 
122  Q_INVOKABLE QScriptValue edges();
123 
129  Q_INVOKABLE QScriptValue edges(int type);
130 
137  Q_INVOKABLE QScriptValue createNode(int type);
138 
143  Q_INVOKABLE QScriptValue createNode();
144 
154  Q_INVOKABLE QScriptValue createEdge(Data* fromRaw, Data* toRaw, int type);
155 
162  Q_INVOKABLE QScriptValue createEdge(Data* fromRaw, Data* toRaw);
163 
164 
165 public slots:
171  void setGraphType(int type);
172 
178  QScriptValue list_nodes();
179 
186  QScriptValue list_nodes(int type);
187 
193  QScriptValue list_edges();
194 
201  QScriptValue list_edges(int type);
202 
210  QScriptValue overlay_edges(int overlay);
211 
218  QScriptValue add_node(const QString& name);
219 
230  QScriptValue add_overlay_edge(Data* fromRaw, Data* toRaw, int overlay);
231 
239  QScriptValue add_edge(Data* fromRaw, Data* toRaw);
240 
252  QScriptValue dijkstra_shortest_path(Data* fromRaw, Data* toRaw);
253 
266  QScriptValue distances(Data* fromRaw);
267 
268 private:
269  GraphStructure::GRAPH_TYPE _type;
270 };
271 }
272 #endif // GRAPHSTRUCTURE_H
Rocs::GraphStructure
Definition: GraphStructure.h:29
ROCS_GRAPHSTRUCTURE_EXPORT
#define ROCS_GRAPHSTRUCTURE_EXPORT
Definition: rocs_graphstructure_export.h:32
DataStructure
Definition: DataStructure.h:43
Rocs::GraphStructure::GRAPH_TYPE
GRAPH_TYPE
Definition: GraphStructure.h:35
DataStructurePtr
boost::shared_ptr< DataStructure > DataStructurePtr
Definition: CoreTypes.h:38
DotParser::createData
void createData(const std::string &str)
Definition: DotGrammar.cpp:372
PointerPtr
boost::shared_ptr< Pointer > PointerPtr
Definition: CoreTypes.h:35
DataStructure.h
rocs_graphstructure_export.h
DataStructure::createData
virtual DataPtr createData(const QString &name, int dataType)
Definition: DataStructure.cpp:300
DataStructure::createPointer
virtual PointerPtr createPointer(DataPtr from, DataPtr to, int pointerType)
Creates new pointer from data element "from" to data element "to" of given type "pointerType".
Definition: DataStructure.cpp:393
Document
Definition: Document.h:41
DataStructure::remove
void remove()
if this datastructure shall be deleted, call ONLY this function
Definition: DataStructure.cpp:271
DataPtr
boost::shared_ptr< Data > DataPtr
Definition: CoreTypes.h:34
Data
Definition: Data.h:40
Rocs::GraphStructure::Graph
Definition: GraphStructure.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/RocsCore

Skip menu "rocs/RocsCore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal