contrib/gel/vifa/vifa_group_pgram_params.cxx
Go to the documentation of this file.
00001 // This is gel/vifa/vifa_group_pgram_params.cxx
00002 #include "vifa_group_pgram_params.h"
00003 //:
00004 // \file
00005 
00006 #include <vcl_iostream.h>
00007 #include <vcl_sstream.h>
00008 
00009 vifa_group_pgram_params::
00010 vifa_group_pgram_params(const vifa_group_pgram_params&  dp)
00011   : gevd_param_mixin(), vul_timestamp(), vbl_ref_count()
00012 {
00013   init_params(dp.angle_increment_,
00014               dp.max_suppress_radius_,
00015               dp.length_ratio_);
00016 }
00017 
00018 bool vifa_group_pgram_params::
00019 SanityCheck()
00020 {
00021   vcl_stringstream  msg;
00022   bool        valid = true;
00023 
00024   if ((angle_increment_ <= 0) || (angle_increment_ > 45))
00025   {
00026     msg << "ERROR: Value of angle increment is out of range (0, 45]" << vcl_ends;
00027     valid = false;
00028   }
00029 
00030   if (max_suppress_radius_ <= 0)
00031   {
00032     msg << "ERROR: Maximum suppression radius must be greater than 0" << vcl_ends;
00033     valid = false;
00034   }
00035 
00036   if ((length_ratio_ <= 0) || (length_ratio_ > 1.0))
00037   {
00038     msg << "ERROR: length_ratio is out of range (0, 1.0]" << vcl_ends;
00039     valid = false;
00040   }
00041 
00042   SetErrorMsg(msg.str().c_str());
00043   return valid;
00044 }
00045 
00046 void vifa_group_pgram_params::
00047 print_info(void)
00048 {
00049   vcl_cout << "vifa_group_pgram_params:\n"
00050            << "  angle increment     = " << angle_increment_ << vcl_endl
00051            << "  max suppress radius = " << max_suppress_radius_ << vcl_endl
00052            << "  length ratio        = " << length_ratio_ << vcl_endl;
00053 }