QtBaseViewer.hh 38 KB
Newer Older
1
/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
2 3
*                                                                            *
*                              OpenFlipper                                   *
Martin Schultz's avatar
Martin Schultz committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
 *           Copyright (c) 2001-2015, RWTH-Aachen University                 *
 *           Department of Computer Graphics and Multimedia                  *
 *                          All rights reserved.                             *
 *                            www.openflipper.org                            *
 *                                                                           *
 *---------------------------------------------------------------------------*
 * This file is part of OpenFlipper.                                         *
 *---------------------------------------------------------------------------*
 *                                                                           *
 * Redistribution and use in source and binary forms, with or without        *
 * modification, are permitted provided that the following conditions        *
 * are met:                                                                  *
 *                                                                           *
 * 1. Redistributions of source code must retain the above copyright notice, *
 *    this list of conditions and the following disclaimer.                  *
 *                                                                           *
 * 2. Redistributions in binary form must reproduce the above copyright      *
 *    notice, this list of conditions and the following disclaimer in the    *
 *    documentation and/or other materials provided with the distribution.   *
 *                                                                           *
 * 3. Neither the name of the copyright holder nor the names of its          *
 *    contributors may be used to endorse or promote products derived from   *
 *    this software without specific prior written permission.               *
 *                                                                           *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS       *
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A           *
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  *
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,       *
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR        *
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    *
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING      *
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        *
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              *
Jan Möbius's avatar
Jan Möbius committed
39
*                                                                            *
40 41 42
\*===========================================================================*/

/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
43 44 45 46 47
*                                                                            *
*   $Revision$                                                       *
*   $LastChangedBy$                                                *
*   $Date$                     *
*                                                                            *
48
\*===========================================================================*/
Jan Möbius's avatar
 
Jan Möbius committed
49 50 51 52 53 54




//=============================================================================
//
Jan Möbius's avatar
 
Jan Möbius committed
55
//  CLASS glViewer
Jan Möbius's avatar
 
Jan Möbius committed
56 57 58
//
//=============================================================================

Jan Möbius's avatar
Jan Möbius committed
59 60
#ifndef BASEVIEWER_HH
#define BASEVIEWER_HH
Jan Möbius's avatar
 
Jan Möbius committed
61 62 63

//== INCLUDES =================================================================

Jan Möbius's avatar
 
Jan Möbius committed
64 65
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/common/ViewerProperties.hh>
Jan Möbius's avatar
 
Jan Möbius committed
66

67 68
#include <OpenFlipper/common/OFGLWidget.hh>

Jan Möbius's avatar
 
Jan Möbius committed
69
#include <ACG/GL/GLState.hh>
Jan Möbius's avatar
Jan Möbius committed
70
#include <ACG/GL/FBO.hh>
Jan Möbius's avatar
 
Jan Möbius committed
71 72 73
#include <ACG/Scenegraph/SceneGraph.hh>
#include <ACG/QtWidgets/QtSceneGraphWidget.hh>

74 75 76
#include <ACG/ShaderUtils/GLSLShader.hh>
#include <ACG/GL/globjects.hh>

Jan Möbius's avatar
 
Jan Möbius committed
77 78
#include <vector>
#include <string>
79
#include <limits>
Jan Möbius's avatar
 
Jan Möbius committed
80

Hans-Christian Ebke's avatar
Hans-Christian Ebke committed
81 82 83 84 85
#include <QGraphicsWidget>
#include <QTimer>
#include <QMouseEvent>
#include <QTime>

Jan Möbius's avatar
 
Jan Möbius committed
86 87 88 89 90 91 92 93
//== FORWARDDECLARATIONS ======================================================


class QPushButton;
class QToolButton;
class QSplitter;
class QImage;
class QSocketNotifier;
Hans-Christian Ebke's avatar
Hans-Christian Ebke committed
94
class QPropertyAnimation;
Jan Möbius's avatar
Jan Möbius committed
95
struct PostProcessorInput;
Jan Möbius's avatar
 
Jan Möbius committed
96 97 98 99 100 101 102 103 104 105 106


//== NAMESPACES ===============================================================

//== FORWARDDECLARATIONS ======================================================

namespace ACG {
  namespace QtWidgets {
    class QtWheel;
  }
}
107
class QGraphicsScene;
Jan Möbius's avatar
Jan Möbius committed
108
class QtGLViewerLayout;
Jan Möbius's avatar
 
Jan Möbius committed
109
class QtShiftPopupMenu;
Jan Möbius's avatar
Dennis:  
Jan Möbius committed
110
class CursorPainter;
Christopher Tenter's avatar
Christopher Tenter committed
111 112
class PostProcessing;

113 114
#if QT_VERSION < 0x050000
class QGLFramebufferObject;
115
class QGLFramebufferObjectFormat;
116 117
#else
class QOpenGLFramebufferObject;
118
class QOpenGLFramebufferObjectFormat;
119
#endif
Jan Möbius's avatar
 
Jan Möbius committed
120

121 122 123 124
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
class QOpenGLDebugLogger;
class QOpenGLDebugMessage;
#endif
Jan Möbius's avatar
 
Jan Möbius committed
125 126 127 128

//== CLASS DEFINITION =========================================================


Jan Möbius's avatar
Jan Möbius committed
129
/** \class glViewer QtBaseViewer.hh <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
Jan Möbius's avatar
 
Jan Möbius committed
130

Jan Möbius's avatar
Jan Möbius committed
131 132
    Base Viewer Widget: All viewers are derived from this one. Implements
    Mouse & Keyboard Events.
Jan Möbius's avatar
 
Jan Möbius committed
133 134
 **/

Jan Möbius's avatar
 
Jan Möbius committed
135
class DLLEXPORT glViewer : public QGraphicsWidget
Jan Möbius's avatar
 
