contrib/brl/bseg/vpro/vpro_motion_params.cxx
Go to the documentation of this file.
00001 // This is brl/bseg/vpro/vpro_motion_params.cxx
00002 #include "vpro_motion_params.h"
00003 //:
00004 // \file
00005 // See vpro_motion_params.h
00006 //
00007 //-----------------------------------------------------------------------------
00008 #include <vcl_sstream.h>
00009 #include <vcl_iostream.h>
00010 
00011 //------------------------------------------------------------------------
00012 // Constructors
00013 //
00014 
00015 vpro_motion_params::
00016 vpro_motion_params(const vpro_motion_params& vmp)
00017   : gevd_param_mixin()
00018 {
00019   InitParams(vmp.low_range_, vmp.high_range_, vmp.smooth_sigma_);
00020 }
00021 
00022 vpro_motion_params::
00023 vpro_motion_params(const float low_range, const float high_range,
00024                    const float smooth_sigma)
00025 {
00026   InitParams(low_range, high_range, smooth_sigma);
00027 }
00028 
00029 void vpro_motion_params::InitParams(float low_range, float high_range,
00030                                     float smooth_sigma)
00031 {
00032   low_range_= low_range;
00033   high_range_ = high_range;
00034   smooth_sigma_ = smooth_sigma;
00035 }
00036 
00037 //-----------------------------------------------------------------------------
00038 //
00039 //:   Checks that parameters are within acceptable bounds
00040 //    Note that msg << ends seems to restart the string and erase the
00041 //    previous string. We should only use it as the last call, use
00042 //    vcl_endl otherwise.
00043 bool vpro_motion_params::SanityCheck()
00044 {
00045   vcl_stringstream msg;
00046   bool valid = true;
00047 
00048   msg << vcl_ends;
00049 
00050   SetErrorMsg(msg.str().c_str());
00051   return valid;
00052 }
00053 
00054 vcl_ostream& operator << (vcl_ostream& os, const vpro_motion_params& vmp)
00055 {
00056   return
00057   os << "vpro_motion_params:\n[---\n"
00058      << "low_range " << vmp.low_range_ << vcl_endl
00059      << "high_range " << vmp.high_range_ << vcl_endl
00060      << "smooth_sigma " << vmp.smooth_sigma_ << vcl_endl
00061      << "---]" << vcl_endl;
00062 }