From 7f0f945c35bc8c12d55efbce7545995fc76892c1 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 26 Jan 2016 11:52:44 +0100 Subject: VoronoiSplat & main(): moved all skelft to VoronoiSplat. --- main.cpp | 16 +++++----------- voronoisplat.cpp | 4 ++++ 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 &, const LinearScale &)), m->cpPlot, SLOT(setScale(const LinearScale &, const LinearScale &))); @@ -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); } -- cgit v1.2.3