Developer Documentation
glViewer Class Reference

#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>

Inheritance diagram for glViewer:

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()). More...
 
virtual void setHome ()
 set home position More...
 
virtual void home ()
 go to home pos More...
 
virtual void viewAll ()
 view the whole scene More...
 
virtual void perspectiveProjection ()
 set perspective view (projectionMode(PERSPECTIVE_PROJECTION)) More...
 
virtual void orthographicProjection ()
 set orthographic view (projectionMode(ORTHOGRAPHIC_PROJECTION)) More...
 
virtual void toggleProjectionMode ()
 toggle projection mode More...
 
virtual void toggleNavigationMode ()
 toggle navigation mode More...
 
virtual void setFOVY (double _fovy)
 Set fovy. More...
 
virtual void setView (const ACG::GLMatrixd &_modelview, const ACG::GLMatrixd &_inverse_modelview)
 set view, used for synchronizing More...
 
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. More...
 

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. More...
 
virtual void makeCurrent ()
 Makes this widget the current widget for OpenGL operations. More...
 
virtual void swapBuffers ()
 Swaps the screen contents with the off-screen buffer. More...
 
void lockProjectionUpdate (void)
 Lock update of projection matrix. More...
 
void unlockProjectionUpdate (void)
 Unlock update of projection matrix. More...
 
void trackMouse (bool _track)
 Enable/disable mouse tracking (move events with no button press) More...
 
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. More...
 
ProjectionMode projectionMode () const
 get current projection mode More...
 
void navigationMode (NavigationMode _n)
 Changes the navigation mode. More...
 
NavigationMode navigationMode () const
 get current navigation mode More...
 
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 More...
 
void lookAt (const ACG::Vec3d &_eye, const ACG::Vec3d &_center, const ACG::Vec3d &_up)
 Set look at transformation directly. More...
 
void normalsMode (NormalsMode _mode)
 set treatment of normals More...
 
NormalsMode normalsMode () const
 get treatment of normals More...
 
void copyToImage (QImage &_image, GLenum _buffer=GL_BACK)
 copy current framebuffer to an QImage More...
 
void copyToImage (QImage &_image, unsigned int _left, unsigned int _top, unsigned int _width, unsigned int _height, GLenum _buffer)
 copy current framebuffer to an QImage More...
 
qreal sceneWidth () const
 get width of scene More...
 
qreal sceneHeight () const
 
qreal scenePosX () const
 
qreal scenePosY () const
 
unsigned int glWidth () const
 get width of QGLWidget More...
 
unsigned int glHeight () const
 get height of QGLWidget More...
 
QSize glSize () const
 get size of QGLWIdget More...
 
QPoint glMapFromGlobal (const QPoint &_pos) const
 map global to glarea coords More...
 
QPoint glMapToGlobal (const QPoint &_pos) const
 map glarea coords to global coords More...
 
double field_of_view_vertical () const
 
double aspect_ratio () const
 Returns the viewer's aspect ratio. More...
 
double near_plane () const
 Returns a chili cheese burger. More...
 
double far_plane () const
 Returns a peanut butter sandwich. More...
 
double ortho_width () const
 Get width of the gl scene in orthogonal projection mode. More...
 
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 More...
 
void grabGLArea ()
 get all Mouse & Key Events for GlWidget More...
 
void releaseGLArea ()
 undo grabbing GLArea More...
 
void translate (const ACG::Vec3d &trans)
 translate the scene and update modelview matrix More...
 
void rotate (const ACG::Vec3d &axis, double angle)
 rotate the scene (around its center) and update modelview matrix More...
 
void rotate (const ACG::Vec3d &axis, double angle, const ACG::Vec3d &_center)
 rotate the scene and update modelview matrix More...
 
void setCursorPainter (CursorPainter *_cursorPainter)
 sets the current cursor painter More...
 
void updateCursorPosition (QPointF _scenePos)
 will be called from CursorPainter to inform the viewer that the cursor position changed More...
 
void moveForward ()
 First person navigation: Move forward. More...
 
void moveBack ()
 First person navigation: Move back. More...
 
void strafeLeft ()
 First person navigation: Strafe left. More...
 
void strafeRight ()
 First person navigation: Strafe Right. More...
 
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_ More...
 
virtual void slotWheelY (double _dAngle)
 process signals from wheelX_ More...
 
virtual void slotWheelZ (double _dist)
 process signals from wheelZ_ More...
 
virtual void cleanupEventFilter ()
 correct ??? (same function as in qt src) More...
 
void processGLDebugMessage (const QOpenGLDebugMessage &msg)
 process opengl debug messages More...
 

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(). More...
 
virtual void resizeEvent (QGraphicsSceneResizeEvent *_e)
 handle resize events More...
 
virtual void moveEvent (QGraphicsSceneMoveEvent *_e)
 handle move events More...
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *_event)
 handle mouse press events More...
 
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *_event)
 handle mouse double click events More...
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *_event)
 handle mouse move events More...
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event)
 handle mouse release events More...
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *_event)
 handle mouse wheel events More...
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *_e)
 handle mouse press events More...
 
void viewMouseEvent (QMouseEvent *_event)
 specialized viewer: hande mouse events More...
 
void viewWheelEvent (QWheelEvent *_event)
 specialized viewer: handle wheel events More...
 
void viewKeyEvent (QKeyEvent *_event)
 specialized viewer: hande key events
 
void updateProjectionMatrix (double _aspect=0.0)
 updates projection matrix More...
 

Protected Attributes

bool isRotating_
 
bool lookAround_
 

Private Slots

void slotClickTimeout ()
 Handle click timeout. More...
 

Private Member Functions

 glViewer (const glViewer &)
 Copy constructor. Never used!
 
