WindowManager.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 _GAZEBO_RENDERING_WINDOWMANAGER_HH_
18 #define _GAZEBO_RENDERING_WINDOWMANAGER_HH_
19 
20 #ifdef _WIN32
21  // Oh, yeah, CreateWindow is taken, too.
22  #include <windows.h>
23  #undef CreateWindow
24 #endif
25 
26 #include <memory>
27 #include <string>
28 
30 #include "gazebo/util/system.hh"
31 
32 namespace Ogre
33 {
34  class RenderWindow;
35 }
36 
37 namespace gazebo
38 {
39  namespace rendering
40  {
41  // Forward declare private data.
42  class WindowManagerPrivate;
43 
46 
49  class GZ_RENDERING_VISIBLE WindowManager
50  {
52  public: WindowManager();
53 
55  public: virtual ~WindowManager();
56 
58  public: void Fini();
59 
65  public: int CreateWindow(const std::string &_ogreHandle,
66  uint32_t _width,
67  uint32_t _height,
68  const double _devicePixelRatio = 1.0);
69 
73  public: void SetCamera(int _windowId, CameraPtr _camera);
74 
79  public: void Resize(uint32_t _id, int _width, int _height);
80 
83  public: void Moved(uint32_t _id);
84 
88  public: float AvgFPS(const uint32_t _id) const;
89 
93  public: uint32_t TriangleCount(const uint32_t _id) const;
94 
98  public: Ogre::RenderWindow *Window(const uint32_t _id) const;
99 
102  private: std::unique_ptr<WindowManagerPrivate> dataPtr;
103  };
105  }
106 }
107 #endif
Forward declarations for the common classes.
Definition: Animation.hh:26
Class to mangage render windows.
Definition: WindowManager.hh:49
Definition: JointMaker.hh:39
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90