OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Attributes | List of all members
ossimplugins::Noise Class Reference

This class represents an Noise. More...

#include <Noise.h>

Public Member Functions

 Noise ()
 Constructor. More...
 
virtual ~Noise ()
 Destructor. More...
 
 Noise (const Noise &rhs)
 Copy constructor. More...
 
Noiseoperator= (const Noise &rhs)
 Affectation operator. More...
 
bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save object state to a keyword list. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 
virtual std::ostream & print (std::ostream &out) const
 
void set_numberOfNoiseRecords (const ossim_int32 &numberOfNoiseRecords)
 
void set_imageNoise (const std::vector< ImageNoise > &image_noise)
 
const std::vector< ImageNoise > & get_imageNoise () const
 
void set_imagePolarisation (const ossimString &polarisation)
 
const ossimStringget_imagePolarisation () const
 

Protected Attributes

ossim_uint32 _numberOfNoiseRecords
 Image Noise. More...
 
std::vector< ImageNoise_tabImageNoise
 Image Noise. More...
 
ossimString _polarisation
 Noise Polarisation Layer. More...
 

Detailed Description

This class represents an Noise.

Definition at line 28 of file Noise.h.

Constructor & Destructor Documentation

◆ Noise() [1/2]

ossimplugins::Noise::Noise ( )

Constructor.

Definition at line 25 of file Noise.cpp.

25  :
28  _polarisation("UNDEFINED")
29 {
30 }
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102

◆ ~Noise()

ossimplugins::Noise::~Noise ( )
virtual

Destructor.

Definition at line 32 of file Noise.cpp.

33 {
34 }

◆ Noise() [2/2]

ossimplugins::Noise::Noise ( const Noise rhs)

Copy constructor.

Definition at line 37 of file Noise.cpp.

37  :
38  _numberOfNoiseRecords(rhs._numberOfNoiseRecords),
39  _tabImageNoise(rhs._tabImageNoise),
40  _polarisation(rhs._polarisation)
41 {
42 }
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102

Member Function Documentation

◆ get_imageNoise()

const std::vector<ImageNoise>& ossimplugins::Noise::get_imageNoise ( ) const
inline

Definition at line 80 of file Noise.h.

81  {
82  return _tabImageNoise;
83  }
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106

◆ get_imagePolarisation()

const ossimString& ossimplugins::Noise::get_imagePolarisation ( ) const
inline

Definition at line 89 of file Noise.h.

90  {
91  return _polarisation;
92  }
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111

◆ loadState()

bool ossimplugins::Noise::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)

Method to the load (recreate) the state of the object from a keyword list.

Return true if ok or false on error.

Returns
true if load OK, false on error

Definition at line 77 of file Noise.cpp.

References _numberOfNoiseRecords, _polarisation, _tabImageNoise, ossimString::c_str(), ossimKeywordlist::find(), ossimplugins::ImageNoise::loadState(), ossimNotify(), ossimNotifyLevel_WARN, ossimString::toString(), and ossimString::toUInt32().

78 {
79  static const char MODULE[] = "Noise::loadState";
80 
81  bool result = true;
82 
83  std::string pfx("");
84  if (prefix)
85  {
86  pfx = prefix;
87  }
88  pfx += NOISE;
89 
90  ossimString s;
91  const char* lookup = 0;
92  std::string s1 = pfx + ".";
93 
94  lookup = kwl.find(s1.c_str(), NAME_OF_NOISE_POLARISATION_KW);
95  if (lookup)
96  {
97  _polarisation = lookup;
98  }
99  else
100  {
102  << MODULE << " Keyword not found: " << NAME_OF_NOISE_POLARISATION_KW << "\n";
103  result = false;
104  }
105 
106  lookup = kwl.find(s1.c_str(), NUMBER_OF_NOISE_RECORDS_KW);
107  if (lookup)
108  {
109  s = lookup;
111  }
112  else
113  {
115  << MODULE << " Keyword not found: " << NUMBER_OF_NOISE_RECORDS_KW << "\n";
116  result = false;
117  }
118 
119  _tabImageNoise.clear();
120  for (unsigned int i = 0; i < _numberOfNoiseRecords; ++i)
121  {
122  std::string s2 = pfx + "[" + ossimString::toString(i).c_str() + "]";
123  ImageNoise in;
124  result = in.loadState(kwl, s2.c_str());
125  _tabImageNoise.push_back(in);
126  }
127  if( _numberOfNoiseRecords != _tabImageNoise.size() )
128  {
130  << MODULE << " Keyword " << NUMBER_OF_NOISE_RECORDS_KW << " is different with the number of ImageNoise nodes \n";
131  }
132  return result;
133 }
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
ossim_uint32 toUInt32() const
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ operator=()

Noise & ossimplugins::Noise::operator= ( const Noise rhs)

Affectation operator.

Definition at line 44 of file Noise.cpp.

References _numberOfNoiseRecords, _polarisation, and _tabImageNoise.