Jan Möbius committed
136 137 138 139 140 141 142 143
{
Q_OBJECT

//-------------------------------------------------------------- public methods
public:

  //--------------------------------------------------- constructor / destructor

Jan Möbius's avatar
 
Jan Möbius committed
144
  /** Create a glViewer.
Jan Möbius's avatar
Jan Möbius committed
145
   *
Jan Möbius's avatar
Jan Möbius committed
146
   * @param _scene      The graphics scene that will be the parent of this widget
Jan Möbius's avatar
Jan Möbius committed
147 148 149 150
   * @param _glWidget   A pointer to the underlying gl widget
   * @param _properties viewerOptions controlled by PluginFunctions
   * @param _parent     The parent graphicswidget
   *
Jan Möbius's avatar
 
Jan Möbius committed
151
  */
Jan Möbius's avatar
Jan Möbius committed
152
  glViewer( QGraphicsScene*           _scene,
153
            OFGLWidget*                _glWidget,
154
            Viewer::ViewerProperties& _properties,
Jan Möbius's avatar
Jan Möbius committed
155
            QGraphicsWidget*          _parent = 0 );
Jan Möbius's avatar
 
Jan Möbius committed
156 157

  /// Destructor.
Jan Möbius's avatar
 
Jan Möbius committed
158
  virtual ~glViewer();
Jan Möbius's avatar
 
Jan Möbius committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173

  //------------------------------------------------------------- public methods


  /// Makes this widget the current widget for OpenGL operations.
  virtual void makeCurrent();
  /// Swaps the screen contents with the off-screen buffer.
  virtual void swapBuffers();

  /// Lock update of projection matrix.
  void lockProjectionUpdate( void ) { projectionUpdateLocked_ = true; }

  /// Unlock update of projection matrix.
  void unlockProjectionUpdate( void ) { projectionUpdateLocked_ = false; }

174 175
  signals :
    void functionMenuUpdate();
Jan Möbius's avatar
 
Jan Möbius committed
176

177 178
    void statusMessage (const QString & message, int timeout = 0);

179
  public:
Jan Möbius's avatar
 
Jan Möbius committed
180

181 182
  /// Enable/disable mouse tracking (move events with no button press)
  void trackMouse(bool _track);
Jan Möbius's avatar
 
Jan Möbius committed
183 184 185

  /** Set scene graph.
      Sets the scene graph to the the graph rooted at \c _root.
186
      Recomputes Scene center and resets the trackball center if specified.
Jan Möbius's avatar
 
Jan Möbius committed
187 188
      The \c sceneGraphToched() signal will be emitted (even if
      \c _root does not actually change).
Jan Möbius's avatar
Jan Möbius committed
189 190
      Use the ACG::SceneGraph::analyzeSceneGraph() function to get the required
      bounding box and pass information.
Jan Möbius's avatar
Jan Möbius committed
191

Jan Möbius's avatar
Jan Möbius committed
192 193 194 195
      @param _root           The root node of the scene graph
      @param _maxPasses      The maximal number of passes required to render the scenegraph
      @param _bbmin          Lower left of the scenegraph bounding box
      @param _bbmax          Upper right of the scenegraph bounding box
Jan Möbius's avatar
Jan Möbius committed
196
      @param _resetTrackBall Reset the trackball center?
Jan Möbius's avatar
 
Jan Möbius committed
197
  */
Jan Möbius's avatar
Jan Möbius committed
198 199 200 201 202
  void sceneGraph(ACG::SceneGraph::BaseNode* _root,
                  unsigned int               _maxPasses,
                  ACG::Vec3d                 _bbmin,
                  ACG::Vec3d                 _bbmax,
                  const bool _resetTrackBall = false);
Jan Möbius's avatar
 
Jan Möbius committed
203 204 205 206 207 208 209

   /// projection mode
  enum ProjectionMode {
    ORTHOGRAPHIC_PROJECTION, //!< orthographic
    PERSPECTIVE_PROJECTION   //!< perspective
  };

210 211 212
  /// Navigation mode
  enum NavigationMode {
	  NORMAL_NAVIGATION, 	 //!< Normal mode
Mike Kremer's avatar
Mike Kremer committed
213
	  FIRSTPERSON_NAVIGATION  //!< First person mode
214 215
  };

Jan Möbius's avatar
 
Jan Möbius committed
216 217 218 219 220
  /// Changes the projection mode and updates the projection matrix.
  void projectionMode(ProjectionMode _p);
  /// get current projection mode
  ProjectionMode projectionMode() const { return projectionMode_; }

221 222 223 224
  /// Changes the navigation mode
  void navigationMode(NavigationMode _n);
  /// get current navigation mode
  NavigationMode navigationMode() const { return navigationMode_; }
Jan Möbius's avatar
 
Jan Möbius committed
225

226 227
  /** Sets the center and dimension of the whole scene.  This point is
      used as fixpoint for rotations and to set the eye point far
Jan Möbius's avatar
 
Jan Möbius committed
228 229
      enough from the scene so that the whole scene is visible.
    */
230
  void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _resetTrackBall = false );
231

Jan Möbius's avatar
 
Jan Möbius committed
232 233
  /// set the viewing direction
  void viewingDirection( const ACG::Vec3d& _dir, const ACG::Vec3d& _up );
234 235 236
  
  /// Set look at transformation directly
  void lookAt(const ACG::Vec3d& _eye, const ACG::Vec3d& _center, const ACG::Vec3d& _up);
237
  
Jan Möbius's avatar
 
Jan Möbius committed
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
  /// Automatically normalize normals?
  enum NormalsMode {
    /// use provided normals as is
    DONT_TOUCH_NORMALS,
    /** Automatically normalize normals.
        Input normals are not normalized \a or the transformation matrix
	does scaling or shearing.
     */
    NORMALIZE_NORMALS
  };

  /// set treatment of normals
  void normalsMode(NormalsMode _mode);
  /// get treatment of normals
  NormalsMode normalsMode() const { return normalsMode_; }

  /// copy current framebuffer to an QImage
  void copyToImage( QImage& _image, GLenum _buffer=GL_BACK) {
    copyToImage(_image, 0, 0, glWidth(), glHeight(), _buffer);
  }

  /// copy current framebuffer to an QImage
  void copyToImage( QImage& _image,
		    unsigned int _left,  unsigned int _top,
		    unsigned int _width, unsigned int _height,
		    GLenum _buffer );


  /// get width of QGLWidget
  unsigned int glWidth() const;
  /// get height of QGLWidget
  unsigned int glHeight() const;
  /// get size of QGLWIdget
  QSize glSize() const;
  /// map global to glarea coords
  QPoint glMapFromGlobal( const QPoint& _pos ) const;
  /// map glarea coords to global coords
  QPoint glMapToGlobal( const QPoint& _pos ) const;

277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
  double field_of_view_vertical() const;

  /// Returns the viewer's aspect ratio.
  double aspect_ratio() const {
      if (isVisible() && glWidth() && glHeight())
        return (double) glWidth() / (double) glHeight();
      else
        return 1.0;
  }

  /// Returns a chili cheese burger.
  double near_plane() const {
      return properties_.nearPlane();
  }

  /// Returns a peanut butter sandwich.
  double far_plane() const {
      return properties_.farPlane();
  }

  /// Get width of the gl scene in orthogonal projection mode
  double ortho_width() const {
      return properties_.orthoWidth();
  }

302 303
  /** convert current view to text representation
      if saved, the old window size will be written into _windowSize
304
      \note QSize(0,0) indicates that the window is maximized.
305
   */
306 307
  void encodeView(QString& _view, const QSize& _windowSize = QSize(-1,-1),
          const int _toolBarWidth = -1, const bool _make_c_string = false);
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325

  /** Decode text representation of view encoded by encodeView() into
      the supplied output parameters.

      If \c _view was successfully decoded \c true is returned, \c 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.
      \note _splitterWidth is -1 if no splitterWidth was saved
   */
  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);

Jan Möbius's avatar
 
Jan Möbius committed
326 327 328
  /** Decode and apply text representation of view encoded by encodeView().
      If \c _view was successfully decoded it will immediately be applied
      and \c true is returned, \c false is returned else.
329

Matthias Möller's avatar
Matthias Möller committed
330 331
      You can save the current Window size via parameter _windowSize and one splitter size via _splitterwidth
      These values will not be applied immediately.
332
      \note QSize(0,0) indicates that the window was maximized.
333
      \note _splitterWidth is -1 if no splitterWidth was saved
Jan Möbius's avatar
 
Jan Möbius committed
334
   */
Hans-Christian Ebke's avatar
Hans-Christian Ebke committed
335 336
  bool decodeView(const QString& _view, QSize *_windowSize = NULL,
          int* _toolBarWidth = NULL, QSize *_viewportSize = NULL);
Jan Möbius's avatar
 
Jan Möbius committed
337 338 339 340

  /// initialize modelview matrix to identity
  void initModelviewMatrix();

Jan Möbius's avatar
Jan Möbius committed
341
  /// get all Mouse & Key Events for GlWidget
Jan Möbius's avatar
 
Jan Möbius committed
342 343
  void grabGLArea();

Jan Möbius's avatar
Jan Möbius committed
344
  /// undo grabbing GLArea
Jan Möbius's avatar
 
Jan Möbius committed
345 346 347 348 349 350 351
  void releaseGLArea();

  /// translate the scene and update modelview matrix
  void translate(const ACG::Vec3d& trans);

  /// rotate the scene (around its center) and update modelview matrix
  void rotate(const ACG::Vec3d& axis, double angle)
352
  { rotate(axis, angle, properties_.trackballCenter()); }
Jan Möbius's avatar
 
Jan Möbius committed
353 354 355 356

  /// rotate the scene and update modelview matrix
  void rotate(const ACG::Vec3d& axis, double angle, const ACG::Vec3d& _center);

Jan Möbius's avatar
Dennis:  
Jan Möbius committed
357 358 359 360 361 362
  /// sets the current cursor painter
  void setCursorPainter (CursorPainter *_cursorPainter);

  /// will be called from CursorPainter to inform the viewer that the cursor position changed
  void updateCursorPosition (QPointF _scenePos);

Mike Kremer's avatar
Mike Kremer committed
363 364 365 366 367 368 369 370 371 372 373 374
  /// First person navigation: Move forward
  void moveForward();

  /// First person navigation: Move back
  void moveBack();

  /// First person navigation: Strafe left
  void strafeLeft();

  /// First person navigation: Strafe Right
  void strafeRight();

Jan Möbius's avatar
 
Jan Möbius committed
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
//---------------------------------------------------------------- public slots
public slots:

  /// Redraw scene. Triggers paint event for updating the view (cf. drawNow()).
  virtual void updateGL();

  /// set home position
  virtual void setHome();
  /// go to home pos
  virtual void home();
  /// view the whole scene
  virtual void viewAll();

  /// set perspective view (projectionMode(PERSPECTIVE_PROJECTION))
  virtual void perspectiveProjection();
  /// set orthographic view (projectionMode(ORTHOGRAPHIC_PROJECTION))
  virtual void orthographicProjection();
  /// toggle projection mode
  virtual void toggleProjectionMode();
394 395
  /// toggle navigation mode
  virtual void toggleNavigationMode();
396 397 398
  
  /// Set fovy
  virtual void setFOVY(double _fovy);
Jan Möbius's avatar
 
Jan Möbius committed
399

400 401 402
  signals:

    void projectionModeChanged( bool _ortho );
403
    void navigationModeChanged( bool _normal );
404 405

  public slots:
Jan Möbius's avatar
 
Jan Möbius committed
406 407 408 409 410

  /// set view, used for synchronizing
  virtual void setView( const ACG::GLMatrixd& _modelview,
			               const ACG::GLMatrixd& _inverse_modelview );

411
  /** you get the older window size (if saved) back
412
      \note QSize(0,0) indicates that the window is maximized.
413
      \note _splitterWidth is -1 if no splitterWidth was saved
414
   */
415
  void actionPasteView(QSize * _windowSize = NULL, int *_splitterWidth = NULL);
416 417 418
  /** if you want to save the windowSize, use the parameter
      \note QSize(0,0) indicates that the window is maximized
   */
419 420
  void actionCopyView(const QSize &_windowSize = QSize(-1,-1), const int _splitterWidth = -1,
          const bool _make_c_string = false);
421

422 423
  void actionSetView(QString view);

Jan Möbius's avatar
 
Jan Möbius committed
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
//-------------------------------------------------------------- public signals
signals:

  /** 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.<br>
      \a Notes:
      \arg You have to test for the QMouseEvent::type() of the
      event yourself (press/release/move)!
      \arg signalMouseEventIdentify() is emitted on button press if
      actionMode()==Question.
  */
  void signalMouseEvent(QMouseEvent*, const std::string&);

  /// This signal does not send the pick mode and is kept for compatibility
  void signalMouseEvent(QMouseEvent*);

  /// Emitted in Pick mode. Uses pick mode.
  void signalWheelEvent(QWheelEvent*, const std::string&);

Jan Möbius's avatar
Mike:  
Jan Möbius committed
445
  /** Emitted instead of signalMouseEvent() if actionMode()==Question
Jan Möbius's avatar
 
Jan Möbius committed
446 447 448
      and \c _event is a mouse press event.
   */
  void signalMouseEventIdentify( QMouseEvent* );
Jan Möbius's avatar
Mike:  
Jan Möbius committed
449 450 451 452 453
  
  /** Emitted instead of signalMouseEvent() if actionMode()==Light
      and \c _event is a mouse press event.
   */
  void signalMouseEventLight( QMouseEvent* );
Jan Möbius's avatar
 
Jan Möbius committed
454 455 456

  /// scene graph has changed
  void signalSceneGraphChanged(ACG::SceneGraph::BaseNode* _root);
457

458 459 460 461
  /** Emitted if a (double) mouse click is performed in actionMode()==ExamineMode
   */
  void signalMouseEventClick ( QMouseEvent*, bool _double );

Jan Möbius's avatar
 
Jan Möbius committed
462 463 464 465 466 467 468 469 470

  signals:

  /** 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.
   */
  void signalCustomContextMenuRequested ( const QPoint & );

471 472 473 474 475
  private slots:

  /// Handle click timeout
  void slotClickTimeout ();

Jan Möbius's avatar
 
Jan Möbius committed
476 477 478 479 480

//----------------------------------------------------------- protected methods
protected:

  friend class QtGLGraphicsScene;
Jan Möbius's avatar
Jan Möbius committed
481
  friend class SimpleGLGraphicsScene;
Jan Möbius's avatar
 
Jan Möbius committed
482 483
  friend class QtGLGraphicsView;

484 485

  /// Return a resonable size hint
486
  //virtual QSizeF sizeHint (Qt::SizeHint which, const QSizeF & constraint) const;
487

Jan Möbius's avatar
 
Jan Möbius committed
488 489 490
  /// initialize OpenGL states
  virtual void initializeGL();
  /// draw the scene. Triggered by updateGL().
491
  virtual void paintGL(double _aspect = 0.0);
Jan Möbius's avatar
 
Jan Möbius committed
492
  /// handle resize events
Jan Möbius's avatar
 
Jan Möbius committed
493 494 495
  virtual void resizeEvent(QGraphicsSceneResizeEvent * _e);
  /// handle move events
  virtual void moveEvent (QGraphicsSceneMoveEvent * _e);
Jan Möbius's avatar
 
Jan Möbius committed
496 497

  /// handle mouse press events
498
  virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
499
  /// handle mouse double click events
500
  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
501
  /// handle mouse move events
502
  virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
503
  /// handle mouse release events
504
  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
505
  /// handle mouse wheel events
506
  virtual void wheelEvent(QGraphicsSceneWheelEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
507
  /// handle mouse press events
Jan Möbius's avatar
 
Jan Möbius committed
508
  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* _e);
Jan Möbius's avatar
 
Jan Möbius committed
509 510 511


  /// specialized viewer: hande mouse events
512
  void viewMouseEvent( QMouseEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
513
  /// specialized viewer: handle wheel events
514
  void viewWheelEvent(QWheelEvent* _event);
515 516
  /// specialized viewer: hande key events
  void viewKeyEvent( QKeyEvent* _event);
Jan Möbius's avatar
 
Jan Möbius committed
517

Jan Möbius's avatar
Mike:  
Jan Möbius committed
518
  
Jan Möbius's avatar
 
Jan Möbius committed
519 520 521 522
  protected:


  /// updates projection matrix
523
  void updateProjectionMatrix(double _aspect = 0.0);
Jan Möbius's avatar
 
Jan Möbius committed
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539


//------------------------------------------------------------- protected slots
protected slots:

  /// process signals from wheelX_
  virtual void slotWheelX(double _dAngle);
  /// process signals from wheelX_
  virtual void slotWheelY(double _dAngle);
  /// process signals from wheelZ_
  virtual void slotWheelZ(double _dist);

  /// correct ??? (same function as in qt src)
  virtual void cleanupEventFilter()
  { removeEventFilter( sender());}

540 541 542 543 544
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
  /// process opengl debug messages
  void processGLDebugMessage(const QOpenGLDebugMessage& msg);
#endif

Jan Möbius's avatar
 
Jan Möbius committed
545 546 547 548
//----------------------------------------------------------- private functions
private:

  /// Copy constructor. Never used!
Jan Möbius's avatar
 
Jan Möbius committed
549
  glViewer(const glViewer&);
Jan Möbius's avatar
 
Jan Möbius committed
550
  /// Assignment operator. Never used!
Jan Möbius's avatar
 
Jan Möbius committed
551
  glViewer& operator=(const glViewer&);
Jan Möbius's avatar
 
Jan Möbius committed
552 553

  // create widgets
554
  void createWidgets();
Jan Möbius's avatar
 
Jan Möbius committed
555 556 557

  /* Recursively draws each node in the scene graph.
      Called by paintGL(). */
558
  void drawScene(double _aspect = 0.0);
Jan Möbius's avatar
 
Jan Möbius committed
559 560
  // helper called by drawScene().
  void drawScene_mono();
561 562
  /// helper function for setting the projection mode of the coordinate system node
  void setCoordSysProjection(glViewer::ProjectionMode _mode);
Christopher Tenter's avatar
Christopher Tenter committed
563 564
  /// draw the cursor
  void drawCursor();
565
  
566 567 568
  // start QOpenGLDebugLogger
  void startGLDebugLogger();
  void deleteGLDebugLogger();
Jan Möbius's avatar
Dennis:  
Jan Möbius committed
569

570

Jan Möbius's avatar
 
Jan Möbius committed
571 572 573 574 575
//-------------------------------------------------------------- protected data
protected:

  // helper
  bool                         isRotating_;
Mike Kremer's avatar
Mike Kremer committed
576
  bool                         lookAround_;
Jan Möbius's avatar
 
Jan Möbius committed
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593


//---------------------------------------------------------------- private data
private:


  // data stored for home view
  ACG::Vec3d                   home_center_;
  double                       home_radius_;
  ACG::GLMatrixd               home_modelview_,
                               home_inverse_modelview_;
  double                       homeOrthoWidth_;


  // modi
  NormalsMode                  normalsMode_;
  ProjectionMode               projectionMode_;
Jan Möbius's avatar
Jan Möbius committed
594
  NavigationMode               navigationMode_;
595

Jan Möbius's avatar
 
Jan Möbius committed
596 597 598 599 600 601 602 603 604 605 606 607 608

  // helper
  bool                         trackMouse_;
  bool                         glareaGrabbed_;
  double                       frame_time_;


  // scenegraph stuff
  ACG::SceneGraph::BaseNode*   sceneGraphRoot_;

  bool                         projectionUpdateLocked_;

  // graphics scene used to paint gl context and widgets
609
  QGraphicsScene* glScene_;
Jan Möbius's avatar
 
Jan Möbius committed
610

Jan Möbius's avatar
 
Jan Möbius committed
611
  // gl widget used as drawing area to paint the graphics scene
612
  OFGLWidget* glWidget_;
Jan Möbius's avatar
 
Jan Möbius committed
613

Jan Möbius's avatar
 
Jan Möbius committed
614
  // Base graphics widget layout
Jan Möbius's avatar
Jan Möbius committed
615
  QtGLViewerLayout* glBaseLayout_;
Jan Möbius's avatar
 
Jan Möbius committed
616 617 618 619 620 621 622

  // vector of current draw mode actions
  std::vector< QAction * > drawMenuActions_;

  // Used to calculate the time passed between redraws
  QTime redrawTime_;

623 624 625 626 627 628

#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
  // Get additional debug info from OpenGL
  QOpenGLDebugLogger* glDebugLogger_;
#endif

Jan Möbius's avatar
Jan Möbius committed
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
  //===========================================================================
  /** @name Wheels
   * @{ */
  //===========================================================================

  public:
    bool wheelsVisible();

  public slots:
    void slotShowWheels();
    void slotHideWheels();

  private:
    // rotate around x-axis
    ACG::QtWidgets::QtWheel* wheelX_;
    // rotate around y-axis
    ACG::QtWidgets::QtWheel* wheelY_;
    // translate along z-axis
    ACG::QtWidgets::QtWheel* wheelZ_;


  /** @} */

652 653 654 655 656
  //===========================================================================
  /** @name view handling
   * @{ */
  //===========================================================================
  signals:
657
    /// This signal is emitted when the scene is repainted due to any event.
658
    void viewUpdated();
659

660 661
    /// This signal is emitted whenever the view is changed by the user
    void viewChanged();
662

663 664 665
    /// make this widget active
    void signalMakeActive ();

Jan Möbius's avatar
Jan Möbius committed
666
  /** @} */
Jan Möbius's avatar
Jan Möbius committed
667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698
  
  
  //===========================================================================
  /** @name Projection settings
  * @{ */
    //===========================================================================
    
    public:
    /**
    * Set new center point of scene
    */
    void setSceneCenter( const ACG::Vec3d& _center ) { properties_.sceneCenter(_center); };
    
    /** \brief Set Trackball Center point of scene
    *
    * The scene is rotated around the trackball center when using the mouse
    */
    void setTrackBallCenter( const ACG::Vec3d& _center ) { properties_.trackballCenter(_center); }
    
    /** \brief Get Trackball Center point of scene
    *
    * The scene is rotated around the trackball center when using the mouse
    */
    const ACG::Vec3d trackBallCenter( ) { return properties_.trackballCenter(); };
    
    /** Get scene's center
    \see setScenePos()
    */
    const ACG::Vec3d scene_center() const { return properties_.sceneCenter(); }
    /** Get scene's radius
    */
    double scene_radius() const { return properties_.sceneRadius(); }
Marcel Campen's avatar
Marcel Campen committed
699
    
Marcel Campen's avatar
Marcel Campen committed
700
    void setSceneRadius(double _radius) { properties_.sceneRadius(_radius); }
Jan Möbius's avatar
Jan Möbius committed
701 702
  
  /** @} */
Jan Möbius's avatar
Jan Möbius committed
703

Jan Möbius's avatar
 
Jan Möbius committed
704

705
  //===========================================================================
Jan Möbius's avatar
 
Jan Möbius committed
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724
  /** @name Key handling
   * @{ */
  //===========================================================================

  signals:
    /** \brief 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.
     */
    void signalKeyPressEvent(QKeyEvent*);

  protected:

    /** \brief Get keyPress events from the glArea
     *
     * This function is called by the internal gl widget when receiving a key press event.
     */
725
    virtual void keyPressEvent(QKeyEvent* _event) { _event->ignore(); };
Jan Möbius's avatar
 
Jan Möbius committed
726 727 728 729 730 731 732

    /** \brief 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.
     *
     */
Jan Möbius's avatar
 
Jan Möbius committed
733
    virtual void keyReleaseEvent(QKeyEvent* _event) { _event->ignore(); };
Jan Möbius's avatar
 
Jan Möbius committed
734 735 736

    /** \brief Handle key events in view mode
     *
737
     * This function is called by the BaseViewer if a key press event occured in view mode.
Jan Möbius's avatar
 
Jan Möbius committed
738 739 740 741
     * This function has to be implemented by every viewer!
     *
     * @return If the derived class handled the event it has to return true otherwise false
     */
742
    virtual bool viewKeyPressEvent(QKeyEvent* /* _event */ ) { return false; }
Jan Möbius's avatar
 
Jan Möbius committed
743 744 745 746 747 748 749 750

  /** @} */

  //===========================================================================
  /** @name Drag and Drop
   * @{ */
  //===========================================================================

751
  public:
Jan Möbius's avatar
 
Jan Möbius committed
752 753

    /// drag & drop for modelview copying
Jan Möbius's avatar
 
Jan Möbius committed
754 755
    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent* _e);

Jan Möbius's avatar
 
Jan Möbius committed
756
    /// drag & drop for modelview copying
Jan Möbius's avatar
 
Jan Möbius committed
757
    virtual void dropEvent(QGraphicsSceneDragDropEvent* _e);
Jan Möbius's avatar
 
Jan Möbius committed
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789

  signals:
    /** Signal is emitted when Control modifier is pressed and mouse moded.
     * It will only be emitted if in externalDragMode ( see setExternalDrag )
     */
    void startDragEvent( QMouseEvent* _event );

    /** Signal is emitted only if in externalDragMode ( see setExternalDrag )
     * It will be send if a drag enters the gl widget.
     */
    void dragEnterEvent(QDragEnterEvent* _event);

    /** Signal is emitted only if in externalDragMode ( see setExternalDrag )
     * It will be send if a drop occurs in the gl widget.
     */
    void dropEvent( QDropEvent* _event );


  /** @} */

  //===========================================================================
  /** @name Snapshots
   * @{ */
  //===========================================================================

  public slots:


    /** Trigger a snapshot and increase the snapshot counter.
        Save snapshot to file determined by snapshotBaseFileName() and
        the current snapshot counter. The \a back buffer will be saved.
    */
790
    virtual void snapshot(int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int samples = 1);
Jan Möbius's avatar
 
Jan Möbius committed
791

Dirk Wilden's avatar
Dirk Wilden committed
792
    /// Take a snapshot and store it in the given image
793
    virtual void snapshot(QImage& _image, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int samples = 1);
Dirk Wilden's avatar
Dirk Wilden committed
794

Jan Möbius's avatar
 
Jan Möbius committed
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
  /** @} */

  //===========================================================================
  /** @name Picking
   * @{ */
  //===========================================================================
  public:
    /** Apply pick action. <br>
     *   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 \c true
     *   has been returned!<br>
     *
     * @param _pickTarget Select what should be picked: Faces/Vertices/...
     * @param _mousePos   The position to be used for picking
810
     * @param _nodeIdx    If picking is successful this will contain the id of the scenegraph node picked.
Jan Möbius's avatar
 
Jan Möbius committed
811 812
     * @param _targetIdx  Special index defined by the picked Node. E.g. Facehandle/VertexHandle/.. for MeshNodes
     * @param _hitPointPtr Pointer to 3D point from picking
813
     * @return Successful?
Jan Möbius's avatar
 
Jan Möbius committed
814 815
     */
    bool pick( ACG::SceneGraph::PickTarget _pickTarget,
816 817 818 819
               const QPoint&               _mousePos,
               size_t&                     _nodeIdx,
               size_t&                     _targetIdx,
               ACG::Vec3d*                 _hitPointPtr=0 );
Jan Möbius's avatar
 
Jan Möbius committed
820

821
  /**  \brief Perform picking action n a whole region.
Henrik Zimmer's avatar
Henrik Zimmer committed
822
     *
823
     *   Apply pick action. <br>
Henrik Zimmer's avatar
Henrik Zimmer committed
824
     *   Picks all objects in the given Region. Information about the picked primitives is stored in the
825
     *   provided list. Resulting values are defined only if \c true has been returned!
Henrik Zimmer's avatar
Henrik Zimmer committed
826 827 828 829
     *
     * @param _pickTarget Select what should be picked: Faces/Vertices/...
     * @param _region     Area for picking
     * @param _list       List of found scenegraph objects (node/target pairs)
830 831
     * @param _depths     depths [0,1] (Only provided, if requested)
     * @param _points     back projected 3d points (Only provided, if requested)
Henrik Zimmer's avatar
Henrik Zimmer committed
832 833 834 835
     * @return Successful?
     */
    bool pick_region( ACG::SceneGraph::PickTarget                _pickTarget,
                      const QRegion&                             _region,
836
                      QList<QPair<size_t,size_t> >&              _list,
837 838
                      QVector<float>*                            _depths = 0,
                      QVector<ACG::Vec3d>*                       _points = 0);
Henrik Zimmer's avatar
Henrik Zimmer committed
839 840


Jan Möbius's avatar
 
Jan Möbius committed
841 842 843
    /** get the coordinates of the picked point by z-buffer re-projection
     * @param _mousePos The position to pick
     * @param _hitPoint The point returned by the reprojection
844
     * @return Successful?
Jan Möbius's avatar
 
Jan Möbius committed
845 846 847 848
     */
    bool fast_pick( const QPoint&  _mousePos,
                    ACG::Vec3d&    _hitPoint );

849 850 851 852
    ACG::Vec3d unproject(const ACG::Vec3d &pt) {
        return glstate_->unproject(pt);
    }

Jan Möbius's avatar
 
Jan Möbius committed
853 854
  private:

Jan Möbius's avatar
Dennis:  
Jan Möbius committed
855 856 857
    /// pick using colors
    int pickColor( ACG::SceneGraph::PickTarget _pickTarget,
                   const QPoint& _mousePos,
858 859
                   size_t& _nodeIdx,
                   size_t& _targetIdx,
Jan Möbius's avatar
Dennis:  
Jan Möbius committed
860 861
                   ACG::Vec3d*   _hitPointPtr=0 );

Jan Möbius's avatar
Jan Möbius committed
862 863 864
    /// pick from cache
    int pickFromCache( ACG::SceneGraph::PickTarget _pickTarget,
                       const QPoint& _mousePos,
865 866
                       size_t& _nodeIdx,
                       size_t& _targetIdx,
Jan Möbius's avatar
Jan Möbius committed
867 868 869 870
                       ACG::Vec3d*   _hitPointPtr=0 );

  private:

871
#if QT_VERSION < 0x050000
872 873
    typedef QGLFramebufferObjectFormat QFramebufferObjectFormat;
    typedef QGLFramebufferObject QFramebufferObject;
874
#else
875 876
    typedef QOpenGLFramebufferObjectFormat QFramebufferObjectFormat;
    typedef QOpenGLFramebufferObject QFramebufferObject;
877 878
#endif

Jan Möbius's avatar
Jan Möbius committed
879
    /// Framebuffer object that holds the pick cache
880
    QFramebufferObject* pickCache_;
Jan Möbius's avatar
Jan Möbius committed
881 882 883 884

    /// Should the pick cache be updated
    bool updatePickCache_;

885 886 887
    /// Pick target stored in pick cache
    ACG::SceneGraph::PickTarget pickCacheTarget_;

Jan Möbius's avatar
Jan Möbius committed
888 889 890
    /// Is pick caching supported
    bool pickCacheSupported_;

Jan Möbius's avatar
 
Jan Möbius committed
891
  /** @} */
892 893 894 895 896 897 898 899 900 901

  //===========================================================================
  /** @name Merge from examiner
   * @{ */
  //===========================================================================

  public:

  /// Lock scene rotation
  void allowRotation( bool _mode ) { allowRotation_ = _mode; };
902
  bool allowRotation() { return allowRotation_; };
903

904 905 906 907 908 909 910 911 912 913 914 915
  void allowConstrainedRotation(const ACG::Vec3d &axis) {
      constrainedRotationAxis_ = axis;
  }
  bool allowConstrainedRotation() {
      return constrainedRotationAxis_[0] == constrainedRotationAxis_[0];
  }
  const ACG::Vec3d &getConstrainedRotationAxis() {
      return constrainedRotationAxis_;
  }
  void disallowConstrainedRotation() {
      constrainedRotationAxis_[0] = std::numeric_limits<double>::quiet_NaN();
  }
916 917 918
  void invalidatePickCache() {
      updatePickCache_ = true;
  }
919

920 921 922 923 924 925
  private slots:

    void slotAnimation();

  protected:

926 927 928 929
    /** \brief mouse interaction position
    *
    * This variable stores the last mouse position during mouse interaction.
    */
930
    QPoint   lastPoint2D_;
931 932 933 934 935 936
    
    /** \brief mouse interaction depth
    *
    * This variable stores the depth when the user started a mouse interaction.
    */
    float startDepth_;
937 938 939 940 941 942

  private:

    /// virtual trackball: map 2D screen point to unit sphere
    bool mapToSphere(const QPoint& _p, ACG::Vec3d& _result) const;

Mike Kremer's avatar
Mike Kremer committed
943
    /// Navigate through scene if first person mode has been selected
Jan Möbius's avatar
Jan Möbius committed
944
    void handleFirstPersonNavigation( QMouseEvent* _event);
945 946

    /// Navigate through scene if normal mode has been selected
Jan Möbius's avatar
Jan Möbius committed
947
    void handleNormalNavigation( QMouseEvent* _event);
948

949 950 951 952 953 954 955 956

    // mouse interaction
    ACG::Vec3d    lastPoint3D_;
    bool          lastPoint_hitSphere_;
    bool          allowRotation_;

    // animation stuff
    ACG::Vec3d                   lastRotationAxis_;
957
    ACG::Vec3d                   constrainedRotationAxis_;
958 959 960
    double                       lastRotationAngle_;
    QTime                        lastMoveTime_;
    QTimer*                      timer_;
961
    double                       fovyModifier_;
962

963 964 965 966
    QTimer                       clickTimer_;
    QTime                        clickTime_;
    QMouseEvent                  clickEvent_;

967

968
    /** @} */
Jan Möbius's avatar
 
Jan Möbius committed
969 970 971 972 973 974 975 976

  //===========================================================================
  /** @name Viewer State
   * @{ */
  //===========================================================================

  public:
    /// Returns a pointer to the Viewer Status
977 978
    Viewer::ViewerProperties* properties() { return &properties_; };
    const Viewer::ViewerProperties* properties() const { return &properties_; };
Jan Möbius's avatar
 
Jan Möbius committed
979 980

  private:
981
    /// All properties for this viewer
Dirk Wilden's avatar
Dirk Wilden committed
982
    Viewer::ViewerProperties& properties_;
Jan Möbius's avatar
 
Jan Möbius committed
983

984 985 986
    /// Gl State
    ACG::GLState                 *glstate_;

987 988 989
    /// Have the viewer gl properties been initalized
    bool initialized_;

Jan Möbius's avatar
 
Jan Möbius committed
990
  private slots:
991 992 993
    /** Called when properties for the viewer require a redraw
     * The slot will trigger the redraw after setting the right properties.
     */
Jan Möbius's avatar
 
Jan Möbius committed
994 995
    void slotPropertiesUpdated();

996 997 998 999 1000 1001
  private:
    /** This will apply all properties without redrawing
     *  You have to set the context yourself!
     */
    void applyProperties();

Jan Möbius's avatar
 
Jan Möbius committed
1002
  /** @} */
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045

  //===========================================================================
  /** @name Flying animation properties
    * @{ */
  //===========================================================================
  public slots:

    /** \brief Animated flight to or away from a given point
     *
     * Animated flight to or away from a given point.
     *
     * @param _pos Point defining direction of flight (eye-point)
     * @param _moveBack  To or away from point?
     */
    virtual void flyTo(const QPoint& _pos, bool _moveBack);

    /** \brief Animated flight
     *
     * Animated flight into the direction of the given point.
     *
     */
    virtual void flyTo(const QPoint& _pos) { flyTo(_pos,false); }


    /** \brief Animated flight
     *
     * Animated flight away from the given point.
     *
     */
    virtual void flyFrom(const QPoint& _pos) { flyTo(_pos,true); }

    /**  Fly to point and set new viewing direction (animated).
     * @param _position New viewer position ( the new eye point of the viewer )
     * @param _center   The new scene center ( the point we are looking at )
     * @param _time     Animation time in ms
     */
    virtual void flyTo(const ACG::Vec3d& _position,
                       const ACG::Vec3d& _center,
                       int               _time = 1000);

  private:

    /// The animation object for flyTo
Jan Möbius's avatar
Jan Möbius committed
1046 1047
    QPropertyAnimation* flyAnimationPerspective_;
    QPropertyAnimation* flyAnimationOrthogonal_;
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101

    /// Full translation between start and ed of animation
    ACG::Vec3d flyTranslation_;

    /// The rotation axis for fly to animation
    ACG::Vec3d flyAxis_;

    /// The rotation angle (full angle) for fly to animation
    double     flyAngle_;

    /// The last position of the animation to compute the difference vector
    double     lastAnimationPos_;

    Q_PROPERTY(double currentAnimationPosition READ currentAnimationPos WRITE currentAnimationPos NOTIFY currentAnimationPosChanged)

    /// The property that is animated by flyTo
    double     currentAnimationPos_;

    /// Getter for aflyToAnimationPosition
    double currentAnimationPos() {return currentAnimationPos_;};

    /// Setter for aflyToAnimationPosition
    void   currentAnimationPos(double _currentAnimationPos) {currentAnimationPos_ = _currentAnimationPos; emit currentAnimationPosChanged(_currentAnimationPos); };

    /// The new center after the flyTo animation
    ACG::Vec3d flyCenter_;

    /// The new position after the flyTo animation
    ACG::Vec3d flyPosition_;

    /// Original orthogonal width during flyTo in orthogonal mode
    double flyOrthoWidthOriginal_;

    /// Flag for fly in orthogonal mode if we move back or forward
    bool flyMoveBack_;

  signals:
    /// Emitted when the currentAnimationPosition changed
    void currentAnimationPosChanged(double _currentAnimationPos);

  private slots:
    /// Slot called during flyTo Animation in perspective mode
    void flyAnimationPerspective(QVariant _pos);

    /// Slot called during flyTo Animation in orthogonal mode
    void flyAnimationOrthogonal(QVariant _pos);

    /// Slot called when flyTo perspective Animation finished
    void flyAnimationPerspectiveFinished();

    /// Slot called when flyTo orthogonal Animation finished
    void flyAnimationOrthogonalFinished();

  /** @} */
Jan Möbius's avatar
Jan Möbius committed
1102 1103 1104



Christopher Tenter's avatar
Christopher Tenter committed
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
  //===========================================================================
  /** @name Stereo rendering
    * @{ */
  //===========================================================================

private:

  /** \brief Compute left and right eye projection matrix for stereo rendering
   *
   * @param _width  viewport width
   * @param _height viewport height
   * @param _properties viewer props
   * @param _outLeft [out] projection matrix for left eye
   * @param _outRight [out] projection matrix for right eye
   */
  void computeProjStereo(int _width, int _height,
    Viewer::ViewerProperties& _properties,
    ACG::GLMatrixd* _outLeft, ACG::GLMatrixd* _outRight);

  /** @} */

Jan Möbius's avatar
Jan Möbius committed
1126 1127 1128 1129 1130 1131 1132 1133 1134

  //===========================================================================
  /** @name Post Processing
    * @{ */
  //===========================================================================

private:


Christopher Tenter's avatar
Christopher Tenter committed
1135 1136
  /// Post-Processing executor
  PostProcessing* postproc_;
Jan Möbius's avatar
Jan Möbius committed
1137 1138 1139 1140


  /** @} */

Jan Möbius's avatar
 
Jan Möbius committed
1141 1142 1143 1144 1145
};


//=============================================================================
//=============================================================================
Jan Möbius's avatar
Jan Möbius committed
1146
#endif // BASEVIEWER_HH defined
Jan Möbius's avatar
 
Jan Möbius committed
1147
//=============================================================================