vgl_intersection.h
Go to the documentation of this file.
1 // This is core/vgl/algo/vgl_intersection.h
2 #ifndef vgl_algo_intersection_h_
3 #define vgl_algo_intersection_h_
4 //:
5 // \file
6 // \brief Set of intersection functions
7 // \author Jan 25, 2007 Gamze Tunali
8 //
9 // This file aims to gather all the intersection methods on vgl classes
10 // at one place. Some of the functions moved from their own class
11 // files to here or interface methods created for non-homogeneous versions
12 // of the ones that are already defined in vgl/algo/vgl_homg_operators_3d
13 //
14 // \verbatim
15 // Modifications
16 // 23 Jul 2009 - Gamze Tunali - added a 3D box-polygon intersection method
17 //
18 // 01 Mar 2007 - Gamze Tunali - split up into vgl/algo and vgl parts
19 // \endverbatim
20 
21 #include <vector>
22 #include <list>
23 #include <vgl/vgl_fwd.h> // forward declare various vgl classes
24 #ifdef _MSC_VER
25 # include <vcl_msvc_warnings.h>
26 #endif
27 
28 //: Return the intersection point of vector of planes.
29 // \relatesalso vgl_plane_3d
30 template <class T>
31 vgl_point_3d<T> vgl_intersection(const std::vector<vgl_plane_3d<T> >& p);
32 
33 //: Return the intersection line of a set of planes, use list to distinguish from point return
34 // \relatesalso vgl_plane_3d
35 // \relatesalso vgl_infinite_line_3d
36 template <class T>
38 vgl_intersection(const std::list<vgl_plane_3d<T> >& planes);
39 
40 //: Return the intersection line of a set of weighted planes, use list to distinguish from point return
41 // \relatesalso vgl_plane_3d
42 // \relatesalso vgl_infinite_line_3d
43 
44 template <class T>
45 bool
46 vgl_intersection(const std::list<vgl_plane_3d<T> >& planes, std::vector<T> ws, vgl_infinite_line_3d<T>& line, T & residual);
47 
48 //: Return true if the box and polygon intersect in 3-d, regions include boundaries
49 // Polygon is represented as an ordered vector of 3-d points
50 // \relatesalso vgl_point_3d
51 // \relatesalso vgl_box_3d
52 template <class T>
53 bool vgl_intersection(vgl_box_3d<T> const& b, std::list<vgl_point_3d<T> >& p);
54 
55 
56 #define VGL_ALGO_INTERSECTION_INSTANTIATE(T) extern "please include vgl/algo/vgl_intersection.hxx first"
57 
58 #endif // vgl_algo_intersection_h_
vgl_point_3d< T > vgl_intersection(const std::vector< vgl_plane_3d< T > > &p)
Return the intersection point of vector of planes.
Represents a Euclidean 3D plane.
Definition: vgl_fwd.h:23
Represents a 3-d line with position defined in the orthogonal plane passing through the origin.
Definition: vgl_fwd.h:20
Represents a cartesian 3D box.
Definition: vgl_box_3d.h:65