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 {
30  namespace math
31  {
32  class Vector3;
33  }
34 
37  namespace rendering
38  {
39  class RayQueryPrivate;
40 
43 
47  class GZ_RENDERING_VISIBLE RayQuery
48  {
51  public: explicit RayQuery(CameraPtr _camera);
52 
54  public: ~RayQuery();
55 
62  public: bool SelectMeshTriangle(int _x, int _y, VisualPtr _visual,
63  math::Vector3 &_intersect, std::vector<math::Vector3> &_vertices)
64  GAZEBO_DEPRECATED(8.0);
65 
72  public: bool SelectMeshTriangle(const int _x, const int _y,
73  const VisualPtr &_visual,
74  ignition::math::Vector3d &_intersect,
75  ignition::math::Triangle3d &_triangle) const;
76 
80  private: void MeshVisuals(const rendering::VisualPtr _visual,
81  std::vector<rendering::VisualPtr> &_visuals) const;
82 
85  private: std::unique_ptr<RayQueryPrivate> dataPtr;
86  };
88  }
89 }
90 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
static const double GAZEBO_DEPRECATED(8.0) MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:140
A Ray Query class used for retrieving mesh data of a visual, adapted from Ogre3D wiki.
Definition: RayQuery.hh:47
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:113
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:89