Frapper  1.0a
OgreManager.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 OGREMANAGER_H
35 #define OGREMANAGER_H
36 
37 
38 #include "FrapperPrerequisites.h"
39 #include "Ogre.h"
40 #include <QtCore/QString>
41 #include <QtCore/QMap>
42 #include <QtGui/QColor>
43 
44 namespace Frapper {
45 
50 {
51 
52 private: // type definitions
53 
54 
55 public: // static functions
56 
66  static Ogre::RenderWindow * createRenderWindow ( const Ogre::String &name = "OGRE Render Window", int width = 800, int height = 600, const Ogre::NameValuePairList *miscParams = 0 );
67 
71  static void execConfigDialog ();
72 
76  static void initialize ( const Ogre::String &pluginFileName = "config/plugins.cfg", const Ogre::String &configFileName = "config/ogre.cfg", const Ogre::String &resourceFileName = "config/resources.cfg", const Ogre::String &logFileName = "logs/ogre.log" );
77 
81  static void finalize ();
82 
88  static Ogre::Root * getRoot ();
89 
95  static Ogre::SceneManager * getSceneManager ();
96 
104  static Ogre::SceneNode * createSceneNode ( const QString &name );
105 
112  static void deleteSceneNode ( Ogre::SceneNode *sceneNode );
113 
120  static Ogre::SceneNode* relocateSceneNode ( Ogre::SceneNode *sceneNode, Ogre::SceneNode *newParent );
121 
128  static void deleteAttachedObjects( Ogre::SceneNode* sceneNode );
129 
135  static bool isFullscreen ();
136 
140  static void setFullscreen ( bool fullscreen );
141 
147  static Ogre::String getRenderSystemName ( );
148 
155  static Ogre::ColourValue convertColor ( const QColor &color );
156 
163  static void unloadResource ( Ogre::ResourceManager *resMgr, const std::string &resourceName );
164 
172  static void loadResource ( Ogre::ResourceManager *resMgr, const std::string &resourceName, const std::string &resourceGroup );
173 
179  static void unloadMaterials ( const std::string &filename );
180 
186  static void unloadVertexPrograms ( const std::string &filename );
187 
193  static void unloadFragmentPrograms ( const std::string &filename );
194 
203  static void reloadMaterial ( const std::string &materialName, const std::string &groupName, const std::string &filename, bool parseMaterialScript );
204 
205 private: // static data
206 
210  static Ogre::Root *s_root;
211 
215  static Ogre::SceneManager *s_sceneManager;
216 
220  static bool s_initialized;
221 
225  static bool s_fullscreen;
226 
230  static Ogre::String s_rendersystemName;
231 
232 };
233 
234 } // end namespace Frapper
235 
236 #endif