Ignition Rendering

API Reference

6.3.1
Utils.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 IGNITION_RENDERING_UTILS_HH_
18 #define IGNITION_RENDERING_UTILS_HH_
19 
20 #include <vector>
21 
22 #include <ignition/math/Helpers.hh>
24 #include <ignition/math/Vector2.hh>
25 #include <ignition/math/Vector3.hh>
26 #include <ignition/math/Pose3.hh>
27 
29 #include "ignition/rendering/config.hh"
30 #include "ignition/rendering/Export.hh"
32 
33 
34 namespace ignition
35 {
37  namespace rendering
38  {
39  // Inline bracket to help doxygen filtering.
40  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
41  //
49  IGNITION_RENDERING_VISIBLE
51  const math::Vector2i &_screenPos,
52  const CameraPtr &_camera,
53  const RayQueryPtr &_rayQuery,
54  float _maxDistance = 10.0);
55 
64  IGNITION_RENDERING_VISIBLE
66  const math::Vector2i &_screenPos,
67  const CameraPtr &_camera,
68  const RayQueryPtr &_rayQuery,
69  RayQueryResult &_rayResult,
70  float _maxDistance = 10.0);
71 
79  IGNITION_RENDERING_VISIBLE
81  const math::Vector2i &_screenPos,
82  const CameraPtr &_camera,
83  const RayQueryPtr &_rayQuery,
84  const float _offset = 0.0);
85 
88  IGNITION_RENDERING_VISIBLE
89  float screenScalingFactor();
90 
96  IGNITION_RENDERING_VISIBLE
99  const ignition::math::Pose3d &_pose);
100  }
101  }
102 }
103 #endif
float screenScalingFactor()
Get the screen scaling factor.
math::Vector3d screenToPlane(const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, const float _offset=0.0)
Retrieve the point on a plane at z = 0 in the 3D scene hit by a ray cast from the given 2D screen coo...
shared_ptr< RayQuery > RayQueryPtr
Shared pointer to RayQuery.
Definition: RenderTypes.hh:223
math::Vector3d screenToScene(const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, float _maxDistance=10.0)
Retrieve the first point on a surface in the 3D scene hit by a ray cast from the given 2D screen coor...
shared_ptr< Camera > CameraPtr
Shared pointer to Camera.
Definition: RenderTypes.hh:107
Vector3< double > Vector3d
Vector2< int > Vector2i
ignition::math::AxisAlignedBox transformAxisAlignedBox(const ignition::math::AxisAlignedBox &_box, const ignition::math::Pose3d &_pose)
Transform a bounding box.