glVieweroperator= (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 More...
 
void drawCursor ()
 draw the cursor More...
 
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::BaseNodesceneGraphRoot_
 
bool projectionUpdateLocked_
 
QGraphicsScene * glScene_
 
OFGLWidget * glWidget_
 
QtGLViewerLayoutglBaseLayout_
 
std::vector< QAction * > drawMenuActions_
 
QElapsedTimer redrawTime_
 
ACG::VertexArrayObject defaultVAO_
 
QOpenGLDebugLogger * glDebugLogger_
 
Post Processing
PostProcessingpostproc_
 Post-Processing executor. More...
 

Friends

class QtGLGraphicsScene
 
class SimpleGLGraphicsScene
 
class QtGLGraphicsView
 

Picking

typedef QOpenGLFramebufferObjectFormat QFramebufferObjectFormat
 Framebuffer object that holds the pick cache. More...
 
typedef QOpenGLFramebufferObject QFramebufferObject
 Framebuffer object that holds the pick cache. More...
 
QFramebufferObjectpickCache_
 Framebuffer object that holds the pick cache. More...
 
QFramebufferObjectmouseCache_
 Framebuffer object that holds the pick cache. More...
 
bool updatePickCache_
 Should the pick cache be updated. More...
 
ACG::SceneGraph::PickTarget pickCacheTarget_
 Pick target stored in pick cache. More...
 
bool pickCacheSupported_
 Is pick caching supported. More...
 
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. More...
 
int pickColor (ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
 pick using colors More...
 
int pickFromCache (ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
 pick from cache More...
 

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...
 
QElapsedTimer lastMoveTime_
 mouse interaction position More...
 
QTimer * timer_
 mouse interaction position More...
 
double fovyModifier_
 mouse interaction position More...
 
QTimer clickTimer_
 mouse interaction position More...
 
QElapsedTimer clickTime_
 mouse interaction position More...
 
QMouseEvent * clickEvent_
 mouse interaction position More...
 
void allowRotation (bool _mode)
 Lock scene rotation. More...
 
bool allowRotation ()
 mouse interaction position More...
 
void allowConstrainedRotation (const ACG::Vec3d &axis)
 mouse interaction position More...
 
bool allowConstrainedRotation ()
 mouse interaction position More...
 
const ACG::Vec3dgetConstrainedRotationAxis ()
 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 More...
 
void handleFirstPersonNavigation (QMouseEvent *_event)
 Navigate through scene if first person mode has been selected. More...
 
void handleNormalNavigation (QMouseEvent *_event)
 Navigate through scene if normal mode has been selected. More...
 

Wheels

ACG::QtWidgets::QtWheelwheelX_
 
ACG::QtWidgets::QtWheelwheelY_
 
ACG::QtWidgets::QtWheelwheelZ_
 
bool wheelsVisible ()
 
void slotShowWheels ()
 
void slotHideWheels ()
 

Viewer State

Viewer::ViewerPropertiesproperties_
 All properties for this viewer. More...
 
ACG::GLStateglstate_
 Gl State. More...
 
bool initialized_
 Have the viewer gl properties been initalized. More...
 
Viewer::ViewerPropertiesproperties ()
 Returns a pointer to the Viewer Status. More...
 
const Viewer::ViewerPropertiesproperties () const
 All properties for this viewer. More...
 
void slotPropertiesUpdated ()
 
void applyProperties ()
 

Flying animation properties

QPropertyAnimation * flyAnimationPerspective_
 The animation object for flyTo. More...
 
QPropertyAnimation * flyAnimationOrthogonal_
 The animation object for flyTo. More...
 
ACG::Vec3d flyTranslation_
 Full translation between start and ed of animation. More...
 
ACG::Vec3d flyAxis_
 The rotation axis for fly to animation. More...
 
double flyAngle_
 The rotation angle (full angle) for fly to animation. More...
 
double lastAnimationPos_
 The last position of the animation to compute the difference vector. More...
 
double currentAnimationPos_
 The property that is animated by flyTo. More...
 
ACG::Vec3d flyCenter_
 The new center after the flyTo animation. More...
 
ACG::Vec3d flyPosition_
 The new position after the flyTo animation. More...
 
double flyOrthoWidthOriginal_
 Original orthogonal width during flyTo in orthogonal mode. More...
 
bool flyMoveBack_
 Flag for fly in orthogonal mode if we move back or forward. More...
 
double currentAnimationPosition
 The animation object for flyTo. More...
 
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. More...
 
void flyAnimationOrthogonal (QVariant _pos)
 Slot called during flyTo Animation in orthogonal mode. More...
 
void flyAnimationPerspectiveFinished ()
 Slot called when flyTo perspective Animation finished. More...
 
void flyAnimationOrthogonalFinished ()
 Slot called when flyTo orthogonal Animation finished. More...
 
double currentAnimationPos ()
 Getter for aflyToAnimationPosition. More...
 
void currentAnimationPos (double _currentAnimationPos)
 Setter for aflyToAnimationPosition. More...
 

Drag and Drop

virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *_e)
 drag & drop for modelview copying More...
 
virtual void dropEvent (QGraphicsSceneDragDropEvent *_e)
 drag & drop for modelview copying More...
 
void startDragEvent (QMouseEvent *_event)
 
void dragEnterEvent (QDragEnterEvent *_event)
 
void dropEvent (QDropEvent *_event)
 

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...
 

Detailed Description

Base Viewer Widget: All viewers are derived from this one. Implements Mouse & Keyboard Events.

Definition at line 127 of file QtBaseViewer.hh.

Member Typedef Documentation

◆ QFramebufferObject

typedef QOpenGLFramebufferObject glViewer::QFramebufferObject
private

Framebuffer object that holds the pick cache.

Definition at line 881 of file QtBaseViewer.hh.

◆ QFramebufferObjectFormat

typedef QOpenGLFramebufferObjectFormat glViewer::QFramebufferObjectFormat
private

Framebuffer object that holds the pick cache.

Definition at line 880 of file QtBaseViewer.hh.

Member Enumeration Documentation

◆ NavigationMode

Navigation mode.

Enumerator
NORMAL_NAVIGATION 

Normal mode.

FIRSTPERSON_NAVIGATION 

First person mode.

Definition at line 203 of file QtBaseViewer.hh.

◆ NormalsMode

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 231 of file QtBaseViewer.hh.

◆ ProjectionMode

projection mode

Enumerator
ORTHOGRAPHIC_PROJECTION 

orthographic

PERSPECTIVE_PROJECTION 

perspective

Definition at line 197 of file QtBaseViewer.hh.

Constructor & Destructor Documentation

◆ glViewer()

glViewer::glViewer ( QGraphicsScene *  _scene,
OFGLWidget *  _glWidget,
Viewer::ViewerProperties _properties,
QGraphicsWidget *  _parent = 0 
)

Create a glViewer.

Parameters
_sceneThe graphics scene that will be the parent of this widget
_glWidgetA pointer to the underlying gl widget
_propertiesviewerOptions controlled by PluginFunctions
_parentThe parent graphicswidget

Definition at line 122 of file QtBaseViewer.cc.

◆ ~glViewer()

glViewer::~glViewer ( )
virtual

Destructor.

Definition at line 209 of file QtBaseViewer.cc.

Member Function Documentation

◆ actionCopyView

void glViewer::actionCopyView ( const QSize &  _windowSize = QSize(-1,-1),
const int  _splitterWidth = -1,
const bool  _make_c_string = false 
)
slot

if you want to save the windowSize, use the parameter

Note
QSize(0,0) indicates that the window is maximized

Definition at line 1349 of file QtBaseViewer.cc.

◆ actionPasteView

void glViewer::actionPasteView ( QSize *  _windowSize = NULL,
int *  _splitterWidth = NULL 
)
slot

you get the older window size (if saved) back

Note
QSize(0,0) indicates that the window is maximized.
_splitterWidth is -1 if no splitterWidth was saved

Definition at line 1361 of file QtBaseViewer.cc.

◆ actionSetView

void glViewer::actionSetView ( QString  view)
slot

Definition at line 1368 of file QtBaseViewer.cc.

◆ allowConstrainedRotation() [1/2]

bool glViewer::allowConstrainedRotation ( )
inline

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 913 of file QtBaseViewer.hh.

◆ allowConstrainedRotation() [2/2]

void glViewer::allowConstrainedRotation ( const ACG::Vec3d axis)
inline

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 910 of file QtBaseViewer.hh.

◆ allowRotation() [1/2]

bool glViewer::allowRotation ( )
inline

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 908 of file QtBaseViewer.hh.

◆ allowRotation() [2/2]

void glViewer::allowRotation ( bool  _mode)
inline

Lock scene rotation.

Definition at line 907 of file QtBaseViewer.hh.

◆ applyProperties()

void glViewer::applyProperties ( )
private

This will apply all properties without redrawing You have to set the context yourself!

Definition at line 2286 of file QtBaseViewer.cc.

◆ aspect_ratio()

double glViewer::aspect_ratio ( ) const
inline

Returns the viewer's aspect ratio.

Definition at line 278 of file QtBaseViewer.hh.

◆ bindQFBO()

bool glViewer::bindQFBO ( QOpenGLFramebufferObject *  _ptr)
private

Definition at line 246 of file QtBaseViewer_qt.cc.

◆ blitQFBO()

void glViewer::blitQFBO ( QOpenGLFramebufferObject *  _ptr1,
const QRect &  _size1,
QOpenGLFramebufferObject *  _ptr2,
const QRect &  _size2 
)
private

Definition at line 239 of file QtBaseViewer_qt.cc.

◆ cleanupEventFilter

virtual void glViewer::cleanupEventFilter ( )
inlineprotectedvirtualslot

correct ??? (same function as in qt src)

Definition at line 535 of file QtBaseViewer.hh.

◆ computeProjStereo()

void glViewer::computeProjStereo ( int  _width,
int  _height,
Viewer::ViewerProperties _properties,
ACG::GLMatrixd _outLeft,
ACG::GLMatrixd _outRight 
)
private

Compute left and right eye projection matrix for stereo rendering.

Parameters
_widthviewport width
_heightviewport height
_propertiesviewer props
_outLeft[out] projection matrix for left eye
_outRight[out] projection matrix for right eye

Definition at line 2650 of file QtBaseViewer.cc.

◆ contextMenuEvent()

void glViewer::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  _e)
protectedvirtual

handle mouse press events

Definition at line 1587 of file QtBaseViewer.cc.

◆ copyToImage() [1/2]

void glViewer::copyToImage ( QImage &  _image,
GLenum  _buffer = GL_BACK 
)
inline

copy current framebuffer to an QImage

Definition at line 247 of file QtBaseViewer.hh.

◆ copyToImage() [2/2]

void glViewer::copyToImage ( QImage &  _image,
unsigned int  _left,
unsigned int  _top,
unsigned int  _width,
unsigned int  _height,
GLenum  _buffer 
)

copy current framebuffer to an QImage

Definition at line 189 of file QtBaseViewer_qt.cc.

◆ createQFBO()

bool glViewer::createQFBO ( QOpenGLFramebufferObject *&  _ptr,
GLuint *  _handle,
int  _width,
int  _height,
int *  _samples 
)
private

Definition at line 207 of file QtBaseViewer_qt.cc.

◆ createWidgets()

void glViewer::createWidgets ( )
private

Definition at line 1375 of file QtBaseViewer.cc.

◆ currentAnimationPos() [1/2]

double glViewer::currentAnimationPos ( )
inlineprivate

Getter for aflyToAnimationPosition.

Definition at line 1073 of file QtBaseViewer.hh.

◆ currentAnimationPos() [2/2]

void glViewer::currentAnimationPos ( double  _currentAnimationPos)
inlineprivate

Setter for aflyToAnimationPosition.

Definition at line 1076 of file QtBaseViewer.hh.

◆ decodeView() [1/2]

bool glViewer::decodeView ( const QString &  _view,
ACG::GLMatrixd m,
ACG::GLMatrixd p,
int &  pMode,
double &  ortho_width,
QSize *  _windowSize = NULL,
int *  _splitterWidth = NULL,
QSize *  _viewportSize = NULL 
)
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

Note
QSize(0,0) indicates that the window was maximized.
_splitterWidth is -1 if no splitterWidth was saved

Definition at line 1204 of file QtBaseViewer.cc.

◆ decodeView() [2/2]

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.

Note
QSize(0,0) indicates that the window was maximized.
_splitterWidth is -1 if no splitterWidth was saved

Definition at line 1312 of file QtBaseViewer.cc.

◆ deleteGLDebugLogger()

void glViewer::deleteGLDebugLogger ( )
private

Definition at line 104 of file QtBaseViewer_qt.cc.

◆ deleteQFBO()

void glViewer::deleteQFBO ( QOpenGLFramebufferObject *  _ptr)
private

Definition at line 260 of file QtBaseViewer_qt.cc.

◆ disallowConstrainedRotation()

void glViewer::disallowConstrainedRotation ( )
inline

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 919 of file QtBaseViewer.hh.

◆ dragEnterEvent [1/2]

void glViewer::dragEnterEvent ( QDragEnterEvent *  _event)
signal

Signal is emitted only if in externalDragMode ( see setExternalDrag ) It will be send if a drag enters the gl widget.

◆ dragEnterEvent() [2/2]

void glViewer::dragEnterEvent ( QGraphicsSceneDragDropEvent *  _e)
virtual

drag & drop for modelview copying

Definition at line 1856 of file QtBaseViewer.cc.

◆ drawCursor()

void glViewer::drawCursor ( )
private

draw the cursor

Definition at line 878 of file QtBaseViewer.cc.

◆ drawScene()

void glViewer::drawScene ( double  _aspect = 0.0)
private

Definition at line 544 of file QtBaseViewer.cc.

◆ drawScene_mono()

void glViewer::drawScene_mono ( )
private

Definition at line 754 of file QtBaseViewer.cc.

◆ dropEvent [1/2]

void glViewer::dropEvent ( QDropEvent *  _event)
signal

Signal is emitted only if in externalDragMode ( see setExternalDrag ) It will be send if a drop occurs in the gl widget.

◆ dropEvent() [2/2]

void glViewer::dropEvent ( QGraphicsSceneDragDropEvent *  _e)
virtual

drag & drop for modelview copying

Definition at line 1870 of file QtBaseViewer.cc.

◆ encodeView()

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

Note
QSize(0,0) indicates that the window is maximized.

Definition at line 1161 of file QtBaseViewer.cc.

◆ far_plane()

double glViewer::far_plane ( ) const
inline

Returns a peanut butter sandwich.

Definition at line 291 of file QtBaseViewer.hh.

◆ fast_pick()

bool glViewer::fast_pick ( const QPoint &  _mousePos,
ACG::Vec3d _hitPoint 
)

get the coordinates of the picked point by z-buffer re-projection

Parameters
_mousePosThe position to pick
_hitPointThe point returned by the reprojection
Returns
Successful?

Definition at line 622 of file QtBaseViewerPicking.cc.

◆ field_of_view_vertical()

double glViewer::field_of_view_vertical ( ) const

Definition at line 1515 of file QtBaseViewer.cc.

◆ flyAnimationOrthogonal

void glViewer::flyAnimationOrthogonal ( QVariant  _pos)
privateslot

Slot called during flyTo Animation in orthogonal mode.

Definition at line 146 of file QtBaseViewerFlyAnimation.cc.

◆ flyAnimationOrthogonalFinished

void glViewer::flyAnimationOrthogonalFinished ( )
privateslot

Slot called when flyTo orthogonal Animation finished.

Definition at line 200 of file QtBaseViewerFlyAnimation.cc.

◆ flyAnimationPerspective

void glViewer::flyAnimationPerspective ( QVariant  _pos)
privateslot

Slot called during flyTo Animation in perspective mode.

Definition at line 174 of file QtBaseViewerFlyAnimation.cc.

◆ flyAnimationPerspectiveFinished

void glViewer::flyAnimationPerspectiveFinished ( )
privateslot

Slot called when flyTo perspective Animation finished.

Definition at line 213 of file QtBaseViewerFlyAnimation.cc.

◆ flyFrom

virtual void glViewer::flyFrom ( const QPoint &  _pos)
inlinevirtualslot

Animated flight.

Animated flight away from the given point.

Definition at line 1038 of file QtBaseViewer.hh.

◆ flyTo [1/3]

void glViewer::flyTo ( const ACG::Vec3d _position,
const ACG::Vec3d _center,
int  _time = 1000 
)
virtualslot

Fly to point and set new viewing direction (animated).

Parameters
_positionNew viewer position ( the new eye point of the viewer )
_centerThe new scene center ( the point we are looking at )
_timeAnimation time in ms

Definition at line 221 of file QtBaseViewerFlyAnimation.cc.

◆ flyTo [2/3]

virtual void glViewer::flyTo ( const QPoint &  _pos)
inlinevirtualslot

Animated flight.

Animated flight into the direction of the given point.

Definition at line 1030 of file QtBaseViewer.hh.

◆ flyTo [3/3]

void glViewer::flyTo ( const QPoint &  _pos,
bool  _moveBack 
)
virtualslot

Animated flight to or away from a given point.

Animated flight to or away from a given point.

Parameters
_posPoint defining direction of flight (eye-point)
_moveBackTo or away from point?

Definition at line 65 of file QtBaseViewerFlyAnimation.cc.

◆ getConstrainedRotationAxis()

const ACG::Vec3d & glViewer::getConstrainedRotationAxis ( )
inline

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 916 of file QtBaseViewer.hh.

◆ glHeight()

unsigned int glViewer::glHeight ( ) const

get height of QGLWidget

Definition at line 1497 of file QtBaseViewer.cc.

◆ glMapFromGlobal()

QPoint glViewer::glMapFromGlobal ( const QPoint &  _pos) const

map global to glarea coords

Definition at line 1503 of file QtBaseViewer.cc.

◆ glMapToGlobal()

QPoint glViewer::glMapToGlobal ( const QPoint &  _pos) const

map glarea coords to global coords

Definition at line 1509 of file QtBaseViewer.cc.

◆ glSize()

QSize glViewer::glSize ( ) const

get size of QGLWIdget

Definition at line 1500 of file QtBaseViewer.cc.

◆ glWidth()

unsigned int glViewer::glWidth ( ) const

get width of QGLWidget

Definition at line 1494 of file QtBaseViewer.cc.

◆ grabGLArea()

void glViewer::grabGLArea ( )

get all Mouse & Key Events for GlWidget

Definition at line 1552 of file QtBaseViewer.cc.

◆ handleFirstPersonNavigation()

void glViewer::handleFirstPersonNavigation ( QMouseEvent *  _event)
private

Navigate through scene if first person mode has been selected.

Definition at line 1899 of file QtBaseViewer.cc.

◆ handleNormalNavigation()

void glViewer::handleNormalNavigation ( QMouseEvent *  _event)
private

Navigate through scene if normal mode has been selected.

Definition at line 1964 of file QtBaseViewer.cc.

◆ home

void glViewer::home ( )
virtualslot

go to home pos

Definition at line 904 of file QtBaseViewer.cc.

◆ initializeGL()

void glViewer::initializeGL ( )
protectedvirtual

Return a resonable size hint.

initialize OpenGL states

Definition at line 971 of file QtBaseViewer.cc.

◆ initModelviewMatrix()

void glViewer::initModelviewMatrix ( )

initialize modelview matrix to identity

Definition at line 1448 of file QtBaseViewer.cc.

◆ invalidatePickCache()

void glViewer::invalidatePickCache ( )
inline

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 922 of file QtBaseViewer.hh.

◆ keyPressEvent()

virtual void glViewer::keyPressEvent ( QKeyEvent *  _event)
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 733 of file QtBaseViewer.hh.

◆ keyReleaseEvent()

virtual void glViewer::keyReleaseEvent ( QKeyEvent *  _event)
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 741 of file QtBaseViewer.hh.

◆ lockProjectionUpdate()

void glViewer::lockProjectionUpdate ( void  )
inline

Lock update of projection matrix.

Definition at line 161 of file QtBaseViewer.hh.

◆ lookAt()

void glViewer::lookAt ( const ACG::Vec3d _eye,
const ACG::Vec3d _center,
const ACG::Vec3d _up 
)

Set look at transformation directly.

Definition at line 490 of file QtBaseViewer.cc.

◆ makeCurrent()

void glViewer::makeCurrent ( )
virtual

Makes this widget the current widget for OpenGL operations.

Definition at line 232 of file QtBaseViewer.cc.

◆ makeWidgetCurrent()

void glViewer::makeWidgetCurrent ( )
private

Definition at line 200 of file QtBaseViewer_qt.cc.

◆ mapToSphere()

bool glViewer::mapToSphere ( const QPoint &  _p,
ACG::Vec3d _result 
) const
private

virtual trackball: map 2D screen point to unit sphere

Definition at line 2240 of file QtBaseViewer.cc.

◆ mouseDoubleClickEvent()

void glViewer::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  _event)
protectedvirtual

handle mouse double click events

Definition at line 1682 of file QtBaseViewer.cc.

◆ mouseMoveEvent()

void glViewer::mouseMoveEvent ( QGraphicsSceneMouseEvent *  _event)
protectedvirtual

handle mouse move events

Definition at line 1718 of file QtBaseViewer.cc.

◆ mousePressEvent()

void glViewer::mousePressEvent ( QGraphicsSceneMouseEvent *  _event)
protectedvirtual

handle mouse press events

Definition at line 1599 of file QtBaseViewer.cc.

◆ mouseReleaseEvent()

void glViewer::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  _event)
protectedvirtual

handle mouse release events

Definition at line 1758 of file QtBaseViewer.cc.

◆ moveBack()

void glViewer::moveBack ( )

First person navigation: Move back.

Definition at line 2603 of file QtBaseViewer.cc.

◆ moveEvent()

void glViewer::moveEvent ( QGraphicsSceneMoveEvent *  _e)
protectedvirtual

handle move events

update device pixel ratio. getters in this class will make use of it so it is not necessary to manually multiply values here with it

Definition at line 1142 of file QtBaseViewer.cc.

◆ moveForward()

void glViewer::moveForward ( )

First person navigation: Move forward.

Definition at line 2587 of file QtBaseViewer.cc.

