WindowManager.hh
00001 /*
00002  * Copyright 2011 Nate Koenig & Andrew Howard
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  *
00016 */
00017 #ifndef WINDOWMANAGER_HH
00018 #define WINDOWMANAGER_HH
00019 
00020 #include "common/SingletonT.hh"
00021 #include "rendering/RenderTypes.hh"
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 namespace Ogre
00027 {
00028   class RenderWindow;
00029 }
00030 
00031 namespace gazebo
00032 {
00033     namespace rendering
00034   {
00037 
00039     class WindowManager : public SingletonT<WindowManager>
00040     {
00041       public: WindowManager();
00042       public: virtual ~WindowManager();
00043 
00045       public: void Fini();
00046  
00047       public: int CreateWindow( std::string ogreHandle, 
00048                                 unsigned int width, 
00049                                 unsigned int height );
00050   
00051       public: void GetAttribute(unsigned int id, 
00052                   const std::string &attr, void *data);
00053   
00055       public: void SetCamera( int windowId, CameraPtr camera);
00056   
00058       public: void Resize(unsigned int id, int width, int height);
00059   
00060       public: void Moved(unsigned int id);
00061 
00063       public: float GetAvgFPS(unsigned int windowId);
00064   
00066       public: unsigned int GetTriangleCount(unsigned int windotId);
00067  
00068       private: std::vector<Ogre::RenderWindow *> windows;
00069   
00070       private: static unsigned int windowCounter;
00071   
00072       private: friend class SingletonT<WindowManager>;
00073     };
00075   }
00076 }
00077 #endif