Skip to content
Snippets Groups Projects
Commit cd57a9d1 authored by Patrick Imbo's avatar Patrick Imbo
Browse files

ENH: polarisation information for Noise class

parent 032cac4e
No related branches found
No related tags found
No related merge requests found
......@@ -20,10 +20,12 @@ namespace ossimplugins
{
static const char NOISE[] = "noise";
static const char NUMBER_OF_NOISE_RECORDS_KW[] = "numberOfNoiseRecords";
static const char NAME_OF_NOISE_POLARISATION_KW[] = "nameOfOfNoisePolarisation";
Noise::Noise():
_numberOfNoiseRecords(0),
_tabImageNoise()
_tabImageNoise(),
_polarisation("UNDEFINED")
{
}
......@@ -34,7 +36,8 @@ Noise::~Noise()
Noise::Noise(const Noise& rhs):
_numberOfNoiseRecords(rhs._numberOfNoiseRecords),
_tabImageNoise(rhs._tabImageNoise)
_tabImageNoise(rhs._tabImageNoise),
_polarisation(rhs._polarisation)
{
}
......@@ -42,6 +45,7 @@ Noise& Noise::operator=(const Noise& rhs)
{
_numberOfNoiseRecords = rhs._numberOfNoiseRecords;
_tabImageNoise = rhs._tabImageNoise;
_polarisation = rhs._polarisation;
return *this;
}
......@@ -53,8 +57,14 @@ bool Noise::saveState(ossimKeywordlist& kwl, const char* prefix) const
pfx = prefix;
}
pfx += NOISE;
std::string s = pfx + "." + NUMBER_OF_NOISE_RECORDS_KW;
std::string s = pfx + "." + NAME_OF_NOISE_POLARISATION_KW;
kwl.add(prefix, s.c_str(), _polarisation);
s = pfx + "." + NUMBER_OF_NOISE_RECORDS_KW;
kwl.add(prefix, s.c_str(), _numberOfNoiseRecords);
for (unsigned int i = 0; i < _tabImageNoise.size(); ++i)
{
std::string s2 = pfx + "[" + ossimString::toString(i) + "]";
......@@ -81,6 +91,18 @@ bool Noise::loadState(const ossimKeywordlist& kwl, const char* prefix)
const char* lookup = 0;
std::string s1 = pfx + ".";
lookup = kwl.find(s1.c_str(), NAME_OF_NOISE_POLARISATION_KW);
if (lookup)
{
_polarisation = lookup;
}
else
{
ossimNotify(ossimNotifyLevel_WARN)
<< MODULE << " Keyword not found: " << NAME_OF_NOISE_POLARISATION_KW << "\n";
result = false;
}
lookup = kwl.find(s1.c_str(), NUMBER_OF_NOISE_RECORDS_KW);
if (lookup)
{
......@@ -122,6 +144,8 @@ std::ostream& Noise::print(std::ostream& out) const
pfx += NOISE;
std::string s = pfx + "." + NUMBER_OF_NOISE_RECORDS_KW;
kwl.add(prefix, s.c_str(), _numberOfNoiseRecords);
s = pfx + "." + NAME_OF_NOISE_POLARISATION_KW;
kwl.add(prefix, s.c_str(), _polarisation);
for (unsigned int i = 0; i < _tabImageNoise.size(); ++i)
{
std::string s2 = pfx + "[" + ossimString::toString(i) + "]";
......
......@@ -81,6 +81,18 @@ public:
{
return _tabImageNoise;
}
void set_imagePolarisation(const ossimString& polarisation)
{
_polarisation = polarisation;
}
const ossimString & get_imagePolarisation() const
{
return _polarisation;
}
protected:
......@@ -92,6 +104,12 @@ protected:
* @brief Image Noise.
*/
std::vector<ImageNoise> _tabImageNoise;
/**
* @brief Noise Polarisation Layer.
*/
ossimString _polarisation;
private:
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment