Skip to content

Commit

Permalink
"hotfix" switch between compressed and raw data
Browse files Browse the repository at this point in the history
  • Loading branch information
my-tien committed Aug 15, 2014
1 parent 0abfa48 commit 1eb93d5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions eventmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,21 @@ void EventModel::handleKeyboard(QKeyEvent *event, int VPfound) {
}
}

void EventModel::handleKeyRelease(QKeyEvent *event) {
if (event->key() == Qt::Key_5) { // switch between compresed and raw
static uint originalCompressionRatio;
static bool changeToRaw = false;
changeToRaw = !changeToRaw;
if (changeToRaw) {
originalCompressionRatio = state->compressionRatio;
state->compressionRatio = 0;
} else {
state->compressionRatio = originalCompressionRatio;
}
state->viewer->changeDatasetMag(DATA_SET);
}
}

Coordinate *EventModel::getCoordinateFromOrthogonalClick(QMouseEvent *event, int VPfound) {

Coordinate *foundCoordinate;
Expand Down
1 change: 1 addition & 0 deletions eventmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class EventModel : public QObject
void handleMouseReleaseMiddle(QMouseEvent *event, int VPfound);
void handleMouseWheel(QWheelEvent * const event, int VPfound);
void handleKeyboard(QKeyEvent *event, int VPfound);
void handleKeyRelease(QKeyEvent *event);
static Coordinate *getCoordinateFromOrthogonalClick(QMouseEvent *event, int VPfound);

void startNodeSelection(int x, int y, int vpId);
Expand Down
2 changes: 2 additions & 0 deletions widgets/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ void Viewport::keyReleaseEvent(QKeyEvent *event) {
state->repeatDirection[0] /= 10;
state->repeatDirection[1] /= 10;
state->repeatDirection[2] /= 10;
} else {
eventDelegate->handleKeyRelease(event);
}
}

Expand Down

0 comments on commit 1eb93d5

Please sign in to comment.