MorphoGraphX  2.0-1-227
MGXCamera.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2016 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef MGX_CAMERA_HPP
12 #define MGX_CAMERA_HPP
13 
14 #include <MGXViewer/manipulatedCameraFrame.h>
15 #include <MGXViewer/camera.h>
16 
17 // This class is overloaded so that the zoom behavior can be modified.
18 // In libqglviewer you cannot zoom very close, you jsut move through the
19 // surface.
20 //
22 public:
24 
25  void wheelEvent(QWheelEvent* const event, qglviewer::Camera* const camera);
26 
27  float zoom() const { return _zoom; }
28  void setZoom(float z) { _zoom = z; }
29 
30 protected:
31  float _zoom;
32 };
33 
35 {
36 public:
37  MGXCamera();
38 
39  void getOrthoWidthHeight(GLdouble& halfWidth, GLdouble& halfHeight) const;
40  void resetZoom();
41  void fitSphere(const qglviewer::Vec& center, float radius);
42  virtual void addKeyFrameToPath(int i);
43  virtual void playPath(int i);
44  virtual void deletePath(int i);
45  virtual void resetPath(int i);
46  virtual void drawAllPaths();
47 
48  float zoom() const { return _frame->zoom(); }
49  void setZoom(float z) { _frame->setZoom(z); }
50  MGXCameraFrame* frame() { return _frame; }
51  const MGXCameraFrame* frame() const { return _frame; }
52 
53 protected:
55 };
56 
57 #endif
58 
MGXCamera::resetZoom
void resetZoom()
MGXCamera::deletePath
virtual void deletePath(int i)
MGXCameraFrame::wheelEvent
void wheelEvent(QWheelEvent *const event, qglviewer::Camera *const camera)
MGXCamera::zoom
float zoom() const
Definition: MGXCamera.hpp:48
MGXCameraFrame
Definition: MGXCamera.hpp:21
MGXCameraFrame::setZoom
void setZoom(float z)
Definition: MGXCamera.hpp:28
MGXCamera::drawAllPaths
virtual void drawAllPaths()
MGXCamera::getOrthoWidthHeight
void getOrthoWidthHeight(GLdouble &halfWidth, GLdouble &halfHeight) const
qglviewer::Vec
MGXCamera::_frame
MGXCameraFrame * _frame
Definition: MGXCamera.hpp:54
MGXCamera::MGXCamera
MGXCamera()
MGXCamera::fitSphere
void fitSphere(const qglviewer::Vec &center, float radius)
MGXCamera::addKeyFrameToPath
virtual void addKeyFrameToPath(int i)
MGXCamera::playPath
virtual void playPath(int i)
MGXCameraFrame::zoom
float zoom() const
Definition: MGXCamera.hpp:27
MGXCameraFrame::MGXCameraFrame
MGXCameraFrame()
MGXCameraFrame::_zoom
float _zoom
Definition: MGXCamera.hpp:31
MGXCamera::setZoom
void setZoom(float z)
Definition: MGXCamera.hpp:49
MGXCamera
Definition: MGXCamera.hpp:34
MGXCamera::frame
MGXCameraFrame * frame()
Definition: MGXCamera.hpp:50
MGXCamera::frame
const MGXCameraFrame * frame() const
Definition: MGXCamera.hpp:51
qglviewer::ManipulatedCameraFrame
qglviewer::Camera
MGXCamera::resetPath
virtual void resetPath(int i)