BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Friends | List of all members
BALL::VIEW::Scene Class Reference

#include <BALL/VIEW/WIDGETS/scene.h>

Inheritance diagram for BALL::VIEW::Scene:
QWidget BALL::VIEW::ModularWidget BALL::Embeddable BALL::VIEW::ConnectionObject BALL::VIEW::EditableScene

Public Types

Type definitions
enum  ModeType { ROTATE__MODE = 0, MOVE__MODE, PICKING__MODE }
 
enum  ModeAction { TRANSLATE_ACTION, ZOOM_ACTION, ROTATE_ACTION, ROTATE_CLOCKWISE_ACTION }
 Different Mouse Mode actions. More...
 
Enums
enum  WindowType { CONTROL_WINDOW = 0, LEFT_EYE_WINDOW, RIGHT_EYE_WINDOW }
 

Public Member Functions

Constructors and Destructor
 Scene ()
 
 Scene (QWidget *parent_widget, const char *name=NULL, Qt::WFlags w_flags=0)
 
 Scene (const Scene &scene, QWidget *parent_widget=NULL, const char *name=NULL, Qt::WFlags wflags=0)
 
virtual ~Scene ()
 
virtual void clear ()
 
Assignment
void set (const Scene &scene)
 
const Sceneoperator= (const Scene &scene)
 
Accessors: inspectors and mutators
virtual void onNotify (Message *message)
 
virtual bool exportScene (Renderer &er) const
 
virtual void initializeWidget (MainControl &main_control)
 
virtual void fetchPreferences (INIFile &inifile)
 
virtual void writePreferences (INIFile &inifile)
 
virtual void checkMenu (MainControl &main_control)
 
- Public Member Functions inherited from BALL::VIEW::ModularWidget
void setWorkingDirFromFilename_ (String filename)
 
virtual void showHelp (const String &url)
 
 ModularWidget (const char *name="<ModularWidget>")
 
 ModularWidget (const ModularWidget &widget)
 
virtual ~ModularWidget ()
 
virtual void destroy ()
 
QAction * insertMenuEntry (Position parent_id, const String &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence())
 
void setMenuHint (const String &hint)
 
void setMenuHelp (const String &url)
 
virtual void registerForHelpSystem (const QObject *object, const String &url)
 
void setIcon (const String &filename, bool add_to_main_toolbar=true)
 
bool lockComposites ()
 
bool unlockComposites ()
 Unlock the Composites. More...
 
MainControlgetMainControl () const
 
virtual void setStatusbarText (const String &text, bool important=false)
 
virtual void setStatusbarText (const QString &text, bool important=false)
  More...
 
String getWorkingDir ()
 Implemented for convenience. More...
 
void setWorkingDir (const String &dir)
 Implemented for convenience. More...
 
FragmentDBgetFragmentDB () const
 
virtual void finalizeWidget (MainControl &main_control)
 
virtual bool canHandle (const String &) const
 
virtual bool openFile (const String &)
 
- Public Member Functions inherited from BALL::Embeddable
 Embeddable (const String &identifier="<Embeddable>")
 
 Embeddable (const Embeddable &embeddable)
 
virtual ~Embeddable ()
 
void setIdentifier (const String &identifier)
 
const StringgetIdentifier () const
 
void unregisterThis ()
 
virtual void registerThis ()
 
- Public Member Functions inherited from BALL::VIEW::ConnectionObject
 ConnectionObject ()
 
virtual ~ConnectionObject ()
 
void registerConnectionObject (ConnectionObject &object)
 
void unregisterConnectionObject (ConnectionObject &object)
 
bool isConnectionObjectRegistered (const ConnectionObject &object)
 
ConnectionObjectgetParent () const
 
ConnectionObjectgetRoot ()
 

Protected Slots

Protected slots
virtual void rotateMode_ ()
 
virtual void pickingMode_ ()
 
virtual void moveMode_ ()
 
virtual void showViewPoint_ ()
 Show the viewpoint and the look at point in the statusline of the mainwidget. More...
 
virtual void setViewPoint_ ()
 Set the viewpoint. More...
 
virtual void resetCamera_ ()
 Reset the camera to standard values. More...
 
virtual void resetRepresentationsForRenderer_ (RenderSetup &rs)
 
virtual void dropEvent (QDropEvent *e)
 
virtual void dragEnterEvent (QDragEnterEvent *e)
 
void dummySlot ()
 

Friends

class AnimationThread
 
class RenderSetup
 

Debugging and Diagnostics

virtual bool isValid () const
 
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 
StagegetStage ()
 
const StagegetStage () const
 
void setCamera (const Camera &camera)
 
std::list< Camera > & getAnimationPoints ()
 
void setDefaultLighting (bool update_GL=true)
 
void initializePreferencesTab (Preferences &preferences)
 
void finalizePreferencesTab (Preferences &preferences)
 
virtual void applyPreferences ()
 
GLRenderergetGLRenderer ()
 
void setGLRenderer (GLRenderer &renderer)
 
float getMousePositionX ()
 
float getMousePositionY ()
 
