aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-12 18:01:27 -0200
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-12 18:04:03 -0200
commit95a77b04a6855b26d340aaca5e3030a7d1a7cb3c (patch)
tree7f636d927f7d31f0972496387325332a098e529d /main.h
parent7a07231716f04ee98091a946e122056e1fa69686 (diff)
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)
Diffstat (limited to 'main.h')
-rw-r--r--main.h25
1 files changed, 20 insertions, 5 deletions
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) {