RayQuery.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 GAZEBO_RENDERING_RAYQUERY_HH_
18 #define GAZEBO_RENDERING_RAYQUERY_HH_
19 
20 #include <memory>
21 #include <vector>
22 #include <ignition/math/Triangle3.hh>
23 #include <ignition/math/Vector3.hh>
24 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
32  namespace rendering
33  {
34  class RayQueryPrivate;
35 
38 
42  class GZ_RENDERING_VISIBLE RayQuery
43  {
46  public: explicit RayQuery(CameraPtr _camera);
47 
49  public: ~RayQuery();
50 
57  public: bool SelectMeshTriangle(const int _x, const int _y,
58  const VisualPtr &_visual,
59  ignition::math::Vector3d &_intersect,
60  ignition::math::Triangle3d &_triangle) const;
61 
65  private: void MeshVisuals(const rendering::VisualPtr _visual,
66  std::vector<rendering::VisualPtr> &_visuals) const;
67 
70  private: std::unique_ptr<RayQueryPrivate> dataPtr;
71  };
73  }
74 }
75 #endif
A Ray Query class used for retrieving mesh data of a visual, adapted from Ogre3D wiki.
Definition: RayQuery.hh:42
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90