bool exportPNG (const String &filename)
 
virtual void setWidgetVisible (bool state)
 
void setOffScreenRendering (bool enabled, Size factor)
 
virtual void paintEvent (QPaintEvent *e)
 
virtual void keyPressEvent (QKeyEvent *e)
 Catch key events. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *e)
 
virtual bool eventFilter (QObject *object, QEvent *event)
 
ModeType getMode () const
 
virtual void setMode (ModeType mode)
 
virtual void projectionModeChanged ()
 
void rotate (float degree_right, float degree_up)
 
void rotateClockwise (float degree)
 
void move (Vector3 v)
 
void moveComposites (const std::list< Composite * > &composites, Vector3 v)
 
void rotateComposites (const std::list< Composite * > &composites, float degree_right, float degree_up, float degree_clockwise=0)
 
bool isAnimationRunning () const
 
void setTurnPoint (const Vector3 &v)
 
const Vector3getTurnPoint () const
 
void setFullScreen (bool state)
 
void setFPSEnabled (bool state)
 
void showText (const String &text, Size font_size=20)
 
virtual void addToolBarEntries (QToolBar *tb)
 
bool isUpdateRunning () const
 
void resetTracking ()
 
bool inMoveMode () const
 
Position prepareGridTextures (const RegularData3D &grid, const ColorMap &map)
 
void updateGL ()
 
static void setAnimationSmoothness (float value)
 
static float getAnimationSmoothness ()
 
static void setMouseSensitivity (float sensitivity)
 
static float getMouseSensitivity ()
 
static void setMouseWheelSensitivity (float sensitivity)
 
static float getMouseWheelSensitivity ()
 
static void setShowLightSources (bool state)
 
static bool showLightSourcesEnabled ()
 
static bool stereoBufferSupportTest ()
 
static void setScreenShotNumber (Position pos)
 
static void setPOVNumber (Position pos)
 
static void setVRMLNumber (Position pos)
 
void createCoordinateSystem ()
 Create an coordinate system at current position. More...
 
void createCoordinateSystemAtOrigin ()
 Create an coordinate system at origin. More...
 
String exportPNG ()
 Export PNG image and return the filename. More...
 
void exportPOVRay ()
 
void exportNextPOVRay ()
 Export to POVRay whithout showing file dialog. More...
 
void printScene ()
 
void showExportPNGDialog ()
 show an dialog to save an PNG file to More...
 
void showExportVRMLDialog ()
 opens the VIEW/DIALOGS/GeometryExportDialog for vrml and stl export More...
 
void setPreview (bool state)
 Enable or disable model previews e.g. while rotating. More...
 
bool usePreview () const
 Returns the state of the preview mode. More...
 
virtual void switchShowWidget ()
 
void addGlWindow ()
 
void exitStereo ()
 
void enterActiveStereo ()
 
void enterDualStereo ()
 
void enterDualStereoDifferentDisplays ()
 
void clearRecordedAnimation ()
 
void startAnimation ()
 
void stopAnimation ()
 
void switchToLastMode ()
 
void switchShowGrid ()
 
void showInfos ()
 Popup informations for object under mouse cursor. More...
 
void setupViewVolume ()
 
void storeViewPoint ()
 
void restoreViewPoint ()
 

Protected QT overridden virtual methods

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 * dual_stereo_different_display_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_VRML_action_
 
QAction * animation_export_PNG_action_
 
QAction * animation_repeat_action_
 
QAction * switch_grid_
 
QMenu * create_coordinate_system_
 
Vector3 system_origin_
 
Vector3 old_trackorigin_
 
bool tracking_initialized_
 
Quaternion old_trackrotation_
 
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_
 
Stagestage_
 
Camera stereo_camera_
 
Camera stored_camera_
 
std::vector< RenderSetuprenderers_
 
GLRenderergl_renderer_
 
LightSettingslight_settings_
 
StageSettingsstage_settings_
 
MaterialSettingsmaterial_settings_
 
std::list< Cameraanimation_points_
 
AnimationThreadanimation_thread_
 
bool stop_animation_
 
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< floatfps_
 
bool show_fps_
 
Size offscreen_factor_
 
String text_
 
Size font_size_
 
QToolBar * toolbar_view_controls_
 
QList< QAction * > toolbar_actions_view_controls_
 
bool ignore_pick_
 
QActionGroup * mode_group_
 
String info_string_
 
GLRenderWindowmain_display_
 
Index stereo_left_eye_
 
Index stereo_right_eye_
 
static float mouse_sensitivity_
 
static float mouse_wheel_sensitivity_
 
static bool show_light_sources_
 
static float animation_smoothness_
 
static Position screenshot_nr_
 
static Position pov_nr_
 
static Position vrml_nr_
 
static bool offscreen_rendering_
 
virtual void init ()
 
virtual void paintGL ()
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void customEvent (QEvent *evt)
 
virtual void transformationEvent6D (TransformationEvent6D *evt)
 
virtual void motionTrackingEvent (MotionTrackingEvent *evt)
 
virtual void buttonPressEvent (ButtonEvent *evt)
 
