All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SelectionBuffer.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 _SELECTIONBUFFER_HH_
18 #define _SELECTIONBUFFER_HH_
19 
20 #include <string>
21 #include "gazebo/util/system.hh"
22 
23 namespace Ogre
24 {
25  class SceneManager;
26  class Camera;
27  class RenderTarget;
28  class RenderTexture;
29  class PixelBox;
30  class Overlay;
31 }
32 
33 namespace gazebo
34 {
35  namespace rendering
36  {
37  class MaterialSwitcher;
38  class SelectionRenderListener;
39  class Scene;
40 
42  {
48  public: SelectionBuffer(const std::string &_cameraName,
49  Ogre::SceneManager *_mgr, Ogre::RenderTarget *_renderTarget);
50 
52  public: ~SelectionBuffer();
53 
58  public: Ogre::Entity *OnSelectionClick(int _x, int _y);
59 
62  public: void ShowOverlay(bool _show);
63 
65  public: void Update();
66 
68  private: void DeleteRTTBuffer();
69 
71  private: void CreateRTTBuffer();
72 
74  private: void CreateRTTOverlays();
75 
77  private: void UpdateBufferSize();
78 
82  private: MaterialSwitcher *materialSwitchListener;
83 
84  private: SelectionRenderListener *selectionTargetListener;
85 
86  private: Ogre::SceneManager *sceneMgr;
87  private: Ogre::Camera *camera;
88  private: Ogre::RenderTarget *renderTarget;
89  private: Ogre::TexturePtr texture;
90  private: Ogre::RenderTexture *renderTexture;
91  private: uint8_t *buffer;
92  private: Ogre::PixelBox *pixelBox;
93  private: Ogre::Overlay *selectionDebugOverlay;
94  };
95  }
96 }
97 #endif
Definition: SelectionRenderListener.hh:32
Definition: MaterialSwitcher.hh:40
Definition: SelectionBuffer.hh:41
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48