◆ navigationMode() [1/2]

NavigationMode glViewer::navigationMode ( ) const
inline

get current navigation mode

Definition at line 216 of file QtBaseViewer.hh.

◆ navigationMode() [2/2]

void glViewer::navigationMode ( NavigationMode  _n)

Changes the navigation mode.

Definition at line 384 of file QtBaseViewer.cc.

◆ near_plane()

double glViewer::near_plane ( ) const
inline

Returns a chili cheese burger.

Definition at line 286 of file QtBaseViewer.hh.

◆ normalsMode() [1/2]

NormalsMode glViewer::normalsMode ( ) const
inline

get treatment of normals

Definition at line 244 of file QtBaseViewer.hh.

◆ normalsMode() [2/2]

void glViewer::normalsMode ( NormalsMode  _mode)

set treatment of normals

Definition at line 503 of file QtBaseViewer.cc.

◆ ortho_width()

double glViewer::ortho_width ( ) const
inline

Get width of the gl scene in orthogonal projection mode.

Definition at line 296 of file QtBaseViewer.hh.

◆ orthographicProjection

void glViewer::orthographicProjection ( )
virtualslot

set orthographic view (projectionMode(ORTHOGRAPHIC_PROJECTION))

Definition at line 343 of file QtBaseViewer.cc.