virtual void buttonReleaseEvent (ButtonEvent *evt)
 
virtual void mouseMoveEvent (QMouseEvent *qmouse_event)
 
virtual void mousePressEvent (QMouseEvent *qmouse_event)
 
virtual void mouseReleaseEvent (QMouseEvent *qmouse_event)
 
virtual void wheelEvent (QWheelEvent *qmouse_event)
 
void animate_ ()
 
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
 
void readLights_ (const INIFile &inifile)
 
float getXDiff_ ()
 
float getYDiff_ ()
 
Vector3 getTranslationVector_ (const Vector3 &v)
 
void createCoordinateSystem_ (bool at_origin)
 
String createFPSInfo_ ()
 Estimate current fps and convert into a string. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BALL::VIEW::ModularWidget
static void registerWidget (ModularWidget *mwidget) throw (Exception::NullPointer)
 
- Protected Member Functions inherited from BALL::VIEW::ConnectionObject
void onNotify_ (Message *message)
 
void notify_ (Message *message)
 
void notify_ (Message &message)
 
- Static Protected Member Functions inherited from BALL::Embeddable
static void registerInstance_ (const std::type_info &type, const Embeddable *instance)
 
static void unregisterInstance_ (const Embeddable *instance)
 
static Size countInstances_ (const std::type_info &type)
 
static EmbeddablegetInstance_ (const std::type_info &type, Position index)
 
static EmbeddablegetInstance_ (const std::type_info &type, const String &identifier)
 
- Protected Attributes inherited from BALL::VIEW::ModularWidget
QAction * window_menu_entry_
 
bool show_window_enty_
 
bool default_visible_
 
QAction * last_action_
 
QList< QAction * > main_toolbar_actions_
 

Detailed Description

Scene is the main visualization widget that shows the graphical Representation 's. 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.

Definition at line 115 of file scene.h.

Member Enumeration Documentation

Different Mouse Mode actions.

Enumerator
TRANSLATE_ACTION 
ZOOM_ACTION 
ROTATE_ACTION 
ROTATE_CLOCKWISE_ACTION 

Definition at line 158 of file scene.h.

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.

Enumerator
ROTATE__MODE 

Default value.

MOVE__MODE 

Move mode.

PICKING__MODE 

Picking mode.

Definition at line 143 of file scene.h.

Scene may hold several windows for different renering modes. If you need to retrieve a particular window, use this enum together with Scene::getWindow() to get a reference to it.

Enumerator
CONTROL_WINDOW 

Main window that is always being displayed directly in the QT main interface.

LEFT_EYE_WINDOW 

Window into which left eye should be rendered. Indicates same window as CONTROL_WINDOW if no stereo is running.

RIGHT_EYE_WINDOW 

Window into which right eye should be renderer. Indicates same window as CONTROL_WINDOW if no stereo is running.

Definition at line 183 of file scene.h.

Constructor & Destructor Documentation

BALL::VIEW::Scene::Scene ( )
BALL::VIEW::Scene::Scene ( QWidget parent_widget,
const char *  name = NULL,
Qt::WFlags  w_flags = 0 
)

Default Constructor. Initialize the width and height of this scene to 600 and sets the camera position.

Calls registerWidget.
Parameters
parent_widgetthe parent widget of this scene
namethe name of this scene
w_flagsthe flags the scene widget should have (See documentation of QT-library for information concerning widget flags)
BALL::VIEW::Scene::Scene ( const Scene scene,
QWidget parent_widget = NULL,
const char *  name = NULL,
Qt::WFlags  wflags = 0 
)

Copy constructor. Initialize the width, height and camera position.

Calls registerWidget.
Parameters
scenethe scene to be copied
parent_widgetthe parent widget of this scene
namethe name of this scene
wflagsthe flags the scene widget should have (See documentation of QT-library for information concerning widget flags)
virtual BALL::VIEW::Scene::~Scene ( )
virtual

Destructor.

Member Function Documentation

void BALL::VIEW::Scene::addGlWindow ( )
slot
virtual void BALL::VIEW::Scene::addToolBarEntries ( QToolBar *  main_tb)
virtual

Add the widgets actions to the (main) toolbar. This method is needed to enable ordering the entries. It is called in Mainframe.

Reimplemented from BALL::VIEW::ModularWidget.

Reimplemented in BALL::VIEW::EditableScene.

void BALL::VIEW::Scene::animate_ ( )
protected
virtual void BALL::VIEW::Scene::applyPreferences ( )
virtual

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.

Parameters
preferencesthe Preferences dialog of the MainControl
See Also
initializePreferencesTab
finalizePreferencesTab
applyPreferencesTab

Reimplemented from BALL::VIEW::ModularWidget.

Reimplemented in BALL::VIEW::EditableScene.

virtual void BALL::VIEW::Scene::buttonPressEvent ( ButtonEvent evt)
protectedvirtual

Function that interpretes the button press events sent to customEvent()

virtual void BALL::VIEW::Scene::buttonReleaseEvent ( ButtonEvent evt)
protectedvirtual

Function that interpretes the button release events sent to customEvent()

virtual void BALL::VIEW::Scene::checkMenu ( MainControl main_control)
virtual

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.

Parameters
main_controlthe MainControl object whose menus should be checked
See Also
initializeWidget
finalizeWidget
checkMenus
show

Reimplemented from BALL::VIEW::ModularWidget.

Reimplemented in BALL::VIEW::EditableScene.

virtual void BALL::VIEW::Scene::clear ( )
virtual

Explicit default initialization. Reset the default values of this scene to:

  • width is set to 600
  • height is set to 600
  • camera position set to Vector(1,0,0)
  • camera look at position set to Vector(0,0,0)

Reimplemented from BALL::VIEW::ModularWidget.

void BALL::VIEW::Scene::clearRecordedAnimation ( )
slot
void BALL::VIEW::Scene::createCoordinateSystem ( )
slot

Create an coordinate system at current position.

void BALL::VIEW::Scene::createCoordinateSystem_ ( bool  at_origin)
protected
void BALL::VIEW::Scene::createCoordinateSystemAtOrigin ( )
slot

Create an coordinate system at origin.

String BALL::VIEW::Scene::createFPSInfo_ ( )
protected

Estimate current fps and convert into a string.

virtual void BALL::VIEW::Scene::customEvent ( QEvent evt)
protectedvirtual

This function handles custom events that for example are sent by the input device drivers

Parameters
evtA pointer to the event that shell be processed
virtual void BALL::VIEW::Scene::dragEnterEvent ( QDragEnterEvent *  e)
protectedvirtualslot
virtual void BALL::VIEW::Scene::dropEvent ( QDropEvent *  e)
protectedvirtualslot
void BALL::VIEW::Scene::dummySlot ( )
inlineprotectedslot

Definition at line 651 of file scene.h.

virtual void BALL::VIEW::Scene::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const
virtual

Internal value dump. Dump the current internal state of this scene to the output ostream s with dumping depth depth.

Parameters
soutput stream where to output the internal state of this scene
depththe dumping depth

Reimplemented from BALL::VIEW::ModularWidget.

void BALL::VIEW::Scene::enterActiveStereo ( )
slot
void BALL::VIEW::Scene::enterDualStereo ( )
slot
void BALL::VIEW::Scene::enterDualStereoDifferentDisplays ( )
slot
virtual bool BALL::VIEW::Scene::eventFilter ( QObject object,
QEvent event 
)
virtual
void BALL::VIEW::Scene::exitStereo ( )
slot
void BALL::VIEW::Scene::exportNextPOVRay ( )
slot

Export to POVRay whithout showing file dialog.

bool BALL::VIEW::Scene::exportPNG ( const String filename)
String BALL::VIEW::Scene::exportPNG ( )
slot

Export PNG image and return the filename.

void BALL::VIEW::Scene::exportPOVRay ( )
slot
virtual bool BALL::VIEW::Scene::exportScene ( Renderer er) const
virtual

This method exports the content of the Scene to an external Renderer.

virtual void BALL::VIEW::Scene::fetchPreferences ( INIFile inifile)
virtual

Fetch the widgets preferences from the INIFile. This method is called automatically by MainControl::show() at the start of the application.

Parameters
inifilethe INIFile that contains the needed values
See Also
writePreferences

Reimplemented from BALL::VIEW::ModularWidget.

void BALL::VIEW::Scene::finalizePreferencesTab ( Preferences preferences)
virtual

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.

Parameters
preferencesthe Preferences dialog of the MainControl

Reimplemented from BALL::VIEW::ModularWidget.

std::list<Camera>& BALL::VIEW::Scene::getAnimationPoints ( )
inline

Definition at line 337 of file scene.h.

static float BALL::VIEW::Scene::getAnimationSmoothness ( )
inlinestatic

Definition at line 345 of file scene.h.

GLRenderer& BALL::VIEW::Scene::getGLRenderer ( )
inline

Definition at line 385 of file scene.h.

ModeType BALL::VIEW::Scene::getMode ( ) const
inline

Definition at line 431 of file scene.h.

float BALL::VIEW::Scene::getMousePositionX ( )
inline

Definition at line 404 of file scene.h.

float BALL::VIEW::Scene::getMousePositionY ( )
inline

Definition at line 407 of file scene.h.

static float BALL::VIEW::Scene::getMouseSensitivity ( )
inlinestatic

Definition at line 365 of file scene.h.

static float BALL::VIEW::Scene::getMouseWheelSensitivity ( )
inlinestatic

Definition at line 373 of file scene.h.

Index BALL::VIEW::Scene::getMoveModeAction_ ( const QMouseEvent e)
protected
Stage* BALL::VIEW::Scene::getStage ( )
inline

Definition at line 326 of file scene.h.

const Stage* BALL::VIEW::Scene::getStage ( ) const
inline

Definition at line 330 of file scene.h.

Vector3 BALL::VIEW::Scene::getTranslationVector_ ( const Vector3 v)
inlineprotected
const Vector3& BALL::VIEW::Scene::getTurnPoint ( ) const
inline

Definition at line 483 of file scene.h.

float BALL::VIEW::Scene::getXDiff_ ( )
inlineprotected
float BALL::VIEW::Scene::getYDiff_ ( )
inlineprotected
virtual void BALL::VIEW::Scene::init ( )
protectedvirtual

Initialize the scene and all predefined render setups.

void BALL::VIEW::Scene::initializePreferencesTab ( Preferences preferences)
virtual

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.

Parameters
preferencesthe Preferences dialog of the MainControl

Reimplemented from BALL::VIEW::ModularWidget.

virtual void BALL::VIEW::Scene::initializeWidget ( MainControl main_control)
virtual

ModularWidget methods.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)
    This method is called automatically immediately before the main application is started by MainControl::show().
    Parameters
    main_controlthe MainControl object to be initialized with this scene

Reimplemented from BALL::VIEW::ModularWidget.

Reimplemented in BALL::VIEW::EditableScene.

bool BALL::VIEW::Scene::inMoveMode ( ) const
inline

Definition at line 505 of file scene.h.

bool BALL::VIEW::Scene::isAnimationRunning ( ) const
bool BALL::VIEW::Scene::isUpdateRunning ( ) const
inline

Definition at line 500 of file scene.h.

virtual bool BALL::VIEW::Scene::isValid ( ) const
virtual

Internal state and consistency self-validation. A Scene is valid if it has a parent.

Reimplemented from BALL::VIEW::ConnectionObject.

virtual void BALL::VIEW::Scene::keyPressEvent ( QKeyEvent *  e)
virtual

Catch key events.

Reimplemented in BALL::VIEW::EditableScene.

virtual void BALL::VIEW::Scene::motionTrackingEvent ( MotionTrackingEvent evt)
protectedvirtual

Function that interpretes the motion tracker events sent to customEvent()

virtual void BALL::VIEW::Scene::mouseDoubleClickEvent ( QMouseEvent e)
virtual

Reimplemented in BALL::VIEW::EditableScene.

virtual void BALL::VIEW::Scene::mouseMoveEvent ( QMouseEvent qmouse_event)
protectedvirtual

Catch mouse move events, store the actual mouse position in this scene widget and sent events accordingly.

Parameters
ethe QT-mouse event (See QT-library for mouse events)
virtual void BALL::VIEW::Scene::mousePressEvent ( QMouseEvent qmouse_event)
protectedvirtual

Catch mouse press events, store the actual mouse position in this scene widget and sent events accordingly.

Parameters
ethe QT-mouse event (See QT-library for mouse events)
virtual void BALL::VIEW::Scene::mouseReleaseEvent ( QMouseEvent qmouse_event)
protectedvirtual

Catch mouse release events, store the actual mouse position in this scene widget and sent events accordingly.

Parameters
ethe QT-mouse event (See QT-library for mouse events)
void BALL::VIEW::Scene::move ( Vector3  v)

Move the view. \ v.x = right \ v.y = up \ v.z = view direction

void BALL::VIEW::Scene::moveComposites ( const std::list< Composite * > &  composites,
Vector3  v 
)

Move some Composites. \ v.x = right \ v.y = up \ v.z = view direction

virtual void BALL::VIEW::Scene::moveMode_ ( )
protectedvirtualslot
virtual void BALL::VIEW::Scene::onNotify ( Message message)
virtual

Handles messages sent by other registered ConnectionObject objects. Filters for SceneMessage and sets the Camera appropriate or updates the visualization.

Parameters
messagethe pointer to the message that should be processed
See Also
ConnectionObject
Message

Reimplemented from BALL::VIEW::ConnectionObject.

Reimplemented in BALL::VIEW::EditableScene.

const Scene& BALL::VIEW::Scene::operator= ( const Scene scene)

Assignment operator. Calls set.

virtual void BALL::VIEW::Scene::paintEvent ( QPaintEvent *  e)
virtual
virtual void BALL::VIEW::Scene::paintGL ( )
protectedvirtual

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.

See Also
MainControl
virtual void BALL::VIEW::Scene::pickingMode_ ( )
protectedvirtualslot

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.

See Also
initializeWidget
checkMenu
void BALL::VIEW::Scene::pickParent_ ( QPoint  p)
protected
Position BALL::VIEW::Scene::prepareGridTextures ( const RegularData3D grid,
const ColorMap map 
)
void BALL::VIEW::Scene::printScene ( )
slot
void BALL::VIEW::Scene::processMoveModeMouseEvents_ ( QMouseEvent e)
protected
void BALL::VIEW::Scene::processRotateModeMouseEvents_ ( QMouseEvent e)
protected
virtual void BALL::VIEW::Scene::projectionModeChanged ( )
virtual
void BALL::VIEW::Scene::readLights_ ( const INIFile inifile)
protected
virtual void BALL::VIEW::Scene::resetCamera_ ( )
protectedvirtualslot

Reset the camera to standard values.

virtual void BALL::VIEW::Scene::resetRepresentationsForRenderer_ ( RenderSetup rs)
protectedvirtualslot

Rebuffer all representations for the current renderer_. Note: this function does not yet clear the old state of the renderer.

void BALL::VIEW::Scene::resetTracking ( )
inline

Definition at line 502 of file scene.h.

virtual void BALL::VIEW::Scene::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Resize the widget. Overridden qt method for resizing this scene. This method will be called automatically every time a rezize event is handled.

Parameters
widththe new width of this scene
heightthe new height of this scene
void BALL::VIEW::Scene::restoreViewPoint ( )
slot
void BALL::VIEW::Scene::rotate ( float  degree_right,
float  degree_up 
)
void BALL::VIEW::Scene::rotateClockwise ( float  degree)
void BALL::VIEW::Scene::rotateComposites ( const std::list< Composite * > &  composites,
float  degree_right,
float  degree_up,
float  degree_clockwise = 0 
)

Rotate some Composites. \ v.x = right \ v.y = up \ v.z = view direction

virtual void BALL::VIEW::Scene::rotateMode_ ( )
protectedvirtualslot

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.

See Also
initializeWidget
checkMenu
void BALL::VIEW::Scene::rotateSystem_ ( )
protected
void BALL::VIEW::Scene::rotateSystemClockwise_ ( )
protected
void BALL::VIEW::Scene::selectionPressed_ ( )
protected
void BALL::VIEW::Scene::selectionPressedMoved_ ( )
protected
void BALL::VIEW::Scene::selectObjects_ ( )
protected
void BALL::VIEW::Scene::set ( const Scene scene)

Assignment. Initialize the width, height and camera position.

Parameters
scenethe scene to be copied
static void BALL::VIEW::Scene::setAnimationSmoothness ( float  value)
inlinestatic

Definition at line 341 of file scene.h.

void BALL::VIEW::Scene::setCamera ( const Camera camera)
void BALL::VIEW::Scene::setDefaultLighting ( bool  update_GL = true)
void BALL::VIEW::Scene::setFPSEnabled ( bool  state)
inline

Definition at line 489 of file scene.h.

void BALL::VIEW::Scene::setFullScreen ( bool  state)
void BALL::VIEW::Scene::setGLRenderer ( GLRenderer renderer)

Set a new GLRenderer. This method is intended for users, that what to overload the behaviour of the GLRenderer.

virtual void BALL::VIEW::Scene::setMode ( ModeType  mode)
virtual

Reimplemented in BALL::VIEW::EditableScene.

static void BALL::VIEW::Scene::setMouseSensitivity ( float  sensitivity)
inlinestatic

Definition at line 361 of file scene.h.

static void BALL::VIEW::Scene::setMouseWheelSensitivity ( float  sensitivity)
inlinestatic

Definition at line 369 of file scene.h.

void BALL::VIEW::Scene::setOffScreenRendering ( bool  enabled,
Size  factor 
)
static void BALL::VIEW::Scene::setPOVNumber ( Position  pos)
inlinestatic

Definition at line 444 of file scene.h.

void BALL::VIEW::Scene::setPreview ( bool  state)
inlineslot

Enable or disable model previews e.g. while rotating.

Definition at line 545 of file scene.h.

static void BALL::VIEW::Scene::setScreenShotNumber ( Position  pos)
inlinestatic

Definition at line 441 of file scene.h.

static void BALL::VIEW::Scene::setShowLightSources ( bool  state)
inlinestatic

Definition at line 377 of file scene.h.

void BALL::VIEW::Scene::setTurnPoint ( const Vector3 v)
inline

Definition at line 480 of file scene.h.

void BALL::VIEW::Scene::setupViewVolume ( )
slot
virtual void BALL::VIEW::Scene::setViewPoint_ ( )
protectedvirtualslot

Set the viewpoint.

static void BALL::VIEW::Scene::setVRMLNumber ( Position  pos)
inlinestatic

Definition at line 447 of file scene.h.

virtual void BALL::VIEW::Scene::setWidgetVisible ( bool  state)
virtual
void BALL::VIEW::Scene::showExportPNGDialog ( )
slot

show an dialog to save an PNG file to

void BALL::VIEW::Scene::showExportVRMLDialog ( )
slot

opens the VIEW/DIALOGS/GeometryExportDialog for vrml and stl export

void BALL::VIEW::Scene::showInfos ( )
slot

Popup informations for object under mouse cursor.

static bool BALL::VIEW::Scene::showLightSourcesEnabled ( )
inlinestatic

Definition at line 381 of file scene.h.

void BALL::VIEW::Scene::showText ( const String text,
Size  font_size = 20 
)

Show text in the lower right corner. To clear the text, call this method again with an empty string.

virtual void BALL::VIEW::Scene::showViewPoint_ ( )
protectedvirtualslot

Show the viewpoint and the look at point in the statusline of the mainwidget.

void BALL::VIEW::Scene::startAnimation ( )
slot
static bool BALL::VIEW::Scene::stereoBufferSupportTest ( )
static
void BALL::VIEW::Scene::stopAnimation ( )
slot
void BALL::VIEW::Scene::storeViewPoint ( )
slot
void BALL::VIEW::Scene::switchShowGrid ( )
slot
virtual void BALL::VIEW::Scene::switchShowWidget ( )
virtualslot