45 {
46  _numberOfNoiseRecords = rhs._numberOfNoiseRecords;
47  _tabImageNoise = rhs._tabImageNoise;
48  _polarisation = rhs._polarisation;
49  return *this;
50 }
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102

◆ print()

std::ostream & ossimplugins::Noise::print ( std::ostream &  out) const
virtual

METHOD: print() Fulfills base-class pure virtual. Dumps contents of object to ostream.

Definition at line 136 of file Noise.cpp.

References _numberOfNoiseRecords, _polarisation, _tabImageNoise, ossimKeywordlist::add(), ossimString::c_str(), ossimString::chars(), and ossimString::toString().

137 {
138  out << setprecision(15) << setiosflags(ios::fixed)
139  << "\n Noise class data members:\n";
140 
141  const char* prefix = 0;
142  ossimKeywordlist kwl;
143  ossimString pfx;
144  pfx += NOISE;
145  ossimString s = pfx + "." + NUMBER_OF_NOISE_RECORDS_KW;
146  kwl.add(prefix, s.c_str(), _numberOfNoiseRecords);
147  s = pfx + "." + NAME_OF_NOISE_POLARISATION_KW;
148  kwl.add(prefix, s.chars(), _polarisation);
149  for (unsigned int i = 0; i < _tabImageNoise.size(); ++i)
150  {
151  ossimString s2 = pfx + "[" + ossimString::toString(i).c_str() + "]";
152  _tabImageNoise[i].saveState(kwl, s2.c_str());
153  }
154 
155  out << kwl;
156 
157  return out;
158 }
Represents serializable keyword/value map.
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102

◆ saveState()

bool ossimplugins::Noise::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const

Method to save object state to a keyword list.

Parameters
kwlKeyword list to save to.
prefixadded to keys when saved.
Returns
true on success, false on error.

Definition at line 52 of file Noise.cpp.

References _numberOfNoiseRecords, _polarisation, _tabImageNoise, ossimKeywordlist::add(), ossimString::c_str(), and ossimString::toString().

53 {
54  std::string pfx;
55  if (prefix)
56  {
57  pfx = prefix;
58  }
59  pfx += NOISE;
60 
61 
62  std::string s = pfx + "." + NAME_OF_NOISE_POLARISATION_KW;
63  kwl.add(prefix, s.c_str(), _polarisation);
64 
65  s = pfx + "." + NUMBER_OF_NOISE_RECORDS_KW;
66  kwl.add(prefix, s.c_str(), _numberOfNoiseRecords);
67 
68  for (unsigned int i = 0; i < _tabImageNoise.size(); ++i)
69  {
70  ossimString s2 = pfx + "[" + ossimString::toString(i).c_str() + "]";
71  _tabImageNoise[i].saveState(kwl, s2.c_str());
72  }
73 
74  return true;
75 }
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102

◆ set_imageNoise()

void ossimplugins::Noise::set_imageNoise ( const std::vector< ImageNoise > &  image_noise)
inline

Definition at line 75 of file Noise.h.

Referenced by ossimplugins::ossimTerraSarModel::getNoiseAtGivenNode(), and ossimplugins::ossimTerraSarProductDoc::initNoise().

76  {
77  _tabImageNoise = image_noise;
78  }
std::vector< ImageNoise > _tabImageNoise
Image Noise.
Definition: Noise.h:106

◆ set_imagePolarisation()

void ossimplugins::Noise::set_imagePolarisation ( const ossimString polarisation)
inline

Definition at line 84 of file Noise.h.

85  {
86  _polarisation = polarisation;
87  }
ossimString _polarisation
Noise Polarisation Layer.
Definition: Noise.h:111

◆ set_numberOfNoiseRecords()

void ossimplugins::Noise::set_numberOfNoiseRecords ( const ossim_int32 numberOfNoiseRecords)
inline

Definition at line 71 of file Noise.h.

Referenced by ossimplugins::ossimTerraSarModel::getNoiseAtGivenNode(), and ossimplugins::ossimTerraSarProductDoc::initNoise().

72  {
73  _numberOfNoiseRecords = numberOfNoiseRecords;
74  }
ossim_uint32 _numberOfNoiseRecords
Image Noise.
Definition: Noise.h:102

Member Data Documentation

◆ _numberOfNoiseRecords

ossim_uint32 ossimplugins::Noise::_numberOfNoiseRecords
protected

Image Noise.

Definition at line 102 of file Noise.h.

Referenced by loadState(), operator=(), print(), and saveState().

◆ _polarisation

ossimString ossimplugins::Noise::_polarisation
protected

Noise Polarisation Layer.

Definition at line 111 of file Noise.h.

Referenced by loadState(), operator=(), print(), and saveState().

◆ _tabImageNoise

std::vector<ImageNoise> ossimplugins::Noise::_tabImageNoise
protected

Image Noise.

Definition at line 106 of file Noise.h.

Referenced by loadState(), operator=(), print(), and saveState().


The documentation for this class was generated from the following files: