Home | Documentation | Download | Screenshots | Developer |
Key | Description | Associated function | Action |
A | Toggle the display of the world axis | QGLViewer::toggleDrawAxis() |
DRAW_AXIS |
G | Toggle the display of the XY grid | QGLViewer::toggleDrawGrid() |
DRAW_GRID |
F | Toggle the display of the Frame per Second | QGLViewer::toggleDisplayFPS() |
DISPLAY_FPS |
? | Toggle the display of all the text | QGLViewer::toggleEnableText() |
ENABLE_TEXT |
S | Toggle the stereo display. | QGLViewer::toggleStereoDisplay() |
STEREO |
H | Calls a help function. | QGLViewer::help() |
HELP |
Esc | Quit the application. | qApp->quit |
EXIT |
Space | Switch between the FLY and REVOLVE camera mode. | camera()->toggleMode() |
CAMERA_MODE |
Return | Start/stop the animation loop. | QGLViewer::toggleAnimationMode() |
ANIMATION |
Ctrl-S | Open the save snapshot dialog box. | QGLViewer::saveSnapshot() |
SAVE_SCREENSHOT |
Alt-Return | Toggle the full screen mode | QGLViewer::toggleFullScreen() |
FULL_SCREEN |
C | Toggle the camera key frame path editor. | toggleCameraPathEditor() |
EDIT_CAMERA_PATHS |
Z | Toggle z-buffer display. | QGLViewer::toggleDisplayZBuffer() |
DISPLAY_Z_BUFFER |
Arrows | Move the camera (parallel to screen). | camera()->frame()->translate() |
- |
+ / - | Increases (decreases) camera fly speed. | setFlySpeed() |
- |
F1-F12 | Plays/Pauses camera key frame path (if defined) Reset the path when Fx is quickly press twice. |
camera()->playKeyFramePath(i) camera()->resetKeyFramePath(i) |
- |
Alt+(F1-F12) | Defines a new camera key frame for path 1..12. Deletes the path when Fx is quickly press twice. |
camera()->addKeyFrame(i) camera()->deleteKeyFrame(i) |
- |
Use QGLViewer::setShortcutKey(Action, Key)
and QGLViewer::setShortcutStateKey(Action,
StateKey)
if you want to redefine one of these keys (probably in your init()
function). Action
is defined by the ShortcutAction
enum, as in the above table.
void Viewer::init() { setShortcutKey(QGLViewer::CAMERA_MODE, Qt::Key_M, Qt::AltButton); setShortcutKey(QGLViewer::EXIT, Qt::Key_Q); setShortcutKey(QGLViewer::DISPLAY_Z_BUFFER, 0); }You can retrieve the current shortcut key value with
shortcutKey(Action)
and
shortcutStateKey(Action)
. Current bindings are displayed by the default help()
function.
One might argue that too many keys are binded to the viewer shortcuts, leaving no key for the user's defined shortcuts. If you think that the binded actions are too complex and you want to forbid them, simple set 0 as the action shortcut key, as is done above. If you want to use one of the binded keys for one of your own function, optionally bind the original action to a new key and do as detailed below.
void
QGLViewer::keyPressEvent(QKeyEvent *e)
function:
void Viewer::keyPressEvent(QKeyEvent *e) { switch (e->key()) { case Qt::Key_R : reset(); updateGL(); break; // and so on... default: QGLViewer::keyPressEvent(e); } }See the keyboardAndMouse example for a practical illustration.
Alt-Fx
adds a new keyFrame to path x.Fx
will then make the Camera play/pause the associated path (or will simply
restore the save position if only one keyFrame was defined for this path).Fx
twice resets the interpolation:
Alt-Fx-Fx
delete path x.Fx-Fx
reset path x to its starting point.setKeyFrameKey(const int nb, const int key)
(default is F1-F12), setAddKeyFrameStateKey(const ushort skey)
(default is Alt) andsetPlayKeyFramePathStateKey(const ushort skey)
(default is no button).