Show or hide widget (Called by menu entry in "WINDOWS") If the ModularWidget is not also a QWidget, this method does nothing

void BALL::VIEW::Scene::switchToLastMode ( )
slot
virtual void BALL::VIEW::Scene::transformationEvent6D ( TransformationEvent6D evt)
protectedvirtual

Function that interpretes the transformation events sent to customEvent()

void BALL::VIEW::Scene::translateSystem_ ( )
protected
void BALL::VIEW::Scene::updateGL ( )
bool BALL::VIEW::Scene::usePreview ( ) const
inlineslot

Returns the state of the preview mode.

Definition at line 548 of file scene.h.

virtual void BALL::VIEW::Scene::wheelEvent ( QWheelEvent *  qmouse_event)
protectedvirtual

Catch mouse wheel events and zoom the scene accordingly.

Parameters
ethe QT-mouse event (See QT-library for mouse events)
void BALL::VIEW::Scene::writeLights_ ( INIFile inifile) const
protected
virtual void BALL::VIEW::Scene::writePreferences ( INIFile inifile)
virtual

Writes the widgets preferences to the INIFile. This method is called automatically by MainControl::aboutToExit at the end of the application.

Parameters
inifilethe INIFile to contain the values
See Also
fetchPreferences

Reimplemented from BALL::VIEW::ModularWidget.

void BALL::VIEW::Scene::zoomSystem_ ( )
protected

Friends And Related Function Documentation

friend class AnimationThread
friend

Definition at line 119 of file scene.h.

friend class RenderSetup
friend

Definition at line 120 of file scene.h.

Member Data Documentation

QAction * BALL::VIEW::Scene::active_stereo_action_
protected

Definition at line 770 of file scene.h.

QAction * BALL::VIEW::Scene::animation_export_PNG_action_
protected

Definition at line 772 of file scene.h.

QAction* BALL::VIEW::Scene::animation_export_POV_action_
protected

Definition at line 772 of file scene.h.

QAction * BALL::VIEW::Scene::animation_export_VRML_action_
protected

Definition at line 772 of file scene.h.

std::list<Camera> BALL::VIEW::Scene::animation_points_
protected

Definition at line 824 of file scene.h.

QAction * BALL::VIEW::Scene::animation_repeat_action_
protected

Definition at line 772 of file scene.h.

float BALL::VIEW::Scene::animation_smoothness_
staticprotected

Definition at line 811 of file scene.h.

AnimationThread* BALL::VIEW::Scene::animation_thread_
protected

Definition at line 825 of file scene.h.

QAction * BALL::VIEW::Scene::cancel_animation_action_
protected

Definition at line 771 of file scene.h.

QAction * BALL::VIEW::Scene::clear_animation_action_
protected

Definition at line 771 of file scene.h.

QMenu* BALL::VIEW::Scene::create_coordinate_system_
protected

Definition at line 774 of file scene.h.

ModeType BALL::VIEW::Scene::current_mode_
protected

Definition at line 763 of file scene.h.

QAction * BALL::VIEW::Scene::dual_stereo_action_
protected

Definition at line 770 of file scene.h.

QAction * BALL::VIEW::Scene::dual_stereo_different_display_action_
protected

Definition at line 770 of file scene.h.

Size BALL::VIEW::Scene::font_size_
protected

Definition at line 841 of file scene.h.

list<float> BALL::VIEW::Scene::fps_
protected

Definition at line 836 of file scene.h.

GLRenderer* BALL::VIEW::Scene::gl_renderer_
protected

Definition at line 801 of file scene.h.

bool BALL::VIEW::Scene::ignore_pick_
protected

Definition at line 844 of file scene.h.

QPoint BALL::VIEW::Scene::info_point_
protected

Definition at line 834 of file scene.h.

String BALL::VIEW::Scene::info_string_
protected

Definition at line 847 of file scene.h.

ModeType BALL::VIEW::Scene::last_mode_
protected

Definition at line 766 of file scene.h.

QByteArray BALL::VIEW::Scene::last_state_
protected

Definition at line 835 of file scene.h.

LightSettings* BALL::VIEW::Scene::light_settings_
protected

Definition at line 813 of file scene.h.

GLRenderWindow* BALL::VIEW::Scene::main_display_
protected

Definition at line 849 of file scene.h.

MaterialSettings* BALL::VIEW::Scene::material_settings_
protected

Definition at line 815 of file scene.h.

QActionGroup* BALL::VIEW::Scene::mode_group_
protected

Definition at line 845 of file scene.h.

bool BALL::VIEW::Scene::mouse_button_is_pressed_
protected

Definition at line 828 of file scene.h.

float BALL::VIEW::Scene::mouse_sensitivity_
staticprotected

Definition at line 808 of file scene.h.

float BALL::VIEW::Scene::mouse_wheel_sensitivity_
staticprotected

Definition at line 809 of file scene.h.

