contrib/gel/vifa/vifa_group_pgram_params.h
Go to the documentation of this file.
00001 // This is gel/vifa/vifa_group_pgram_params.h
00002 #ifndef VIFA_GROUP_PGRAM_PARAMS_H
00003 #define VIFA_GROUP_PGRAM_PARAMS_H
00004 
00005 //-----------------------------------------------------------------------------
00006 //:
00007 // \file
00008 // \brief Parameter mixin for grouping parallel line sets.
00009 //
00010 // \author Joseph L. Mundy
00011 //
00012 // \date December 1998
00013 //
00014 // \verbatim
00015 //  Modifications:
00016 //   MPP Mar 2003, Ported to VXL
00017 // \endverbatim
00018 //-----------------------------------------------------------------------------
00019 
00020 #include <vbl/vbl_ref_count.h>
00021 #include <vbl/vbl_smart_ptr.h>
00022 #include <vul/vul_timestamp.h>
00023 #include <gevd/gevd_param_mixin.h>
00024 
00025 
00026 //: Container holding parameters for grouping polygons
00027 class vifa_group_pgram_params : public gevd_param_mixin,
00028                                 public vul_timestamp,
00029                                 public vbl_ref_count
00030 {
00031   float  angle_increment_;
00032   int    max_suppress_radius_;
00033   float  length_ratio_;
00034 
00035  public:
00036   //: Granularity in the angle bins.
00037   float  angle_increment() const { return angle_increment_; }
00038 
00039   //: Radius of maximum suppression kernel.
00040   int    max_suppress_radius() const { return max_suppress_radius_; }
00041 
00042   //: Relative length of sorter side of parallellogram.
00043   float  length_ratio() const { return length_ratio_; }
00044 
00045   //: Default constructor.
00046   vifa_group_pgram_params(float  angle_increment = 5.0f,
00047                           int    max_suppress_radius = 2,
00048                           float  length_ratio = .1f
00049                          )
00050     { init_params(angle_increment, max_suppress_radius, length_ratio); }
00051 
00052 
00053   //: Copy constructor.
00054   vifa_group_pgram_params(const vifa_group_pgram_params&  old_params);
00055 
00056   //: Check that parameters are within acceptable bounds.
00057   bool  SanityCheck();
00058 
00059   //: Output contents
00060   void  print_info(void);
00061 
00062  protected:
00063   //: Assign internal parameter blocks.
00064   void  init_params(float  angle_increment,
00065                     int    max_suppress_radius,
00066                     float  length_ratio
00067                    )
00068   { angle_increment_ = angle_increment;
00069     max_suppress_radius_ = max_suppress_radius;
00070     length_ratio_ = length_ratio;
00071   }
00072 };
00073 
00074 typedef vbl_smart_ptr<vifa_group_pgram_params>  vifa_group_pgram_params_sptr;
00075 
00076 
00077 #endif  // VIFA_GROUP_PGRAM_PARAMS_H