Skip to content

Commit

Permalink
Merge ac05c85 into 283b59e
Browse files Browse the repository at this point in the history
  • Loading branch information
Sedictious committed Jul 20, 2019
2 parents 283b59e + ac05c85 commit b7c2474
Show file tree
Hide file tree
Showing 6 changed files with 431 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ set(EVOPLEX_GUI_H
experimentwidget.h
graphdesigner.h
graphattrsdlg.h
graphgendlg.h
fontstyles.h
#linechart.h
linebutton.h
Expand Down Expand Up @@ -120,6 +121,7 @@ set(EVOPLEX_GUI_CXX
attrsgendlg.cpp
experimentdesigner.cpp
graphattrsdlg.cpp
graphgendlg.cpp
graphdesigner.cpp
colormap.cpp
#contextmenutable.cpp
Expand Down Expand Up @@ -159,6 +161,7 @@ set(EVOPLEX_GUI_UIFORM
graphtitlebar
graphdesignerpage
graphattrsdlg
graphgendlg
#linechartsettings
outputwidget
pluginspage
Expand Down
192 changes: 192 additions & 0 deletions src/gui/forms/graphgendlg.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GraphGenDlg</class>
<widget class="QWidget" name="GraphGenDlg">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>312</width>
<height>408</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Graph Generator</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="wNumAttrs" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>8</number>
</property>
<item>
<widget class="QLabel" name="lNodes">
<property name="text">
<string>Nodes</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="numNodes">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100000000</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="wData" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QComboBox" name="graphType"/>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lgraphType">
<property name="text">
<string>Graph Type</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QTreeWidget" name="treeWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<property name="columnCount">
<number>2</number>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ok">
<property name="text">
<string>Ok</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
19 changes: 15 additions & 4 deletions src/gui/graphdesignerpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "fontstyles.h"
#include "graphdesignerpage.h"
#include "graphgendlg.h"
#include "ui_graphdesignerpage.h"

namespace evoplex {
Expand Down Expand Up @@ -57,12 +58,15 @@ void GraphDesignerPage::slotEdgeAttrs() {
new GraphAttrsDlg(this, AttrsType::Edges);
};

void GraphDesignerPage::slotNodeAttrs() {
void GraphDesignerPage::slotNodeAttrs()
{
new GraphAttrsDlg(this, AttrsType::Nodes);
};
}

void GraphDesignerPage::slotGraphGen() {
};
void GraphDesignerPage::slotGraphGen()
{
new GraphGenDlg(this, m_mainGUI);
}

void GraphDesignerPage::changedAttrsScope(const AttrsType type, AttributesScope attrs)
{
Expand All @@ -73,4 +77,11 @@ void GraphDesignerPage::changedAttrsScope(const AttrsType type, AttributesScope
}
}

void GraphDesignerPage::changedGraphAttrs(const int numNodes, QStringList& graphAttrHeader, QStringList& graphAttrValues)
{
m_numNodes = numNodes;
m_graphAttrHeader = graphAttrHeader;
m_graphAttrValues = graphAttrValues;
}

}
13 changes: 10 additions & 3 deletions src/gui/graphdesignerpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
#define GRAPHDESIGNERPAGE_H

#include <QMainWindow>
#include <QStringList>

#include "maingui.h"
#include "abstractgraph.h"
#include "attributerange.h"
#include "graphdesigner.h"
#include "graphattrsdlg.h"
#include "graphgendlg.h"

#include "core/mainapp.h"

Expand All @@ -36,7 +38,7 @@ class Ui_GraphDesignerPage;
namespace evoplex {

class GraphDesigner;
enum class AttrsType;
enum class AttrsType;

class GraphDesignerPage : public QMainWindow
{
Expand All @@ -48,18 +50,23 @@ class GraphDesignerPage : public QMainWindow

protected:
friend class GraphAttrsDlg;

friend class GraphGenDlg;

void changedAttrsScope(const AttrsType type, AttributesScope attrs);
void changedGraphAttrs(const int numNodes, QStringList& graphAttrHeader, QStringList& graphAttrValues);

private:
Ui_GraphDesignerPage* m_ui;
MainApp* m_mainApp;
MainGUI* m_mainGUI;
QMainWindow* m_innerWindow;
GraphDesigner* m_graphDesigner;

AttributesScope m_edgeAttrScope;
AttributesScope m_nodeAttrScope;

int m_numNodes;
QStringList m_graphAttrHeader;
QStringList m_graphAttrValues;

private slots:
void slotEdgeAttrs();
Expand Down

0 comments on commit b7c2474

Please sign in to comment.