◆ paintGL()

void glViewer::paintGL ( double  _aspect = 0.0)
protectedvirtual

draw the scene. Triggered by updateGL().

Definition at line 1037 of file QtBaseViewer.cc.

◆ perspectiveProjection

void glViewer::perspectiveProjection ( )
virtualslot

set perspective view (projectionMode(PERSPECTIVE_PROJECTION))

Definition at line 336 of file QtBaseViewer.cc.

◆ pick()

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!

Parameters
_pickTargetSelect what should be picked: Faces/Vertices/...
_mousePosThe position to be used for picking
_nodeIdxIf picking is successful this will contain the id of the scenegraph node picked.
_targetIdxSpecial index defined by the picked Node. E.g. Facehandle/VertexHandle/.. for MeshNodes
_hitPointPtrPointer to 3D point from picking
Returns
Successful?

Definition at line 71 of file QtBaseViewerPicking.cc.

◆ pick_region()

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!

Parameters
_pickTargetSelect what should be picked: Faces/Vertices/...
_regionArea for picking
_listList of found scenegraph objects (node/target pairs)
_depthsdepths [0,1] (Only provided, if requested)
_pointsback projected 3d points (Only provided, if requested)
Returns
Successful?

Definition at line 426 of file QtBaseViewerPicking.cc.

◆ pickColor()

int glViewer::pickColor ( ACG::SceneGraph::PickTarget  _pickTarget,
const QPoint &  _mousePos,
size_t &  _nodeIdx,
size_t &  _targetIdx,
ACG::Vec3d _hitPointPtr = 0 
)
private

pick using colors

Definition at line 103 of file QtBaseViewerPicking.cc.

◆ pickFromCache()

int glViewer::pickFromCache ( ACG::SceneGraph::PickTarget  _pickTarget,
const QPoint &  _mousePos,
size_t &  _nodeIdx,
size_t &  _targetIdx,
ACG::Vec3d _hitPointPtr = 0 
)
private

pick from cache

Definition at line 314 of file QtBaseViewerPicking.cc.

◆ processGLDebugMessage

void glViewer::processGLDebugMessage ( const QOpenGLDebugMessage &  msg)
protectedslot

process opengl debug messages

Definition at line 112 of file QtBaseViewer_qt.cc.

◆ projectionMode() [1/2]

ProjectionMode glViewer::projectionMode ( ) const
inline

get current projection mode

Definition at line 211 of file QtBaseViewer.hh.

◆ projectionMode() [2/2]

void glViewer::projectionMode ( ProjectionMode  _p)

Changes the projection mode and updates the projection matrix.

Definition at line 361 of file QtBaseViewer.cc.

◆ properties() [1/2]

Viewer::ViewerProperties * glViewer::properties ( )
inline

Returns a pointer to the Viewer Status.

Definition at line 983 of file QtBaseViewer.hh.

◆ properties() [2/2]

const Viewer::ViewerProperties * glViewer::properties ( ) const
inline

All properties for this viewer.

Definition at line 984 of file QtBaseViewer.hh.

◆ QFBOResized()

bool glViewer::QFBOResized ( QOpenGLFramebufferObject *  _ptr)
private

Definition at line 253 of file QtBaseViewer_qt.cc.

◆ releaseGLArea()

void glViewer::releaseGLArea ( )

undo grabbing GLArea

Definition at line 1567 of file QtBaseViewer.cc.

◆ resizeEvent()

void glViewer::resizeEvent ( QGraphicsSceneResizeEvent *  _e)
protectedvirtual

handle resize events

update device pixel ratio. getters in this class will make use of it so we only need to multiply scene information

Definition at line 1117 of file QtBaseViewer.cc.

◆ rotate() [1/2]

void glViewer::rotate ( const ACG::Vec3d axis,
double  angle 
)
inline

rotate the scene (around its center) and update modelview matrix

Definition at line 349 of file QtBaseViewer.hh.

