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

rocs/VisualEditor

  • sources
  • kde-4.14
  • kdeedu
  • rocs
  • VisualEditor
  • Tools
  • GenerateGraph
GenerateGraphWidget.h
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright (C) 2011-2013 Andreas Cord-Landwehr <cola@uni-paderborn.de>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of
8  the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef GENERATEGRAPHWIDGET_H
20 #define GENERATEGRAPHWIDGET_H
21 
22 #include "ui_GenerateGraphWidget.h"
23 #include <QWidget>
24 #include <KDialog>
25 
26 class Document;
27 
28 class GenerateGraphWidget
29 : public KDialog
30 {
31  Q_OBJECT
32 
33  enum GraphGenerator {
34  MeshGraph,
35  StarGraph,
36  CircleGraph,
37  RandomEdgeGraph,
38  ErdosRenyiRandomGraph,
39  RandomTree
40  };
41 
42 public:
43  explicit GenerateGraphWidget(Document *document = 0);
44  ~GenerateGraphWidget();
45 
46 public slots:
52  void setGraphGenerator(int index);
53 
59  void setSeed(int seed);
60 
66  void setDataType(int type);
67 
73  void setPointerType(int type);
74 
81  void setGraphIdentifier(const QString &identifier);
82 
86  void generateGraph();
87 
88 private:
94  void generateCircle(int nodes);
95 
102  void generateMesh(int rows, int columns);
103 
112  void generateRandomGraph(int nodes, int edges, bool selfEdges);
113 
119  void generateStar(int satelliteNodes);
120 
130  void generateErdosRenyiRandomGraph(int nodes, double edgeProbability, bool selfEdges);
131 
139  void generateRandomTreeGraph(int nodes);
140 
141 
142  int seed_;
143  int dataType_;
144  int pointerType_;
145  QString identifier_;
146  GraphGenerator graphGenerator_;
147 
148  QHash<GraphGenerator, QString> defaultIdentifiers;
149 
150  Ui::GenerateGraphWidget *ui;
151 };
152 
153 #endif
GenerateGraphWidget::setGraphGenerator
void setGraphGenerator(int index)
Select graph generator by its index.
Definition: GenerateGraphWidget.cpp:136
KDialog
GenerateGraphWidget::setGraphIdentifier
void setGraphIdentifier(const QString &identifier)
Set the unique graph identifier for the next generated graph.
Definition: GenerateGraphWidget.cpp:146
QHash< GraphGenerator, QString >
GenerateGraphWidget::setSeed
void setSeed(int seed)
Set seed for the internal random number generator.
Definition: GenerateGraphWidget.cpp:169
GenerateGraphWidget::GenerateGraphWidget
GenerateGraphWidget(Document *document=0)
Definition: GenerateGraphWidget.cpp:66
QString
GenerateGraphWidget::setPointerType
void setPointerType(int type)
Set the type of pointers for the generator.
Definition: GenerateGraphWidget.cpp:160
GenerateGraphWidget::generateGraph
void generateGraph()
Generate the graph with the previously set configuration.
Definition: GenerateGraphWidget.cpp:174
GenerateGraphWidget
Definition: GenerateGraphWidget.h:28
GenerateGraphWidget::~GenerateGraphWidget
~GenerateGraphWidget()
Definition: GenerateGraphWidget.cpp:217
GenerateGraphWidget::setDataType
void setDataType(int type)
Set the type of data elements for the generator.
Definition: GenerateGraphWidget.cpp:151
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/VisualEditor

Skip menu "rocs/VisualEditor"
  • Main Page
  • 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
  • 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