From 95a77b04a6855b26d340aaca5e3030a7d1a7cb3c Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Fri, 12 Feb 2016 18:01:27 -0200 Subject: Many bugfixes related to ProjectionObserver. * Correct handling of relative metrics in UI * undo(), reset() methods added * Main class responsible for undoing and resetting both history and the observer (MUST BE AT THE SAME TIME! -- this might indicate a design issue to be addressed in the future) --- main.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index c4699c4..e1964e7 100644 --- a/main.h +++ b/main.h @@ -83,7 +83,16 @@ public: }; Q_INVOKABLE bool setObserverType(ObserverType observerType) { - return projectionObserver->setType((int) observerType); + switch (observerType) { + case ObserverCurrent: + return projectionObserver->setType(ProjectionObserver::ObserverCurrent); + case ObserverDiffPrevious: + return projectionObserver->setType(ProjectionObserver::ObserverDiffPrevious); + case ObserverDiffFirst: + return projectionObserver->setType(ProjectionObserver::ObserverDiffFirst); + } + + return false; } enum ColorScaleType { @@ -130,12 +139,18 @@ public: Scatterplot *cpPlot, *rpPlot; VoronoiSplat *splat; - ProjectionObserver *projectionObserver; - // Shared object that controls manipulation history ProjectionHistory *projectionHistory; - Q_INVOKABLE void undoManipulation() { projectionHistory->undo(); } - Q_INVOKABLE void resetManipulation() { projectionHistory->reset(); } + ProjectionObserver *projectionObserver; + + Q_INVOKABLE void undoManipulation() { + projectionHistory->undo(); + projectionObserver->undo(); + } + Q_INVOKABLE void resetManipulation() { + projectionHistory->reset(); + projectionObserver->reset(); + } public slots: void setCPIndices(const arma::uvec &indices) { -- cgit v1.2.3