Logo Search packages:      
Sourcecode: ball version File versions

BALL::VIEW::Scene Class Reference

#include <scene.h>

Inheritance diagram for BALL::VIEW::Scene:

BALL::VIEW::ModularWidget BALL::Embeddable BALL::VIEW::ConnectionObject BALL::VIEW::EditableScene

List of all members.

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.

Protected QT overridden virtual methods

QAction * active_stereo_action_
QAction * animation_export_PNG_action_
QAction * animation_export_POV_action_
QAction * animation_export_VRML_action_
List< Cameraanimation_points_
QAction * animation_repeat_action_
AnimationThread * animation_thread_
QAction * cancel_animation_action_
QAction * clear_animation_action_
QMenu * create_coordinate_system_
ModeType current_mode_
QAction * dual_stereo_action_
QAction * dual_stereo_different_display_action_
Size font_size_
list< float > fps_
QAction * fullscreen_action_
bool ignore_pick_
QPoint info_point_
String info_string_
ModeType last_mode_
QByteArray last_state_
QActionGroup * mode_group_
bool mouse_button_is_pressed_
QAction * move_action_
bool need_update_
QAction * no_stereo_action_
Size offscreen_factor_
Vector3 old_trackorigin_
Quaternion old_trackrotation_
bool pick_select_
QAction * picking_action_
bool preview_
QRubberBand * rb_
QAction * record_animation_action_
std::vector< RenderSetuprenderers_
QAction * rotate_action_
bool show_fps_
QAction * start_animation_action_
Camera stereo_camera_
Index stereo_left_eye_
Index stereo_right_eye_
bool stop_animation_
Camera stored_camera_
QAction * switch_grid_
Vector3 system_origin_
String text_
PreciseTime time_
QToolBar * toolbar_
QList< QAction * > toolbar_actions_
bool tracking_initialized_
bool update_running_
bool use_preview_
bool want_to_use_vertex_buffer_
Index x_window_pick_pos_first_
Index x_window_pick_pos_second_
Index x_window_pos_new_
Index x_window_pos_old_
Index y_window_pick_pos_first_
Index y_window_pick_pos_second_
Index y_window_pos_new_
Index y_window_pos_old_
float zoom_factor_
static float animation_smoothness_ = 2
static float mouse_sensitivity_ = 5
static float mouse_wheel_sensitivity_ = 5
static bool offscreen_rendering_ = true
static Position pov_nr_ = 100000
static Position screenshot_nr_ = 100000
static bool show_light_sources_ = false
static Position vrml_nr_ = 100000
void animate_ ()
virtual void buttonPressEvent (ButtonEvent *evt)
virtual void buttonReleaseEvent (ButtonEvent *evt)
void createCoordinateSystem_ (bool at_origin)
String createFPSInfo_ ()
 Estimate current fps and convert into a string.
virtual void customEvent (QEvent *evt)
Index getMoveModeAction_ (const QMouseEvent &e)
Vector3 getTranslationVector_ (const Vector3 &v)
float getXDiff_ ()
float getYDiff_ ()
virtual void init ()
virtual void motionTrackingEvent (MotionTrackingEvent *evt)
virtual void mouseMoveEvent (QMouseEvent *qmouse_event)
virtual void mousePressEvent (QMouseEvent *qmouse_event)
virtual void mouseReleaseEvent (QMouseEvent *qmouse_event)
virtual void paintGL ()
void pickParent_ (QPoint p)
void processMoveModeMouseEvents_ (QMouseEvent *e)
void processRotateModeMouseEvents_ (QMouseEvent *e)
void readLights_ (const INIFile &inifile)
virtual void resizeEvent (QResizeEvent *event)
void rotateSystem_ ()
void rotateSystemClockwise_ ()
void selectionPressed_ ()
void selectionPressedMoved_ ()
void selectObjects_ ()
virtual void transformationEvent6D (TransformationEvent6D *evt)
void translateSystem_ ()
virtual void wheelEvent (QWheelEvent *qmouse_event)
void writeLights_ (INIFile &inifile) const
void zoomSystem_ ()

Debugging and Diagnostics

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


virtual bool canHandle (const String &) const
virtual void finalizeWidget (MainControl &main_control)
virtual bool openFile (const String &)
static void registerWidget (ModularWidget *mwidget) throw (Exception::NullPointer)

Public Types

Type definitions
typedef std::vector< Embeddable * > EmbeddableVector
Type definitions
 Different Mouse Mode actions.
enum  ModeType { ROTATE__MODE = 0, MOVE__MODE, PICKING__MODE }

Public Member Functions

void setWorkingDirFromFilename_ (String filename)
virtual void showHelp (const String &url)
virtual void checkMenu (MainControl &main_control)
virtual void fetchPreferences (INIFile &inifile)
virtual void initializeWidget (MainControl &main_control)
virtual void writePreferences (INIFile &inifile)
Constructors and Destructor
virtual void clear ()
 Scene (const Scene &scene, QWidget *parent_widget=NULL, const char *name=NULL, Qt::WFlags wflags=0)
 Scene (QWidget *parent_widget, const char *name=NULL, Qt::WFlags w_flags=0)
 Scene ()
virtual ~Scene ()
virtual void destroy ()
Accessors: inspectors and mutators
virtual bool exportScene (Renderer &er) const
virtual void onNotify (Message *message)
Convenience methods
FragmentDBgetFragmentDB () const
MainControlgetMainControl () const
String getWorkingDir ()
 Implemented for convenience.
virtual void setStatusbarText (String text, bool important=false)
void setWorkingDir (const String &dir)
 Implemented for convenience.
const StringgetIdentifier () const
virtual void registerThis ()
void setIdentifier (const String &identifier)
void unregisterThis ()
Accessors: inspectors and mutators
ConnectionObjectgetParent () const
ConnectionObjectgetRoot ()
bool isConnectionObjectRegistered (const ConnectionObject &object)
void registerConnectionObject (ConnectionObject &object)
void unregisterConnectionObject (ConnectionObject &object)
Management of menu and toolbar entries
QAction * insertMenuEntry (Position parent_id, const String &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence())
virtual void registerForHelpSystem (const QObject *object, const String &url)
void setIcon (const String &filename, bool add_to_main_toolbar=true)
void setMenuHelp (const String &url)
void setMenuHint (const String &hint)
Preferences handling
bool lockComposites ()
bool unlockComposites ()
 Unlock the Composites.
const Sceneoperator= (const Scene &scene)
void set (const Scene &scene)

Protected Slots

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

Protected Member Functions

void onNotify_ (Message *message)
Protected notification methods
void notify_ (Message &message)
void notify_ (Message *message)

Static Protected Member Functions

static Size countInstances_ (const std::type_info &type)
static EmbeddablegetInstance_ (const std::type_info &type, const String &identifier)
static EmbeddablegetInstance_ (const std::type_info &type, Position index)
static void registerInstance_ (const std::type_info &type, const Embeddable *instance)
static void unregisterInstance_ (const Embeddable *instance)

Protected Attributes

bool default_visible_
QAction * last_action_
QList< QAction * > main_toolbar_actions_
bool show_window_enty_
QAction * window_menu_entry_


class AnimationThread
class RenderSetup

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index