Carna  Version 3.3.2
ProjectionControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef PROJECTIONCONTROL_H_6014714286
13 #define PROJECTIONCONTROL_H_6014714286
14 
15 #include <Carna/Carna.h>
16 #include <Carna/base/math.h>
17 #include <memory>
18 
23 namespace Carna
24 {
25 
26 namespace base
27 {
28 
29 
30 
31 // ----------------------------------------------------------------------------------
32 // ProjectionControl
33 // ----------------------------------------------------------------------------------
34 
41 class CARNA_LIB ProjectionControl
42 {
43 
45 
46  struct Details;
47  const std::unique_ptr< Details > pimpl;
48 
49 public:
50 
56 
62 
67 
71  virtual ~ProjectionControl();
72 
79  void setViewportWidth( unsigned int width );
80 
87  void setViewportHeight( unsigned int height );
88 
93  unsigned int viewportWidth() const;
94 
99  unsigned int viewportHeight() const;
100 
107  void setMinimumVisibleDistance( float minimumVisibleDistance );
108 
115  void setMaximumVisibleDistance( float maximumVisibleDistance );
116 
120  float minimumVisibleDistance() const;
121 
125  float maximumVisibleDistance() const;
126 
130  virtual void updateProjection( math::Matrix4f& projectionMatrix ) const = 0;
131 
137  bool isUpdateAvailable() const;
138 
139 protected:
140 
144  void invalidateProjection();
145 
149  void setProjectionValidated() const;
150 
151 }; // ProjectionControl
152 
153 
154 
155 } // namespace Carna :: base
156 
157 } // namespace Carna
158 
159 
160 
161 #endif // PROJECTIONCONTROL_H_6014714286
162 
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
static const float DEFAULT_MAXIMUM_VISIBLE_DISTANCE
Holds default far clipping plane distance that should be used by updateProjection.
Controls projection matrices.
static const float DEFAULT_MINIMUM_VISIBLE_DISTANCE
Holds default near clipping plane distance that should be used by updateProjection.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
#define NON_COPYABLE
Features class it is placed in as non-copyable.
Definition: noncopyable.h:109