contrib/oxl/mvl/HomgOperator3D.h
Go to the documentation of this file.
00001 #ifndef HomgOperator3D_h_
00002 #define HomgOperator3D_h_
00003 //:
00004 // \file
00005 // \brief operators for the 3D homogeneous primitive classes
00006 //
00007 // Useful operators for the 3D homogeneous primitive classes.
00008 //
00009 // \verbatim
00010 // Modifications
00011 //   221198 - Peter Vanroose - Added CrossRatio()
00012 // \endverbatim
00013 
00014 #include <vcl_vector.h>
00015 
00016 #include <mvl/HomgLine3D.h>
00017 #include <mvl/HomgPoint3D.h>
00018 #include <mvl/HomgPlane3D.h>
00019 
00020 class HomgOperator3D
00021 {
00022  public:
00023   static double angle_between_oriented_lines (const HomgLine3D& line1, const HomgLine3D& line2);
00024   static double distance_squared (const HomgPoint3D& point1, const HomgPoint3D& point2);
00025   static HomgPoint3D intersect_line_and_plane (const HomgLine3D&, const HomgPlane3D&);
00026   static HomgPoint3D lines_to_point (const HomgLine3D& line1, const HomgLine3D& line2);
00027   static HomgPoint3D lines_to_point (const vcl_vector<HomgLine3D>& line_list);
00028   static double perp_dist_squared (const HomgPoint3D& point, const HomgLine3D& line);
00029   static HomgLine3D perp_line_through_point (const HomgLine3D& line, const HomgPoint3D& point);
00030   static HomgPoint3D perp_projection (const HomgLine3D& line, const HomgPoint3D& point);
00031   static HomgLine3D planes_to_line (const HomgPlane3D& plane1, const HomgPlane3D& plane2);
00032   static HomgLine3D planes_to_line (const vcl_vector<HomgPlane3D>& plane_list);
00033   static HomgLine3D points_to_line (const HomgPoint3D& point1, const HomgPoint3D& point2);
00034   static HomgLine3D points_to_line (const vcl_vector<HomgPoint3D>& point_list);
00035 
00036   static HomgPlane3D points_to_plane (const HomgPoint3D& , const HomgPoint3D& , const HomgPoint3D& );
00037   static HomgPlane3D points_to_plane (const vcl_vector<HomgPoint3D>& point_list);
00038   static HomgPoint3D intersection_point (const HomgPlane3D& , const HomgPlane3D& , const HomgPlane3D& );
00039   static HomgPoint3D intersection_point (const vcl_vector<HomgPlane3D>&);
00040 
00041   static void sort_points(HomgPoint3D* p, int n);
00042 
00043   // cross ratio of four collinear points, or four planes through a common line
00044   static double CrossRatio(const Homg3D& p1, const Homg3D& p2,
00045                            const Homg3D& p3, const Homg3D& p4);
00046 };
00047 
00048 #endif // HomgOperator3D_h_