17 static const char* NUMBER_OF_ADJUSTMENTS_KW =
"number_of_adjustments";
18 static const char* NUMBER_OF_ADJUSTMENTS_OLD_KW =
"number_of_adjustements";
19 static const char* CURRENT_ADJUSTMENT_OLD_KW =
"current_adjustement";
20 static const char* CURRENT_ADJUSTMENT_KW =
"current_adjustment";
21 static const char* ADJUSTMENT_PREFIX =
"adjustment_";
25 theChangeFlags(false),
27 theCurrentAdjustment(0)
33 theChangeFlags(rhs.theChangeFlags),
34 theAdjustmentList(rhs.theAdjustmentList),
35 theCurrentAdjustment(rhs.theCurrentAdjustment)
42 if(numberOfParameters > 0)
128 for(idx = 0; idx < numberOfAdjustables; ++idx)
473 for(idx = 0; ((idx <
n)&&(!found)); ++idx)
494 for(idx = 0; ((idx <
n)&&(!found)); ++idx)
565 for(idx = 0; idx <
n; ++idx)
579 for(idx = 0; idx <
n; ++idx)
738 NUMBER_OF_ADJUSTMENTS_KW,
742 CURRENT_ADJUSTMENT_KW,
770 int numberOfAdjustments = 0;
771 const char* value = kwl.
find(prefix, NUMBER_OF_ADJUSTMENTS_KW);
774 numberOfAdjustments = atoi(value);
785 if (i < numberOfAdjustments)
790 if ((i == numberOfAdjustments) || (adjInfo.
getDescription() == currentLabel))
797 if (i == numberOfAdjustments)
799 kwl.
add(prefix, NUMBER_OF_ADJUSTMENTS_KW, ++numberOfAdjustments);
818 const char* numberOfAdjustments = kwl.
find(prefix, NUMBER_OF_ADJUSTMENTS_KW);
819 const char* currentAdjustment = kwl.
find(prefix, CURRENT_ADJUSTMENT_KW);
821 if(!numberOfAdjustments)
823 numberOfAdjustments = kwl.
find(prefix, NUMBER_OF_ADJUSTMENTS_OLD_KW);
825 if(!currentAdjustment)
827 currentAdjustment = kwl.
find(prefix, CURRENT_ADJUSTMENT_OLD_KW);
829 if(!numberOfAdjustments)
return false;
833 for(
int adjIdx = 0; adjIdx <maxdjustments; ++adjIdx)
862 out <<
"\nossimAdjustableParameterInterface base-class current adjustment index: " 867 out <<
"No adjustments specified." << std::endl;
879 for (
unsigned int i=0; i<num_params; ++i)
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
double computeParameterOffset(ossim_uint32 idx) const
bool saveAdjustments(ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
Save all adjustments to the KWL file.
void setCurrentAdjustment(ossim_uint32 adjustmentIndex, bool notify=false)
void setParameterLockFlag(ossim_uint32 idxParam, bool flag)
Represents serializable keyword/value map.
void keepAdjustment(ossim_uint32 idx, bool createCopy)
const char * find(const char *key) const
bool hasDirtyAdjustments() const
bool loadState(const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
virtual void adjustableParametersChanged()
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString getDescription() const
void setAdjustmentDescription(const ossimString &description)
ossim_uint32 toUInt32() const
ossim_int32 findParameterIdxGivenDescription(ossim_uint32 adjustmentIdx, const ossimString &name) const
ossim_uint32 getNumberOfAdjustableParameters() const
ossim_uint32 getCurrentAdjustmentIdx() const
std::vector< bool > theChangeFlags
void lockAllParametersCurrentAdjustment()
ossimString getParameterDescription(ossim_uint32 idx) const
void setAdjustment(const ossimAdjustmentInfo &adj, bool notify=false)
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimUnitType getParameterUnit(ossim_uint32 idx) const
void setParameterOffset(ossim_uint32 idx, ossim_float64 value, bool notify=false)
void eraseAdjustment(bool notify)
virtual void saveCurrentAdjustmentOnly(ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
Saves the current active adjustment to the KWL file.
os2<< "> n<< " > nendobj n
bool saveState(ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
void setAllDirtyFlag(bool flag=true)
virtual void initAdjustableParameters()
void newAdjustment(ossim_uint32 numberOfParameters=0)
unsigned int ossim_uint32
double getAdjustableParameter(ossim_uint32 idx) const
void setAllChangeFlags(bool areChanged)
Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (...
void addAdjustment(const ossimAdjustmentInfo &adj, bool notify)
bool loadAdjustments(const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
void unlockAllParameters(ossim_uint32 idxAdjustment)
bool isParameterLocked(ossim_uint32 idx) const
void setParameterUnit(ossim_uint32 idx, ossimUnitType unit)
void unlockAllParametersCurrentAdjustment()
void setDirtyFlag(bool flag=true)
ossim_uint32 theCurrentAdjustment
void lockAllParameters(ossim_uint32 idxAdjustment)
bool getParameterLockFlag(ossim_uint32 idx) const
virtual void setAdjustableParameter(ossim_uint32 idx, double value, bool notify=false)
void resetAdjustableParameters(bool notify=false)
void resizeAdjustableParameterArray(ossim_uint32 numberOfParameters)
std::ostream & print(std::ostream &out) const
Dumps the currently active adjustment to ostream.
void removeAllAdjustments()
RTTI_DEF(ossimAdjustableParameterInterface, "ossimAdjustableParameterInterface")
const ossimAdjustableParameterInterface & operator=(const ossimAdjustableParameterInterface &rhs)
ossim_uint32 getNumberOfAdjustments() const
void getAdjustment(ossimAdjustmentInfo &adj) const
std::vector< ossimAdjustmentInfo > theAdjustmentList
void setNumberOfAdjustableParameters(ossim_uint32 numberOfAdjustableParameters)
ossim_int32 findParameterIdxContainingDescription(ossim_uint32 adjustmentIdx, const ossimString &name) const
void setParameterCenter(ossim_uint32 idx, double center, bool notify=false)
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
void initChangeFlags()
Initializes the change flags to TRUE.
ossimAdjustableParameterInterface()
double getParameterCenter(ossim_uint32 idx) const
void setParameterSigma(ossim_uint32 idx, double value, bool notify=false)
std::basic_ostream< char > ostream
Base class for char output streams.
double getParameterSigma(ossim_uint32 idx) const
void copyAdjustment(ossim_uint32 idx, bool notify)
ossimString getAdjustmentDescription() const
const char * getDescription()