All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WindowManager.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _WINDOWMANAGER_HH_
18 #define _WINDOWMANAGER_HH_
19 
20 #include <string>
21 #include <vector>
22 
23 #include "common/SingletonT.hh"
24 #include "rendering/RenderTypes.hh"
25 
26 namespace Ogre
27 {
28  class RenderWindow;
29 }
30 
31 namespace gazebo
32 {
33  namespace rendering
34  {
37 
40  class WindowManager : public SingletonT<WindowManager>
41  {
43  private: WindowManager();
44 
46  private: virtual ~WindowManager();
47 
49  public: void Fini();
50 
55  public: int CreateWindow(const std::string &_ogreHandle,
56  uint32_t _width,
57  uint32_t _height);
58 
62  public: void SetCamera(int _windowId, CameraPtr _camera);
63 
68  public: void Resize(uint32_t _id, int _width, int _height);
69 
72  public: void Moved(uint32_t _id);
73 
77  public: float GetAvgFPS(uint32_t _id);
78 
82  public: uint32_t GetTriangleCount(uint32_t _id);
83 
87  public: Ogre::RenderWindow *GetWindow(uint32_t _id);
88 
90  private: std::vector<Ogre::RenderWindow *> windows;
91 
93  private: static uint32_t windowCounter;
94 
96  private: friend class SingletonT<WindowManager>;
97  };
99  }
100 }
101 #endif
102 
103