Gazebo Rendering

API Reference

9.0.0
Ogre2SelectionBuffer.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 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 GZ_RENDERING_OGRE2_OGRE2SELECTIONBUFFER_HH_
18#define GZ_RENDERING_OGRE2_OGRE2SELECTIONBUFFER_HH_
19
20#include <memory>
21#include <string>
22
23#include "gz/rendering/config.hh"
24#include "gz/rendering/ogre2/Export.hh"
25
26namespace Ogre
27{
28 class Item;
29 class RenderTarget;
30 class SceneManager;
31}
32
33namespace gz
34{
35 namespace rendering
36 {
37 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
38 //
39 // forward declaration
40 struct Ogre2SelectionBufferPrivate;
41
47 class GZ_RENDERING_OGRE2_VISIBLE Ogre2SelectionBuffer
48 {
55 public: Ogre2SelectionBuffer(const std::string &_cameraName,
56 Ogre2ScenePtr _scene, unsigned int _width,
57 unsigned int _height);
58
61
66 public: Ogre::MovableObject *OnSelectionClick(int _x, int _y);
67
75 public: bool GZ_DEPRECATED(9) ExecuteQuery(const int _x, const int _y,
76 Ogre::Item *&_item, math::Vector3d &_point);
77
85 public: bool ExecuteQuery(int _x, int _y,
86 Ogre::MovableObject *&_obj, math::Vector3d &_point);
87
91 public: void SetDimensions(unsigned int _width, unsigned int _height);
92
94 public: void Update();
95
97 private: void DeleteRTTBuffer();
98
100 private: void CreateRTTBuffer();
101
103 // private: void CreateRTTOverlays();
104
107 private: std::unique_ptr<Ogre2SelectionBufferPrivate> dataPtr;
108 };
109 }
110 }
111}
112#endif