Developer Documentation
|
#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
Public Types | |
enum | ProjectionMode { ORTHOGRAPHIC_PROJECTION, PERSPECTIVE_PROJECTION } |
projection mode More... | |
enum | NavigationMode { NORMAL_NAVIGATION, FIRSTPERSON_NAVIGATION } |
Navigation mode. More... | |
enum | NormalsMode { DONT_TOUCH_NORMALS, NORMALIZE_NORMALS } |
Automatically normalize normals? More... | |
Public Slots | |
virtual void | updateGL () |
Redraw scene. Triggers paint event for updating the view (cf. drawNow()). | |
virtual void | setHome () |
set home position | |
virtual void | home () |
go to home pos | |
virtual void | viewAll () |
view the whole scene | |
virtual void | perspectiveProjection () |
set perspective view (projectionMode(PERSPECTIVE_PROJECTION)) | |
virtual void | orthographicProjection () |
set orthographic view (projectionMode(ORTHOGRAPHIC_PROJECTION)) | |
virtual void | toggleProjectionMode () |
toggle projection mode | |
virtual void | toggleNavigationMode () |
toggle navigation mode | |
virtual void | setFOVY (double _fovy) |
Set fovy. | |
virtual void | setView (const ACG::GLMatrixd &_modelview, const ACG::GLMatrixd &_inverse_modelview) |
set view, used for synchronizing | |
void | actionPasteView (QSize *_windowSize=NULL, int *_splitterWidth=NULL) |
void | actionCopyView (const QSize &_windowSize=QSize(-1,-1), const int _splitterWidth=-1, const bool _make_c_string=false) |
void | actionSetView (QString view) |
Snapshots | |
virtual void | snapshot (int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int samples=1) |
virtual void | snapshot (QImage &_image, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int samples=1) |
Take a snapshot and store it in the given image. | |
Signals | |
void | functionMenuUpdate () |
void | statusMessage (const QString &message, int timeout=0) |
void | projectionModeChanged (bool _ortho) |
void | navigationModeChanged (bool _normal) |
void | signalMouseEvent (QMouseEvent *, const std::string &) |
void | signalMouseEvent (QMouseEvent *) |
This signal does not send the pick mode and is kept for compatibility. | |
void | signalWheelEvent (QWheelEvent *, const std::string &) |
Emitted in Pick mode. Uses pick mode. | |
void | signalMouseEventIdentify (QMouseEvent *) |
void | signalMouseEventLight (QMouseEvent *) |
void | signalSceneGraphChanged (ACG::SceneGraph::BaseNode *_root) |
scene graph has changed | |
void | signalMouseEventClick (QMouseEvent *, bool _double) |
void | signalCustomContextMenuRequested (const QPoint &) |
view handling | |
void | viewUpdated () |
This signal is emitted when the scene is repainted due to any event. | |
void | viewChanged () |
This signal is emitted whenever the view is changed by the user. | |
void | signalMakeActive () |
make this widget active | |
Public Member Functions | |
glViewer (QGraphicsScene *_scene, OFGLWidget *_glWidget, Viewer::ViewerProperties &_properties, QGraphicsWidget *_parent=0) | |
virtual | ~glViewer () |
Destructor. | |
virtual void | makeCurrent () |
Makes this widget the current widget for OpenGL operations. | |
virtual void | swapBuffers () |
Swaps the screen contents with the off-screen buffer. | |
void | lockProjectionUpdate (void) |
Lock update of projection matrix. | |
void | unlockProjectionUpdate (void) |
Unlock update of projection matrix. | |
void | trackMouse (bool _track) |
Enable/disable mouse tracking (move events with no button press) | |
void | sceneGraph (ACG::SceneGraph::BaseNode *_root, unsigned int _maxPasses, ACG::Vec3d _bbmin, ACG::Vec3d _bbmax, const bool _resetTrackBall=false) |
void | projectionMode (ProjectionMode _p) |
Changes the projection mode and updates the projection matrix. | |
ProjectionMode | projectionMode () const |
get current projection mode | |
void | navigationMode (NavigationMode _n) |
Changes the navigation mode. | |
NavigationMode | navigationMode () const |
get current navigation mode | |
void | setScenePos (const ACG::Vec3d &_center, double _radius, const bool _resetTrackBall=false) |
void | viewingDirection (const ACG::Vec3d &_dir, const ACG::Vec3d &_up) |
set the viewing direction | |
void | lookAt (const ACG::Vec3d &_eye, const ACG::Vec3d &_center, const ACG::Vec3d &_up) |
Set look at transformation directly. | |
void | normalsMode (NormalsMode _mode) |
set treatment of normals | |
NormalsMode | normalsMode () const |
get treatment of normals | |
void | copyToImage (QImage &_image, GLenum _buffer=GL_BACK) |
copy current framebuffer to an QImage | |
void | copyToImage (QImage &_image, unsigned int _left, unsigned int _top, unsigned int _width, unsigned int _height, GLenum _buffer) |
copy current framebuffer to an QImage | |
unsigned int | glWidth () const |
get width of QGLWidget | |
unsigned int | glHeight () const |
get height of QGLWidget | |
QSize | glSize () const |
get size of QGLWIdget | |
QPoint | glMapFromGlobal (const QPoint &_pos) const |
map global to glarea coords | |
QPoint | glMapToGlobal (const QPoint &_pos) const |
map glarea coords to global coords | |
double | field_of_view_vertical () const |
double | aspect_ratio () const |
Returns the viewer's aspect ratio. | |
double | near_plane () const |
Returns a chili cheese burger. | |
double | far_plane () const |
Returns a peanut butter sandwich. | |
double | ortho_width () const |
Get width of the gl scene in orthogonal projection mode. | |
void | encodeView (QString &_view, const QSize &_windowSize=QSize(-1,-1), const int _toolBarWidth=-1, const bool _make_c_string=false) |
bool | decodeView (const QString &_view, QSize *_windowSize=NULL, int *_toolBarWidth=NULL, QSize *_viewportSize=NULL) |
void | initModelviewMatrix () |
initialize modelview matrix to identity | |
void | grabGLArea () |
get all Mouse & Key Events for GlWidget | |
void | releaseGLArea () |
undo grabbing GLArea | |
void | translate (const ACG::Vec3d &trans) |
translate the scene and update modelview matrix | |
void | rotate (const ACG::Vec3d &axis, double angle) |
rotate the scene (around its center) and update modelview matrix | |
void | rotate (const ACG::Vec3d &axis, double angle, const ACG::Vec3d &_center) |
rotate the scene and update modelview matrix | |
void | setCursorPainter (CursorPainter *_cursorPainter) |
sets the current cursor painter | |
void | updateCursorPosition (QPointF _scenePos) |
will be called from CursorPainter to inform the viewer that the cursor position changed | |
void | moveForward () |
First person navigation: Move forward. | |
void | moveBack () |
First person navigation: Move back. | |
void | strafeLeft () |
First person navigation: Strafe left. | |
void | strafeRight () |
First person navigation: Strafe Right. | |
Projection settings | |
void | setSceneCenter (const ACG::Vec3d &_center) |
void | setTrackBallCenter (const ACG::Vec3d &_center) |
Set Trackball Center point of scene. More... | |
const ACG::Vec3d | trackBallCenter () |
Get Trackball Center point of scene. More... | |
const ACG::Vec3d | scene_center () const |
double | scene_radius () const |
void | setSceneRadius (double _radius) |
Static Public Member Functions | |
static bool | decodeView (const QString &_view, ACG::GLMatrixd &m, ACG::GLMatrixd &p, int &pMode, double &ortho_width, QSize *_windowSize=NULL, int *_splitterWidth=NULL, QSize *_viewportSize=NULL) |
Protected Slots | |
virtual void | slotWheelX (double _dAngle) |
process signals from wheelX_ | |
virtual void | slotWheelY (double _dAngle) |
process signals from wheelX_ | |
virtual void | slotWheelZ (double _dist) |
process signals from wheelZ_ | |
virtual void | cleanupEventFilter () |
correct ??? (same function as in qt src) | |
void | processGLDebugMessage (const QOpenGLDebugMessage &msg) |
process opengl debug messages | |
Protected Member Functions | |
virtual void | initializeGL () |
Return a resonable size hint. More... | |
virtual void | paintGL (double _aspect=0.0) |
draw the scene. Triggered by updateGL(). | |
virtual void | resizeEvent (QGraphicsSceneResizeEvent *_e) |
handle resize events | |
virtual void | moveEvent (QGraphicsSceneMoveEvent *_e) |
handle move events | |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *_event) |
handle mouse press events | |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *_event) |
handle mouse double click events | |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *_event) |
handle mouse move events | |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *_event) |
handle mouse release events | |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *_event) |
handle mouse wheel events | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *_e) |
handle mouse press events | |
void | viewMouseEvent (QMouseEvent *_event) |
specialized viewer: hande mouse events | |
void | viewWheelEvent (QWheelEvent *_event) |
specialized viewer: handle wheel events | |
void | viewKeyEvent (QKeyEvent *_event) |
specialized viewer: hande key events | |
void | updateProjectionMatrix (double _aspect=0.0) |
updates projection matrix | |
Protected Attributes | |
bool | isRotating_ |
bool | lookAround_ |
Private Slots | |
void | slotClickTimeout () |
Handle click timeout. | |
Private Member Functions | |
glViewer (const glViewer &) | |
Copy constructor. Never used! | |
glViewer & | operator= (const glViewer &) |
Assignment operator. Never used! | |
void | createWidgets () |
void | drawScene (double _aspect=0.0) |
void | drawScene_mono () |
void | setCoordSysProjection (glViewer::ProjectionMode _mode) |
helper function for setting the projection mode of the coordinate system node | |
void | drawCursor () |
draw the cursor | |
void | startGLDebugLogger () |
void | deleteGLDebugLogger () |
void | makeWidgetCurrent () |
bool | createQFBO (QOpenGLFramebufferObject *&_ptr, GLuint *_handle, int _width, int _height, int *_samples) |
bool | bindQFBO (QOpenGLFramebufferObject *_ptr) |
bool | QFBOResized (QOpenGLFramebufferObject *_ptr) |
void | blitQFBO (QOpenGLFramebufferObject *_ptr1, const QRect &_size1, QOpenGLFramebufferObject *_ptr2, const QRect &_size2) |
void | deleteQFBO (QOpenGLFramebufferObject *_ptr) |
Stereo rendering | |
void | computeProjStereo (int _width, int _height, Viewer::ViewerProperties &_properties, ACG::GLMatrixd *_outLeft, ACG::GLMatrixd *_outRight) |
Compute left and right eye projection matrix for stereo rendering. More... | |
Private Attributes | |
ACG::Vec3d | home_center_ |
double | home_radius_ |
ACG::GLMatrixd | home_modelview_ |
ACG::GLMatrixd | home_inverse_modelview_ |
double | homeOrthoWidth_ |
NormalsMode | normalsMode_ |
ProjectionMode | projectionMode_ |
NavigationMode | navigationMode_ |
bool | trackMouse_ |
bool | glareaGrabbed_ |
double | frame_time_ |
ACG::SceneGraph::BaseNode * | sceneGraphRoot_ |
bool | projectionUpdateLocked_ |
QGraphicsScene * | glScene_ |
OFGLWidget * | glWidget_ |
QtGLViewerLayout * | glBaseLayout_ |
std::vector< QAction *> | drawMenuActions_ |
QTime | redrawTime_ |
ACG::VertexArrayObject | defaultVAO_ |
QOpenGLDebugLogger * | glDebugLogger_ |
Post Processing | |
PostProcessing * | postproc_ |
Post-Processing executor. | |
Friends | |
class | QtGLGraphicsScene |
class | SimpleGLGraphicsScene |
class | QtGLGraphicsView |
Wheels | |
ACG::QtWidgets::QtWheel * | wheelX_ |
ACG::QtWidgets::QtWheel * | wheelY_ |
ACG::QtWidgets::QtWheel * | wheelZ_ |
bool | wheelsVisible () |
void | slotShowWheels () |
void | slotHideWheels () |
Key handling | |
void | signalKeyPressEvent (QKeyEvent *) |
Key Event received. More... | |
virtual void | keyPressEvent (QKeyEvent *_event) |
Get keyPress events from the glArea. More... | |
virtual void | keyReleaseEvent (QKeyEvent *_event) |
Get keyRelease events from the glArea. More... | |
virtual bool | viewKeyPressEvent (QKeyEvent *) |
Handle key events in view mode. More... | |
Drag and Drop | |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *_e) |
drag & drop for modelview copying | |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *_e) |
drag & drop for modelview copying | |
void | startDragEvent (QMouseEvent *_event) |
void | dragEnterEvent (QDragEnterEvent *_event) |
void | dropEvent (QDropEvent *_event) |
Picking | |
typedef QOpenGLFramebufferObjectFormat | QFramebufferObjectFormat |
Framebuffer object that holds the pick cache. | |
typedef QOpenGLFramebufferObject | QFramebufferObject |
Framebuffer object that holds the pick cache. | |
QFramebufferObject * | pickCache_ |
Framebuffer object that holds the pick cache. | |
QFramebufferObject * | mouseCache_ |
Framebuffer object that holds the pick cache. | |
bool | updatePickCache_ |
Should the pick cache be updated. | |
ACG::SceneGraph::PickTarget | pickCacheTarget_ |
Pick target stored in pick cache. | |
bool | pickCacheSupported_ |
Is pick caching supported. | |
bool | pick (ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0) |
bool | pick_region (ACG::SceneGraph::PickTarget _pickTarget, const QRegion &_region, QList< QPair< size_t, size_t > > &_list, QVector< float > *_depths=0, QVector< ACG::Vec3d > *_points=0) |
Perform picking action n a whole region. More... | |
bool | fast_pick (const QPoint &_mousePos, ACG::Vec3d &_hitPoint) |
ACG::Vec3d | unproject (const ACG::Vec3d &pt) |
Framebuffer object that holds the pick cache. | |
int | pickColor (ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0) |
pick using colors | |
int | pickFromCache (ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0) |
pick from cache | |
Merge from examiner | |
QPoint | lastPoint2D_ |
mouse interaction position More... | |
float | startDepth_ |
mouse interaction depth More... | |
ACG::Vec3d | lastPoint3D_ |
mouse interaction position More... | |
bool | lastPoint_hitSphere_ |
mouse interaction position More... | |
bool | allowRotation_ |
mouse interaction position More... | |
ACG::Vec3d | lastRotationAxis_ |
mouse interaction position More... | |
ACG::Vec3d | constrainedRotationAxis_ |
mouse interaction position More... | |
double | lastRotationAngle_ |
mouse interaction position More... | |
QTime | lastMoveTime_ |
mouse interaction position More... | |
QTimer * | timer_ |
mouse interaction position More... | |
double | fovyModifier_ |
mouse interaction position More... | |
QTimer | clickTimer_ |
mouse interaction position More... | |
QTime | clickTime_ |
mouse interaction position More... | |
QMouseEvent | clickEvent_ |
mouse interaction position More... | |
void | allowRotation (bool _mode) |
Lock scene rotation. | |
bool | allowRotation () |
mouse interaction position More... | |
void | allowConstrainedRotation (const ACG::Vec3d &axis) |
mouse interaction position More... | |
bool | allowConstrainedRotation () |
mouse interaction position More... | |
const ACG::Vec3d & | getConstrainedRotationAxis () |
mouse interaction position More... | |
void | disallowConstrainedRotation () |
mouse interaction position More... | |
void | invalidatePickCache () |
mouse interaction position More... | |
void | slotAnimation () |
mouse interaction position More... | |
bool | mapToSphere (const QPoint &_p, ACG::Vec3d &_result) const |
virtual trackball: map 2D screen point to unit sphere | |
void | handleFirstPersonNavigation (QMouseEvent *_event) |
Navigate through scene if first person mode has been selected. | |
void | handleNormalNavigation (QMouseEvent *_event) |
Navigate through scene if normal mode has been selected. | |
Viewer State | |
Viewer::ViewerProperties & | properties_ |
All properties for this viewer. | |
ACG::GLState * | glstate_ |
Gl State. | |
bool | initialized_ |
Have the viewer gl properties been initalized. | |
Viewer::ViewerProperties * | properties () |
Returns a pointer to the Viewer Status. | |
const Viewer::ViewerProperties * | properties () const |
All properties for this viewer. | |
void | slotPropertiesUpdated () |
void | applyProperties () |
Flying animation properties | |
QPropertyAnimation * | flyAnimationPerspective_ |
The animation object for flyTo. | |
QPropertyAnimation * | flyAnimationOrthogonal_ |
The animation object for flyTo. | |
ACG::Vec3d | flyTranslation_ |
Full translation between start and ed of animation. | |
ACG::Vec3d | flyAxis_ |
The rotation axis for fly to animation. | |
double | flyAngle_ |
The rotation angle (full angle) for fly to animation. | |
double | lastAnimationPos_ |
The last position of the animation to compute the difference vector. | |
double | currentAnimationPos_ |
The property that is animated by flyTo. | |
ACG::Vec3d | flyCenter_ |
The new center after the flyTo animation. | |
ACG::Vec3d | flyPosition_ |
The new position after the flyTo animation. | |
double | flyOrthoWidthOriginal_ |
Original orthogonal width during flyTo in orthogonal mode. | |
bool | flyMoveBack_ |
Flag for fly in orthogonal mode if we move back or forward. | |
double | currentAnimationPosition |
The animation object for flyTo. | |
void | currentAnimationPosChanged (double _currentAnimationPos) |
Emitted when the currentAnimationPosition changed. | |
virtual void | flyTo (const QPoint &_pos, bool _moveBack) |
Animated flight to or away from a given point. More... | |
virtual void | flyTo (const QPoint &_pos) |
Animated flight. More... | |
virtual void | flyFrom (const QPoint &_pos) |
Animated flight. More... | |
virtual void | flyTo (const ACG::Vec3d &_position, const ACG::Vec3d &_center, int _time=1000) |
void | flyAnimationPerspective (QVariant _pos) |
Slot called during flyTo Animation in perspective mode. | |
void | flyAnimationOrthogonal (QVariant _pos) |
Slot called during flyTo Animation in orthogonal mode. | |
void | flyAnimationPerspectiveFinished () |
Slot called when flyTo perspective Animation finished. | |
void | flyAnimationOrthogonalFinished () |
Slot called when flyTo orthogonal Animation finished. | |
double | currentAnimationPos () |
Getter for aflyToAnimationPosition. | |
void | currentAnimationPos (double _currentAnimationPos) |
Setter for aflyToAnimationPosition. | |
Base Viewer Widget: All viewers are derived from this one. Implements Mouse & Keyboard Events.
Definition at line 126 of file QtBaseViewer.hh.
Navigation mode.
Enumerator | |
---|---|
NORMAL_NAVIGATION | Normal mode. |
FIRSTPERSON_NAVIGATION | First person mode. |
Definition at line 202 of file QtBaseViewer.hh.
Automatically normalize normals?
Enumerator | |
---|---|
DONT_TOUCH_NORMALS | use provided normals as is |
NORMALIZE_NORMALS | Automatically normalize normals. Input normals are not normalized or the transformation matrix does scaling or shearing. |
Definition at line 230 of file QtBaseViewer.hh.
projection mode
Enumerator | |
---|---|
ORTHOGRAPHIC_PROJECTION | orthographic |
PERSPECTIVE_PROJECTION | perspective |
Definition at line 196 of file QtBaseViewer.hh.
glViewer::glViewer | ( | QGraphicsScene * | _scene, |
OFGLWidget * | _glWidget, | ||
Viewer::ViewerProperties & | _properties, | ||
QGraphicsWidget * | _parent = 0 |
||
) |
Create a glViewer.
_scene | The graphics scene that will be the parent of this widget |
_glWidget | A pointer to the underlying gl widget |
_properties | viewerOptions controlled by PluginFunctions |
_parent | The parent graphicswidget |
Definition at line 120 of file QtBaseViewer.cc.
|
slot |
if you want to save the windowSize, use the parameter
Definition at line 1323 of file QtBaseViewer.cc.
|
slot |
you get the older window size (if saved) back
Definition at line 1335 of file QtBaseViewer.cc.
|
inline |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 903 of file QtBaseViewer.hh.
|
inline |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 906 of file QtBaseViewer.hh.
|
inline |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 901 of file QtBaseViewer.hh.
|
private |
This will apply all properties without redrawing You have to set the context yourself!
Definition at line 2219 of file QtBaseViewer.cc.
|
private |
Compute left and right eye projection matrix for stereo rendering.
_width | viewport width |
_height | viewport height |
_properties | viewer props |
_outLeft | [out] projection matrix for left eye |
_outRight | [out] projection matrix for right eye |
Definition at line 2585 of file QtBaseViewer.cc.
|
static |
Decode text representation of view encoded by encodeView() into the supplied output parameters.
If _view
was successfully decoded true
is returned, false
is returned otherwise.
You can save the current Window size via parameter _windowSize and one splitter size via _splitterwidth
Definition at line 1182 of file QtBaseViewer.cc.
bool glViewer::decodeView | ( | const QString & | _view, |
QSize * | _windowSize = NULL , |
||
int * | _toolBarWidth = NULL , |
||
QSize * | _viewportSize = NULL |
||
) |
Decode and apply text representation of view encoded by encodeView(). If _view
was successfully decoded it will immediately be applied and true
is returned, false
is returned else.
You can save the current Window size via parameter _windowSize and one splitter size via _splitterwidth These values will not be applied immediately.
Definition at line 1286 of file QtBaseViewer.cc.
|
inline |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 912 of file QtBaseViewer.hh.
|
signal |
Signal is emitted only if in externalDragMode ( see setExternalDrag ) It will be send if a drag enters the gl widget.
|
signal |
Signal is emitted only if in externalDragMode ( see setExternalDrag ) It will be send if a drop occurs in the gl widget.
void glViewer::encodeView | ( | QString & | _view, |
const QSize & | _windowSize = QSize(-1,-1) , |
||
const int | _toolBarWidth = -1 , |
||
const bool | _make_c_string = false |
||
) |
convert current view to text representation if saved, the old window size will be written into _windowSize
Definition at line 1139 of file QtBaseViewer.cc.
bool glViewer::fast_pick | ( | const QPoint & | _mousePos, |
ACG::Vec3d & | _hitPoint | ||
) |
get the coordinates of the picked point by z-buffer re-projection
_mousePos | The position to pick |
_hitPoint | The point returned by the reprojection |
Definition at line 623 of file QtBaseViewerPicking.cc.
|
inlinevirtualslot |
Animated flight.
Animated flight away from the given point.
Definition at line 1031 of file QtBaseViewer.hh.
|
virtualslot |
Animated flight to or away from a given point.
Animated flight to or away from a given point.
_pos | Point defining direction of flight (eye-point) |
_moveBack | To or away from point? |
Definition at line 65 of file QtBaseViewerFlyAnimation.cc.
|
inlinevirtualslot |
Animated flight.
Animated flight into the direction of the given point.
Definition at line 1023 of file QtBaseViewer.hh.
|
virtualslot |
Fly to point and set new viewing direction (animated).
_position | New viewer position ( the new eye point of the viewer ) |
_center | The new scene center ( the point we are looking at ) |
_time | Animation time in ms |
Definition at line 221 of file QtBaseViewerFlyAnimation.cc.
|
inline |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 909 of file QtBaseViewer.hh.
|
protectedvirtual |
Return a resonable size hint.
initialize OpenGL states
Definition at line 968 of file QtBaseViewer.cc.
|
inline |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 915 of file QtBaseViewer.hh.
|
inlineprotectedvirtual |
Get keyPress events from the glArea.
This function is called by the internal gl widget when receiving a key press event.
Definition at line 726 of file QtBaseViewer.hh.
|
inlineprotectedvirtual |
Get keyRelease events from the glArea.
This function is called by the internal gl widget when receiving a key release event. Here these events are simply passed to the parent widget.
Definition at line 734 of file QtBaseViewer.hh.
bool glViewer::pick | ( | ACG::SceneGraph::PickTarget | _pickTarget, |
const QPoint & | _mousePos, | ||
size_t & | _nodeIdx, | ||
size_t & | _targetIdx, | ||
ACG::Vec3d * | _hitPointPtr = 0 |
||
) |
Apply pick action.
Information about the picked primitive is stored in the provided pointers. No information is stored if 0-pointers are given. Resulting values are defined only if true
has been returned!
_pickTarget | Select what should be picked: Faces/Vertices/... |
_mousePos | The position to be used for picking |
_nodeIdx | If picking is successful this will contain the id of the scenegraph node picked. |
_targetIdx | Special index defined by the picked Node. E.g. Facehandle/VertexHandle/.. for MeshNodes |
_hitPointPtr | Pointer to 3D point from picking |
Definition at line 71 of file QtBaseViewerPicking.cc.
bool glViewer::pick_region | ( | ACG::SceneGraph::PickTarget | _pickTarget, |
const QRegion & | _region, | ||
QList< QPair< size_t, size_t > > & | _list, | ||
QVector< float > * | _depths = 0 , |
||
QVector< ACG::Vec3d > * | _points = 0 |
||
) |
Perform picking action n a whole region.
Apply pick action.
Picks all objects in the given Region. Information about the picked primitives is stored in the provided list. Resulting values are defined only if true
has been returned!
_pickTarget | Select what should be picked: Faces/Vertices/... |
_region | Area for picking |
_list | List of found scenegraph objects (node/target pairs) |
_depths | depths [0,1] (Only provided, if requested) |
_points | back projected 3d points (Only provided, if requested) |
Definition at line 424 of file QtBaseViewerPicking.cc.
|
inline |
|
inline |
Get scene's radius
Definition at line 699 of file QtBaseViewer.hh.
void glViewer::sceneGraph | ( | ACG::SceneGraph::BaseNode * | _root, |
unsigned int | _maxPasses, | ||
ACG::Vec3d | _bbmin, | ||
ACG::Vec3d | _bbmax, | ||
const bool | _resetTrackBall = false |
||
) |
Set scene graph. Sets the scene graph to the the graph rooted at _root
. Recomputes Scene center and resets the trackball center if specified. The sceneGraphToched()
signal will be emitted (even if _root
does not actually change). Use the ACG::SceneGraph::analyzeSceneGraph() function to get the required bounding box and pass information.
_root | The root node of the scene graph |
_maxPasses | The maximal number of passes required to render the scenegraph |
_bbmin | Lower left of the scenegraph bounding box |
_bbmax | Upper right of the scenegraph bounding box |
_resetTrackBall | Reset the trackball center? |
Definition at line 248 of file QtBaseViewer.cc.
|
inline |
Set new center point of scene
Definition at line 679 of file QtBaseViewer.hh.
void glViewer::setScenePos | ( | const ACG::Vec3d & | _center, |
double | _radius, | ||
const bool | _resetTrackBall = false |
||
) |
Sets the center and dimension of the whole scene. This point is used as fixpoint for rotations and to set the eye point far enough from the scene so that the whole scene is visible.
Definition at line 433 of file QtBaseViewer.cc.
|
inline |
Set new center point of scene
Definition at line 701 of file QtBaseViewer.hh.
|
inline |
Set Trackball Center point of scene.
The scene is rotated around the trackball center when using the mouse
Definition at line 685 of file QtBaseViewer.hh.
|
signal |
If popups are disabled context menu mode is set to custom Menu and the signal is passed from the QGLWidget to this signal. You can use mapToGlobal for mapping this point to global coords.
|
signal |
Key Event received.
This signal is emitted if a Key press event is received which is not handled by the widget itself. If internal key handling is disabled the events are passed to the parent of this widget.
|
signal |
A signal for giving mouse events to the application. This is done if the Pick-Button (top-most button of the toolbar) is activated. Connect to this signal to implement application specific handling of mouse events.
Notes:
|
signal |
Emitted if a (double) mouse click is performed in actionMode()==ExamineMode
|
signal |
Emitted instead of signalMouseEvent() if actionMode()==Question and _event
is a mouse press event.
|
signal |
Emitted instead of signalMouseEvent() if actionMode()==Light and _event
is a mouse press event.
|
privateslot |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 2197 of file QtBaseViewer.cc.
|
privateslot |
Called when properties for the viewer require a redraw The slot will trigger the redraw after setting the right properties.
Definition at line 2245 of file QtBaseViewer.cc.
|
virtualslot |
Trigger a snapshot and increase the snapshot counter. Save snapshot to file determined by snapshotBaseFileName() and the current snapshot counter. The back buffer will be saved.
Definition at line 2384 of file QtBaseViewer.cc.
|
signal |
Signal is emitted when Control modifier is pressed and mouse moded. It will only be emitted if in externalDragMode ( see setExternalDrag )
|
inline |
Get Trackball Center point of scene.
The scene is rotated around the trackball center when using the mouse
Definition at line 691 of file QtBaseViewer.hh.
|
inlineprotectedvirtual |
Handle key events in view mode.
This function is called by the BaseViewer if a key press event occured in view mode. This function has to be implemented by every viewer!
Definition at line 743 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 952 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 964 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 963 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 962 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 956 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 960 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 958 of file QtBaseViewer.hh.
|
protected |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 929 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 950 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 951 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 957 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 955 of file QtBaseViewer.hh.
|
protected |
mouse interaction depth
This variable stores the depth when the user started a mouse interaction.
Definition at line 935 of file QtBaseViewer.hh.
|
private |
mouse interaction position
This variable stores the last mouse position during mouse interaction.
Definition at line 959 of file QtBaseViewer.hh.