Frapper  1.0a
StereoCameraNode.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-2010 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 STEREOCAMERANODE_H
36 #define STEREOCAMERANODE_H
37 
38 #include "ImageNode.h"
39 #include "OgreTools.h"
40 
41 // OGRE
42 #include <Ogre.h>
43 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
44 #include <windows.h>
45 #endif
46 
47 namespace StereoCameraNode {
48 using namespace Frapper;
49 
57 {
58 
59  Q_OBJECT
60 
61 protected: // static constants
62 
66  static const QString BackgroundColorParameterName;
67 
71  static const int DefaultRenderWidth = 1200;
72 
76  static const int DefaultRenderHeight = 720;
77 
81  static float DefaultGamma;
82 
86  static QStringList resLiterals;
87 
91  static QStringList resValues;
92 
96  static const QString InputGeometryParameterName;
97 
101  static const QString InputLightsParameterName;
102 
106  static const QString InputCameraParameterName;
107 
111  static const QString CameraLightToggleParameterName;
112 
113 
114 public: // constructors and destructors
115 
122  StereoCameraNode ( const QString &name, ParameterGroup *parameterRoot );
123 
131  virtual ~StereoCameraNode ();
132 
133 public: // methods
134 
140  unsigned int getWidth() const;
141 
147  unsigned int getHeight() const;
148 
149 
150 public slots: //
151 
155  virtual void redrawLeftTriggered ();
156  virtual void redrawRightTriggered ();
157 
158 
159 protected: // methods
160 
166  void initializeRenderTargets( Ogre::ColourValue bkColor = Ogre::ColourValue(0,0,0), Ogre::PixelFormat format = Ogre::PF_R8G8B8, bool clearFrame = true);
167 
171  void finalizeRenderTargets();
172 
176  void removeRenderTexture(Ogre::TexturePtr &texture);
177 
178 
179 protected: // data
180 
184  Ogre::SceneManager *m_sceneManager;
185 
186 
190  Ogre::Viewport *m_viewportL, *m_viewportR;
191 
192 
196  Ogre::TexturePtr m_renderTextureL, m_renderTextureR;
197 
201  Ogre::String m_renderTextureNameL, m_renderTextureNameR;
202 
207 
212 
217 
221  Ogre::TexturePtr m_defaultTexture;
222 
223 };
224 } // namespace StereoCameraNode
225 
226 #endif