OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Attributes | Friends | List of all members
ossimAdjustmentInfo Class Reference

#include <ossimAdjustmentInfo.h>

Public Member Functions

 ossimAdjustmentInfo (int numberOfAdjustableParameters=0)
 
 ossimAdjustmentInfo (const ossimAdjustmentInfo &rhs)
 
void setNumberOfAdjustableParameters (ossim_uint32 numberOfAdjustableParameters)
 
ossim_uint32 getNumberOfAdjustableParameters () const
 
ossimString getDescription () const
 
void setDescription (const ossimString &description)
 
bool isDirty () const
 
void setDirtyFlag (bool flag=true)
 
void setLockParameterFlag (bool flag, ossim_uint32 idx)
 
void keep ()
 
std::vector< ossimAdjustableParameterInfo > & getParameterList ()
 
const std::vector< ossimAdjustableParameterInfo > & getParameterList () const
 
void setLockFlag (bool flag, ossim_uint32 idx)
 
bool saveState (ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
 
bool loadState (const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 

Private Attributes

std::vector< ossimAdjustableParameterInfotheParameterList
 
ossimString theDescription
 
bool theDirtyFlag
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimAdjustmentInfo &data)
 

Detailed Description

Definition at line 16 of file ossimAdjustmentInfo.h.

Constructor & Destructor Documentation

◆ ossimAdjustmentInfo() [1/2]

ossimAdjustmentInfo::ossimAdjustmentInfo ( int  numberOfAdjustableParameters = 0)

Definition at line 36 of file ossimAdjustmentInfo.cpp.

37  :theParameterList(numberOfAdjustableParameters),
38  theDescription(""),
39  theDirtyFlag(false)
40 {
41 }
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ ossimAdjustmentInfo() [2/2]

ossimAdjustmentInfo::ossimAdjustmentInfo ( const ossimAdjustmentInfo rhs)

Definition at line 43 of file ossimAdjustmentInfo.cpp.

47 {
48 }
std::vector< ossimAdjustableParameterInfo > theParameterList

Member Function Documentation

◆ getDescription()

ossimString ossimAdjustmentInfo::getDescription ( ) const

Definition at line 77 of file ossimAdjustmentInfo.cpp.

References theDescription.

Referenced by operator<<(), ossimAdjustableParameterInterface::saveCurrentAdjustmentOnly(), and saveState().

78 {
79  return theDescription;
80 }

◆ getNumberOfAdjustableParameters()

ossim_uint32 ossimAdjustmentInfo::getNumberOfAdjustableParameters ( ) const

Definition at line 72 of file ossimAdjustmentInfo.cpp.

References theParameterList.

Referenced by operator<<().

73 {
74  return (ossim_uint32)theParameterList.size();
75 }
unsigned int ossim_uint32
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ getParameterList() [1/2]

std::vector< ossimAdjustableParameterInfo > & ossimAdjustmentInfo::getParameterList ( )

Definition at line 119 of file ossimAdjustmentInfo.cpp.

References theParameterList.

Referenced by ossimSensorModel::optimizeFit().

120 {
121  return theParameterList;
122 }
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ getParameterList() [2/2]

const std::vector< ossimAdjustableParameterInfo > & ossimAdjustmentInfo::getParameterList ( ) const

Definition at line 124 of file ossimAdjustmentInfo.cpp.

References theParameterList.

125 {
126  return theParameterList;
127 }
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ isDirty()

bool ossimAdjustmentInfo::isDirty ( ) const

Definition at line 87 of file ossimAdjustmentInfo.cpp.

References theDirtyFlag.

88 {
89  return theDirtyFlag;
90 }

◆ keep()

void ossimAdjustmentInfo::keep ( )

Definition at line 106 of file ossimAdjustmentInfo.cpp.

References theParameterList.

107 {
108  ossim_uint32 idx = 0;
109 
110  for(idx = 0; idx < theParameterList.size();++idx)
111  {
112  double center = theParameterList[idx].computeOffset();
113  theParameterList[idx].setParameter(0.0);
114  theParameterList[idx].setCenter(center);
115  }
116 }
unsigned int ossim_uint32
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ loadState()

bool ossimAdjustmentInfo::loadState ( const ossimKeywordlist kwl,
const ossimString prefix = ossimString("") 
)

Definition at line 156 of file ossimAdjustmentInfo.cpp.

References ossimKeywordNames::DESCRIPTION_KW, ossimKeywordlist::find(), setDescription(), and setNumberOfAdjustableParameters().

158 {
160  setNumberOfAdjustableParameters(ossimString(kwl.find(prefix, NUMBER_OF_PARAMS_KW)).toUInt32());
161  const char *dirtyFlag = kwl.find(prefix, DIRTY_FLAG_KW);
162  ossimString value;
163 
164  if(dirtyFlag)
165  {
166  theDirtyFlag = ossimString(dirtyFlag).toBool();
167  }
168  else
169  {
170  theDirtyFlag = false;
171  }
172 
173  for(ossim_uint32 idx = 0; idx < theParameterList.size();++idx)
174  {
175  ossimString newPrefix = ossimString(prefix) + (ossimString(PARAM_PREFIX) + ossimString::toString(idx)+".");
176  if(!theParameterList[idx].loadState(kwl, newPrefix.c_str()))
177  {
178  return false;
179  }
180  }
181 
182  return true;
183 }
const char * find(const char *key) const
bool loadState(const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
static ossimString toString(bool aValue)
Numeric to string methods.
bool toBool() const
String to numeric methods.
unsigned int ossim_uint32
static const char * DESCRIPTION_KW
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
void setNumberOfAdjustableParameters(ossim_uint32 numberOfAdjustableParameters)
std::vector< ossimAdjustableParameterInfo > theParameterList
void setDescription(const ossimString &description)

◆ saveState()

bool ossimAdjustmentInfo::saveState ( ossimKeywordlist kwl,
const ossimString prefix = ossimString("") 
) const

Definition at line 129 of file ossimAdjustmentInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimKeywordNames::DESCRIPTION_KW, and getDescription().

131 {
132  kwl.add(prefix,
134  getDescription(),
135  true);
136  kwl.add(prefix.c_str(),
137  NUMBER_OF_PARAMS_KW,
138  static_cast<ossim_uint32>(theParameterList.size()),
139  true);
140 
141  kwl.add(prefix,
142  DIRTY_FLAG_KW,
143  (short)theDirtyFlag,
144  true);
145 
146  ossimString value;
147  for(ossim_uint32 idx = 0; idx < theParameterList.size();++idx)
148  {
149  ossimString newPrefix = ossimString(prefix) + (ossimString(PARAM_PREFIX) + ossimString::toString(idx)+".");
150  theParameterList[idx].saveState(kwl, newPrefix.c_str());
151  }
152 
153  return true;
154 }
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString getDescription() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
static const char * DESCRIPTION_KW
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
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ setDescription()

void ossimAdjustmentInfo::setDescription ( const ossimString description)

Definition at line 82 of file ossimAdjustmentInfo.cpp.

References theDescription.

Referenced by loadState().

83 {
84  theDescription = description;
85 }

◆ setDirtyFlag()

void ossimAdjustmentInfo::setDirtyFlag ( bool  flag = true)

Definition at line 92 of file ossimAdjustmentInfo.cpp.

References theDirtyFlag.

93 {
94  theDirtyFlag = flag;
95 }

◆ setLockFlag()

void ossimAdjustmentInfo::setLockFlag ( bool  flag,
ossim_uint32  idx 
)

Definition at line 97 of file ossimAdjustmentInfo.cpp.

References theParameterList.

99 {
100  if(idx < theParameterList.size())
101  {
102  theParameterList[idx].setLockFlag(flag);
103  }
104 }
std::vector< ossimAdjustableParameterInfo > theParameterList

◆ setLockParameterFlag()

void ossimAdjustmentInfo::setLockParameterFlag ( bool  flag,
ossim_uint32  idx 
)

◆ setNumberOfAdjustableParameters()

void ossimAdjustmentInfo::setNumberOfAdjustableParameters ( ossim_uint32  numberOfAdjustableParameters)

Definition at line 50 of file ossimAdjustmentInfo.cpp.

References theParameterList.

Referenced by ossimAdjustableParameterInterface::getAdjustment(), and loadState().

51 {
52  std::vector<ossimAdjustableParameterInfo> temp = theParameterList;
53 
54  theParameterList.resize(numberOfAdjustableParameters);
55  if(temp.size() < numberOfAdjustableParameters)
56  {
57  std::copy(temp.begin(),
58  temp.end(),
59  theParameterList.begin());
60  }
61  else if(temp.size() > numberOfAdjustableParameters)
62  {
63  if(numberOfAdjustableParameters > 0)
64  {
65  std::copy(temp.begin(),
66  temp.begin()+numberOfAdjustableParameters,
67  theParameterList.begin());
68  }
69  }
70 }
std::vector< ossimAdjustableParameterInfo > theParameterList

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimAdjustmentInfo data 
)
friend

Definition at line 18 of file ossimAdjustmentInfo.cpp.

19 {
20  ossim_int32 idx = 0;
21 
22  out << "Description: " << data.getDescription()
23  << "\nNumber of Params: " << data.theParameterList.size()
24  << "\nDirty flag: " << data.theDirtyFlag << std::endl;
25 
26  for(idx = 0; idx < (int)data.getNumberOfAdjustableParameters(); ++idx)
27  {
28  out << "Param " << idx << std::endl;
29  out << data.theParameterList[idx] << std::endl;
30  }
31 
32  return out;
33 }
ossim_uint32 getNumberOfAdjustableParameters() const
ossimString getDescription() const
std::vector< ossimAdjustableParameterInfo > theParameterList
int ossim_int32

Member Data Documentation

◆ theDescription

ossimString ossimAdjustmentInfo::theDescription
private

Definition at line 46 of file ossimAdjustmentInfo.h.

Referenced by getDescription(), and setDescription().

◆ theDirtyFlag

bool ossimAdjustmentInfo::theDirtyFlag
mutableprivate

Definition at line 47 of file ossimAdjustmentInfo.h.

Referenced by isDirty(), operator<<(), and setDirtyFlag().

◆ theParameterList

std::vector<ossimAdjustableParameterInfo> ossimAdjustmentInfo::theParameterList
private

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