Frapper  1.0a
CameraNode.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
12 version.
13 
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License along with
19 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21 http://www.gnu.org/copyleft/lesser.txt.
22 -----------------------------------------------------------------------------
23 */
24 
34 
35 #ifndef CAMERANODE_H
36 #define CAMERANODE_H
37 
38 #include "ViewNode.h"
39 #include "OgreContainer.h"
40 #include "InstanceCounterMacros.h"
41 
42 // OGRE
43 #include <Ogre.h>
44 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
45 #include <windows.h>
46 #endif
47 
48 namespace CameraNode {
49 using namespace Frapper;
50 
54 class CameraNode : public ViewNode
55 {
56 
57  Q_OBJECT
59 
60 public: // constructors and destructors
61 
68  CameraNode ( const QString &name, ParameterGroup *parameterRoot );
69 
77  virtual ~CameraNode ();
78 
79 public: // functions
80 
87  virtual Ogre::SceneNode * getSceneNode ();
88 
89 private: // functions
90 
95  void checkForPreset ();
96 
102  void updateDependentOutputParameters ();
103 
107  virtual void loadReady ();
108 
113  void applyPosition ( QString positionParameter = "Position");
114 
119  void applyOrientation ( QString orientationParameter = "Orientation");
120 
121 private slots: //
122 
127  void updateTransform ();
128 
136  void renderResolutionPresetChanged ();
137 
143  void renderWidthChanged ();
144 
150  void renderHeightChanged ();
151 
157  void focalLengthChanged ();
158 
164  void fieldOfViewChanged ();
165 
172  void horizontalApertureChanged ();
173 
180  void nearClippingPlaneChanged ();
181 
188  void farClippingPlaneChanged ();
189 
190 protected: // data
191 
195  QVariantList m_ptMatList;
196 
200  QVariantList m_wMatList;
201 
202 private: // data
203 
207  Ogre::SceneManager *m_sceneManager;
208 
213 
218 
222  Ogre::Camera *m_camera;
223 
227  Ogre::Entity *m_entity;
228 
233 
239 
240 };
241 } // namespace CameraNode
242 
243 #endif