Public Member Functions | Protected Attributes | Related Functions | List of all members
vgl_frustum_3d< Type > Class Template Reference

A 3D frustum is the portion of a solid (normally a cone or pyramid). More...

#include <vgl_frustum_3d.h>

Public Member Functions

 vgl_frustum_3d ()
 default constructor. More...
 
 vgl_frustum_3d (std::vector< vgl_ray_3d< Type > > const &corner_rays, vgl_vector_3d< Type > const &norm, Type d0, Type d1)
 Construct the frustum from rays. More...
 
bool operator== (vgl_frustum_3d< Type > const &other) const
 Equality test. More...
 
const vgl_point_3d< Type > & apex () const
 
const std::vector< vgl_plane_3d< Type > > & surface_planes () const
 
const vgl_plane_3d< Type > & near_plane () const
 
const vgl_plane_3d< Type > & far_plane () const
 
const std::vector< vgl_point_3d< Type > > & verts () const
 
const std::map< int, std::vector< int > > & faces () const
 
vgl_box_3d< Type > bounding_box () const
 
vgl_point_3d< Type > centroid () const
 Get the centroid point. More...
 
bool is_convex () const
 test if the frustum is convex. More...
 
bool contains (vgl_point_3d< Type > const &p) const
 Return true iff the point p is inside this frustum. More...
 
bool contains (Type const &x, Type const &y, Type const &z) const
 Return true if (x,y,z) is inside this frustum. More...
 

Protected Attributes

vgl_point_3d< Type > apex_
 
vgl_vector_3d< Type > norm_
 
std::vector< vgl_plane_3d< Type > > surface_planes_
 planes bounding the frustum volume including near and far plane. More...
 
int near_plane_
 
int far_plane_
 
std::vector< vgl_point_3d< Type > > verts_
 
int n_top_bot_face_verts_
 the number of verts in the top or bottom face. More...
 
std::map< int, std::vector< int > > faces_
 

Related Functions

(Note that these are not member functions.)

template<class Type >
std::ostream & operator<< (std::ostream &s, vgl_frustum_3d< Type > const &p)
 Write frustum to stream. More...
 

Detailed Description

template<class Type>
class vgl_frustum_3d< Type >

A 3D frustum is the portion of a solid (normally a cone or pyramid).

that lies between two parallel planes cutting it.

Definition at line 28 of file vgl_frustum_3d.h.

Constructor & Destructor Documentation

◆ vgl_frustum_3d() [1/2]

template<class Type>
vgl_frustum_3d< Type >::vgl_frustum_3d ( )
inline

default constructor.

Definition at line 32 of file vgl_frustum_3d.h.

◆ vgl_frustum_3d() [2/2]

template<class Type >
vgl_frustum_3d< Type >::vgl_frustum_3d ( std::vector< vgl_ray_3d< Type > > const &  corner_rays,
vgl_vector_3d< Type > const &  norm,
Type  d0,
Type  d1 
)

Construct the frustum from rays.

the corner rays intersect in a common origin point, i.e., the apex of the frustum cone. It is assumed the rays are in sorted order around the cone surface, so that sequential rays are coplanar with a cone surface plane and the cross product r[i].dir X r[i+1].dir defines an outward-pointing normal. norm is the vector perpendicular to the parallel frustum faces. d0 is the distance in the norm vector dirction from the apex to the closest parallel face. d1 the distance in the norm direction from the apex to the far face.

Definition at line 17 of file vgl_frustum_3d.hxx.

Member Function Documentation

◆ apex()

template<class Type>
const vgl_point_3d<Type>& vgl_frustum_3d< Type >::apex ( ) const
inline

Definition at line 52 of file vgl_frustum_3d.h.

◆ bounding_box()

template<class Type >
vgl_box_3d< Type > vgl_frustum_3d< Type >::bounding_box ( ) const

Definition at line 132 of file vgl_frustum_3d.hxx.

◆ centroid()

template<class Type >
vgl_point_3d< Type > vgl_frustum_3d< Type >::centroid ( ) const

Get the centroid point.

