Go to the documentation of this file.00001
00002 #ifndef HomgPoint3D_h_
00003 #define HomgPoint3D_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vnl/vnl_double_3.h>
00019 #include <mvl/Homg3D.h>
00020 #include <vcl_iosfwd.h>
00021
00022 class HomgPoint3D : public Homg3D
00023 {
00024 public:
00025
00026
00027 HomgPoint3D () {}
00028 HomgPoint3D (const HomgPoint3D& p): Homg3D(p) {}
00029 HomgPoint3D (const vnl_vector<double>& p): Homg3D(p) {}
00030 HomgPoint3D (const vnl_vector_fixed<double,4>& p): Homg3D(p) {}
00031
00032 HomgPoint3D (double x, double y, double z, double w=1.0) : Homg3D(x,y,z,w) {}
00033 ~HomgPoint3D () {}
00034
00035
00036
00037
00038
00039
00040
00041 inline bool ideal(double tol = 1e-12) const {
00042 #define mvl_abs(x) ((x)<0?-(x):(x))
00043 return mvl_abs(w()) <= tol*mvl_abs(x()) && mvl_abs(w()) <= tol*mvl_abs(y()) && mvl_abs(w()) <= tol*mvl_abs(z());
00044 #undef mvl_abs
00045 }
00046
00047 bool get_nonhomogeneous(double& x, double& y, double& z) const;
00048 vnl_double_3 get_double3() const;
00049 double radius() const { return get_double3().magnitude(); }
00050 bool rescale_w(double new_w = 1.0);
00051 double squared_radius() const { return get_double3().squared_magnitude(); }
00052 };
00053
00054 vcl_ostream& operator<<(vcl_ostream& s, const HomgPoint3D& );
00055
00056 #endif // HomgPoint3D_h_