All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Frustum.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_FRUSTUM_HH_
18 #define _IGNITION_FRUSTUM_HH_
19 
20 #include <ignition/math/Plane.hh>
21 #include <ignition/math/Angle.hh>
22 #include <ignition/math/Pose3.hh>
23 
24 namespace ignition
25 {
26  namespace math
27  {
28  // Forward declaration of private data
29  class FrustumPrivate;
30 
34  {
36  public: enum FrustumPlane
37  {
39  FRUSTUM_PLANE_NEAR = 0,
40 
42  FRUSTUM_PLANE_FAR = 1,
43 
45  FRUSTUM_PLANE_LEFT = 2,
46 
48  FRUSTUM_PLANE_RIGHT = 3,
49 
51  FRUSTUM_PLANE_TOP = 4,
52 
54  FRUSTUM_PLANE_BOTTOM = 5
55  };
56 
64  public: Frustum();
65 
78  public: Frustum(const double _near,
79  const double _far,
80  const math::Angle &_fov,
81  const double _aspectRatio,
82  const math::Pose3d &_pose = math::Pose3d::Zero);
83 
86  public: Frustum(const Frustum &_p);
87 
89  public: virtual ~Frustum();
90 
95  public: double Near() const;
96 
101  public: void SetNear(const double _near);
102 
107  public: double Far() const;
108 
113  public: void SetFar(const double _far);
114 
120  public: math::Angle FOV() const;
121 
127  public: void SetFOV(const math::Angle &_fov);
128 
133  public: double AspectRatio() const;
134 
139  public: void SetAspectRatio(const double _aspectRatio);
140 
144  public: Planed Plane(const FrustumPlane _plane) const;
145 
149  public: bool Contains(const Box &_b) const;
150 
154  public: bool Contains(const Vector3d &_p) const;
155 
159  public: Pose3d Pose() const;
160 
164  public: void SetPose(const Pose3d &_pose);
165 
168  private: void ComputePlanes();
169 
172  private: FrustumPrivate *dataPtr;
173  };
174  }
175 }
176 #endif
An angle and related functions.
Definition: Angle.hh:44
FrustumPlane
Planes that define the boundaries of the frustum.
Definition: Frustum.hh:36
#define IGNITION_VISIBLE
Use to represent &quot;symbol visible&quot; if supported.
Definition: Helpers.hh:408
Definition: FrustumPrivate.hh:32
A plane and related functions.
Definition: Plane.hh:32
Mathematical representation of a box and related functions.
Definition: Box.hh:33
Mathematical representation of a frustum and related functions.
Definition: Frustum.hh:33
static const Pose3< double > Zero
math::Pose3&lt;T&gt;(0, 0, 0, 0, 0, 0)
Definition: Pose3.hh:33