aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-26 11:52:44 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-26 11:52:44 +0100
commit7f0f945c35bc8c12d55efbce7545995fc76892c1 (patch)
tree1cfacaccb4944f5979ffb416acece0d1d009ad62
parent60a0bfb863aa2a05bafd943423c284f5c2d68863 (diff)
VoronoiSplat & main(): moved all skelft to VoronoiSplat.
-rw-r--r--main.cpp16
-rw-r--r--voronoisplat.cpp4
2 files changed, 9 insertions, 11 deletions
diff --git a/main.cpp b/main.cpp
index 34eb240..58d0f5a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -20,7 +20,6 @@
#include "mapscalehandler.h"
#include "selectionhandler.h"
#include "projectionobserver.h"
-#include "skelft.h"
static QObject *mainProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
@@ -146,10 +145,9 @@ int main(int argc, char **argv)
QObject::connect(m->cpPlot, SIGNAL(xyInteractivelyChanged(const arma::mat &)),
m, SLOT(setCP(const arma::mat &)));
- // Update projection as the cp are modified
+ // Update projection as the cp are modified (either directly in the
+ // manipulationHandler object or interactively in cpPlot
ManipulationHandler manipulationHandler(X, cpIndices);
- //QObject::connect(m->cpPlot, SIGNAL(xyChanged(const arma::mat &)),
- // &manipulationHandler, SLOT(setCP(const arma::mat &)));
QObject::connect(m->cpPlot, SIGNAL(xyInteractivelyChanged(const arma::mat &)),
&manipulationHandler, SLOT(setCP(const arma::mat &)));
QObject::connect(&manipulationHandler, SIGNAL(cpChanged(const arma::mat &)),
@@ -166,7 +164,8 @@ int main(int argc, char **argv)
//QObject::connect(history, SIGNAL(currentItemChanged(const arma::mat &)),
// cpPlot, SLOT(setXY(const arma::mat &)));
- // Keep both scatterplots scaled equally and to the full plot
+ // Keep both scatterplots and the splat scaled equally and relative to the
+ // full plot
MapScaleHandler mapScaleHandler;
QObject::connect(&mapScaleHandler, SIGNAL(scaleChanged(const LinearScale<float> &, const LinearScale<float> &)),
m->cpPlot, SLOT(setScale(const LinearScale<float> &, const LinearScale<float> &)));
@@ -211,8 +210,6 @@ int main(int argc, char **argv)
QObject::connect(m->projectionObserver, SIGNAL(rpValuesChanged(const arma::vec &)),
m->rpBarChart, SLOT(setValues(const arma::vec &)));
- skelft2DInitialization(m->splat->width());
-
m->cpPlot->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton);
m->cpBarChart->setAcceptedMouseButtons(Qt::LeftButton);
m->rpBarChart->setAcceptedMouseButtons(Qt::LeftButton);
@@ -230,8 +227,5 @@ int main(int argc, char **argv)
manipulationHandler.setCP(Ys);
- auto ret = app.exec();
-
- skelft2DDeinitialization();
- return ret;
+ return app.exec();
}
diff --git a/voronoisplat.cpp b/voronoisplat.cpp
index 1b3f462..f5aa69b 100644
--- a/voronoisplat.cpp
+++ b/voronoisplat.cpp
@@ -324,6 +324,8 @@ VoronoiSplatRenderer::~VoronoiSplatRenderer()
delete m_program1;
delete m_program2;
+
+ skelft2DDeinitialization();
}
void VoronoiSplatRenderer::resizeTextures()
@@ -350,6 +352,8 @@ QOpenGLFramebufferObject *VoronoiSplatRenderer::createFramebufferObject(const QS
m_size.setHeight(baseSize);
resizeTextures();
+ skelft2DInitialization(m_size.width());
+
return QQuickFramebufferObject::Renderer::createFramebufferObject(m_size);
}