Go to the documentation of this file.00001
00002 #ifndef vpgl_ray_h_
00003 #define vpgl_ray_h_
00004
00005
00006
00007
00008
00009
00010 #include <vpgl/vpgl_rational_camera.h>
00011 #include <vgl/algo/vgl_rotation_3d.h>
00012 #include <vpgl/vpgl_local_rational_camera.h>
00013 #include <vpgl/vpgl_perspective_camera.h>
00014 #include <vpgl/vpgl_generic_camera.h>
00015 #include <vnl/vnl_double_3.h>
00016 #include <vgl/vgl_point_3d.h>
00017 #include <vgl/vgl_vector_3d.h>
00018 #include <vgl/vgl_ray_3d.h>
00019
00020 class vpgl_ray
00021 {
00022 public:
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 static bool ray(const vpgl_camera<double>* cam,
00033 vnl_double_3 const& point_3d,
00034 vnl_double_3& ray);
00035
00036
00037
00038
00039 static bool ray(const vpgl_camera<double>* cam,
00040 vgl_point_3d<double> const& point_3d,
00041 vgl_vector_3d<double>& ray);
00042
00043
00044 static bool ray(const vpgl_camera<double>* cam,
00045 vgl_point_3d<double> const& point_3d,
00046 double origin_z,
00047 vgl_ray_3d<double>& ray);
00048
00049
00050
00051
00052
00053
00054 static bool ray(vpgl_rational_camera<double> const& rcam,
00055 vnl_double_3 const& point_3d,
00056 vnl_double_3& ray);
00057
00058
00059
00060
00061 static bool ray(vpgl_rational_camera<double> const& rcam,
00062 vgl_point_3d<double> const& point_3d,
00063 vgl_vector_3d<double>& ray);
00064
00065
00066 static bool ray(vpgl_rational_camera<double> const& rcam,
00067 vgl_point_3d<double> const& point_3d,
00068 vgl_ray_3d<double>& ray);
00069
00070
00071 static bool ray(vpgl_local_rational_camera<double> const& lrcam,
00072 const double u, const double v,
00073 vgl_point_3d<double>& origin, vgl_vector_3d<double>& dir);
00074
00075
00076 static bool ray(vpgl_local_rational_camera<double> const& lrcam,
00077 const double u, const double v,
00078 vgl_ray_3d<double>& ray);
00079
00080
00081 static bool plane_ray(vpgl_local_rational_camera<double> const& lrcam,
00082 const vgl_point_2d<double> image_point1,
00083 const vgl_point_2d<double> image_point2,
00084 vgl_plane_3d<double>& plane);
00085
00086 static bool ray(vpgl_proj_camera<double> const& cam,
00087 vgl_point_3d<double> const& world_pt,
00088 vgl_ray_3d<double>& ray);
00089
00090 static bool principal_ray(vpgl_proj_camera<double> const& cam,
00091 vgl_ray_3d<double>& pray);
00092
00093
00094 static bool ray(vpgl_perspective_camera<double> const& cam,
00095 vgl_point_3d<double> const& world_pt,
00096 vgl_ray_3d<double>& ray);
00097
00098 static bool principal_ray(vpgl_perspective_camera<double> const& cam,
00099 vgl_ray_3d<double>& pray) {
00100 vpgl_proj_camera<double> const* procam =
00101 static_cast<vpgl_proj_camera<double> const* >(&cam);
00102 return vpgl_ray::principal_ray(*procam, pray);
00103 }
00104
00105
00106 static bool ray(vpgl_generic_camera<double> const& cam,
00107 vgl_point_3d<double> const& world_pt,
00108 vgl_ray_3d<double>& ray);
00109
00110
00111
00112
00113
00114
00115 static double angle_between_rays(vgl_rotation_3d<double> const& r0, vgl_rotation_3d<double> const& r1);
00116
00117
00118 static double rot_about_ray(vgl_rotation_3d<double> const& r0, vgl_rotation_3d<double> const& r1);
00119
00120
00121 static vgl_rotation_3d<double> rot_to_point_ray(vgl_vector_3d<double> const& ray_dir);
00122
00123 static vgl_rotation_3d<double> rot_to_point_ray(double azimuth, double elevation);
00124 private:
00125
00126 vpgl_ray();
00127 ~vpgl_ray();
00128 };
00129
00130 #endif // vpgl_ray_h_