◆ rotate() [2/2]

void glViewer::rotate ( const ACG::Vec3d axis,
double  angle,
const ACG::Vec3d _center 
)

rotate the scene and update modelview matrix

Definition at line 1458 of file QtBaseViewer.cc.

◆ scene_center()

const ACG::Vec3d glViewer::scene_center ( ) const
inline

Get scene's center

See also
setScenePos()

Definition at line 703 of file QtBaseViewer.hh.

◆ scene_radius()

double glViewer::scene_radius ( ) const
inline

Get scene's radius

Definition at line 706 of file QtBaseViewer.hh.

◆ sceneGraph()

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.

Parameters
_rootThe root node of the scene graph
_maxPassesThe maximal number of passes required to render the scenegraph
_bbminLower left of the scenegraph bounding box
_bbmaxUpper right of the scenegraph bounding box
_resetTrackBallReset the trackball center?

Definition at line 252 of file QtBaseViewer.cc.

◆ sceneHeight()

qreal glViewer::sceneHeight ( ) const

Definition at line 1481 of file QtBaseViewer.cc.

◆ scenePosX()

qreal glViewer::scenePosX ( ) const

Definition at line 1486 of file QtBaseViewer.cc.

◆ scenePosY()

qreal glViewer::scenePosY ( ) const

Definition at line 1490 of file QtBaseViewer.cc.

◆ sceneWidth()

qreal glViewer::sceneWidth ( ) const

get width of scene

Definition at line 1476 of file QtBaseViewer.cc.

◆ setCoordSysProjection()

void glViewer::setCoordSysProjection ( glViewer::ProjectionMode  _mode)
private

helper function for setting the projection mode of the coordinate system node

Definition at line 316 of file QtBaseViewer.cc.

◆ setCursorPainter()

void glViewer::setCursorPainter ( CursorPainter _cursorPainter)

sets the current cursor painter

Definition at line 2531 of file QtBaseViewer.cc.

◆ setFOVY

void glViewer::setFOVY ( double  _fovy)
virtualslot

Set fovy.

Definition at line 392 of file QtBaseViewer.cc.

◆ setHome

void glViewer::setHome ( )
virtualslot

set home position

Definition at line 894 of file QtBaseViewer.cc.

◆ setSceneCenter()

void glViewer::setSceneCenter ( const ACG::Vec3d _center)
inline

Set new center point of scene

Definition at line 686 of file QtBaseViewer.hh.

◆ setScenePos()

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 437 of file QtBaseViewer.cc.

◆ setSceneRadius()

void glViewer::setSceneRadius ( double  _radius)
inline

Set new center point of scene

Definition at line 708 of file QtBaseViewer.hh.

◆ setTrackBallCenter()

void glViewer::setTrackBallCenter ( const ACG::Vec3d _center)
inline

Set Trackball Center point of scene.

The scene is rotated around the trackball center when using the mouse

Definition at line 692 of file QtBaseViewer.hh.

◆ setView

void glViewer::setView ( const ACG::GLMatrixd _modelview,
const ACG::GLMatrixd _inverse_modelview 
)
virtualslot

set view, used for synchronizing

Definition at line 957 of file QtBaseViewer.cc.

◆ signalCustomContextMenuRequested

void glViewer::signalCustomContextMenuRequested ( const QPoint &  )
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.

◆ signalKeyPressEvent

void glViewer::signalKeyPressEvent ( QKeyEvent *  )
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.

◆ signalMouseEvent

void glViewer::signalMouseEvent ( QMouseEvent *  ,
const std::string &   
)
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:

  • You have to test for the QMouseEvent::type() of the event yourself (press/release/move)!
  • signalMouseEventIdentify() is emitted on button press if actionMode()==Question.

◆ signalMouseEventClick

void glViewer::signalMouseEventClick ( QMouseEvent *  ,
bool  _double 
)
signal

Emitted if a (double) mouse click is performed in actionMode()==ExamineMode

◆ signalMouseEventIdentify

void glViewer::signalMouseEventIdentify ( QMouseEvent *  )
signal

Emitted instead of signalMouseEvent() if actionMode()==Question and _event is a mouse press event.

◆ signalMouseEventLight

void glViewer::signalMouseEventLight ( QMouseEvent *  )
signal

Emitted instead of signalMouseEvent() if actionMode()==Light and _event is a mouse press event.

◆ slotAnimation

void glViewer::slotAnimation ( )
privateslot

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 2264 of file QtBaseViewer.cc.

◆ slotClickTimeout

void glViewer::slotClickTimeout ( )
privateslot

Handle click timeout.

Definition at line 2524 of file QtBaseViewer.cc.

◆ slotHideWheels

void glViewer::slotHideWheels ( )
slot

Definition at line 2483 of file QtBaseViewer.cc.

◆ slotPropertiesUpdated

void glViewer::slotPropertiesUpdated ( )
privateslot

Called when properties for the viewer require a redraw The slot will trigger the redraw after setting the right properties.

Definition at line 2312 of file QtBaseViewer.cc.

◆ slotShowWheels

void glViewer::slotShowWheels ( )
slot

Definition at line 2500 of file QtBaseViewer.cc.

◆ slotWheelX

void glViewer::slotWheelX ( double  _dAngle)
protectedvirtualslot

process signals from wheelX_

Definition at line 1524 of file QtBaseViewer.cc.

◆ slotWheelY

void glViewer::slotWheelY ( double  _dAngle)
protectedvirtualslot

process signals from wheelX_

Definition at line 1532 of file QtBaseViewer.cc.

◆ slotWheelZ

void glViewer::slotWheelZ ( double  _dist)
protectedvirtualslot

process signals from wheelZ_

Definition at line 1540 of file QtBaseViewer.cc.

◆ snapshot [1/2]

void glViewer::snapshot ( int  _width = 0,
int  _height = 0,
bool  _alpha = false,
bool  _hideCoordsys = false,
int  samples = 1 
)
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 2451 of file QtBaseViewer.cc.

◆ snapshot [2/2]

void glViewer::snapshot ( QImage &  _image,
int  _width = 0,
int  _height = 0,
bool  _alpha = false,
bool  _hideCoordsys = false,
int  samples = 1 
)
virtualslot

Take a snapshot and store it in the given image.

Definition at line 2318 of file QtBaseViewer.cc.

◆ startDragEvent

void glViewer::startDragEvent ( QMouseEvent *  _event)
signal

Signal is emitted when Control modifier is pressed and mouse moded. It will only be emitted if in externalDragMode ( see setExternalDrag )

◆ startGLDebugLogger()

void glViewer::startGLDebugLogger ( )
private

Definition at line 86 of file QtBaseViewer_qt.cc.

◆ strafeLeft()

void glViewer::strafeLeft ( )

First person navigation: Strafe left.

Definition at line 2618 of file QtBaseViewer.cc.

◆ strafeRight()

void glViewer::strafeRight ( )

First person navigation: Strafe Right.

Definition at line 2633 of file QtBaseViewer.cc.

◆ swapBuffers()

void glViewer::swapBuffers ( )
virtual

Swaps the screen contents with the off-screen buffer.

Definition at line 78 of file QtBaseViewer_qt.cc.

◆ toggleNavigationMode

void glViewer::toggleNavigationMode ( )
virtualslot

toggle navigation mode

Definition at line 375 of file QtBaseViewer.cc.

◆ toggleProjectionMode

void glViewer::toggleProjectionMode ( )
virtualslot

toggle projection mode

Definition at line 350 of file QtBaseViewer.cc.

◆ trackBallCenter()

const ACG::Vec3d glViewer::trackBallCenter ( )
inline

Get Trackball Center point of scene.

The scene is rotated around the trackball center when using the mouse

Definition at line 698 of file QtBaseViewer.hh.

◆ trackMouse()

void glViewer::trackMouse ( bool  _track)

Enable/disable mouse tracking (move events with no button press)

Definition at line 308 of file QtBaseViewer.cc.

◆ translate()

void glViewer::translate ( const ACG::Vec3d trans)

translate the scene and update modelview matrix

Definition at line 1434 of file QtBaseViewer.cc.

◆ unlockProjectionUpdate()

void glViewer::unlockProjectionUpdate ( void  )
inline

Unlock update of projection matrix.

Definition at line 164 of file QtBaseViewer.hh.

◆ unproject()

ACG::Vec3d glViewer::unproject ( const ACG::Vec3d pt)
inline

Framebuffer object that holds the pick cache.

Definition at line 857 of file QtBaseViewer.hh.

◆ updateCursorPosition()

void glViewer::updateCursorPosition ( QPointF  _scenePos)

will be called from CursorPainter to inform the viewer that the cursor position changed

Definition at line 2538 of file QtBaseViewer.cc.

◆ updateGL

void glViewer::updateGL ( )
virtualslot

Redraw scene. Triggers paint event for updating the view (cf. drawNow()).

Definition at line 528 of file QtBaseViewer.cc.

◆ updateProjectionMatrix()

void glViewer::updateProjectionMatrix ( double  _aspect = 0.0)
protected

updates projection matrix

Definition at line 403 of file QtBaseViewer.cc.

◆ viewAll

void glViewer::viewAll ( )
virtualslot

view the whole scene

Definition at line 920 of file QtBaseViewer.cc.

◆ viewingDirection()

void glViewer::viewingDirection ( const ACG::Vec3d _dir,
const ACG::Vec3d _up 
)

set the viewing direction

Definition at line 477 of file QtBaseViewer.cc.

◆ viewKeyPressEvent()

virtual bool glViewer::viewKeyPressEvent ( QKeyEvent *  )
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!

Returns
If the derived class handled the event it has to return true otherwise false

Definition at line 750 of file QtBaseViewer.hh.

◆ viewMouseEvent()

void glViewer::viewMouseEvent ( QMouseEvent *  _event)
protected

specialized viewer: hande mouse events

Definition at line 1884 of file QtBaseViewer.cc.

◆ viewWheelEvent()

void glViewer::viewWheelEvent ( QWheelEvent *  _event)
protected

specialized viewer: handle wheel events

Definition at line 2174 of file QtBaseViewer.cc.

◆ wheelEvent()

void glViewer::wheelEvent ( QGraphicsSceneWheelEvent *  _event)
protectedvirtual

handle mouse wheel events

Definition at line 1819 of file QtBaseViewer.cc.

◆ wheelsVisible()

bool glViewer::wheelsVisible ( )

Definition at line 2517 of file QtBaseViewer.cc.

Friends And Related Function Documentation

◆ QtGLGraphicsScene

friend class QtGLGraphicsScene
friend

Definition at line 478 of file QtBaseViewer.hh.

◆ QtGLGraphicsView

friend class QtGLGraphicsView
friend

Definition at line 480 of file QtBaseViewer.hh.

◆ SimpleGLGraphicsScene

friend class SimpleGLGraphicsScene
friend

Definition at line 479 of file QtBaseViewer.hh.

Member Data Documentation

◆ allowRotation_

bool glViewer::allowRotation_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 959 of file QtBaseViewer.hh.

◆ clickEvent_

QMouseEvent* glViewer::clickEvent_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 971 of file QtBaseViewer.hh.

◆ clickTime_

QElapsedTimer glViewer::clickTime_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 970 of file QtBaseViewer.hh.

◆ clickTimer_

QTimer glViewer::clickTimer_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 969 of file QtBaseViewer.hh.

◆ constrainedRotationAxis_

ACG::Vec3d glViewer::constrainedRotationAxis_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 963 of file QtBaseViewer.hh.

◆ currentAnimationPos_

double glViewer::currentAnimationPos_
private

The property that is animated by flyTo.

Definition at line 1070 of file QtBaseViewer.hh.

◆ defaultVAO_

ACG::VertexArrayObject glViewer::defaultVAO_
private

Definition at line 631 of file QtBaseViewer.hh.

◆ drawMenuActions_

std::vector< QAction * > glViewer::drawMenuActions_
private

Definition at line 625 of file QtBaseViewer.hh.

◆ flyAngle_

double glViewer::flyAngle_
private

The rotation angle (full angle) for fly to animation.

Definition at line 1062 of file QtBaseViewer.hh.

◆ flyAnimationOrthogonal_

QPropertyAnimation* glViewer::flyAnimationOrthogonal_
private

The animation object for flyTo.

Definition at line 1053 of file QtBaseViewer.hh.

◆ flyAnimationPerspective_

QPropertyAnimation* glViewer::flyAnimationPerspective_
private

The animation object for flyTo.

Definition at line 1052 of file QtBaseViewer.hh.

◆ flyAxis_

ACG::Vec3d glViewer::flyAxis_
private

The rotation axis for fly to animation.

Definition at line 1059 of file QtBaseViewer.hh.

◆ flyCenter_

ACG::Vec3d glViewer::flyCenter_
private

The new center after the flyTo animation.

Definition at line 1079 of file QtBaseViewer.hh.

◆ flyMoveBack_

bool glViewer::flyMoveBack_
private

Flag for fly in orthogonal mode if we move back or forward.

Definition at line 1088 of file QtBaseViewer.hh.

◆ flyOrthoWidthOriginal_

double glViewer::flyOrthoWidthOriginal_
private

Original orthogonal width during flyTo in orthogonal mode.

Definition at line 1085 of file QtBaseViewer.hh.

◆ flyPosition_

ACG::Vec3d glViewer::flyPosition_
private

The new position after the flyTo animation.

Definition at line 1082 of file QtBaseViewer.hh.

◆ flyTranslation_

ACG::Vec3d glViewer::flyTranslation_
private

Full translation between start and ed of animation.

Definition at line 1056 of file QtBaseViewer.hh.

◆ fovyModifier_

double glViewer::fovyModifier_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 967 of file QtBaseViewer.hh.

◆ frame_time_

double glViewer::frame_time_
private

Definition at line 607 of file QtBaseViewer.hh.

◆ glareaGrabbed_

bool glViewer::glareaGrabbed_
private

Definition at line 606 of file QtBaseViewer.hh.

◆ glBaseLayout_

QtGLViewerLayout* glViewer::glBaseLayout_
private

Definition at line 622 of file QtBaseViewer.hh.

◆ glDebugLogger_

QOpenGLDebugLogger* glViewer::glDebugLogger_
private

Definition at line 634 of file QtBaseViewer.hh.

◆ glScene_

QGraphicsScene* glViewer::glScene_
private

Definition at line 616 of file QtBaseViewer.hh.

◆ glstate_

ACG::GLState* glViewer::glstate_
private

Gl State.

Definition at line 991 of file QtBaseViewer.hh.

◆ glWidget_

OFGLWidget* glViewer::glWidget_
private

Definition at line 619 of file QtBaseViewer.hh.

◆ home_center_

ACG::Vec3d glViewer::home_center_
private

Definition at line 591 of file QtBaseViewer.hh.

◆ home_inverse_modelview_

ACG::GLMatrixd glViewer::home_inverse_modelview_
private

Definition at line 594 of file QtBaseViewer.hh.

◆ home_modelview_

ACG::GLMatrixd glViewer::home_modelview_
private

Definition at line 593 of file QtBaseViewer.hh.

◆ home_radius_

double glViewer::home_radius_
private

Definition at line 592 of file QtBaseViewer.hh.

◆ homeOrthoWidth_

double glViewer::homeOrthoWidth_
private

Definition at line 595 of file QtBaseViewer.hh.

◆ initialized_

bool glViewer::initialized_
private

Have the viewer gl properties been initalized.

Definition at line 994 of file QtBaseViewer.hh.

◆ isRotating_

bool glViewer::isRotating_
protected

Definition at line 582 of file QtBaseViewer.hh.

◆ lastAnimationPos_

double glViewer::lastAnimationPos_
private

The last position of the animation to compute the difference vector.

Definition at line 1065 of file QtBaseViewer.hh.

◆ lastMoveTime_

QElapsedTimer glViewer::lastMoveTime_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 965 of file QtBaseViewer.hh.

◆ lastPoint2D_

QPoint glViewer::lastPoint2D_
protected

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 936 of file QtBaseViewer.hh.

◆ lastPoint3D_

ACG::Vec3d glViewer::lastPoint3D_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 957 of file QtBaseViewer.hh.

◆ lastPoint_hitSphere_

bool glViewer::lastPoint_hitSphere_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 958 of file QtBaseViewer.hh.

◆ lastRotationAngle_

double glViewer::lastRotationAngle_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 964 of file QtBaseViewer.hh.

◆ lastRotationAxis_

ACG::Vec3d glViewer::lastRotationAxis_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 962 of file QtBaseViewer.hh.

◆ lookAround_

bool glViewer::lookAround_
protected

Definition at line 583 of file QtBaseViewer.hh.

◆ mouseCache_

QFramebufferObject* glViewer::mouseCache_
private

Framebuffer object that holds the pick cache.

Definition at line 886 of file QtBaseViewer.hh.

◆ navigationMode_

NavigationMode glViewer::navigationMode_
private

Definition at line 601 of file QtBaseViewer.hh.

◆ normalsMode_

NormalsMode glViewer::normalsMode_
private

Definition at line 599 of file QtBaseViewer.hh.

◆ pickCache_

QFramebufferObject* glViewer::pickCache_
private

Framebuffer object that holds the pick cache.

Definition at line 885 of file QtBaseViewer.hh.

◆ pickCacheSupported_

bool glViewer::pickCacheSupported_
private

Is pick caching supported.

Definition at line 895 of file QtBaseViewer.hh.

◆ pickCacheTarget_

ACG::SceneGraph::PickTarget glViewer::pickCacheTarget_
private

Pick target stored in pick cache.

Definition at line 892 of file QtBaseViewer.hh.

◆ postproc_

PostProcessing* glViewer::postproc_
private

Post-Processing executor.

Definition at line 1142 of file QtBaseViewer.hh.

◆ projectionMode_

ProjectionMode glViewer::projectionMode_
private

Definition at line 600 of file QtBaseViewer.hh.

◆ projectionUpdateLocked_

bool glViewer::projectionUpdateLocked_
private

Definition at line 613 of file QtBaseViewer.hh.

◆ properties_

Viewer::ViewerProperties& glViewer::properties_
private

All properties for this viewer.

Definition at line 988 of file QtBaseViewer.hh.

◆ redrawTime_

QElapsedTimer glViewer::redrawTime_
private

Definition at line 628 of file QtBaseViewer.hh.

◆ sceneGraphRoot_

ACG::SceneGraph::BaseNode* glViewer::sceneGraphRoot_
private

Definition at line 611 of file QtBaseViewer.hh.

◆ startDepth_

float glViewer::startDepth_
protected

mouse interaction depth

This variable stores the depth when the user started a mouse interaction.

Definition at line 942 of file QtBaseViewer.hh.

◆ timer_

QTimer* glViewer::timer_
private

mouse interaction position

This variable stores the last mouse position during mouse interaction.

Definition at line 966 of file QtBaseViewer.hh.

◆ trackMouse_

bool glViewer::trackMouse_
private

Definition at line 605 of file QtBaseViewer.hh.

◆ updatePickCache_

bool glViewer::updatePickCache_
private

Should the pick cache be updated.

Definition at line 889 of file QtBaseViewer.hh.

◆ wheelX_

ACG::QtWidgets::QtWheel* glViewer::wheelX_
private

Definition at line 651 of file QtBaseViewer.hh.

◆ wheelY_

ACG::QtWidgets::QtWheel* glViewer::wheelY_
private

Definition at line 653 of file QtBaseViewer.hh.

◆ wheelZ_

ACG::QtWidgets::QtWheel* glViewer::wheelZ_
private

Definition at line 655 of file QtBaseViewer.hh.

Property Documentation

◆ currentAnimationPosition

double glViewer::currentAnimationPosition
readwrite

The animation object for flyTo.

Definition at line 1065 of file QtBaseViewer.hh.


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