Definition at line 140 of file vgl_frustum_3d.hxx.

◆ contains() [1/2]

template<class Type >
bool vgl_frustum_3d< Type >::contains ( vgl_point_3d< Type > const &  p) const

Return true iff the point p is inside this frustum.

assumes that the frustum is a convex solid

Definition at line 202 of file vgl_frustum_3d.hxx.

◆ contains() [2/2]

template<class Type >
bool vgl_frustum_3d< Type >::contains ( Type const &  x,
Type const &  y,
Type const &  z 
) const

Return true if (x,y,z) is inside this frustum.

assumes that the frustum is a convex solid

Definition at line 186 of file vgl_frustum_3d.hxx.

◆ faces()

template<class Type>
const std::map<int, std::vector<int> >& vgl_frustum_3d< Type >::faces ( ) const
inline

Definition at line 67 of file vgl_frustum_3d.h.

◆ far_plane()

template<class Type>
const vgl_plane_3d<Type>& vgl_frustum_3d< Type >::far_plane ( ) const
inline

Definition at line 61 of file vgl_frustum_3d.h.

◆ is_convex()

template<class Type >
bool vgl_frustum_3d< Type >::is_convex ( ) const

test if the frustum is convex.

Definition at line 157 of file vgl_frustum_3d.hxx.

◆ near_plane()

template<class Type>
const vgl_plane_3d<Type>& vgl_frustum_3d< Type >::near_plane ( ) const
inline

Definition at line 58 of file vgl_frustum_3d.h.

◆ operator==()

template<class Type >
bool vgl_frustum_3d< Type >::operator== ( vgl_frustum_3d< Type > const &  other) const
inline

Equality test.

Definition at line 114 of file vgl_frustum_3d.hxx.

◆ surface_planes()

template<class Type>
const std::vector<vgl_plane_3d<Type> >& vgl_frustum_3d< Type >::surface_planes ( ) const
inline

Definition at line 55 of file vgl_frustum_3d.h.

◆ verts()

template<class Type>
const std::vector<vgl_point_3d<Type> >& vgl_frustum_3d< Type >::verts ( ) const
inline

Definition at line 64 of file vgl_frustum_3d.h.

Friends And Related Function Documentation

◆ operator<<()

template<class Type >
std::ostream & operator<< ( std::ostream &  s,
vgl_frustum_3d< Type > const &  p 
)
related

Write frustum to stream.

Member Data Documentation

◆ apex_

template<class Type>
vgl_point_3d<Type> vgl_frustum_3d< Type >::apex_
protected

Definition at line 94 of file vgl_frustum_3d.h.

◆ faces_

template<class Type>
std::map<int, std::vector<int> > vgl_frustum_3d< Type >::faces_
protected

Definition at line 105 of file vgl_frustum_3d.h.

◆ far_plane_

template<class Type>
int vgl_frustum_3d< Type >::far_plane_
protected

Definition at line 99 of file vgl_frustum_3d.h.

◆ n_top_bot_face_verts_

template<class Type>
int vgl_frustum_3d< Type >::n_top_bot_face_verts_
protected

the number of verts in the top or bottom face.

Definition at line 102 of file vgl_frustum_3d.h.

◆ near_plane_

template<class Type>
int vgl_frustum_3d< Type >::near_plane_
protected

Definition at line 98 of file vgl_frustum_3d.h.

◆ norm_

template<class Type>
vgl_vector_3d<Type> vgl_frustum_3d< Type >::norm_
protected

Definition at line 95 of file vgl_frustum_3d.h.

◆ surface_planes_

template<class Type>
std::vector<vgl_plane_3d<Type> > vgl_frustum_3d< Type >::surface_planes_
protected

planes bounding the frustum volume including near and far plane.

Definition at line 97 of file vgl_frustum_3d.h.

◆ verts_

template<class Type>
std::vector<vgl_point_3d<Type> > vgl_frustum_3d< Type >::verts_
protected

Definition at line 100 of file vgl_frustum_3d.h.


The documentation for this class was generated from the following files: