feat: qwidget layout
This commit is contained in:
parent
4a5b7c4712
commit
7d7e1a5b95
|
|
@ -5,6 +5,7 @@ project(ParticleTrackTrace)
|
|||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
find_package(Qt5Core REQUIRED)
|
||||
|
|
@ -77,9 +78,10 @@ add_executable(ParticleTrackTrace MACOSX_BUNDLE main.cpp
|
|||
advection/Vel.h
|
||||
advection/kernel/SnapBoundaryConditionKernel.h
|
||||
advection/kernel/SnapBoundaryConditionKernel.cpp
|
||||
# QT/MainWindow.h
|
||||
# QT/MainWindow.cpp
|
||||
# QT/MainWindow.ui
|
||||
QT/MainWindow.h
|
||||
QT/MainWindow.cpp
|
||||
QT/MainWindow.ui
|
||||
QT/ui_mainwindow.h
|
||||
)
|
||||
|
||||
execute_process(
|
||||
|
|
|
|||
|
|
@ -51,17 +51,17 @@ void Program::setupCameraCallback() {
|
|||
this->interact->AddObserver(vtkCommand::KeyPressEvent, callback);
|
||||
}
|
||||
|
||||
Program::Program(int timerDT, vtkSmartPointer<vtkGenericOpenGLRenderWindow> win) {
|
||||
// this->win = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
|
||||
this->win = win;
|
||||
Program::Program(QWidget *parent): QVTKOpenGLNativeWidget(parent) {
|
||||
this->win = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
|
||||
// this->interact = vtkSmartPointer<vtkRenderWindowInteractor>::New();
|
||||
// this->interact = vtkSmartPointer<QVTKInteractor>::New();
|
||||
setRenderWindow(this->win);
|
||||
this->interact = win->GetInteractor();
|
||||
this->cam = createNormalisedCamera();
|
||||
|
||||
this->win->SetNumberOfLayers(0);
|
||||
setWinProperties();
|
||||
setupTimer(timerDT);
|
||||
setupTimer(60 * 60); // FIXME: manually tracking this variable is a little stupid.
|
||||
setupCameraCallback();
|
||||
}
|
||||
|
||||
|
|
@ -103,3 +103,7 @@ void Program::render() {
|
|||
win->Render();
|
||||
interact->Start();
|
||||
}
|
||||
|
||||
Program::~Program() {
|
||||
cout << "deleting program" << endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
/** This class manages the upper levels of the vtk pipeline; it has attributes for the vtkrenderWindow and a vector of Layers to represent a variable number of vtkRenderers.
|
||||
* It can also set up a vtkTimer by connecting an instance of TimerCallbackCommand with its contained vtkRenderWindowInteractor.
|
||||
*/
|
||||
class Program {
|
||||
class Program : public QVTKOpenGLNativeWidget {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
/** This attribute models a variable number of vtkRenderers, managed through the abstract Layer class.
|
||||
*/
|
||||
|
|
@ -48,7 +50,8 @@ private:
|
|||
public:
|
||||
/** Constructor.
|
||||
*/
|
||||
Program(int timerDT, vtkSmartPointer<vtkGenericOpenGLRenderWindow> win);
|
||||
Program(QWidget *parent = nullptr);
|
||||
~Program() override;
|
||||
|
||||
/** This function adds a new layer (and thus vtkRenderer) to the program.
|
||||
* The layer is expected to set its own position in the vtkRenderWindow layer system.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "MainWindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileDialog>
|
||||
|
|
@ -6,52 +7,144 @@
|
|||
|
||||
#include <vtkDataSetReader.h>
|
||||
|
||||
#include "../layers/BackgroundImage.h"
|
||||
#include "../layers/EColLayer.h"
|
||||
#include "../layers/EGlyphLayer.h"
|
||||
#include "../layers/LGlyphLayer.h"
|
||||
#include "../Program.h"
|
||||
#include "../advection/UVGrid.h"
|
||||
#include "../advection/kernel/RK4AdvectionKernel.h"
|
||||
#include "../advection/kernel/SnapBoundaryConditionKernel.h"
|
||||
using namespace std;
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
cout << "Reading data..." << endl;
|
||||
string dataPath = "../../../../data";
|
||||
shared_ptr<UVGrid> uvGrid = make_shared<UVGrid>(dataPath);
|
||||
auto kernelRK4 = make_unique<RK4AdvectionKernel>(uvGrid);
|
||||
auto kernelRK4BoundaryChecked = make_unique<SnapBoundaryConditionKernel>(std::move(kernelRK4), uvGrid);
|
||||
cout << "Starting vtk..." << endl;
|
||||
|
||||
auto l = new LGlyphLayer(uvGrid, std::move(kernelRK4BoundaryChecked));
|
||||
// l->spoofPoints();
|
||||
l->setDt(3600);
|
||||
// TODO: implement feature to call this function on widget
|
||||
// l->cycleGlyphStyle();
|
||||
|
||||
Program *program = this->ui->getProgram();
|
||||
program->addLayer(new BackgroundImage(dataPath + "/map_qgis_1035.png"));
|
||||
// TODO: implement feature to cycle between layers thru QT
|
||||
program->addLayer(new EGlyphLayer(uvGrid));
|
||||
program->addLayer(new EColLayer(uvGrid));
|
||||
program->addLayer(l);
|
||||
|
||||
program->setupInteractions();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() { delete ui; }
|
||||
|
||||
void MainWindow::showAboutDialog()
|
||||
{
|
||||
QMessageBox::information(
|
||||
this, "About",
|
||||
"interactive particle in-fluid simulation program for surface level advection.");
|
||||
MainWindow::~MainWindow() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::showOpenFileDialog()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open file"), "",
|
||||
"VTK Files (*.vtk)");
|
||||
|
||||
// Open file
|
||||
QFile file(fileName);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
void MainWindow::on_FirstButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
// Return on Cancel
|
||||
if (!file.exists())
|
||||
return;
|
||||
|
||||
openFile(fileName);
|
||||
}
|
||||
|
||||
void MainWindow::openFile(const QString& fileName)
|
||||
{
|
||||
ui->sceneWidget->removeDataSet();
|
||||
|
||||
// Create reader
|
||||
vtkSmartPointer<vtkDataSetReader> reader = vtkSmartPointer<vtkDataSetReader>::New();
|
||||
reader->SetFileName(fileName.toStdString().c_str());
|
||||
|
||||
// Read the file
|
||||
reader->Update();
|
||||
|
||||
// Add data set to 3D view
|
||||
vtkSmartPointer<vtkDataSet> dataSet = reader->GetOutput();
|
||||
if (dataSet != nullptr) {
|
||||
ui->sceneWidget->addDataSet(reader->GetOutput());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_SecondButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_ComplentaryButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_ContrastingButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_MonochromaticButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_SaturateButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_DesaturateButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_CircleButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_TriangleButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_SquareButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_HexagonButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_FullySampledButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_RegularlySubsampledButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_IregularlySampledButton_clicked(bool checked) {
|
||||
if (checked) {
|
||||
|
||||
}}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,19 +14,21 @@ public:
|
|||
explicit MainWindow(QWidget* parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
public slots:
|
||||
//! Show the 'About this application' dialog
|
||||
void showAboutDialog();
|
||||
|
||||
//! Show the 'Open file...' dialog
|
||||
void showOpenFileDialog();
|
||||
|
||||
protected:
|
||||
//! Open a file
|
||||
/*!
|
||||
\param[in] fileName The name of the file including the path
|
||||
*/
|
||||
void openFile(const QString& fileName);
|
||||
private slots:
|
||||
void on_FirstButton_clicked(bool checked);
|
||||
void on_SecondButton_clicked(bool checked);
|
||||
void on_ComplentaryButton_clicked(bool checked);
|
||||
void on_ContrastingButton_clicked(bool checked);
|
||||
void on_MonochromaticButton_clicked(bool checked);
|
||||
void on_SaturateButton_clicked(bool checked);
|
||||
void on_DesaturateButton_clicked(bool checked);
|
||||
void on_CircleButton_clicked(bool checked);
|
||||
void on_TriangleButton_clicked(bool checked);
|
||||
void on_SquareButton_clicked(bool checked);
|
||||
void on_HexagonButton_clicked(bool checked);
|
||||
void on_FullySampledButton_clicked(bool checked);
|
||||
void on_RegularlySubsampledButton_clicked(bool checked);
|
||||
void on_IregularlySampledButton_clicked(bool checked);
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
|
|
|
|||
|
|
@ -6,205 +6,350 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>1048</width>
|
||||
<height>772</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Qt VTK Viewer</string>
|
||||
<string>Simulation</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="settingsBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>280</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
<property name="title">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="TechniqueBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="SceneWidget" name="sceneWidget"/>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Technique</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="FirstButton">
|
||||
<property name="text">
|
||||
<string>ECol + LGlyph</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="SecondButton">
|
||||
<property name="text">
|
||||
<string>EGlyph + LCol</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="ChannelBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>550</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Channel Options</string>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="ColourBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>21</height>
|
||||
<y>30</y>
|
||||
<width>300</width>
|
||||
<height>120</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
<string>Color</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="ComplementaryButton">
|
||||
<property name="text">
|
||||
<string>Complementary </string>
|
||||
</property>
|
||||
<addaction name="actionOpenFile"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="ContrastingButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Contrasting</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="MonochromaticButton">
|
||||
<property name="text">
|
||||
<string>Monochromatic</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="SaturationBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>160</y>
|
||||
<width>269</width>
|
||||
<height>100</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>260</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
<string>Saturation</string>
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionOpenFile"/>
|
||||
<addaction name="actionZoomToExtent"/>
|
||||
</widget>
|
||||
<action name="actionOpenFile">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/open_file.png</normaloff>:/icons/open_file.png</iconset>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="SaturateButton">
|
||||
<property name="text">
|
||||
<string>Open file...</string>
|
||||
<string>Fully saturated</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open file...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+O</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionZoomToExtent">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/zoom_to.png</normaloff>:/icons/zoom_to.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Zoom to extent</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Zoom to extent</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuit">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/quit.png</normaloff>:/icons/quit.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Quit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/about.png</normaloff>:/icons/about.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="DesaturateButton">
|
||||
<property name="text">
|
||||
<string>Desaturated</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="GlyphBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>270</y>
|
||||
<width>260</width>
|
||||
<height>150</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>260</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Glyph Shape</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_10">
|
||||
<property name="text">
|
||||
<string>Circle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_11">
|
||||
<property name="text">
|
||||
<string>Triangle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_12">
|
||||
<property name="text">
|
||||
<string>Square</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="text">
|
||||
<string>Hexagon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="GlyphBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>430</y>
|
||||
<width>260</width>
|
||||
<height>120</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>260</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Glyph count</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_13">
|
||||
<property name="text">
|
||||
<string>Fully sampled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_14">
|
||||
<property name="text">
|
||||
<string>Regularly subsampled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_15">
|
||||
<property name="text">
|
||||
<string>Irregularly sampled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Program" name="program"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SceneWidget</class>
|
||||
<extends>QOpenGLWidget</extends>
|
||||
<header>scenewidget.h</header>
|
||||
<slots>
|
||||
<slot>zoomToExtent()</slot>
|
||||
</slots>
|
||||
<class>MainView</class>
|
||||
<extends>QVTKOpenGLNativeWidget</extends>
|
||||
<header location="global">Program.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>actionOpenFile</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>showOpenFileDialog()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
<y>299</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionQuit</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
<y>299</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionZoomToExtent</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>sceneWidget</receiver>
|
||||
<slot>zoomToExtent()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
<y>314</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionAbout</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>showAboutDialog()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
<y>299</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>showOpenFileDialog()</slot>
|
||||
<slot>showAboutDialog()</slot>
|
||||
</slots>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,282 @@
|
|||
/********************************************************************************
|
||||
** Form generated from reading UI file 'MainWindow.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 5.15.13
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_MAINWINDOW_H
|
||||
#define UI_MAINWINDOW_H
|
||||
|
||||
#include "../Program.h"
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QGroupBox>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QRadioButton>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_MainWindow
|
||||
{
|
||||
public:
|
||||
QWidget *centralWidget;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QGroupBox *settingsBox;
|
||||
QVBoxLayout *verticalLayout_3;
|
||||
QGroupBox *TechniqueBox;
|
||||
QVBoxLayout *verticalLayout_2;
|
||||
QRadioButton *FirstButton;
|
||||
QRadioButton *SecondButton;
|
||||
QGroupBox *ChannelBox;
|
||||
QGroupBox *ColourBox;
|
||||
QVBoxLayout *verticalLayout_12;
|
||||
QRadioButton *ComplementaryButton;
|
||||
QRadioButton *ContrastingButton;
|
||||
QRadioButton *MonochromaticButton;
|
||||
QGroupBox *SaturationBox;
|
||||
QVBoxLayout *verticalLayout_13;
|
||||
QRadioButton *SaturateButton;
|
||||
QRadioButton *DesaturateButton;
|
||||
QGroupBox *GlyphBox;
|
||||
QVBoxLayout *verticalLayout_14;
|
||||
QRadioButton *CircleButton;
|
||||
QRadioButton *TriangleButton;
|
||||
QRadioButton *SquareButton;
|
||||
QRadioButton *HexagonButton;
|
||||
QGroupBox *GlyphBox_2;
|
||||
QVBoxLayout *verticalLayout_16;
|
||||
QRadioButton *FullySampledButton;
|
||||
QRadioButton *RegularlySubsampledButton;
|
||||
QRadioButton *IregularlySubsampledButton;
|
||||
Program *program;
|
||||
|
||||
Program* getProgram() {
|
||||
return program;
|
||||
}
|
||||
|
||||
void setupUi(QMainWindow *MainWindow)
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
||||
MainWindow->resize(1048, 772);
|
||||
centralWidget = new QWidget(MainWindow);
|
||||
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
|
||||
horizontalLayout = new QHBoxLayout(centralWidget);
|
||||
horizontalLayout->setSpacing(6);
|
||||
horizontalLayout->setContentsMargins(11, 11, 11, 11);
|
||||
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
|
||||
settingsBox = new QGroupBox(centralWidget);
|
||||
settingsBox->setObjectName(QString::fromUtf8("settingsBox"));
|
||||
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
sizePolicy.setHorizontalStretch(0);
|
||||
sizePolicy.setVerticalStretch(0);
|
||||
sizePolicy.setHeightForWidth(settingsBox->sizePolicy().hasHeightForWidth());
|
||||
settingsBox->setSizePolicy(sizePolicy);
|
||||
settingsBox->setMinimumSize(QSize(220, 0));
|
||||
settingsBox->setMaximumSize(QSize(280, 16777215));
|
||||
verticalLayout_3 = new QVBoxLayout(settingsBox);
|
||||
verticalLayout_3->setSpacing(6);
|
||||
verticalLayout_3->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
|
||||
TechniqueBox = new QGroupBox(settingsBox);
|
||||
TechniqueBox->setObjectName(QString::fromUtf8("TechniqueBox"));
|
||||
sizePolicy.setHeightForWidth(TechniqueBox->sizePolicy().hasHeightForWidth());
|
||||
TechniqueBox->setSizePolicy(sizePolicy);
|
||||
TechniqueBox->setMinimumSize(QSize(0, 0));
|
||||
TechniqueBox->setMaximumSize(QSize(500, 100));
|
||||
verticalLayout_2 = new QVBoxLayout(TechniqueBox);
|
||||
verticalLayout_2->setSpacing(6);
|
||||
verticalLayout_2->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
|
||||
FirstButton = new QRadioButton(TechniqueBox);
|
||||
FirstButton->setObjectName(QString::fromUtf8("FirstButton"));
|
||||
FirstButton->setChecked(true);
|
||||
|
||||
verticalLayout_2->addWidget(FirstButton);
|
||||
|
||||
SecondButton = new QRadioButton(TechniqueBox);
|
||||
SecondButton->setObjectName(QString::fromUtf8("SecondButton"));
|
||||
SecondButton->setChecked(false);
|
||||
|
||||
verticalLayout_2->addWidget(SecondButton);
|
||||
|
||||
|
||||
verticalLayout_3->addWidget(TechniqueBox);
|
||||
|
||||
ChannelBox = new QGroupBox(settingsBox);
|
||||
ChannelBox->setObjectName(QString::fromUtf8("ChannelBox"));
|
||||
ChannelBox->setMinimumSize(QSize(0, 550));
|
||||
ColourBox = new QGroupBox(ChannelBox);
|
||||
ColourBox->setObjectName(QString::fromUtf8("ColourBox"));
|
||||
ColourBox->setGeometry(QRect(0, 30, 300, 120));
|
||||
sizePolicy.setHeightForWidth(ColourBox->sizePolicy().hasHeightForWidth());
|
||||
ColourBox->setSizePolicy(sizePolicy);
|
||||
ColourBox->setMinimumSize(QSize(250, 0));
|
||||
ColourBox->setMaximumSize(QSize(500, 120));
|
||||
ColourBox->setAlignment(Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter);
|
||||
verticalLayout_12 = new QVBoxLayout(ColourBox);
|
||||
verticalLayout_12->setSpacing(6);
|
||||
verticalLayout_12->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_12->setObjectName(QString::fromUtf8("verticalLayout_12"));
|
||||
ComplementaryButton = new QRadioButton(ColourBox);
|
||||
ComplementaryButton->setObjectName(QString::fromUtf8("ComplementaryButton"));
|
||||
|
||||
verticalLayout_12->addWidget(ComplementaryButton);
|
||||
|
||||
ContrastingButton = new QRadioButton(ColourBox);
|
||||
ContrastingButton->setObjectName(QString::fromUtf8("ContrastingButton"));
|
||||
QSizePolicy sizePolicy1(QSizePolicy::Maximum, QSizePolicy::Fixed);
|
||||
sizePolicy1.setHorizontalStretch(0);
|
||||
sizePolicy1.setVerticalStretch(0);
|
||||
sizePolicy1.setHeightForWidth(ContrastingButton->sizePolicy().hasHeightForWidth());
|
||||
ContrastingButton->setSizePolicy(sizePolicy1);
|
||||
|
||||
verticalLayout_12->addWidget(ContrastingButton);
|
||||
|
||||
MonochromaticButton = new QRadioButton(ColourBox);
|
||||
MonochromaticButton->setObjectName(QString::fromUtf8("MonochromaticButton"));
|
||||
|
||||
verticalLayout_12->addWidget(MonochromaticButton);
|
||||
|
||||
SaturationBox = new QGroupBox(ChannelBox);
|
||||
SaturationBox->setObjectName(QString::fromUtf8("SaturationBox"));
|
||||
SaturationBox->setGeometry(QRect(0, 160, 269, 100));
|
||||
sizePolicy.setHeightForWidth(SaturationBox->sizePolicy().hasHeightForWidth());
|
||||
SaturationBox->setSizePolicy(sizePolicy);
|
||||
SaturationBox->setMinimumSize(QSize(260, 0));
|
||||
SaturationBox->setMaximumSize(QSize(500, 100));
|
||||
SaturationBox->setAlignment(Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter);
|
||||
verticalLayout_13 = new QVBoxLayout(SaturationBox);
|
||||
verticalLayout_13->setSpacing(6);
|
||||
verticalLayout_13->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_13->setObjectName(QString::fromUtf8("verticalLayout_13"));
|
||||
SaturateButton = new QRadioButton(SaturationBox);
|
||||
SaturateButton->setObjectName(QString::fromUtf8("SaturateButton"));
|
||||
|
||||
verticalLayout_13->addWidget(SaturateButton);
|
||||
|
||||
DesaturateButton = new QRadioButton(SaturationBox);
|
||||
DesaturateButton->setObjectName(QString::fromUtf8("DesaturateButton"));
|
||||
|
||||
verticalLayout_13->addWidget(DesaturateButton);
|
||||
|
||||
GlyphBox = new QGroupBox(ChannelBox);
|
||||
GlyphBox->setObjectName(QString::fromUtf8("GlyphBox"));
|
||||
GlyphBox->setGeometry(QRect(0, 270, 260, 150));
|
||||
sizePolicy.setHeightForWidth(GlyphBox->sizePolicy().hasHeightForWidth());
|
||||
GlyphBox->setSizePolicy(sizePolicy);
|
||||
GlyphBox->setMinimumSize(QSize(260, 0));
|
||||
GlyphBox->setMaximumSize(QSize(500, 150));
|
||||
GlyphBox->setAlignment(Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter);
|
||||
verticalLayout_14 = new QVBoxLayout(GlyphBox);
|
||||
verticalLayout_14->setSpacing(6);
|
||||
verticalLayout_14->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_14->setObjectName(QString::fromUtf8("verticalLayout_14"));
|
||||
CircleButton = new QRadioButton(GlyphBox);
|
||||
CircleButton->setObjectName(QString::fromUtf8("CircleButton"));
|
||||
|
||||
verticalLayout_14->addWidget(CircleButton);
|
||||
|
||||
TriangleButton = new QRadioButton(GlyphBox);
|
||||
TriangleButton->setObjectName(QString::fromUtf8("TriangleButton"));
|
||||
|
||||
verticalLayout_14->addWidget(TriangleButton);
|
||||
|
||||
SquareButton = new QRadioButton(GlyphBox);
|
||||
SquareButton->setObjectName(QString::fromUtf8("SquareButton"));
|
||||
|
||||
verticalLayout_14->addWidget(SquareButton);
|
||||
|
||||
HexagonButton = new QRadioButton(GlyphBox);
|
||||
HexagonButton->setObjectName(QString::fromUtf8("HexagonButton"));
|
||||
|
||||
verticalLayout_14->addWidget(HexagonButton);
|
||||
|
||||
GlyphBox_2 = new QGroupBox(ChannelBox);
|
||||
GlyphBox_2->setObjectName(QString::fromUtf8("GlyphBox_2"));
|
||||
GlyphBox_2->setGeometry(QRect(0, 430, 260, 120));
|
||||
QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
sizePolicy2.setHorizontalStretch(0);
|
||||
sizePolicy2.setVerticalStretch(0);
|
||||
sizePolicy2.setHeightForWidth(GlyphBox_2->sizePolicy().hasHeightForWidth());
|
||||
GlyphBox_2->setSizePolicy(sizePolicy2);
|
||||
GlyphBox_2->setMinimumSize(QSize(260, 0));
|
||||
GlyphBox_2->setMaximumSize(QSize(500, 120));
|
||||
GlyphBox_2->setAlignment(Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter);
|
||||
verticalLayout_16 = new QVBoxLayout(GlyphBox_2);
|
||||
verticalLayout_16->setSpacing(6);
|
||||
verticalLayout_16->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_16->setObjectName(QString::fromUtf8("verticalLayout_16"));
|
||||
FullySampledButton = new QRadioButton(GlyphBox_2);
|
||||
FullySampledButton->setObjectName(QString::fromUtf8("FullySampledButton"));
|
||||
|
||||
verticalLayout_16->addWidget(FullySampledButton);
|
||||
|
||||
RegularlySubsampledButton = new QRadioButton(GlyphBox_2);
|
||||
RegularlySubsampledButton->setObjectName(QString::fromUtf8("RegularlySampledButton"));
|
||||
|
||||
verticalLayout_16->addWidget(RegularlySubsampledButton);
|
||||
|
||||
IregularlySubsampledButton = new QRadioButton(GlyphBox_2);
|
||||
IregularlySubsampledButton->setObjectName(QString::fromUtf8("IregularlySubsampledButton"));
|
||||
|
||||
verticalLayout_16->addWidget(IregularlySubsampledButton);
|
||||
|
||||
|
||||
verticalLayout_3->addWidget(ChannelBox);
|
||||
|
||||
|
||||
horizontalLayout->addWidget(settingsBox);
|
||||
|
||||
program = new Program(centralWidget);
|
||||
program->setObjectName(QString::fromUtf8("program"));
|
||||
|
||||
horizontalLayout->addWidget(program);
|
||||
|
||||
MainWindow->setCentralWidget(centralWidget);
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "Simulation", nullptr));
|
||||
settingsBox->setTitle(QCoreApplication::translate("MainWindow", "Settings", nullptr));
|
||||
TechniqueBox->setTitle(QCoreApplication::translate("MainWindow", "Technique", nullptr));
|
||||
FirstButton->setText(QCoreApplication::translate("MainWindow", "ECol + LGlyph", nullptr));
|
||||
SecondButton->setText(QCoreApplication::translate("MainWindow", "EGlyph + LCol", nullptr));
|
||||
ChannelBox->setTitle(QCoreApplication::translate("MainWindow", "Channel Options", nullptr));
|
||||
ColourBox->setTitle(QCoreApplication::translate("MainWindow", "Color", nullptr));
|
||||
ComplementaryButton->setText(QCoreApplication::translate("MainWindow", "Complementary ", nullptr));
|
||||
ContrastingButton->setText(QCoreApplication::translate("MainWindow", "Contrasting", nullptr));
|
||||
MonochromaticButton->setText(QCoreApplication::translate("MainWindow", "Monochromatic", nullptr));
|
||||
SaturationBox->setTitle(QCoreApplication::translate("MainWindow", "Saturation", nullptr));
|
||||
SaturateButton->setText(QCoreApplication::translate("MainWindow", "Fully saturated", nullptr));
|
||||
DesaturateButton->setText(QCoreApplication::translate("MainWindow", "Desaturated", nullptr));
|
||||
GlyphBox->setTitle(QCoreApplication::translate("MainWindow", "Glyph Shape", nullptr));
|
||||
CircleButton->setText(QCoreApplication::translate("MainWindow", "Circle", nullptr));
|
||||
TriangleButton->setText(QCoreApplication::translate("MainWindow", "Triangle", nullptr));
|
||||
SquareButton->setText(QCoreApplication::translate("MainWindow", "Square", nullptr));
|
||||
HexagonButton->setText(QCoreApplication::translate("MainWindow", "Hexagon", nullptr));
|
||||
GlyphBox_2->setTitle(QCoreApplication::translate("MainWindow", "Glyph count", nullptr));
|
||||
FullySampledButton->setText(QCoreApplication::translate("MainWindow", "Fully sampled", nullptr));
|
||||
RegularlySubsampledButton->setText(QCoreApplication::translate("MainWindow", "Regularly subsampled", nullptr));
|
||||
IregularlySubsampledButton->setText(QCoreApplication::translate("MainWindow", "Irregularly sampled", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow: public Ui_MainWindow {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_MAINWINDOW_H
|
||||
|
|
@ -40,35 +40,37 @@ int main(int argc, char* argv[]) {
|
|||
QApplication app(argc, argv);
|
||||
|
||||
// Main window.
|
||||
QMainWindow mainWindow;
|
||||
MainWindow mainWindow;
|
||||
mainWindow.resize(1200, 900);
|
||||
|
||||
mainWindow.show();
|
||||
return app.exec();
|
||||
|
||||
// Control area.
|
||||
QDockWidget controlDock;
|
||||
mainWindow.addDockWidget(Qt::LeftDockWidgetArea, &controlDock);
|
||||
|
||||
QLabel controlDockTitle("Control Dock");
|
||||
controlDockTitle.setMargin(20);
|
||||
controlDock.setTitleBarWidget(&controlDockTitle);
|
||||
|
||||
QPointer<QVBoxLayout> dockLayout = new QVBoxLayout();
|
||||
QWidget layoutContainer;
|
||||
layoutContainer.setLayout(dockLayout);
|
||||
controlDock.setWidget(&layoutContainer);
|
||||
|
||||
QPushButton randomizeButton;
|
||||
randomizeButton.setText("Randomize");
|
||||
dockLayout->addWidget(&randomizeButton);
|
||||
// QDockWidget controlDock;
|
||||
// mainWindow.addDockWidget(Qt::LeftDockWidgetArea, &controlDock);
|
||||
//
|
||||
// QLabel controlDockTitle("Control Dock");
|
||||
// controlDockTitle.setMargin(20);
|
||||
// controlDock.setTitleBarWidget(&controlDockTitle);
|
||||
//
|
||||
// QPointer<QVBoxLayout> dockLayout = new QVBoxLayout();
|
||||
// QWidget layoutContainer;
|
||||
// layoutContainer.setLayout(dockLayout);
|
||||
// controlDock.setWidget(&layoutContainer);
|
||||
//
|
||||
// QPushButton randomizeButton;
|
||||
// randomizeButton.setText("Randomize");
|
||||
// dockLayout->addWidget(&randomizeButton);
|
||||
|
||||
// Render area.
|
||||
QPointer<QVTKOpenGLNativeWidget> vtkRenderWidget =
|
||||
new QVTKOpenGLNativeWidget();
|
||||
mainWindow.setCentralWidget(vtkRenderWidget);
|
||||
// QPointer<QVTKOpenGLNativeWidget> vtkRenderWidget =
|
||||
// new QVTKOpenGLNativeWidget();
|
||||
// mainWindow.setCentralWidget(vtkRenderWidget);
|
||||
|
||||
// VTK part.
|
||||
vtkNew<vtkGenericOpenGLRenderWindow> window;
|
||||
vtkRenderWidget->setRenderWindow(window.Get());
|
||||
|
||||
// vtkNew<vtkGenericOpenGLRenderWindow> window;
|
||||
// vtkRenderWidget->setRenderWindow(window.Get());
|
||||
|
||||
cout << "Reading data..." << endl;
|
||||
string dataPath = "../../../../data";
|
||||
|
|
@ -83,7 +85,7 @@ int main(int argc, char* argv[]) {
|
|||
// TODO: implement feature to call this function on widget
|
||||
// l->cycleGlyphStyle();
|
||||
|
||||
unique_ptr<Program> program = make_unique<Program>(DT, window);
|
||||
unique_ptr<Program> program = make_unique<Program>();
|
||||
program->addLayer(new BackgroundImage(dataPath + "/map_qgis_1035.png"));
|
||||
// TODO: implement feature to cycle between layers thru QT
|
||||
program->addLayer(new EGlyphLayer(uvGrid));
|
||||
|
|
|
|||
Loading…
Reference in New Issue