OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ossimAdjustableParameterInterface Class Referenceabstract

#include <ossimAdjustableParameterInterface.h>

Inheritance diagram for ossimAdjustableParameterInterface:
ossimLocalCorrelationFusion ossimRpcProjection ossimSensorModel ossimSFIMFusion ossimAdjMapModel ossimAlphaSensor ossimApplanixEcefModel ossimApplanixUtmModel ossimCoarseGridModel ossimFcsiModel ossimIpodSensor ossimLandSatModel ossimNitfMapModel ossimplugins::ossimFormosatModel ossimplugins::ossimGeometricSarSensorModel ossimplugins::ossimTileMapModel ossimPpjFrameSensor ossimRpcModel ossimRS1SarModel ossimRsmModel ossimSarModel ossimSkyBoxLearSensor ossimSonomaSensor ossimSpectraboticsRedEdgeModel ossimSpot5Model

Public Member Functions

 ossimAdjustableParameterInterface ()
 
 ossimAdjustableParameterInterface (const ossimAdjustableParameterInterface &rhs)
 
virtual ~ossimAdjustableParameterInterface ()
 
void newAdjustment (ossim_uint32 numberOfParameters=0)
 
void setAdjustmentDescription (const ossimString &description)
 
ossimString getAdjustmentDescription () const
 
ossimString getAdjustmentDescription (ossim_uint32 adjustmentIdx) const
 Returns adjustmentDescription of specific adjustmentInfo. More...
 
void setCurrentAdjustment (ossim_uint32 adjustmentIndex, bool notify=false)
 
bool setCurrentAdjustment (const ossimString &description, bool notify=false)
 Sets the current adjustment to the adjustment with a matching description. More...
 
void eraseAdjustment (bool notify)
 
void eraseAdjustment (ossim_uint32 idx, bool notify)
 
virtual void initAdjustableParameters ()
 
void resetAdjustableParameters (bool notify=false)
 
void copyAdjustment (ossim_uint32 idx, bool notify)
 
void copyAdjustment (bool notify=false)
 
virtual ossimObjectgetBaseObject ()=0
 
virtual const ossimObjectgetBaseObject () const =0
 
void keepAdjustment (ossim_uint32 idx, bool createCopy)
 
virtual void keepAdjustment (bool createCopy=true)
 
const ossimAdjustableParameterInterfaceoperator= (const ossimAdjustableParameterInterface &rhs)
 
void removeAllAdjustments ()
 
ossim_uint32 getNumberOfAdjustableParameters () const
 
double getAdjustableParameter (ossim_uint32 idx) const
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, bool notify=false)
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, double sigma, bool notify=false)
 
double getParameterSigma (ossim_uint32 idx) const
 
void setParameterSigma (ossim_uint32 idx, double value, bool notify=false)
 
ossimUnitType getParameterUnit (ossim_uint32 idx) const
 
void setParameterUnit (ossim_uint32 idx, ossimUnitType unit)
 
void setParameterUnit (ossim_uint32 idx, const ossimString &unit)
 
void setParameterCenter (ossim_uint32 idx, double center, bool notify=false)
 
double getParameterCenter (ossim_uint32 idx) const
 
double computeParameterOffset (ossim_uint32 idx) const
 
void setParameterOffset (ossim_uint32 idx, ossim_float64 value, bool notify=false)
 
ossimString getParameterDescription (ossim_uint32 idx) const
 
void setParameterDescription (ossim_uint32 idx, const ossimString &descrption)
 
ossim_int32 findParameterIdxGivenDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
ossim_int32 findParameterIdxContainingDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
bool isParameterLocked (ossim_uint32 idx) const
 
void setParameterLockFlag (ossim_uint32 idxParam, bool flag)
 
bool getParameterLockFlag (ossim_uint32 idx) const
 
void lockAllParametersCurrentAdjustment ()
 
void unlockAllParametersCurrentAdjustment ()
 
void lockAllParameters (ossim_uint32 idxAdjustment)
 
void unlockAllParameters (ossim_uint32 idxAdjustment)
 
void resizeAdjustableParameterArray (ossim_uint32 numberOfParameters)
 
void setAdjustment (const ossimAdjustmentInfo &adj, bool notify=false)
 
void setAdjustment (ossim_uint32 idx, const ossimAdjustmentInfo &adj, bool notify=false)
 
void addAdjustment (const ossimAdjustmentInfo &adj, bool notify)
 
void getAdjustment (ossimAdjustmentInfo &adj) const
 
void getAdjustment (ossim_uint32 idx, ossimAdjustmentInfo &adj) const
 
ossim_uint32 getNumberOfAdjustments () const
 
ossim_uint32 getCurrentAdjustmentIdx () const
 
void setDirtyFlag (bool flag=true)
 
void setAllDirtyFlag (bool flag=true)
 
bool hasDirtyAdjustments () const
 
virtual void saveCurrentAdjustmentOnly (ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 Saves the current active adjustment to the KWL file. More...
 
bool saveAdjustments (ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
 Save all adjustments to the KWL file. More...
 
bool loadAdjustments (const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 
virtual void updateModel ()
 Provides the derived adjustable class an opportunity to update its state after a param change. More...
 
std::ostream & print (std::ostream &out) const
 Dumps the currently active adjustment to ostream. More...
 
virtual void adjustableParametersChanged ()
 

Protected Member Functions

bool paramChanged (ossim_uint32 param_idx) const
 Returns true if specified parameter has been modified since last setAllChangeFlag(false) call. More...
 
void setAllChangeFlags (bool areChanged)
 Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (FALSE). More...
 
void initChangeFlags ()
 Initializes the change flags to TRUE. More...
 

Private Attributes

std::vector< bool > theChangeFlags
 
std::vector< ossimAdjustmentInfotheAdjustmentList
 
ossim_uint32 theCurrentAdjustment
 

Detailed Description

Definition at line 17 of file ossimAdjustableParameterInterface.h.

Constructor & Destructor Documentation

◆ ossimAdjustableParameterInterface() [1/2]

ossimAdjustableParameterInterface::ossimAdjustableParameterInterface ( )

◆ ossimAdjustableParameterInterface() [2/2]

ossimAdjustableParameterInterface::ossimAdjustableParameterInterface ( const ossimAdjustableParameterInterface rhs)

◆ ~ossimAdjustableParameterInterface()

virtual ossimAdjustableParameterInterface::~ossimAdjustableParameterInterface ( )
inlinevirtual

Definition at line 22 of file ossimAdjustableParameterInterface.h.

22 {}

Member Function Documentation

◆ addAdjustment()

void ossimAdjustableParameterInterface::addAdjustment ( const ossimAdjustmentInfo adj,
bool  notify 
)

Definition at line 657 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), and theAdjustmentList.

Referenced by ossimCoarseGridModel::initAdjustableParameters().

658 {
659  theAdjustmentList.push_back(adj);
660  if(notify)
661  {
663  }
664 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ adjustableParametersChanged()

void ossimAdjustableParameterInterface::adjustableParametersChanged ( )
virtual

◆ computeParameterOffset()

double ossimAdjustableParameterInterface::computeParameterOffset ( ossim_uint32  idx) const

Definition at line 450 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimSFIMFusion::adjustableParametersChanged(), ossimRpcProjection::adjustableParametersChanged(), ossimLocalCorrelationFusion::adjustableParametersChanged(), ossimAlphaSensor::getCameraPosition(), ossimSFIMFusion::getProperty(), ossimLocalCorrelationFusion::getTile(), ossimIpodSensor::imagingRay(), ossimSkyBoxLearSensor::imagingRay(), ossimSonomaSensor::imagingRay(), ossimSFIMFusion::setFilters(), ossimLocalCorrelationFusion::setFilters(), ossimApplanixUtmModel::updateModel(), ossimSpectraboticsRedEdgeModel::updateModel(), ossimApplanixEcefModel::updateModel(), ossimIpodSensor::updateModel(), ossimSkyBoxLearSensor::updateModel(), ossimAdjMapModel::updateModel(), ossimLandSatModel::updateModel(), and ossimRpcModel::updateModel().

451 {
452  if(!theAdjustmentList.size())
453  {
454  return 0.0;
455  }
457  {
458  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].computeOffset();
459  }
460 
461  return 0.0;
462 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ copyAdjustment() [1/2]

void ossimAdjustableParameterInterface::copyAdjustment ( ossim_uint32  idx,
bool  notify 
)

Definition at line 143 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), initChangeFlags(), theAdjustmentList, and theCurrentAdjustment.

Referenced by copyAdjustment(), keepAdjustment(), and resetAdjustableParameters().

144 {
145  if(!theAdjustmentList.size())
146  {
147  return;
148  }
149  if(idx < theAdjustmentList.size())
150  {
151  theAdjustmentList.push_back(theAdjustmentList[idx]);
152 
153  if(idx == theCurrentAdjustment)
154  {
156  initChangeFlags();
157  }
158  if(notify)
159  {
161  }
162  }
163 
164 }
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList
void initChangeFlags()
Initializes the change flags to TRUE.

◆ copyAdjustment() [2/2]

void ossimAdjustableParameterInterface::copyAdjustment ( bool  notify = false)

◆ eraseAdjustment() [1/2]

void ossimAdjustableParameterInterface::eraseAdjustment ( bool  notify)

◆ eraseAdjustment() [2/2]

void ossimAdjustableParameterInterface::eraseAdjustment ( ossim_uint32  idx,
bool  notify 
)

Definition at line 224 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), theAdjustmentList, and theCurrentAdjustment.

225 {
226  if(!theAdjustmentList.size())
227  {
228  return;
229  }
230 
231  if(theCurrentAdjustment == idx)
232  {
235  {
236  if(theAdjustmentList.size() < 1)
237  {
239  }
240  else
241  {
243  }
244 
245  }
246 
247  if(notify)
248  {
250  }
251  }
252  else if(idx < theAdjustmentList.size())
253  {
254  theAdjustmentList.erase(theAdjustmentList.begin() + idx);
255  if(theAdjustmentList.size() < 1)
256  {
258  }
259  else
260  {
261  if(theCurrentAdjustment > idx)
262  {
264  if(notify)
265  {
267  }
268  }
269  }
270  if(notify)
271  {
273  }
274  }
275 }
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ findParameterIdxContainingDescription()

ossim_int32 ossimAdjustableParameterInterface::findParameterIdxContainingDescription ( ossim_uint32  adjustmentIdx,
const ossimString name 
) const

Definition at line 485 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustments(), n, theAdjustmentList, and theCurrentAdjustment.

487 {
488  ossim_int32 result = -1;
489  if(adjustmentIdx < getNumberOfAdjustments())
490  {
491  ossim_uint32 idx = 0;
492  ossim_uint32 n = theAdjustmentList[adjustmentIdx].getNumberOfAdjustableParameters();
493  bool found = false;
494  for(idx = 0; ((idx < n)&&(!found)); ++idx)
495  {
496  if(theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getDescription().contains(name))
497  {
498  result = (ossim_int32) idx;
499  }
500  }
501  }
502 
503  return result;
504 }
os2<< "> n<< " > nendobj n
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList
int ossim_int32

◆ findParameterIdxGivenDescription()

ossim_int32 ossimAdjustableParameterInterface::findParameterIdxGivenDescription ( ossim_uint32  adjustmentIdx,
const ossimString name 
) const

Definition at line 464 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustments(), n, theAdjustmentList, and theCurrentAdjustment.

466 {
467  ossim_int32 result = -1;
468  if(adjustmentIdx < getNumberOfAdjustments())
469  {
470  ossim_uint32 idx = 0;
471  ossim_uint32 n = theAdjustmentList[adjustmentIdx].getNumberOfAdjustableParameters();
472  bool found = false;
473  for(idx = 0; ((idx < n)&&(!found)); ++idx)
474  {
475  if(theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getDescription() == name)
476  {
477  result = (ossim_int32) idx;
478  }
479  }
480  }
481 
482  return result;
483 }
os2<< "> n<< " > nendobj n
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList
int ossim_int32

◆ getAdjustableParameter()

double ossimAdjustableParameterInterface::getAdjustableParameter ( ossim_uint32  idx) const

◆ getAdjustment() [1/2]

void ossimAdjustableParameterInterface::getAdjustment ( ossimAdjustmentInfo adj) const

◆ getAdjustment() [2/2]

void ossimAdjustableParameterInterface::getAdjustment ( ossim_uint32  idx,
ossimAdjustmentInfo adj 
) const

Definition at line 671 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustments(), ossimAdjustmentInfo::setNumberOfAdjustableParameters(), and theAdjustmentList.

672 {
674 
675  if(idx < getNumberOfAdjustments())
676  {
677  adj = theAdjustmentList[(int)idx];
678  }
679 }
std::vector< ossimAdjustmentInfo > theAdjustmentList
void setNumberOfAdjustableParameters(ossim_uint32 numberOfAdjustableParameters)

◆ getAdjustmentDescription() [1/2]

ossimString ossimAdjustableParameterInterface::getAdjustmentDescription ( ) const

Definition at line 61 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList, and theCurrentAdjustment.

62 {
63  if(theAdjustmentList.size())
64  {
65  return theAdjustmentList[theCurrentAdjustment].getDescription();
66  }
67 
68  return "";
69 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getAdjustmentDescription() [2/2]

ossimString ossimAdjustableParameterInterface::getAdjustmentDescription ( ossim_uint32  adjustmentIdx) const

Returns adjustmentDescription of specific adjustmentInfo.

Definition at line 72 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList.

73 {
74  if(adjustmentIdx < theAdjustmentList.size())
75  {
76  return theAdjustmentList[adjustmentIdx].getDescription();
77  }
78  return "";
79 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getBaseObject() [1/2]

virtual ossimObject* ossimAdjustableParameterInterface::getBaseObject ( )
pure virtual

◆ getBaseObject() [2/2]

virtual const ossimObject* ossimAdjustableParameterInterface::getBaseObject ( ) const
pure virtual

◆ getCurrentAdjustmentIdx()

ossim_uint32 ossimAdjustableParameterInterface::getCurrentAdjustmentIdx ( ) const

Definition at line 686 of file ossimAdjustableParameterInterface.cpp.

References theCurrentAdjustment.

◆ getNumberOfAdjustableParameters()

ossim_uint32 ossimAdjustableParameterInterface::getNumberOfAdjustableParameters ( ) const

Definition at line 209 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimPointObservation::addMeasurement(), ossimRpcProjection::buildNormalEquation(), ossimSensorModel::buildNormalEquation(), ossimImageGeometry::computeImageToGroundPartialsWRTAdjParam(), ossimImageGeometry::computeImageToGroundPartialsWRTAdjParams(), computeParameterOffset(), ossimRpcProjection::degreesOfFreedom(), ossimSensorModel::degreesOfFreedom(), getAdjustableParameter(), getParameterCenter(), getParameterDescription(), getParameterLockFlag(), getParameterSigma(), getParameterUnit(), ossimCoarseGridModel::initAdjustableParameters(), ossimRpcModel::initAdjustableParameters(), initChangeFlags(), isParameterLocked(), ossimIpodSensor::loadState(), ossimSkyBoxLearSensor::loadState(), ossimSonomaSensor::loadState(), ossimSensorModel::optimizeFit(), resetAdjustableParameters(), setAdjustableParameter(), setAllChangeFlags(), setParameterCenter(), setParameterDescription(), setParameterLockFlag(), setParameterOffset(), setParameterSigma(), and setParameterUnit().

210 {
211  if(theAdjustmentList.size())
212  {
213  return theAdjustmentList[theCurrentAdjustment].getNumberOfAdjustableParameters();
214  }
215 
216  return 0;
217 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getNumberOfAdjustments()

ossim_uint32 ossimAdjustableParameterInterface::getNumberOfAdjustments ( ) const

◆ getParameterCenter()

double ossimAdjustableParameterInterface::getParameterCenter ( ossim_uint32  idx) const

Definition at line 436 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimImageGeometry::computeImageToGroundPartialsWRTAdjParam(), and ossimAdjustmentExecutive::updateParameters().

437 {
438  if(!theAdjustmentList.size())
439  {
440  return 0.0;
441  }
443  {
444  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getCenter();
445  }
446 
447  return 0.0;
448 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getParameterDescription()

ossimString ossimAdjustableParameterInterface::getParameterDescription ( ossim_uint32  idx) const

Definition at line 392 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

393 {
394  if(theAdjustmentList.size())
395  {
397  {
398  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getDescription();
399  }
400  }
401 
402  return ossimString("");
403 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getParameterLockFlag()

bool ossimAdjustableParameterInterface::getParameterLockFlag ( ossim_uint32  idx) const

Definition at line 534 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

535 {
536  if(!theAdjustmentList.size())
537  {
538  return false;
539  }
541  {
542  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getLockFlag();
543  }
544 
545  return false;
546 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getParameterSigma()

double ossimAdjustableParameterInterface::getParameterSigma ( ossim_uint32  idx) const

Definition at line 327 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

328 {
329  if(theAdjustmentList.size())
330  {
332  {
333  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getSigma();
334  }
335  }
336 
337  return 0.0;
338 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ getParameterUnit()

ossimUnitType ossimAdjustableParameterInterface::getParameterUnit ( ossim_uint32  idx) const

Definition at line 356 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), OSSIM_UNIT_UNKNOWN, theAdjustmentList, and theCurrentAdjustment.

357 {
358  if(theAdjustmentList.size())
359  {
361  {
362  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getUnit();
363  }
364  }
365 
366  return OSSIM_UNIT_UNKNOWN;
367 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ hasDirtyAdjustments()

bool ossimAdjustableParameterInterface::hasDirtyAdjustments ( ) const

Definition at line 709 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList.

710 {
711  ossim_uint32 idx = 0;
712 
713  for(idx = 0; idx < theAdjustmentList.size(); ++idx)
714  {
715  if(theAdjustmentList[idx].isDirty())
716  {
717  return true;
718  }
719  }
720 
721  return false;
722 }
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ initAdjustableParameters()

void ossimAdjustableParameterInterface::initAdjustableParameters ( )
virtual

◆ initChangeFlags()

void ossimAdjustableParameterInterface::initChangeFlags ( )
protected

Initializes the change flags to TRUE.

Initializes the change flags to false.

Definition at line 886 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), setAllChangeFlags(), and theChangeFlags.

Referenced by copyAdjustment(), newAdjustment(), and setCurrentAdjustment().

887 {
888  // Need to resize the flag list?
890  if (theChangeFlags.size() != num_params)
891  theChangeFlags.resize(num_params);
892  setAllChangeFlags(true);
893 }
unsigned int ossim_uint32
void setAllChangeFlags(bool areChanged)
Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (...

◆ isParameterLocked()

bool ossimAdjustableParameterInterface::isParameterLocked ( ossim_uint32  idx) const

Definition at line 507 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimRpcProjection::degreesOfFreedom(), and ossimSensorModel::degreesOfFreedom().

508 {
509  if(!theAdjustmentList.size())
510  {
511  return false;
512  }
514  {
515  return theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].getLockFlag();
516  }
517 
518  return false;
519 
520 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ keepAdjustment() [1/2]

void ossimAdjustableParameterInterface::keepAdjustment ( ossim_uint32  idx,
bool  createCopy 
)

Will copy the adjustment but will set the new center to the applied current center plus the application of the adjustment

Definition at line 171 of file ossimAdjustableParameterInterface.cpp.

References copyAdjustment(), theAdjustmentList, and theCurrentAdjustment.

Referenced by keepAdjustment().

173 {
174  if(!theAdjustmentList.size())
175  {
176  return;
177  }
178  if(idx < theAdjustmentList.size())
179  {
180  if(createCopy)
181  {
182  copyAdjustment(idx);
183  }
185  }
186 }
std::vector< ossimAdjustmentInfo > theAdjustmentList
void copyAdjustment(ossim_uint32 idx, bool notify)

◆ keepAdjustment() [2/2]

void ossimAdjustableParameterInterface::keepAdjustment ( bool  createCopy = true)
virtual

Definition at line 188 of file ossimAdjustableParameterInterface.cpp.

References keepAdjustment(), and theCurrentAdjustment.

189 {
191 }
void keepAdjustment(ossim_uint32 idx, bool createCopy)

◆ loadAdjustments()

bool ossimAdjustableParameterInterface::loadAdjustments ( const ossimKeywordlist kwl,
const ossimString prefix = ossimString("") 
)

Definition at line 812 of file ossimAdjustableParameterInterface.cpp.

References ossimKeywordlist::find(), theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimSFIMFusion::loadState(), and ossimLocalCorrelationFusion::loadState().

814 {
815  theAdjustmentList.clear();
817 
818  const char* numberOfAdjustments = kwl.find(prefix, NUMBER_OF_ADJUSTMENTS_KW);
819  const char* currentAdjustment = kwl.find(prefix, CURRENT_ADJUSTMENT_KW);
820 
821  if(!numberOfAdjustments)
822  {
823  numberOfAdjustments = kwl.find(prefix, NUMBER_OF_ADJUSTMENTS_OLD_KW);
824  }
825  if(!currentAdjustment)
826  {
827  currentAdjustment = kwl.find(prefix, CURRENT_ADJUSTMENT_OLD_KW);
828  }
829  if(!numberOfAdjustments) return false;
830 
831  int maxdjustments = ossimString(numberOfAdjustments).toInt();
832 
833  for(int adjIdx = 0; adjIdx <maxdjustments; ++adjIdx)
834  {
835  ossimAdjustmentInfo info;
836  ossimString adjPrefix = prefix + (ossimString(ADJUSTMENT_PREFIX) + ossimString::toString(adjIdx)+".");
837 
838  if(!info.loadState(kwl, adjPrefix))
839  {
840  return false;
841  }
842  theAdjustmentList.push_back(info);
843  }
844 
845  theCurrentAdjustment = ossimString(currentAdjustment).toUInt32();
846  initChangeFlags();
847  return true;
848 }
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.
ossim_uint32 toUInt32() const
std::vector< ossimAdjustmentInfo > theAdjustmentList
void initChangeFlags()
Initializes the change flags to TRUE.
int toInt() const

◆ lockAllParameters()

void ossimAdjustableParameterInterface::lockAllParameters ( ossim_uint32  idxAdjustment)

Definition at line 558 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustments(), n, theAdjustmentList, and theCurrentAdjustment.

Referenced by lockAllParametersCurrentAdjustment().

559 {
560  if(idxAdjustment < getNumberOfAdjustments())
561  {
562  ossim_uint32 idx = 0;
563  ossim_uint32 n = theAdjustmentList[theCurrentAdjustment].getNumberOfAdjustableParameters();
564 
565  for(idx = 0; idx < n; ++idx)
566  {
567  theAdjustmentList[idxAdjustment].getParameterList()[idx].setLockFlag(true);
568  }
569  }
570 }
os2<< "> n<< " > nendobj n
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ lockAllParametersCurrentAdjustment()

void ossimAdjustableParameterInterface::lockAllParametersCurrentAdjustment ( )

◆ newAdjustment()

void ossimAdjustableParameterInterface::newAdjustment ( ossim_uint32  numberOfParameters = 0)

Definition at line 39 of file ossimAdjustableParameterInterface.cpp.

References initChangeFlags(), theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimAdjMapModel::initAdjustableParameters(), and resizeAdjustableParameterArray().

40 {
42  if(numberOfParameters > 0)
43  {
44  theAdjustmentList[theAdjustmentList.size()-1].setNumberOfAdjustableParameters(numberOfParameters);
45  theAdjustmentList[theAdjustmentList.size()-1].setDescription("Initial adjustment");
46  }
47 
50 }
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList
void initChangeFlags()
Initializes the change flags to TRUE.

◆ operator=()

const ossimAdjustableParameterInterface & ossimAdjustableParameterInterface::operator= ( const ossimAdjustableParameterInterface rhs)

Definition at line 193 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimSensorModel::operator=().

194 {
195  if (this != &rhs)
196  {
199  }
200  return *this;
201 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ paramChanged()

bool ossimAdjustableParameterInterface::paramChanged ( ossim_uint32  param_idx) const
inlineprotected

Returns true if specified parameter has been modified since last setAllChangeFlag(false) call.

Definition at line 137 of file ossimAdjustableParameterInterface.h.

137 { return theChangeFlags[param_idx]; }

◆ print()

std::ostream & ossimAdjustableParameterInterface::print ( std::ostream &  out) const

Dumps the currently active adjustment to ostream.

Definition at line 858 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList, and theCurrentAdjustment.

859 {
861  {
862  out <<"\nossimAdjustableParameterInterface base-class current adjustment index: "
863  << theCurrentAdjustment << "\n" << theAdjustmentList[theCurrentAdjustment] << std::ends;
864  }
865  else
866  {
867  out << "No adjustments specified." << std::endl;
868  }
869  return out;
870 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ removeAllAdjustments()

void ossimAdjustableParameterInterface::removeAllAdjustments ( )

◆ resetAdjustableParameters()

void ossimAdjustableParameterInterface::resetAdjustableParameters ( bool  notify = false)

Definition at line 115 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), copyAdjustment(), eraseAdjustment(), getNumberOfAdjustableParameters(), initAdjustableParameters(), setCurrentAdjustment(), theAdjustmentList, and theCurrentAdjustment.

116 {
117  if(!theAdjustmentList.size())
118  {
119  return;
120  }
121 
122  ossim_uint32 saveCurrent = theCurrentAdjustment;
123  copyAdjustment();
125  ossim_uint32 numberOfAdjustables = getNumberOfAdjustableParameters();
126  ossim_uint32 idx = 0;
127 
128  for(idx = 0; idx < numberOfAdjustables; ++idx)
129  {
130  theAdjustmentList[saveCurrent].getParameterList()[idx].setParameter(theAdjustmentList[theAdjustmentList.size()-1].getParameterList()[idx].getParameter());
131  }
132 
133  setCurrentAdjustment(saveCurrent);
134 
136 
137  if(notify)
138  {
140  }
141 }
void setCurrentAdjustment(ossim_uint32 adjustmentIndex, bool notify=false)
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList
void copyAdjustment(ossim_uint32 idx, bool notify)

◆ resizeAdjustableParameterArray()

void ossimAdjustableParameterInterface::resizeAdjustableParameterArray ( ossim_uint32  numberOfParameters)

◆ saveAdjustments()

bool ossimAdjustableParameterInterface::saveAdjustments ( ossimKeywordlist kwl,
const ossimString prefix = ossimString("") 
) const

Save all adjustments to the KWL file.

Definition at line 727 of file ossimAdjustableParameterInterface.cpp.

References ossimKeywordlist::add(), and theAdjustmentList.

Referenced by ossimSFIMFusion::saveState(), and ossimLocalCorrelationFusion::saveState().

729 {
730  // Nothing to do if no adjustments defined (okramer 04Sep2005)
731  if (theAdjustmentList.size() == 0)
732  return true;
733 
734  // A problem: There may have been adjustments written to the KWL by another process that this
735  // instance doesn't know about. So we need to load in all adjustments present in the KWL and
736  // replace
737  kwl.add(prefix,
738  NUMBER_OF_ADJUSTMENTS_KW,
740  true);
741  kwl.add(prefix,
742  CURRENT_ADJUSTMENT_KW,
744  true);
745 
746  for(ossim_uint32 adjIdx = 0; adjIdx < theAdjustmentList.size(); ++adjIdx)
747  {
748  ossimString adjPrefix = prefix + (ossimString(ADJUSTMENT_PREFIX) + ossimString::toString(adjIdx)+".");
749 
750  theAdjustmentList[adjIdx].saveState(kwl,
751  adjPrefix);
752  }
753 
754  return true;
755 }
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ saveCurrentAdjustmentOnly()

void ossimAdjustableParameterInterface::saveCurrentAdjustmentOnly ( ossimKeywordlist kwl,
const ossimString prefix = ossimString("") 
)
virtual

Saves the current active adjustment to the KWL file.

If an adjustment of the same description already exists in the KWL, it is replaced by the current adjustment. The object is synced up with contents of KWL.

If an adjustment of the same description already exists in the KWL, it is replaced by the current adjustment.

Definition at line 761 of file ossimAdjustableParameterInterface.cpp.

References ossimKeywordlist::find(), getAdjustment(), and ossimAdjustmentInfo::getDescription().

763 {
764  // Fetch current adjustment:
765  ossimAdjustmentInfo adjTosave;
766  getAdjustment(adjTosave);
767  ossimString currentLabel = adjTosave.getDescription();
768 
769  // Fetch the number of adjustments specified in the KWL:
770  int numberOfAdjustments = 0;
771  const char* value = kwl.find(prefix, NUMBER_OF_ADJUSTMENTS_KW);
772  if (value)
773  {
774  numberOfAdjustments = atoi(value);
775  }
776 
777  // Loop to read the descriptions of each adjustment in the KWL to see if a match exists. If
778  // we reach the end, insert it there:
779  // int saved_adj_idx;
780  ossimAdjustmentInfo adjInfo;
781  int i = 0;
782  while (true)
783  {
784  ossimString adjPrefix = prefix+(ossimString(ADJUSTMENT_PREFIX)+ossimString::toString(i)+".");
785  if (i < numberOfAdjustments)
786  {
787  adjInfo.loadState(kwl, adjPrefix);
788  }
789 
790  if ((i == numberOfAdjustments) || (adjInfo.getDescription() == currentLabel))
791  {
792  // match found or end of list, insert the new adjustment at this position:
793  adjTosave.saveState(kwl, adjPrefix);
794  // saved_adj_idx = i;
795 
796  // Need to bump the number of adjustments by one if we added a new one:
797  if (i == numberOfAdjustments)
798  {
799  kwl.add(prefix, NUMBER_OF_ADJUSTMENTS_KW, ++numberOfAdjustments);
800  }
801 
802  break;
803  }
804  ++i;
805  }
806 
808  //loadAdjustments(kwl, prefix);
809  //setCurrentAdjustment(saved_adj_idx);
810 }
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.
ossimString getDescription() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool saveState(ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
void getAdjustment(ossimAdjustmentInfo &adj) const

◆ setAdjustableParameter() [1/2]

void ossimAdjustableParameterInterface::setAdjustableParameter ( ossim_uint32  idx,
double  value,
bool  notify = false 
)
virtual

Definition at line 309 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), getNumberOfAdjustableParameters(), theAdjustmentList, theChangeFlags, and theCurrentAdjustment.

Referenced by ossimRpcProjection::getForwardDeriv(), ossimSensorModel::getForwardDeriv(), ossimRpcProjection::getInverseDeriv(), ossimSensorModel::getInverseDeriv(), ossimApplanixUtmModel::initAdjustableParameters(), ossimSpectraboticsRedEdgeModel::initAdjustableParameters(), ossimApplanixEcefModel::initAdjustableParameters(), ossimIpodSensor::initAdjustableParameters(), ossimSkyBoxLearSensor::initAdjustableParameters(), ossimAdjMapModel::initAdjustableParameters(), ossimSonomaSensor::initAdjustableParameters(), ossimRpcModel::initAdjustableParameters(), and ossimSensorModel::optimizeFit().

310 {
311  if(!theAdjustmentList.size())
312  {
313  return;
314  }
316  {
317  theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].setParameter(value);
318  theChangeFlags[idx] = true;
319 
320  if(notify)
321  {
323  }
324  }
325 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setAdjustableParameter() [2/2]

void ossimAdjustableParameterInterface::setAdjustableParameter ( ossim_uint32  idx,
double  value,
double  sigma,
bool  notify = false 
)
virtual

Definition at line 290 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), getNumberOfAdjustableParameters(), theAdjustmentList, theChangeFlags, and theCurrentAdjustment.

291 {
292  if(!theAdjustmentList.size())
293  {
294  return;
295  }
297  {
298  theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].setParameter(value);
299  theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].setSigma(sigma);
300  theChangeFlags[idx] = true;
301  if(notify)
302  {
304  }
305  }
306 
307 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setAdjustment() [1/2]

void ossimAdjustableParameterInterface::setAdjustment ( const ossimAdjustmentInfo adj,
bool  notify = false 
)

◆ setAdjustment() [2/2]

void ossimAdjustableParameterInterface::setAdjustment ( ossim_uint32  idx,
const ossimAdjustmentInfo adj,
bool  notify = false 
)

Definition at line 644 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), getNumberOfAdjustments(), and theAdjustmentList.

645 {
646  if(idx < getNumberOfAdjustments())
647  {
648  theAdjustmentList[(int)idx] = adj;
649  if(notify)
650  {
652  }
653  }
654 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setAdjustmentDescription()

void ossimAdjustableParameterInterface::setAdjustmentDescription ( const ossimString description)

Definition at line 52 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimAdjMapModel::initAdjustableParameters(), and ossimAutRegUtil::saveAdjustment().

53 {
54  if(!theAdjustmentList.size())
55  {
56  return;
57  }
58  theAdjustmentList[theCurrentAdjustment].setDescription(description);
59 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setAllChangeFlags()

void ossimAdjustableParameterInterface::setAllChangeFlags ( bool  areChanged)
protected

Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (FALSE).

Definition at line 876 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), and theChangeFlags.

Referenced by initChangeFlags().

877 {
879  for (unsigned int i=0; i<num_params; ++i)
880  theChangeFlags[i] = areChanged;
881 }
unsigned int ossim_uint32

◆ setAllDirtyFlag()

void ossimAdjustableParameterInterface::setAllDirtyFlag ( bool  flag = true)

Definition at line 699 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList.

700 {
701  ossim_uint32 idx = 0;
702 
703  for(idx = 0; idx < theAdjustmentList.size(); ++idx)
704  {
705  theAdjustmentList[idx].setDirtyFlag(flag);
706  }
707 }
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setCurrentAdjustment() [1/2]

void ossimAdjustableParameterInterface::setCurrentAdjustment ( ossim_uint32  adjustmentIndex,
bool  notify = false 
)

Definition at line 81 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), initChangeFlags(), theAdjustmentList, and theCurrentAdjustment.

Referenced by resetAdjustableParameters(), and setCurrentAdjustment().

82 {
83  if(adjustmentIdx < theAdjustmentList.size())
84  {
85  theCurrentAdjustment = adjustmentIdx;
87  if(notify)
88  {
90  }
91  }
92 }
std::vector< ossimAdjustmentInfo > theAdjustmentList
void initChangeFlags()
Initializes the change flags to TRUE.

◆ setCurrentAdjustment() [2/2]

bool ossimAdjustableParameterInterface::setCurrentAdjustment ( const ossimString description,
bool  notify = false 
)

Sets the current adjustment to the adjustment with a matching description.

Returns true if successfully matched.

If Returns TRUE if successfully matched.

Definition at line 98 of file ossimAdjustableParameterInterface.cpp.

References getDescription(), setCurrentAdjustment(), and theAdjustmentList.

99 {
100  for (unsigned int i=0; i<theAdjustmentList.size(); i++)
101  {
102  if (theAdjustmentList[i].getDescription() == description)
103  {
104  setCurrentAdjustment(i, notify);
105  return true;
106  }
107  }
108  return false;
109 }
void setCurrentAdjustment(ossim_uint32 adjustmentIndex, bool notify=false)
std::vector< ossimAdjustmentInfo > theAdjustmentList
const char * getDescription()

◆ setDirtyFlag()

void ossimAdjustableParameterInterface::setDirtyFlag ( bool  flag = true)

Definition at line 691 of file ossimAdjustableParameterInterface.cpp.

References theAdjustmentList, and theCurrentAdjustment.

692 {
693  if(theAdjustmentList.size() > 0)
694  {
695  theAdjustmentList[theCurrentAdjustment].setDirtyFlag(flag);
696  }
697 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setParameterCenter()

void ossimAdjustableParameterInterface::setParameterCenter ( ossim_uint32  idx,
double  center,
bool  notify = false 
)

◆ setParameterDescription()

void ossimAdjustableParameterInterface::setParameterDescription ( ossim_uint32  idx,
const ossimString descrption 
)

◆ setParameterLockFlag()

void ossimAdjustableParameterInterface::setParameterLockFlag ( ossim_uint32  idxParam,
bool  flag 
)

Definition at line 522 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

523 {
524  if(!theAdjustmentList.size())
525  {
526  return;
527  }
529  {
530  theAdjustmentList[theCurrentAdjustment].getParameterList()[idxParam].setLockFlag(flag);
531  }
532 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setParameterOffset()

void ossimAdjustableParameterInterface::setParameterOffset ( ossim_uint32  idx,
ossim_float64  value,
bool  notify = false 
)

Definition at line 587 of file ossimAdjustableParameterInterface.cpp.

References adjustableParametersChanged(), getNumberOfAdjustableParameters(), theAdjustmentList, and theCurrentAdjustment.

Referenced by ossimSFIMFusion::initialize(), and ossimSFIMFusion::setProperty().

590 {
591 // double center = getParameterCenter(idx);
592 // double sigma = getParameterSigma(idx);
593 // double minValue = center - sigma;
594 // double maxValue = center + sigma;
595 // double x = 0.0;
596 
597 // if(sigma != 0.0)
598 // {
599 // x = (value - center)/sigma;
600 
601 // value = center + x*sigma;
602 
603 // if(value < minValue)
604 // {
605 // x = -1;
606 // }
607 // else if(value >maxValue)
608 // {
609 // x = 1.0;
610 // }
611 // setAdjustableParameter(idx, x, false);
612 // }
613 
614  if(!theAdjustmentList.size())
615  {
616  return;
617  }
619  {
620  theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].setOffset(value);
621  if(notify)
622  {
624  }
625  }
626 }
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ setParameterSigma()

void ossimAdjustableParameterInterface::setParameterSigma ( ossim_uint32  idx,
double  value,
bool  notify = false 
)

◆ setParameterUnit() [1/2]

void ossimAdjustableParameterInterface::setParameterUnit ( ossim_uint32  idx,
ossimUnitType  unit 
)

◆ setParameterUnit() [2/2]

void ossimAdjustableParameterInterface::setParameterUnit ( ossim_uint32  idx,
const ossimString unit 
)

Definition at line 380 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustableParameters(), ossimUnitTypeLut::instance(), theAdjustmentList, and theCurrentAdjustment.

381 {
382  if(theAdjustmentList.size())
383  {
385  {
386  theAdjustmentList[theCurrentAdjustment].getParameterList()[idx].setUnit((ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(unit));
387  }
388  }
389 }
ossimUnitType
std::vector< ossimAdjustmentInfo > theAdjustmentList
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.

◆ unlockAllParameters()

void ossimAdjustableParameterInterface::unlockAllParameters ( ossim_uint32  idxAdjustment)

Definition at line 572 of file ossimAdjustableParameterInterface.cpp.

References getNumberOfAdjustments(), n, theAdjustmentList, and theCurrentAdjustment.

Referenced by unlockAllParametersCurrentAdjustment().

573 {
574  if(idxAdjustment < getNumberOfAdjustments())
575  {
576  ossim_uint32 idx = 0;
577  ossim_uint32 n = theAdjustmentList[theCurrentAdjustment].getNumberOfAdjustableParameters();
578 
579  for(idx = 0; idx < n; ++idx)
580  {
581  theAdjustmentList[idxAdjustment].getParameterList()[idx].setLockFlag(false);
582  }
583  }
584 }
os2<< "> n<< " > nendobj n
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList

◆ unlockAllParametersCurrentAdjustment()

void ossimAdjustableParameterInterface::unlockAllParametersCurrentAdjustment ( )

◆ updateModel()

virtual void ossimAdjustableParameterInterface::updateModel ( )
inlinevirtual

Member Data Documentation

◆ theAdjustmentList

std::vector<ossimAdjustmentInfo> ossimAdjustableParameterInterface::theAdjustmentList
private

◆ theChangeFlags

std::vector<bool> ossimAdjustableParameterInterface::theChangeFlags
private

◆ theCurrentAdjustment

ossim_uint32 ossimAdjustableParameterInterface::theCurrentAdjustment
private

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