OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimAdjustableParameterInterface.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com)
6 //
7 //*************************************************************************
8 // $Id: ossimAdjustableParameterInterface.h 22892 2014-09-22 15:17:33Z okramer $
9 #ifndef ossimAdjustableParameterInterface_HEADER
10 #define ossimAdjustableParameterInterface_HEADER
11 #include <ossim/base/ossimRtti.h>
12 #include <vector>
15 #include <ossim/base/ossimObject.h>
16 
18 {
19 public:
23  void newAdjustment(ossim_uint32 numberOfParameters=0);
24  void setAdjustmentDescription(const ossimString& description);
25  ossimString getAdjustmentDescription()const;
26 
28  ossimString getAdjustmentDescription(ossim_uint32 adjustmentIdx)const;
29 
30  void setCurrentAdjustment(ossim_uint32 adjustmentIndex, bool notify=false);
31 
34  bool setCurrentAdjustment(const ossimString& description, bool notify=false);
35 
36  void eraseAdjustment(bool notify);
37  void eraseAdjustment(ossim_uint32 idx, bool notify);
38  virtual void initAdjustableParameters();
39  void resetAdjustableParameters(bool notify=false);
40  void copyAdjustment(ossim_uint32 idx, bool notify);
41  void copyAdjustment(bool notify = false);
42 
43  virtual ossimObject* getBaseObject()=0;
44  virtual const ossimObject* getBaseObject()const=0;
45 
51  void keepAdjustment(ossim_uint32 idx, bool createCopy);
52  virtual void keepAdjustment(bool createCopy=true);
53 
54 
56  void removeAllAdjustments();
57  ossim_uint32 getNumberOfAdjustableParameters()const;
58  double getAdjustableParameter(ossim_uint32 idx)const;
59  virtual void setAdjustableParameter(ossim_uint32 idx, double value,
60  bool notify=false);
61  virtual void setAdjustableParameter(ossim_uint32 idx,
62  double value,
63  double sigma,
64  bool notify=false);
65  double getParameterSigma(ossim_uint32 idx)const;
66  void setParameterSigma(ossim_uint32 idx,
67  double value,
68  bool notify=false);
69  ossimUnitType getParameterUnit(ossim_uint32 idx)const;
70  void setParameterUnit(ossim_uint32 idx, ossimUnitType unit);
71  void setParameterUnit(ossim_uint32 idx, const ossimString& unit);
72 
73  void setParameterCenter(ossim_uint32 idx,
74  double center,
75  bool notify = false);
76  double getParameterCenter(ossim_uint32 idx)const;
77  double computeParameterOffset(ossim_uint32 idx)const;
78  void setParameterOffset(ossim_uint32 idx,
79  ossim_float64 value,
80  bool notify = false);
81 
82  ossimString getParameterDescription(ossim_uint32 idx)const;
83  void setParameterDescription(ossim_uint32 idx,
84  const ossimString& descrption);
85 
86  ossim_int32 findParameterIdxGivenDescription(ossim_uint32 adjustmentIdx,
87  const ossimString& name)const;
88  ossim_int32 findParameterIdxContainingDescription(ossim_uint32 adjustmentIdx,
89  const ossimString& name)const;
90 
91  bool isParameterLocked(ossim_uint32 idx)const;
92 
93  void setParameterLockFlag(ossim_uint32 idxParam, bool flag);
94  bool getParameterLockFlag(ossim_uint32 idx)const;
95 
96  void lockAllParametersCurrentAdjustment();
97  void unlockAllParametersCurrentAdjustment();
98 
99  void lockAllParameters(ossim_uint32 idxAdjustment);
100  void unlockAllParameters(ossim_uint32 idxAdjustment);
101 
102  void resizeAdjustableParameterArray(ossim_uint32 numberOfParameters);
103 
104  void setAdjustment(const ossimAdjustmentInfo& adj, bool notify=false);
105  void setAdjustment(ossim_uint32 idx, const ossimAdjustmentInfo& adj, bool notify=false);
106 
107  void addAdjustment(const ossimAdjustmentInfo& adj, bool notify);
108  void getAdjustment(ossimAdjustmentInfo& adj) const;
109  void getAdjustment(ossim_uint32 idx, ossimAdjustmentInfo& adj) const;
110 
111  ossim_uint32 getNumberOfAdjustments()const;
112  ossim_uint32 getCurrentAdjustmentIdx()const;
113 
114  void setDirtyFlag(bool flag=true);
115  void setAllDirtyFlag(bool flag = true);
116  bool hasDirtyAdjustments()const;
117 
121  virtual void saveCurrentAdjustmentOnly(ossimKeywordlist &kwl,
122  const ossimString& prefix=ossimString(""));
123 
124  bool saveAdjustments(ossimKeywordlist& kwl,
125  const ossimString& prefix=ossimString(""))const;
126  bool loadAdjustments(const ossimKeywordlist& kwl,
127  const ossimString& prefix=ossimString(""));
128 
130  virtual void updateModel() {}
131 
133  std::ostream& print(std::ostream& out) const;
134 
135 protected:
137  bool paramChanged(ossim_uint32 param_idx) const { return theChangeFlags[param_idx]; }
138 
141  void setAllChangeFlags(bool areChanged);
142 
144  void initChangeFlags();
145 
146 private:
147  std::vector<bool> theChangeFlags;
148  std::vector<ossimAdjustmentInfo> theAdjustmentList;
150 
151 public:
152  virtual void adjustableParametersChanged();
153 
154 TYPE_DATA
155 };
156 
157 #endif
#define OSSIMDLLEXPORT
ossimUnitType
Represents serializable keyword/value map.
virtual void updateModel()
Provides the derived adjustable class an opportunity to update its state after a param change...
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
bool paramChanged(ossim_uint32 param_idx) const
Returns true if specified parameter has been modified since last setAllChangeFlag(false) call...
double ossim_float64
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
std::vector< ossimAdjustmentInfo > theAdjustmentList
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32