|
CEDRIC
Revision_backup-2009-02
|
Base class for a cedric "Viewer" i.e. a manipulable camera onto a scenegraph. More...
#include <EventViewerWidget.h>
Public Types | |
| enum | ViewModes { VIEW_ORTHO =0, VIEW_PERSPECTIVE, VIEW_PLANAR } |
| Provided for convenience, should match with MyCamera::Projection) More... | |
| enum | ViewHomePerspectives { TOP_VIEW =0, SIDE_VIEW, FRONT_VIEW } |
| Supplied default camera perspectives. More... | |
Public Slots | |
| void | setViewMode (int viewMode) |
| Set projection mode. More... | |
| void | setViewHome (int perspective) |
| Set a default camera without changing projection. More... | |
| void | setHomePosition (osg::Vec3 center) |
| Specify home position by hand (to disable call enableAutoHomePosition()) More... | |
| void | enableAutoHomePosition () |
| Compute home position according to bounding box (and if bounding box is not valid set (0,0,0) as center) More... | |
| void | home () |
| void | adjustDistance () |
| Compute and set distance for which camera fits bounding box. More... | |
| void | adjustCenter () |
| Reset center of view to origin (0,0,0) More... | |
| void | fitBoundingBox () |
| DOESN'T WORK CORRECTLY, SEE MyCamera. More... | |
| void | setRulerVisible (bool enable) |
| Set visibility of rulers. More... | |
| bool | isRulerVisible () const |
| Get visibility of rulers. More... | |
| void | forceContinuousUpdate (bool force) |
| Pass through to OsgViewerWidget member m_viewerWidget. More... | |
| void | triggerRedraw () |
| Pass through to OsgViewerWidget member m_viewerWidget. More... | |
| void | changeProjectionAlpha (double alpha) |
| Change projection plane in "Planar" view mode. More... | |
| void | viewSide () |
| void | viewTop () |
| void | viewFront () |
Signals | |
| void | positionChanged (float x, float y, float z) |
| Unprojected mouse position (forwarded from MyCameraWidget) More... | |
| void | activeViewerChanged (EventViewerWidget *) |
Public Member Functions | |
| EventViewerWidget (QWidget *parent=0) | |
| virtual | ~EventViewerWidget () |
| virtual QSize | minimumSizeHint () const |
| Force a minimum size. More... | |
| void | setScenegraph (osg::Node *node) |
| Set scenegraph containing all event geometry (e.g. tracks and setup) More... | |
| virtual void | setPhastScene (PhastScene *scene) |
| Set scenegraph via PhastScene. More... | |
| int | getViewMode () const |
| Provided for convenience, returns current projection mode. More... | |
| double | getProjectionAlpha () const |
| Rotation angle in "Planar" view mode. More... | |
| MyCameraWidget * | getMyCameraWidget () |
| Access contained MyCameraWidget (usefull for making connections) More... | |
| MyCamera * | getMyCamera () |
| Provided for convenience to get MyCamera of MyCameraWidget member. More... | |
| bool | isContinuousUpdateForced () const |
| Pass through from OsgViewerWidget member m_viewerWidget. More... | |
| bool | isLinked () const |
| void | setLinked (bool l) |
| void | linkTo (EventViewerWidget *viewer) |
| void | unlinkFrom (EventViewerWidget *viewer) |
Protected Slots | |
| void | updateRuler () |
| void | setPosition (float x, float y, float z) |
| void | gotFocus (bool b) |
Protected Member Functions | |
| void | getRulerProjection (osg::Vec3 &projEast, osg::Vec3 &projUp) |
| virtual void | enterEvent (QEvent *) |
| virtual void | leaveEvent (QEvent *) |
Base class for a cedric "Viewer" i.e. a manipulable camera onto a scenegraph.
This "Viewer" provides three ViewMode respectively for orthographic projection with free rotation, perspective projection with free rotation and a special mode labeled 'planar'. In the latter we have a orthographic projection strictly from the side and free rotation is not allowed. But instead the 'projection angle' alpha specifies a rotation around the beam axis which corresponds to choosing a projection plane similar as in TRAFFIC. This rotation is accomplished through an additional MatrixTransform node to which the scenegraph given by setScenegraph() is attached to.
For all viewing modes there are ViewHomePerspectives defined to setup a view from a specific direction (e.g. side and top view).
Besides the main view onto a scenegraph this widget can display vertical and horizontal rulers which automatically adjust to the current view. This is possible because the main view is based on MyCamera.
The viewer is surrounded by a coloured frame to indicate if this is the 'ative viewer (i.e. the viewer which has focus).
Provided for convenience, should match with MyCamera::Projection)
| Enumerator | |
|---|---|
| VIEW_ORTHO | |
| VIEW_PERSPECTIVE | |
| VIEW_PLANAR | |
| EventViewerWidget::EventViewerWidget | ( | QWidget * | parent = 0 | ) |
|
inlinevirtual |
|
signal |
Referenced by gotFocus(), home(), and setViewHome().
|
slot |
Reset center of view to origin (0,0,0)
References MyCamera::center(), MyCameraWidget::getMyCamera(), and MyCamera::translate().
Referenced by home().
|
slot |
Compute and set distance for which camera fits bounding box.
References MyCamera::east(), MyCamera::getAspect(), MyCamera::getFov(), MyCameraWidget::getMyCamera(), and MyCamera::setDistance().
Referenced by home().
|
slot |
Change projection plane in "Planar" view mode.
References OsgViewerWidget::triggerRedraw().
Referenced by home(), setViewHome(), and setViewMode().
|
inlineslot |
Compute home position according to bounding box (and if bounding box is not valid set (0,0,0) as center)
|
inlineprotectedvirtual |
References RulerWidget::setCurrentMarkerEnabled().
|
inlineslot |
DOESN'T WORK CORRECTLY, SEE MyCamera.
References MyCameraWidget::getMyCamera(), and MyCamera::zoom().
|
inlineslot |
Pass through to OsgViewerWidget member m_viewerWidget.
References OsgViewerWidget::forceContinuousUpdate().
|
inline |
Provided for convenience to get MyCamera of MyCameraWidget member.
References MyCameraWidget::getMyCamera().
Referenced by EventMultiViewer::createViewerMatrix(), linkTo(), EventMultiViewer::lock(), EventMultiViewer::setActiveViewer(), EventMultiViewer::setLayout(), and unlinkFrom().
|
inline |
Access contained MyCameraWidget (usefull for making connections)
Referenced by EventMultiViewer::createTrackDetVisPerspective(), EventMultiViewer::exportActiveViewerTo(), and EventMultiViewer::setActiveViewer().
|
inline |
Rotation angle in "Planar" view mode.
Referenced by EventMultiViewer::setActiveViewer().
|
protected |
References MyCamera::east(), MyCameraWidget::getMyCamera(), and MyCamera::up().
Referenced by setPosition(), and updateRuler().
|
inline |
Provided for convenience, returns current projection mode.
Referenced by EventMultiViewer::setActiveViewer(), and EventMultiViewer::setLocalActionsEnabled().
|
inlineprotectedslot |
References activeViewerChanged().
Referenced by EventViewerWidget().
|
slot |
References activeViewerChanged(), adjustCenter(), adjustDistance(), changeProjectionAlpha(), triggerRedraw(), and VIEW_PLANAR.
|
inline |
Pass through from OsgViewerWidget member m_viewerWidget.
References OsgViewerWidget::isContinuousUpdateForced().
|
inline |
Referenced by EventMultiViewer::setActiveViewer().
|
slot |
Get visibility of rulers.
|
inlineprotectedvirtual |
References RulerWidget::setCurrentMarkerEnabled().
|
inline |
References getMyCamera(), and MyCamera::link().
|
inlinevirtual |
Force a minimum size.
|
signal |
Unprojected mouse position (forwarded from MyCameraWidget)
Referenced by EventViewerWidget().
|
inlineslot |
Specify home position by hand (to disable call enableAutoHomePosition())
Referenced by EventMultiViewer::createClusterVisPerspective().
|
inline |
References MyCameraWidget::getMyCamera(), and MyCamera::unlinkAll().
Referenced by LinkedViewers::add(), and LinkedViewers::remove().
|
virtual |
|
protectedslot |
References getRulerProjection(), and RulerWidget::setCurrentValue().
Referenced by EventViewerWidget().
|
slot |
Set visibility of rulers.
Referenced by EventViewerWidget().
| void EventViewerWidget::setScenegraph | ( | osg::Node * | node | ) |
Set scenegraph containing all event geometry (e.g. tracks and setup)
References RulerWidget::ceilDecimal(), OsgGeometry::createLine(), GetBoundingBoxVisitor::getBoundingBox(), MyCameraWidget::getMyCamera(), RulerWidget::multiple(), RulerWidget::setDivisions(), RulerWidget::setLimits(), OsgGeometry::setLineState(), OsgGeometry::setLineStipple(), EventCameraWidget::setSceneData(), and MyCamera::update().
Referenced by FilterVisViewer::applyFilter(), EventMultiViewer::requestView(), and setPhastScene().
|
slot |
Set a default camera without changing projection.
References activeViewerChanged(), changeProjectionAlpha(), MyCamera::distance(), FRONT_VIEW, MyCamera::getLookAt(), MyCameraWidget::getMyCamera(), MyCamera::setDistance(), MyCamera::setLookAt(), SIDE_VIEW, TOP_VIEW, OsgViewerWidget::triggerRedraw(), and VIEW_PLANAR.
Referenced by EventMultiViewer::createClusterVisPerspective(), EventMultiViewer::createViewerMatrix(), EventMultiViewer::setLayout(), setViewMode(), viewFront(), viewSide(), and viewTop().
|
slot |
Set projection mode.
References MyCamera::center(), changeProjectionAlpha(), MyCameraWidget::getMyCamera(), MyCamera::setFixedOrientation(), MyCameraWidget::setProjection(), setViewHome(), SIDE_VIEW, MyCamera::translate(), OsgViewerWidget::triggerRedraw(), VIEW_ORTHO, and VIEW_PLANAR.
Referenced by EventMultiViewer::changeProjection(), EventMultiViewer::createClusterVisPerspective(), EventMultiViewer::createTrackDetVisPerspective(), EventMultiViewer::createViewerMatrix(), and EventMultiViewer::setLayout().
|
inlineslot |
Pass through to OsgViewerWidget member m_viewerWidget.
References OsgViewerWidget::triggerRedraw().
Referenced by home().
|
inline |
References getMyCamera(), and MyCamera::unlink().
Referenced by LinkedViewers::remove().
|
protectedslot |
References MyCameraWidget::getMyCamera(), getRulerProjection(), RulerWidget::setRange(), and MyCamera::unproject().
Referenced by EventViewerWidget().
|
inlineslot |
References FRONT_VIEW, and setViewHome().
|
inlineslot |
Convenience functions
References setViewHome(), and SIDE_VIEW.
|
inlineslot |
References setViewHome(), and TOP_VIEW.
1.8.6