QAction * BALL::VIEW::Scene::move_action_
protected

Definition at line 769 of file scene.h.

bool BALL::VIEW::Scene::need_update_
protected

Definition at line 781 of file scene.h.

QAction* BALL::VIEW::Scene::no_stereo_action_
protected

Definition at line 770 of file scene.h.

Size BALL::VIEW::Scene::offscreen_factor_
protected

Definition at line 839 of file scene.h.

bool BALL::VIEW::Scene::offscreen_rendering_
staticprotected

Definition at line 838 of file scene.h.

Vector3 BALL::VIEW::Scene::old_trackorigin_
protected

Definition at line 777 of file scene.h.

Quaternion BALL::VIEW::Scene::old_trackrotation_
protected

Definition at line 779 of file scene.h.

bool BALL::VIEW::Scene::pick_select_
protected

Definition at line 793 of file scene.h.

QAction * BALL::VIEW::Scene::picking_action_
protected

Definition at line 769 of file scene.h.

Position BALL::VIEW::Scene::pov_nr_
staticprotected

Definition at line 820 of file scene.h.

bool BALL::VIEW::Scene::preview_
protected

Definition at line 829 of file scene.h.

QRubberBand* BALL::VIEW::Scene::rb_
protected

Definition at line 794 of file scene.h.

QAction* BALL::VIEW::Scene::record_animation_action_
protected

Definition at line 771 of file scene.h.

std::vector<RenderSetup> BALL::VIEW::Scene::renderers_
protected

Definition at line 800 of file scene.h.

QAction* BALL::VIEW::Scene::rotate_action_
protected

Definition at line 769 of file scene.h.

Position BALL::VIEW::Scene::screenshot_nr_
staticprotected

Definition at line 818 of file scene.h.

bool BALL::VIEW::Scene::show_fps_
protected

Definition at line 837 of file scene.h.

bool BALL::VIEW::Scene::show_light_sources_
staticprotected

Definition at line 810 of file scene.h.

Stage* BALL::VIEW::Scene::stage_
protected

Definition at line 796 of file scene.h.

StageSettings* BALL::VIEW::Scene::stage_settings_
protected

Definition at line 814 of file scene.h.

QAction * BALL::VIEW::Scene::start_animation_action_
protected

Definition at line 771 of file scene.h.

Camera BALL::VIEW::Scene::stereo_camera_
protected

Definition at line 797 of file scene.h.

Index BALL::VIEW::Scene::stereo_left_eye_
protected

Definition at line 851 of file scene.h.

Index BALL::VIEW::Scene::stereo_right_eye_
protected

Definition at line 852 of file scene.h.

bool BALL::VIEW::Scene::stop_animation_
protected

Definition at line 826 of file scene.h.

Camera BALL::VIEW::Scene::stored_camera_
protected

Definition at line 798 of file scene.h.

QAction* BALL::VIEW::Scene::switch_grid_
protected

Definition at line 773 of file scene.h.

Vector3 BALL::VIEW::Scene::system_origin_
protected

Definition at line 776 of file scene.h.

String BALL::VIEW::Scene::text_
protected

Definition at line 840 of file scene.h.

PreciseTime BALL::VIEW::Scene::time_
protected

Definition at line 832 of file scene.h.

QList<QAction*> BALL::VIEW::Scene::toolbar_actions_view_controls_
protected

Definition at line 843 of file scene.h.

QToolBar* BALL::VIEW::Scene::toolbar_view_controls_
protected

Definition at line 842 of file scene.h.

bool BALL::VIEW::Scene::tracking_initialized_
protected

Definition at line 778 of file scene.h.

bool BALL::VIEW::Scene::update_running_
protected

Definition at line 782 of file scene.h.

bool BALL::VIEW::Scene::use_preview_
protected

Definition at line 830 of file scene.h.

Position BALL::VIEW::Scene::vrml_nr_
staticprotected

Definition at line 822 of file scene.h.

bool BALL::VIEW::Scene::want_to_use_vertex_buffer_
protected

Definition at line 827 of file scene.h.

Index BALL::VIEW::Scene::x_window_pick_pos_first_
protected

Definition at line 789 of file scene.h.

Index BALL::VIEW::Scene::x_window_pick_pos_second_
protected

Definition at line 791 of file scene.h.

Index BALL::VIEW::Scene::x_window_pos_new_
protected

Definition at line 786 of file scene.h.

Index BALL::VIEW::Scene::x_window_pos_old_
protected

Definition at line 784 of file scene.h.

Index BALL::VIEW::Scene::y_window_pick_pos_first_
protected

Definition at line 790 of file scene.h.

Index BALL::VIEW::Scene::y_window_pick_pos_second_
protected

Definition at line 792 of file scene.h.

Index BALL::VIEW::Scene::y_window_pos_new_
protected

Definition at line 787 of file scene.h.

Index BALL::VIEW::Scene::y_window_pos_old_
protected

Definition at line 785 of file scene.h.

float BALL::VIEW::Scene::zoom_factor_
protected

Definition at line 833 of file scene.h.