#include <scene.h>
Inheritance diagram for VIEW::Scene:
Debugging and Diagnostics | |
virtual bool | isValid () const throw () |
Internal state and consistency self-validation. | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal value dump. | |
Stage * | getStage () throw () |
const Stage * | getStage () const throw () |
void | setCamera (const Camera &camera) throw () |
List< Camera > & | getAnimationPoints () throw () |
void | setDefaultLighting (bool update_GL=true) throw () |
void | initializePreferencesTab (Preferences &preferences) throw () |
Initialize a preferences tab for the widget (if needed). | |
void | finalizePreferencesTab (Preferences &preferences) throw () |
Remove the preferences tab. | |
virtual void | applyPreferences () throw () |
Apply the preferences of the specific tab. | |
GLRenderer & | getGLRenderer () throw () |
void | setGLRenderer (GLRenderer &renderer) |
Set a new GLRenderer. | |
float | getMousePositionX () |
float | getMousePositionY () |
bool | exportPNG (const String &filename) |
virtual void | setWidgetVisible (bool state) |
void | setOffScreenRendering (bool enabled, Size factor) |
virtual void | keyPressEvent (QKeyEvent *e) |
Catch key events. | |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
ModeType | getMode () const throw () |
virtual void | setMode (ModeType mode) throw () |
void | rotate (float degree_right, float degree_up) |
void | rotateClockwise (float degree) |
void | move (Vector3 v) |
Move the view. | |
void | moveComposites (const List< Composite * > &composites, Vector3 v) |
Move some Composites. | |
void | rotateComposites (const List< Composite * > &composites, float degree_right, float degree_up, float degree_clockwise=0) |
Rotate some Composites. | |
bool | isAnimationRunning () const throw () |
void | setTurnPoint (const Vector3 &v) |
const Vector3 & | getTurnPoint () const |
void | setFullScreen (bool state) |
void | setFPSEnabled (bool state) |
void | showText (const String &text, Size font_size=20) |
Show text in the lower right corner. | |
virtual void | addToolBarEntries (QToolBar *tb) |
Add the widgets actions to the (main) toolbar. | |
bool | isUpdateRunning () const |
void | createCoordinateSystem () throw () |
Create an coordinate system at current position. | |
void | createCoordinateSystemAtOrigin () throw () |
Create an coordinate system at origin. | |
String | exportPNG () |
Export PNG image and return the filename. | |
void | exportPOVRay () |
void | exportNextPOVRay () |
Export to POVRay whithout showing file dialog. | |
void | printScene () |
void | showExportPNGDialog () |
show an dialog to save an PNG file to | |
void | showExportVRMLDialog () |
void | setPreview (bool state) |
Enable or disable model previews e.g. while rotating. | |
virtual void | switchShowWidget () throw () |
Show or hide widget (Called by menu entry in "WINDOWS") If the ModularWidget is not also a QWidget, this method does nothing. | |
void | exitStereo () throw () |
void | enterActiveStereo () throw () |
void | enterDualStereo () throw () |
void | clearRecordedAnimation () throw () |
void | startAnimation () throw () |
void | stopAnimation () throw () |
void | switchToLastMode () throw () |
void | switchShowGrid () |
void | showInfos () |
Popup informations for object under mouse cursor. | |
void | setupViewVolume () |
void | disableViewVolumeRestriction () |
void | storeViewPoint () |
void | restoreViewPoint () |
void | setAnimationSmoothness (float value) throw () |
float | getAnimationSmoothness () throw () |
void | setMouseSensitivity (float sensitivity) throw () |
float | getMouseSensitivity () throw () |
void | setMouseWheelSensitivity (float sensitivity) throw () |
float | getMouseWheelSensitivity () throw () |
void | setShowLightSources (bool state) throw () |
bool | showLightSourcesEnabled () throw () |
bool | stereoBufferSupportTest () |
void | setScreenShotNumber (Position pos) |
void | setPOVNumber (Position pos) |
Protected QT overridden virtual methods | |
virtual void | initializeGL () |
Initialize the OpenGL context. | |
virtual void | paintGL () |
Render the visualization. | |
virtual void | resizeGL (int width, int height) |
Resize the widget. | |
virtual void | mouseMoveEvent (QMouseEvent *qmouse_event) |
Catch mouse move events, store the actual mouse position in this scene widget and sent events accordingly. | |
virtual void | mousePressEvent (QMouseEvent *qmouse_event) |
Catch mouse press events, store the actual mouse position in this scene widget and sent events accordingly. | |
virtual void | mouseReleaseEvent (QMouseEvent *qmouse_event) |
Catch mouse release events, store the actual mouse position in this scene widget and sent events accordingly. | |
virtual void | wheelEvent (QWheelEvent *qmouse_event) |
Catch mouse wheel events and zoom the scene accordingly. | |
void | updateGL () |
void | renderView_ (RenderMode mode) throw () |
void | renderRepresentations_ (RenderMode mode) throw () |
void | render_ (const Representation &rep, RenderMode mode) throw () |
void | animate_ () throw () |
void | processRotateModeMouseEvents_ (QMouseEvent *e) |
void | processMoveModeMouseEvents_ (QMouseEvent *e) |
void | rotateSystem_ () |
void | rotateSystemClockwise_ () |
void | translateSystem_ () |
void | zoomSystem_ () |
Index | getMoveModeAction_ (const QMouseEvent &e) |
void | selectionPressed_ () |
void | selectionPressedMoved_ () |
void | selectObjects_ () |
void | pickParent_ (QPoint p) |
void | writeLights_ (INIFile &inifile) const throw () |
void | readLights_ (const INIFile &inifile) throw () |
float | getXDiff_ () |
float | getYDiff_ () |
Vector3 | getTranslationVector_ (const Vector3 &v) |
void | createCoordinateSystem_ (bool at_origin) throw () |
void | renderGrid_ () |
Vector3 | get3DPosition_ (int x, int y) |
Given 2D screen coordinates computes the 3D Position in Viewing Volume. | |
bool | mapViewplaneToScreen_ () |
Maps the current viewplane to screen coordinates. | |
ModeType | current_mode_ |
ModeType | last_mode_ |
QAction * | rotate_action_ |
QAction * | picking_action_ |
QAction * | move_action_ |
QAction * | no_stereo_action_ |
QAction * | active_stereo_action_ |
QAction * | dual_stereo_action_ |
QAction * | fullscreen_action_ |
QAction * | record_animation_action_ |
QAction * | start_animation_action_ |
QAction * | clear_animation_action_ |
QAction * | cancel_animation_action_ |
QAction * | animation_export_POV_action_ |
QAction * | animation_export_PNG_action_ |
QAction * | animation_repeat_action_ |
QAction * | switch_grid_ |
QMenu * | create_coordinate_system_ |
Vector3 | system_origin_ |
bool | need_update_ |
bool | update_running_ |
Index | x_window_pos_old_ |
Index | y_window_pos_old_ |
Index | x_window_pos_new_ |
Index | y_window_pos_new_ |
Index | x_window_pick_pos_first_ |
Index | y_window_pick_pos_first_ |
Index | x_window_pick_pos_second_ |
Index | y_window_pick_pos_second_ |
bool | pick_select_ |
QRubberBand * | rb_ |
Stage * | stage_ |
Camera | stereo_camera_ |
Camera | stored_camera_ |
GLRenderer * | gl_renderer_ |
LightSettings * | light_settings_ |
StageSettings * | stage_settings_ |
MaterialSettings * | material_settings_ |
List< Camera > | animation_points_ |
AnimationThread * | animation_thread_ |
bool | stop_animation_ |
bool | content_changed_ |
bool | want_to_use_vertex_buffer_ |
bool | mouse_button_is_pressed_ |
bool | preview_ |
bool | use_preview_ |
PreciseTime | time_ |
float | zoom_factor_ |
QPoint | info_point_ |
QByteArray | last_state_ |
list< float > | fps_ |
bool | show_fps_ |
String | text_ |
Size | font_size_ |
QToolBar * | toolbar_ |
QList< QAction * > | toolbar_actions_ |
bool | draw_grid_ |
bool | ignore_pick_ |
QActionGroup * | mode_group_ |
Vector3 | near_left_bot_ |
Vector3 | near_right_bot_ |
Vector3 | near_left_top_ |
String | info_string_ |
float | volume_width_ |
float | mouse_sensitivity_ |
float | mouse_wheel_sensitivity_ |
bool | show_light_sources_ |
float | animation_smoothness_ |
Position | screenshot_nr_ |
Position | pov_nr_ |
QGLFormat | gl_format_ |
bool | offscreen_rendering_ |
QSize | PNG_size_ |
Public Types | |
Type definitions | |
enum | ModeType { ROTATE__MODE = 0, MOVE__MODE, PICKING__MODE } |
Predefined constants for the mode types Add new enums members in derived classes, for new modi. More... | |
enum | ModeAction { TRANSLATE_ACTION, ZOOM_ACTION, ROTATE_ACTION, ROTATE_CLOCKWISE_ACTION } |
Different Mouse Mode actions. | |
Enums | |
enum | RenderMode { DIRECT_RENDERING = 0, DISPLAY_LISTS_RENDERING, REBUILD_DISPLAY_LISTS } |
There a three different kind of rendering for a Scene:. More... | |
Public Member Functions | |
Constructors and Destructor | |
Scene (QWidget *parent_widget, const char *name=NULL, Qt::WFlags w_flags=0) throw () | |
Default Constructor. | |
Scene (const Scene &scene, QWidget *parent_widget=NULL, const char *name=NULL, Qt::WFlags wflags=0) throw () | |
Copy constructor. | |
virtual | ~Scene () throw () |
Destructor. | |
virtual void | clear () throw () |
Explicit default initialization. | |
Assignment | |
void | set (const Scene &scene) throw () |
Assignment. | |
const Scene & | operator= (const Scene &scene) throw () |
Assignment operator. | |
Accessors: inspectors and mutators | |
void | update (bool rebuild_displaylists=false) throw () |
Update the visualization. | |
virtual void | onNotify (Message *message) throw () |
Handles messages sent by other registered ConnectionObject objects. | |
virtual bool | exportScene (Renderer &er) const throw () |
This method exports the content of the Scene to an external Renderer. | |
virtual void | initializeWidget (MainControl &main_control) throw () |
Initialize the popup menu Display and the menus of this scene: - the rotate mode (all mouse actions are attached to rotating, translating and zooming the scene) - the picking mode (all mouse actions are attached to picking objects from the scene). | |
virtual void | fetchPreferences (INIFile &inifile) throw () |
Fetch the widgets preferences from the INIFile. | |
virtual void | writePreferences (INIFile &inifile) throw () |
Writes the widgets preferences to the INIFile. | |
virtual void | checkMenu (MainControl &main_control) throw () |
Menu checking method. | |
Protected Slots | |
Protected slots | |
virtual void | rotateMode_ () |
Switch to rotate mode. | |
virtual void | pickingMode_ () |
Switch to picking mode. | |
virtual void | moveMode_ () |
virtual void | showViewPoint_ () throw () |
Show the viewpoint and the look at point in the statusline of the mainwidget. | |
virtual void | setViewPoint_ () throw () |
Set the viewpoint. | |
virtual void | resetCamera_ () throw () |
Reset the camera to standard values. | |
virtual void | updateCamera_ () throw () |
Update the GL camera and if necessary the lights. | |
virtual void | dropEvent (QDropEvent *e) |
virtual void | dragEnterEvent (QDragEnterEvent *e) |
void | dummySlot () |
Friends | |
class | AnimationThread |
To do this, the class Scene must be a child of the MainControl. Because the MainControl is also the main application object a Scene must be created with the pointer to the MainControl as parent widget.
Scene is capable of stereo 3D view with shutter glasses and CRT monitors. This only works, if the OpenGL-driver supports this. NVIDIA cards need a Quad buffer, like they are used in the "Quad" cards. For other NVIDIA cards, you can try the tool "Rivatuner", which tries to enable this feature for cards, which natively dont support this. To enter and leave the stereo mode, press ALT-Y. If your OpenGL doesnt support the stereo view, you will see an error message in the message bar at the bottom of the main window.
The Scene has tree different mouse modi:
To change between the first two modi, there is a menu entry with checkboxes in the main menu bar of the application.
In Picking mode, left mouse button selects composites and right mouse button deselects. There are two ways to (de-)select: Either click on single items, or draw a selection rectangle by keeping the mouse button pressed and moving the mouse. Users with only one mouse button can use the SHIFT button, while pressing the mouse button to deselect.
In Rotate mode, left mouse button rotates, mid mouse button zooms in and out and right button moves the view. Users with only one mouse button can use the SHIFT / CONTROL button, while pressing the mouse button.
The eye distance change mode is only available in the stereo view mode. Here a user can press the ALT-button and move the mouse left or right to adjust the eye distance to their desired value.
Its possible to add new modi, to do so, derive a new class from Scene and overload the mouse*Event methods.
Furthermore, users can create modified versions of the GLRenderer and pass them to the Scene with the method setGLRenderer.
|
Predefined constants for the mode types Add new enums members in derived classes, for new modi. If you add new modi in this class, you have to add them in front of the PICKING__MODE entry. |
|
There a three different kind of rendering for a Scene:.
|
|
Default Constructor.
Initialize the width and height of this scene to
|
|
Copy constructor. Initialize the width, height and camera position.
|
|
Destructor.
|
|
Add the widgets actions to the (main) toolbar. This method is needed to enable ordering the entries. It is called in Mainframe. Reimplemented from VIEW::ModularWidget. Reimplemented in VIEW::EditableScene. |
|
Apply the preferences of the specific tab. In this method the widget can extract any changed values from its preferences tab (if required). This method is called automatically by the applyPreferencesTab from the MainControl object if the apply button in the Preferences dialog is pressed.
Reimplemented from VIEW::ModularWidget. Reimplemented in VIEW::EditableScene. |
|
Menu checking method. This method is called by MainControl::checkMenus before a popup menu is shown. The menus rotate mode and picking mode each will be checked if this scene is in the corresponding mode.
Reimplemented from VIEW::ModularWidget. Reimplemented in VIEW::EditableScene. |
|
Explicit default initialization. Reset the default values of this scene to:
Reimplemented from VIEW::ModularWidget. |
|
Internal value dump. Dump the current internal state of this scene to the output ostream s with dumping depth depth.
Reimplemented from VIEW::ModularWidget. |
|
This method exports the content of the Scene to an external Renderer.
|
|
Fetch the widgets preferences from the INIFile. This method is called automatically by MainControl::show() at the start of the application.
Reimplemented from VIEW::ModularWidget. |
|
Remove the preferences tab. This method can remove a preferences widget (if created in initializePreferencesTab) from the Preferences dialog of the MainControl. This method is called automatically by MainControl::aboutToExit() at the end of the application.
Reimplemented from VIEW::ModularWidget. Reimplemented in VIEW::EditableScene. |
|
Initialize the OpenGL context. Overriden qt method for initializing the OpenGL context of this scene. This method will be called automatically before any call to paintGL or resizeGL. It initializes the OpenGL-Renderer via GLRenderer::init and GLRenderer::setStage. See QT-library for information concerning the qglwidget events.
|
|
Initialize a preferences tab for the widget (if needed). This method can be used to create preferences widgets that can be inserted into the Preferences dialog with the method insertTab. This method is called automatically by MainControl::show at the start of the application.
Reimplemented from VIEW::ModularWidget. Reimplemented in VIEW::EditableScene. |
|
Initialize the popup menu Display and the menus of this scene: - the rotate mode (all mouse actions are attached to rotating, translating and zooming the scene) - the picking mode (all mouse actions are attached to picking objects from the scene).
Reimplemented from VIEW::ModularWidget. Reimplemented in VIEW::EditableScene. |
|
Internal state and consistency self-validation. A Scene is valid if it has a parent. Reimplemented from VIEW::ConnectionObject. |
|
Maps the current viewplane to screen coordinates. Returns false if the projection matrix is not correctly initialized. |
|
Catch mouse move events, store the actual mouse position in this scene widget and sent events accordingly.
Reimplemented in VIEW::EditableScene. |
|
Catch mouse press events, store the actual mouse position in this scene widget and sent events accordingly.
Reimplemented in VIEW::EditableScene. |
|
Catch mouse release events, store the actual mouse position in this scene widget and sent events accordingly.
Reimplemented in VIEW::EditableScene. |
|
Move the view. \ v.x = right \ v.y = up \ v.z = view direction |
|
Move some Composites. \ v.x = right \ v.y = up \ v.z = view direction |
|
Handles messages sent by other registered ConnectionObject objects. Filters for SceneMessage and sets the Camera appropriate or updates the visualization.
Reimplemented from VIEW::ConnectionObject. Reimplemented in VIEW::EditableScene. |
|
Assignment operator. Calls set. |
|
Render the visualization. Overriden qt method for rendering the visualization of this scene. This method will be called automatically every time an update is necessary. See QT-library for information concerning qglwidgets and paintGL methods and events.
Reimplemented in VIEW::EditableScene. |
|
Switch to picking mode. If this method is called the mouse actions of this scene will perform object picking. This method will be called from the corresponding menu entry.
|
|
Resize the widget. Overridden qt method for resizing this scene. This method will be called automatically every time a rezize event is handled. See QT-library for information concerning qglwidgets and resizeGL methods and events.
|
|
Rotate some Composites. \ v.x = right \ v.y = up \ v.z = view direction |
|
Switch to rotate mode. If this method is called the mouse actions of this scene will perform rotation, translation and zooming the visualization. This method will be called from the corresponding menu entry.
|
|
Assignment. Initialize the width, height and camera position.
|
|
Set a new GLRenderer. This method is intended for users, that what to overload the behaviour of the GLRenderer. |
|
Show text in the lower right corner. To clear the text, call this method again with an empty string. |
|
Update the visualization.
|
|
Catch mouse wheel events and zoom the scene accordingly.
Reimplemented in VIEW::EditableScene. |
|
Writes the widgets preferences to the INIFile. This method is called automatically by MainControl::aboutToExit at the end of the application.
Reimplemented from VIEW::ModularWidget. |