AnimaL |
Tutorial |
Documentation |
#include <viewer.h>
Inheritance diagram for X3DTK::Qt::Viewer:
Definition at line 20 of file viewer.h.
Public Types | |
enum | video_mode { ANIMATION = 0, DISPLAY = 1, SCREEN = 2 } |
The video modes set. More... | |
Public Member Functions | |
Viewer () | |
Constructor. | |
Viewer (QWidget *q, const char *c) | |
Constructor. | |
~Viewer () | |
Destructor. | |
void | viewAll () |
Upadte the GL frustrum and move the camera to show entire scene. | |
void | updateFrustum () |
Compute the X3DTK::X3D::Scene bounding box and the GL frustum. | |
void | init () |
Init openGL states, lights and camera. | |
bool | viewCapture () |
if snapshot is false and getVideoName() is not empty, xine is launched to view the encoded video getVideoName() and return value is true. | |
void | drawAfterAnimation () |
Update the display after the X3DTK::mainScene being animated. | |
bool | mpeg2encode () |
Encode MPEG-2 video with mpeg2encode. | |
bool | xvidcap () |
Capture frames displayed on the screen with xvidcap. | |
void | setMainController (::MainController *mainController) |
Set the main GUI. | |
bool | setSnapshot (bool b) |
Set snapshot. | |
void | setSnapshotFilename (QString s) |
Set snapshotFilename Verify if the extension is an available format and if it is handled by Qt. | |
void | setVideoName (QString) |
Set video name, i.e. snapshotFilename. | |
void | setVideoMode (video_mode mode) |
Set videoMode. | |
::MainController * | getMainController () |
Get the main GUI. | |
ViewerQt * | getViewerGUI () |
Get the viewer GUI. | |
bool | getSnapshot () |
Get snapshot. | |
QString | getVideoName () |
Get the video name. | |
video_mode | getVideoMode () |
Get the videoMode. | |
Protected Types | |
typedef std::list< animal::ConstrainedItem * > | ItemList |
a list of manipulated objects | |
enum | InteractionMode { MOVE_CAMERA, SELECT_OBJECT } |
User interaction modes. More... | |
Protected Member Functions | |
virtual void | draw () |
Draw the X3DTK::GL::Scene and other things in the X3DTK::mainScene. | |
virtual void | postDraw () |
Call after draw(). | |
QString | helpString () const |
Method call when the help() method is called (keyboard shortcut: Key_H). | |
virtual void | keyPressEvent (QKeyEvent *e) |
Deal with key press event. | |
virtual void | keyReleaseEvent (QKeyEvent *e) |
Deal with key release event. | |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
Deal with mouse double-click event. | |
virtual void | mouseMoveEvent (QMouseEvent *e) |
Deal with mouse move event. | |
virtual void | mousePressEvent (QMouseEvent *e) |
Deal with mouse press event. | |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
Deal with mouse release event. | |
Protected Attributes | |
::MainController * | mainController |
The main GUI. | |
ViewerQt * | viewerGUI |
Viewer GUI. | |
bool | snapshot |
True when a snapshot is processed every draw(). Warning, overwrite mode. | |
QString | snapshotFilename |
The snapshot file names For example: if snapshotFilename = "my_directory_path/my_name%03d.ppm" the snapshot files names will be my_directory_path/my_name000.ppm, my_directory_path/my_name001.ppm... | |
int | snapshotCounter |
The counter for the snapshot file names. | |
QString | snapshotFormat |
The format to save the snapshot file. | |
video_mode | videoMode |
The tree available video modes are: ANIMATION: snapshots are done when the scene is animated, DISPLAY: snapshots are done when the scene is drawn, and SCREEN: snapshots are done on the screen with xvidcap. | |
InteractionMode | interactionMode |
The interaction mode. | |
ItemList | manipulatedObjects |
the list of manipulated objects | |
animal::ConstrainedItem * | selectedPoint |
the selected object |
|
a list of manipulated objects
|
|
User interaction modes.
|
|
The video modes set.
Definition at line 79 of file viewer.h. Referenced by getVideoMode(). |
|
Constructor.
Definition at line 18 of file viewer.cpp. References viewerGUI. |
|
Constructor.
Definition at line 32 of file viewer.cpp. References viewerGUI. |
|
Destructor.
Definition at line 46 of file viewer.cpp. References viewerGUI. |
|
Draw the X3DTK::GL::Scene and other things in the X3DTK::mainScene.
Definition at line 307 of file viewer.cpp. References animal::ConstrainedItem::draw(), MainController::getMainScene(), and selectedPoint. |
|
Update the display after the X3DTK::mainScene being animated.
Definition at line 146 of file viewer.cpp. References ANIMATION, snapshot, snapshotCounter, snapshotFilename, snapshotFormat, and videoMode. |
|
Get the main GUI.
Definition at line 96 of file viewer.h. Referenced by X3DTK::Qt::ViewerQt::startCapture(). |
|
Get snapshot.
Definition at line 102 of file viewer.h. References snapshot. |
|
Get the videoMode.
Definition at line 108 of file viewer.h. References video_mode, and videoMode. Referenced by X3DTK::Qt::ViewerQt::ViewerQt(). |
|
Get the video name.
Definition at line 550 of file viewer.cpp. References snapshotFilename. Referenced by X3DTK::Qt::ViewerQt::chooseVideoName(), mpeg2encode(), X3DTK::Qt::ViewerQt::setTextLabelVideoName(), viewCapture(), and X3DTK::Qt::ViewerQt::ViewerQt(). |
|
Get the viewer GUI.
Definition at line 99 of file viewer.h. References viewerGUI. |
|
Method call when the help() method is called (keyboard shortcut: Key_H).
Definition at line 360 of file viewer.cpp. |
|
Init openGL states, lights and camera.
Definition at line 55 of file viewer.cpp. References viewAll(). |
|
Deal with key press event.
Definition at line 387 of file viewer.cpp. References interactionMode, SELECT_OBJECT, and viewAll(). |
|
Deal with key release event.
Definition at line 405 of file viewer.cpp. References interactionMode, and MOVE_CAMERA. |
|
Deal with mouse double-click event.
Definition at line 418 of file viewer.cpp. |
|
Deal with mouse move event.
Definition at line 425 of file viewer.cpp. References interactionMode, animal::ConstrainedItem::moveTo(), SELECT_OBJECT, and selectedPoint. |
|
Deal with mouse press event.
Definition at line 444 of file viewer.cpp. References animal::ConstrainedItem::getPoint(), interactionMode, manipulatedObjects, animal::ConstrainedItem::moveTo(), MainController::pickPoint(), animal::ConstrainedItem::print(), SELECT_OBJECT, and selectedPoint. |
|
Deal with mouse release event.
Definition at line 486 of file viewer.cpp. References interactionMode, manipulatedObjects, SELECT_OBJECT, and selectedPoint. |
|
Encode MPEG-2 video with mpeg2encode. if snapshotFilename = "my_directory_path/my_name%03d.ppm", the snapshot files names will be my_directory_path/my_name000.ppm, my_directory_path/my_name001.ppm... and the name of the MPEG2 movi will be "my_directory_path/my_name.mpg". Return true if the encode is launched. Definition at line 172 of file viewer.cpp. References getVideoName(), snapshotFilename, and snapshotFormat. Referenced by X3DTK::Qt::ViewerQt::mpeg2encode(). |
|
Call after draw(). Call QGLViewer::postDraw() which behavior displays axis, grid, FPS... If snapshot is true and videoMode==DISPLAY, save the current frame. Definition at line 342 of file viewer.cpp. References DISPLAY, snapshot, snapshotCounter, snapshotFilename, snapshotFormat, and videoMode. |
|
Set the main GUI.
Definition at line 301 of file viewer.cpp. References viewerGUI. |
|
Set snapshot.
Definition at line 502 of file viewer.cpp. References snapshot, snapshotCounter, snapshotFilename, and snapshotFormat. |
|
Set snapshotFilename Verify if the extension is an available format and if it is handled by Qt.
Definition at line 525 of file viewer.cpp. References snapshotFilename, and snapshotFormat. Referenced by setVideoName(). |
|
Set videoMode.
Definition at line 87 of file viewer.h. References videoMode. Referenced by X3DTK::Qt::ViewerQt::toggleVideoAnimation(), X3DTK::Qt::ViewerQt::toggleVideoDisplay(), and X3DTK::Qt::ViewerQt::toggleVideoScreen(). |
|
Set video name, i.e. snapshotFilename.
Definition at line 560 of file viewer.cpp. References setSnapshotFilename(). Referenced by X3DTK::Qt::ViewerQt::chooseVideoName(). |
|
Compute the X3DTK::X3D::Scene bounding box and the GL frustum.
Definition at line 109 of file viewer.cpp. References MainController::getMainScene(). Referenced by viewAll(). |
|
Upadte the GL frustrum and move the camera to show entire scene.
Definition at line 103 of file viewer.cpp. References updateFrustum(). Referenced by init(), and keyPressEvent(). |
|
if snapshot is false and getVideoName() is not empty, xine is launched to view the encoded video getVideoName() and return value is true. Else return false Definition at line 125 of file viewer.cpp. References getVideoName(), and snapshot. Referenced by X3DTK::Qt::ViewerQt::viewCapture(). |
|
Capture frames displayed on the screen with xvidcap. Return true if the capture is launched. Definition at line 274 of file viewer.cpp. References SCREEN, snapshotFilename, snapshotFormat, and videoMode. Referenced by X3DTK::Qt::ViewerQt::startCapture(). |
|
The interaction mode.
Definition at line 178 of file viewer.h. Referenced by keyPressEvent(), keyReleaseEvent(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent(). |
|
The main GUI.
|
|
the list of manipulated objects
Definition at line 184 of file viewer.h. Referenced by mousePressEvent(), and mouseReleaseEvent(). |
|
the selected object
Definition at line 187 of file viewer.h. Referenced by draw(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent(). |
|
True when a snapshot is processed every draw(). Warning, overwrite mode.
Definition at line 149 of file viewer.h. Referenced by drawAfterAnimation(), getSnapshot(), postDraw(), setSnapshot(), and viewCapture(). |
|
The counter for the snapshot file names.
Definition at line 160 of file viewer.h. Referenced by drawAfterAnimation(), postDraw(), and setSnapshot(). |
|
The snapshot file names For example: if snapshotFilename = "my_directory_path/my_name%03d.ppm" the snapshot files names will be my_directory_path/my_name000.ppm, my_directory_path/my_name001.ppm...
Definition at line 157 of file viewer.h. Referenced by drawAfterAnimation(), getVideoName(), mpeg2encode(), postDraw(), setSnapshot(), setSnapshotFilename(), and xvidcap(). |
|
The format to save the snapshot file. The available formats are those handled by Qt: BMP, JPEG, PBM, PGM, PNG, PPM, XBM, XPM Definition at line 165 of file viewer.h. Referenced by drawAfterAnimation(), mpeg2encode(), postDraw(), setSnapshot(), setSnapshotFilename(), and xvidcap(). |
|
The tree available video modes are: ANIMATION: snapshots are done when the scene is animated, DISPLAY: snapshots are done when the scene is drawn, and SCREEN: snapshots are done on the screen with xvidcap.
Definition at line 171 of file viewer.h. Referenced by drawAfterAnimation(), getVideoMode(), postDraw(), setVideoMode(), and xvidcap(). |
|
Viewer GUI.
Definition at line 146 of file viewer.h. Referenced by getViewerGUI(), setMainController(), Viewer(), and ~Viewer(). |