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