contrib/brl/bbas/bugl/bugl_uncertainty_point_3d.h
Go to the documentation of this file.
00001 #ifndef BUGL_UNCERTAINTY_POINT_3D_H_
00002 #define BUGL_UNCERTAINTY_POINT_3D_H_
00003 //:
00004 // \file
00005 // \author Kongbin Kang
00006 // \brief An abstract class for 3d point with uncertainty / probability distribution
00007 //
00008 // \verbatim
00009 //  Modifications
00010 //   10 Sept 2004 Peter Vanroose - made prob_at() pure virtual
00011 //   10 Sept 2004 Peter Vanroose - access to member exists_ restricted (consistency!)
00012 // \endverbatim
00013 
00014 #include <vgl/vgl_point_3d.h>
00015 
00016 template<class T>
00017 class bugl_uncertainty_point_3d : public vgl_point_3d<T>
00018 {
00019  public:
00020   bugl_uncertainty_point_3d() : vgl_point_3d<T>(), exists_(false) {}
00021   bugl_uncertainty_point_3d(T x, T y, T z) : vgl_point_3d<T>(x,y,z), exists_(true) {}
00022   bugl_uncertainty_point_3d(vgl_point_3d<T> const& p) : vgl_point_3d<T>(p), exists_(true) {}
00023   virtual ~bugl_uncertainty_point_3d() {}
00024   virtual T prob_at(vgl_point_3d<T> const& p) const = 0;
00025   bool exists() const { return exists_; }
00026   //: set as if this point is not initialised (as with default constructor)
00027   void set_point() { exists_ = false; }
00028   void set_point(vgl_point_3d<T> const& p) { exists_=true; this->set(p.x(), p.y(), p.z()); }
00029  protected:
00030   bool exists_;//does the point exist
00031 };
00032 
00033 #endif