Frapper  1.0a
OgreContainer.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; version 2.1 of the License.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
21 -----------------------------------------------------------------------------
22 */
23 
33 
34 #ifndef OGRECONTAINER_H
35 #define OGRECONTAINER_H
36 
37 #include "FrapperPrerequisites.h"
38 #include "ParameterGroup.h"
39 #include "NumberParameter.h"
40 #include <QtCore/QObject>
41 #include "InstanceCounterMacros.h"
42 #include <Ogre.h>
43 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
44 #include <windows.h>
45 #endif
46 
47 namespace Frapper {
48 
53 class FRAPPER_CORE_EXPORT OgreContainer : public QObject
54 {
55 
56  Q_OBJECT
58 
59 public: // constructors and destructors
60 
66  OgreContainer ( Ogre::SceneNode *sceneNode );
67 
73  OgreContainer ( Ogre::Entity *entity );
74 
80  OgreContainer ( Ogre::ManualObject *manualObject );
81 
87  OgreContainer ( Ogre::Light *light );
88 
94  OgreContainer ( Ogre::Camera *camera );
95 
99  ~OgreContainer ();
100 
101 public: // functions
102 
108  Ogre::SceneNode * getSceneNode ();
109 
115  void setSceneNode ( Ogre::SceneNode *sceneNode );
116 
122  Ogre::Entity * getEntity ();
123 
129  void setEntity ( Ogre::Entity *entity );
130 
136  Ogre::ManualObject* getManualObject ();
137 
143  void setManualObject ( Ogre::ManualObject *manualObject );
144 
150  Ogre::Light * getLight ();
151 
157  void setLight ( Ogre::Light *light );
158 
164  Ogre::Camera * getCamera ();
165 
171  void setCamera ( Ogre::Camera *camera );
172 
177  void updateCopies ();
178 
186  void updateCopies ( const QString &name, double progress, float weight );
187 
194  void updateCopies ( ParameterGroup* vertexBufferGroup );
195 
208  void updateCopies ( const QString &name,
209  const float &tx, const float &ty, const float &tz,
210  const float &rx, const float &ry, const float &rz );
211 
219  void updateCopies ( const QString &name, float &tx );
220 
221 signals: //
222 
227  void sceneNodeUpdated ();
228 
236  void animationStateUpdated ( const QString &name, double progress, float weight );
237 
250  void boneTransformUpdated ( const QString &name,
251  const float &tx, const float &ty, const float &tz,
252  const float &rx, const float &ry, const float &rz );
253 
260  void vertexBufferUpdated( ParameterGroup* vertexBufferGroup );
261 
262  public slots: //
263 
268  void updateSceneNode ();
269 
274  void updateCamera ();
275 
280  void updateLight ();
281 
289  void updateAnimationState ( const QString &name, double progress, float weight = 1.0 );
290 
303  void updateBoneTransform ( const QString &name,
304  const float &tx, const float &ty, const float &tz,
305  const float &rx, const float &ry, const float &rz );
306 
311  void updateVertexBuffer ( ParameterGroup* vertexBufferGroup );
312 
313 private: // data
314 
319 
323  Ogre::Entity *m_entity;
324 
328  Ogre::ManualObject *m_manualObject;
329 
333  Ogre::Light *m_light;
334 
338  Ogre::Camera *m_camera;
339 
340 };
341 
342 } // end namespace Frapper
343 
344 #endif