|
CEDRIC
Revision_backup-2009-02
|
Viewer based on MyCamera providing Trackball rotation, Rubberband zoom and Picking. More...
#include <MyCameraWidget.h>
Public Types | |
| enum | MouseMode { ROTATE, RUBBERBAND, SELECT } |
| Different action modes for mouse. More... | |
Public Slots | |
| void | setProjection (int proj) |
| void | setMouseMode (int mode) |
| Set mouse action mode (see enum MouseMode for a list of supported action modes) More... | |
Public Slots inherited from OsgViewerWidget | |
| virtual void | idle (double simulationTime=USE_REFERENCE_TIME) |
| Do event and update traversal. More... | |
| void | triggerRedraw () |
| Trigger a redraw in 1/60 sec. More... | |
| void | toggleContinuousUpdate (bool activate) |
| Toggle continous redraw (usefull for animation) More... | |
| void | forceContinuousUpdate (bool force) |
| Forces continous redraw (i.e. continuous redraw cannot be disabled via toggleContinousUpdate(false)) More... | |
Signals | |
| void | positionChanged (float x, float y, float z) |
| Unprojected mouse position. More... | |
| void | focusChanged (bool) |
| On focusInEvent/focusOutEvent this signal is emitted respectively with true/false as parameter. More... | |
| void | doubleClicked (Selectable *selectable) |
| Emitted when in SELECTION mode currently highlighted Selectable is double-clicked. More... | |
Signals inherited from OsgAdapterWidget | |
| void | processEvents () |
Public Member Functions | |
| MyCameraWidget (QWidget *parent=0) | |
| virtual | ~MyCameraWidget () |
| int | getProjection () const |
| Get projection setting of MyCamera member (see MyCamera::Projection for supported projections) More... | |
| int | getMouseMode () const |
| Get current mouse action mode. More... | |
| MyCamera * | getMyCamera () |
| Access to MyCamera class (e.g. for switching between orthographic and perspective projection) More... | |
| virtual void | setSceneData (osg::Node *node) |
| Override to append own HUD. More... | |
Public Member Functions inherited from OsgViewerWidget | |
| OsgViewerWidget (QWidget *parent=0) | |
| virtual | ~OsgViewerWidget () |
| virtual bool | paintGL2PS (const char *filename, int format) |
| Render scene to postscript using GL2PS library. More... | |
| bool | isContinuousUpdateForced () const |
| Returns true if continous update was forced (i.e. continuous redraw cannot be disable via toggleContinousUpdate(false)) More... | |
| virtual void | frame (double simulationTime=USE_REFERENCE_TIME) |
| virtual void | requestRedraw () |
| virtual void | requestContinuousUpdate (bool needed=true) |
| virtual void | requestWarpPointer (float x, float y) |
Public Member Functions inherited from OsgAdapterWidget | |
| OsgAdapterWidget (QWidget *parent=0) | |
| virtual | ~OsgAdapterWidget () |
| osgViewer::GraphicsWindow * | getGraphicsWindow () |
| const osgViewer::GraphicsWindow * | getGraphicsWindow () const |
Protected Slots | |
| void | mouseOverNode (osg::Node *node) |
| Corresponding signal from PickingHandler is connected here. More... | |
| virtual void | focusInEvent (QFocusEvent *) |
| Override QWidget::focusInEvent() to notice that we received focus. More... | |
| virtual void | focusOutEvent (QFocusEvent *) |
| Override QWidget::focusOutEvent() to notice that we lost focus. More... | |
| void | myCameraChanged () |
Protected Member Functions | |
| virtual void | paintGL () |
| Override OsgViewerWidget::paintGL() for overpainting via OpenGL. More... | |
| virtual void | resizeGL (int width, int height) |
| Override OsgAdapterWidget::resizeGL() for changing HUD aspect ratio also. More... | |
| osg::Node * | createHUD (osgText::Text *text) |
| Helper function which creates a simple heads-up-display which is later used to show name of highlighted Pickable. More... | |
| osg::Node * | createAxesView () |
| Helper function which creates a little 3d view in the lower left of fixed size showing the 3d coordinate axes. More... | |
| virtual void | mouseMoveEvent (QMouseEvent *event) |
| Override Qt mouse events to allow different mouse modes. More... | |
| virtual void | mousePressEvent (QMouseEvent *event) |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
| virtual void | wheelEvent (QWheelEvent *event) |
Protected Member Functions inherited from OsgAdapterWidget | |
| void | init () |
| virtual void | keyPressEvent (QKeyEvent *event) |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| osgGA::GUIEventAdapter * | makeEventAdapter (QMouseEvent *event, osgGA::GUIEventAdapter::EventType type) |
Protected Attributes | |
| MyCamera * | m_myCamera |
| int | m_mouseMode |
| bool | m_rubberbandActive |
| ClipRect | m_rubberbandRect |
| osg::ref_ptr< osg::Node > | m_hud |
| osg::ref_ptr< PickingHandler > | m_pickingHandler |
More... | |
| osg::ref_ptr < osg::MatrixTransform > | m_axes |
| osg::ref_ptr< osg::Node > | m_axesView |
Protected Attributes inherited from OsgAdapterWidget | |
| osg::ref_ptr < osgViewer::GraphicsWindowEmbedded > | _gw |
Additional Inherited Members | |
Public Attributes inherited from OsgViewerWidget | |
| unsigned long | idleCount |
Viewer based on MyCamera providing Trackball rotation, Rubberband zoom and Picking.
| MyCameraWidget::MyCameraWidget | ( | QWidget * | parent = 0 | ) |
References MyCamera::associate(), createAxesView(), createHUD(), m_axesView, m_hud, m_myCamera, m_pickingHandler, myCameraChanged(), and MyCamera::update().
|
inlinevirtual |
|
protected |
Helper function which creates a little 3d view in the lower left of fixed size showing the 3d coordinate axes.
References m_axes.
Referenced by MyCameraWidget().
|
protected |
Helper function which creates a simple heads-up-display which is later used to show name of highlighted Pickable.
Referenced by MyCameraWidget().
|
signal |
Emitted when in SELECTION mode currently highlighted Selectable is double-clicked.
Referenced by mouseDoubleClickEvent().
|
signal |
On focusInEvent/focusOutEvent this signal is emitted respectively with true/false as parameter.
Referenced by focusInEvent(), and focusOutEvent().
|
inlineprotectedvirtualslot |
Override QWidget::focusInEvent() to notice that we received focus.
References focusChanged().
|
inlineprotectedvirtualslot |
Override QWidget::focusOutEvent() to notice that we lost focus.
References focusChanged().
|
inline |
Get current mouse action mode.
References m_mouseMode.
|
inline |
Access to MyCamera class (e.g. for switching between orthographic and perspective projection)
References m_myCamera.
Referenced by EventViewerWidget::adjustCenter(), EventViewerWidget::adjustDistance(), EventViewerWidget::EventViewerWidget(), EventViewerWidget::fitBoundingBox(), EventViewerWidget::getMyCamera(), EventViewerWidget::getRulerProjection(), EventViewerWidget::setLinked(), EventViewerWidget::setScenegraph(), EventViewerWidget::setViewHome(), EventViewerWidget::setViewMode(), and EventViewerWidget::updateRuler().
|
inline |
Get projection setting of MyCamera member (see MyCamera::Projection for supported projections)
References MyCamera::getProjection(), and m_myCamera.
|
protectedvirtual |
References doubleClicked(), Selectable::getCurrent(), m_mouseMode, OsgAdapterWidget::mousePressEvent(), and SELECT.
|
protectedvirtual |
Override Qt mouse events to allow different mouse modes.
Reimplemented from OsgAdapterWidget.
Reimplemented in EventCameraWidget.
References ClipRect::bottom, m_myCamera, m_rubberbandActive, m_rubberbandRect, OsgAdapterWidget::mouseMoveEvent(), positionChanged(), ClipRect::right, and MyCamera::unproject().
Referenced by EventCameraWidget::mouseMoveEvent().
|
protectedslot |
Corresponding signal from PickingHandler is connected here.
|
protectedvirtual |
Reimplemented from OsgAdapterWidget.
Reimplemented in EventCameraWidget.
References ClipRect::bottom, ClipRect::left, m_mouseMode, m_rubberbandActive, m_rubberbandRect, OsgAdapterWidget::mousePressEvent(), OsgViewerWidget::requestContinuousUpdate(), ClipRect::right, ROTATE, RUBBERBAND, SELECT, Selectable::toggleCurrent(), and ClipRect::top.
Referenced by EventCameraWidget::mousePressEvent().
|
protectedvirtual |
Reimplemented from OsgAdapterWidget.
Reimplemented in EventCameraWidget.
References ClipRect::bottom, ClipRect::left, m_mouseMode, m_myCamera, m_rubberbandActive, m_rubberbandRect, OsgAdapterWidget::mouseReleaseEvent(), OsgViewerWidget::requestContinuousUpdate(), ClipRect::right, ROTATE, RUBBERBAND, ClipRect::sort(), ClipRect::top, and MyCamera::zoom().
Referenced by EventCameraWidget::mouseReleaseEvent().
|
protectedslot |
References m_axes, m_myCamera, and MyCamera::rotation().
Referenced by MyCameraWidget().
|
protectedvirtual |
Override OsgViewerWidget::paintGL() for overpainting via OpenGL.
Reimplemented from OsgViewerWidget.
References ClipRect::bottom, ClipRect::left, m_rubberbandActive, m_rubberbandRect, OsgViewerWidget::paintGL(), ClipRect::right, ClipRect::sort(), and ClipRect::top.
|
signal |
Unprojected mouse position.
Referenced by mouseMoveEvent().
|
protectedvirtual |
Override OsgAdapterWidget::resizeGL() for changing HUD aspect ratio also.
Reimplemented from OsgAdapterWidget.
References m_hud, and OsgAdapterWidget::resizeGL().
|
slot |
Set mouse action mode (see enum MouseMode for a list of supported action modes)
References m_mouseMode, m_pickingHandler, SELECT, and OsgViewerWidget::toggleContinuousUpdate().
|
inlineslot |
Set projection setting of MyCamera member (see MyCamera::Projection for supported projections) Pass thru is needed because MyCamera is no Q_OBJECT
References m_myCamera, and MyCamera::setProjection().
Referenced by EventViewerWidget::setViewMode().
|
virtual |
Override to append own HUD.
Reimplemented in EventCameraWidget.
References m_axesView, m_hud, and OsgLighting::setupDefaultLighting().
Referenced by EventCameraWidget::setSceneData().
|
protectedvirtual |
Reimplemented from OsgAdapterWidget.
Reimplemented in EventCameraWidget.
References OsgAdapterWidget::wheelEvent().
Referenced by EventCameraWidget::wheelEvent().
|
protected |
Referenced by createAxesView(), and myCameraChanged().
|
protected |
Referenced by MyCameraWidget(), and setSceneData().
|
protected |
Referenced by MyCameraWidget(), resizeGL(), and setSceneData().
|
protected |
|
protected |
Referenced by getMyCamera(), getProjection(), mouseMoveEvent(), mouseReleaseEvent(), myCameraChanged(), MyCameraWidget(), and setProjection().
|
protected |
heads-up-display, should be an osg::Camera to make aspect ratio adjustion in resizeGL work
Referenced by MyCameraWidget(), and setMouseMode().
|
protected |
Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and paintGL().
|
protected |
Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and paintGL().
1.8.6