Isis 3 Programmer Reference
InterestOperator.h
1 #ifndef InterestOperator_h
2 #define InterestOperator_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <string>
13 #include <vector>
14 #include "PvlGroup.h"
15 #include "Camera.h"
16 #include "UniversalGroundMap.h"
17 #include "ControlNetValidMeasure.h"
18 #include "ImageOverlapSet.h"
19 
20 #include "geos/geom/Point.h"
21 #include "geos/geom/Coordinate.h"
22 #include "geos/geom/MultiPolygon.h"
23 #include "geos/util/GEOSException.h"
24 
25 namespace Isis {
26  class Chip;
27  class Pvl;
28  class Cube;
29  class PvlObject;
30  class ControlNet;
31  class ControlPoint;
32  class ControlMeasure;
33 
110  public:
111  InterestOperator(Pvl &pPvl);
112 
113  virtual ~InterestOperator();
114 
115  void InitInterestOptions();
116 
117  void SetPatternValidPercent(const double percent);
118  void SetPatternSampling(const double percent);
119  void SetSearchSampling(const double percent);
120  void SetTolerance(double tolerance);
121  void SetPatternReduction(std::vector<int> samples, std::vector<int> lines);
122 
124  inline QString operatorName() const {
125  return mOperatorGrp["Name"];
126  };
127 
129  bool Operate(Cube &pCube, UniversalGroundMap &pUnivGrndMap, int piSample, int piLine);
130 
132  void Operate(ControlNet &pNewNet, QString psSerialNumFile, QString psOverlapListFile = "");
133 
135  inline double InterestAmount() const {
136  return p_interestAmount;
137  };
138 
140  inline double WorstInterest() const {
141  return p_worstInterest;
142  }
143 
145  inline double CubeSample() const {
146  return p_cubeSample;
147  };
148 
150  inline double CubeLine() const {
151  return p_cubeLine;
152  };
153 
155  virtual bool CompareInterests(double int1, double int2);
156  void addGroup(Isis::PvlObject &obj); //???? check if used
157 
159  void SetClipPolygon(const geos::geom::MultiPolygon &clipPolygon);
160 
163 
164  protected:
166  void Parse(Pvl &pPvl);
167 
169  virtual double Interest(Chip &subCube) = 0;
170 
172  const geos::geom::MultiPolygon *FindOverlap(Isis::ControlPoint &pCnetPoint);
173 
175  const geos::geom::MultiPolygon *FindOverlapByImageFootPrint(Isis::ControlPoint &pCnetPoint);
176 
179  void FindCnetRef(ControlNet &pNewNet);
180 
182  void ProcessLocked_Point_Reference(ControlPoint &pCPoint, PvlObject &pPvlObj, int &piMeasuresModified);
183 
185  int InterestByPoint(ControlPoint &pCnetPoint);
186 
188  bool InterestByMeasure(int piMeasure, Isis::ControlMeasure &pCnetMeasure, Isis::Cube &pCube);
189 
191  void InitInterestResults(int piIndex);
192 
193  virtual int Padding();
194 
195  double p_worstInterest, p_interestAmount;
196 
198  geos::geom::MultiPolygon *p_clipPolygon;
199 
201 
202  private:
203  double p_cubeSample, p_cubeLine;
206  bool mbOverlaps;
207 
209  int p_deltaSamp, p_deltaLine, p_lines, p_samples;
210 
212  typedef struct {
213  QString msSerialNum;
214  double mdInterest;
215  double mdBestSample;
216  double mdBestLine;
217  double mdOrigSample;
218  double mdOrigLine;
219  double mdEmission;
220  double mdIncidence;
221  double mdDn;
222  double mdResolution;
223  bool mbValid;
226  } InterestResults;
228  };
229 };
230 
231 #endif
Isis::InterestOperator::Operator
Isis::PvlGroup Operator()
Return the Operator name.
Definition: InterestOperator.cpp:975
Isis::ControlNetValidMeasure
ControlNetValidMeasure class.
Definition: ControlNetValidMeasure.h:75
Isis::InterestOperator::InterestResults::mdOrigLine
double mdOrigLine
Control Measure's original line.
Definition: InterestOperator.h:218
Isis::InterestOperator::p_cubeLine
double p_cubeLine
Point in a cube from a chip perspective.
Definition: InterestOperator.h:203
Isis::UniversalGroundMap
Universal Ground Map.
Definition: UniversalGroundMap.h:69
Isis::InterestOperator::InterestOperator
InterestOperator(Pvl &pPvl)
Create InterestOperator object.
Definition: InterestOperator.cpp:36
Isis::InterestOperator::ProcessLocked_Point_Reference
void ProcessLocked_Point_Reference(ControlPoint &pCPoint, PvlObject &pPvlObj, int &piMeasuresModified)
Process (Validate and Log) Point with Lock or with Referemce Measure Locked.
Definition: InterestOperator.cpp:278
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::InterestOperator::Interest
virtual double Interest(Chip &subCube)=0
Calculate the interest.
Isis::InterestOperator::mOverlaps
Isis::ImageOverlapSet mOverlaps
Holds the overlaps from the Overlaplist.
Definition: InterestOperator.h:205
Isis::InterestOperator::SetClipPolygon
void SetClipPolygon(const geos::geom::MultiPolygon &clipPolygon)
Set the Clip Polygon for points to be contained in the overlaps.
Definition: InterestOperator.cpp:952
Isis::InterestOperator::InterestResults::mdDn
double mdDn
Cube DN value at most interesting sample,line.
Definition: InterestOperator.h:221
Isis::InterestOperator::Padding
virtual int Padding()
Sets an offset to pass in larger chips if operator requires it This is used to offset the subchip siz...
Definition: InterestOperator.cpp:964
Isis::InterestOperator::p_minimumInterest
double p_minimumInterest
Specified in the Pvl Operator group.
Definition: InterestOperator.h:204
Isis::InterestOperator::CubeLine
double CubeLine() const
Return the search chip cube line that best matched.
Definition: InterestOperator.h:150
Isis::InterestOperator::InterestResults::mdIncidence
double mdIncidence
Incidence angle at most interesting sample,line.
Definition: InterestOperator.h:220
Isis::InterestOperator::InterestResults::mdInterest
double mdInterest
Resulting interest amt from InterestOperator.
Definition: InterestOperator.h:214
Isis::InterestOperator::CompareInterests
virtual bool CompareInterests(double int1, double int2)
Compare for int1 greater than / equal to int2.
Definition: InterestOperator.cpp:934
Isis::InterestOperator::FindCnetRef
void FindCnetRef(ControlNet &pNewNet)
Find best ref for an entire control net by calculating the interest and moving point to a better inte...
Definition: InterestOperator.cpp:371
Isis::InterestOperator::FindOverlap
const geos::geom::MultiPolygon * FindOverlap(Isis::ControlPoint &pCnetPoint)
Find if a point is in the overlap.
Definition: InterestOperator.cpp:846
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::InterestOperator::InterestResults::miDeltaLine
int miDeltaLine
The number of Lines the point has been moved.
Definition: InterestOperator.h:225
Isis::InterestOperator::mtInterestResults
InterestResults * mtInterestResults
Holds the results of an interest computation.
Definition: InterestOperator.h:227
Isis::InterestOperator::CubeSample
double CubeSample() const
Return the search chip cube sample that best matched.
Definition: InterestOperator.h:145
Isis::InterestOperator::InterestAmount
double InterestAmount() const
Return the Interest Amount.
Definition: InterestOperator.h:135
Isis::InterestOperator::p_clipPolygon
geos::geom::MultiPolygon * p_clipPolygon
Clipping polygon set by SetClipPolygon (line,samp)
Definition: InterestOperator.h:198
Isis::InterestOperator::p_deltaSamp
int p_deltaSamp
Specified in the Pvl Operator group for the box car size.
Definition: InterestOperator.h:209
Isis::InterestOperator::InitInterestResults
void InitInterestResults(int piIndex)
Init Interest Results structure.
Definition: InterestOperator.cpp:128
Isis::InterestOperator::~InterestOperator
virtual ~InterestOperator()
Destroy InterestOperator object.
Definition: InterestOperator.cpp:61
Isis::InterestOperator::mbOverlaps
bool mbOverlaps
If Overlaplist exists.
Definition: InterestOperator.h:206
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::InterestOperator::InitInterestOptions
void InitInterestOptions()
Initialise Interest Options to defaults.
Definition: InterestOperator.cpp:47
Isis::InterestOperator::InterestResults::mbValid
bool mbValid
Value of the interest operator result (success)
Definition: InterestOperator.h:223
Isis::InterestOperator::InterestResults::mdBestLine
double mdBestLine
Most interesting line.
Definition: InterestOperator.h:216
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::InterestOperator::InterestByPoint
int InterestByPoint(ControlPoint &pCnetPoint)
Calculate interest for a Control Point.
Definition: InterestOperator.cpp:657
Isis::ImageOverlapSet
This class is used to find the overlaps between all the images in a list of serial numbers.
Definition: ImageOverlapSet.h:86
Isis::InterestOperator::InterestResults
Structure to hold Interest Results.
Definition: InterestOperator.h:212
Isis::InterestOperator::InterestResults::mdOrigSample
double mdOrigSample
Control Measure's original sample.
Definition: InterestOperator.h:217
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::InterestOperator::InterestResults::miDeltaSample
int miDeltaSample
The number of Samples the point has been moved.
Definition: InterestOperator.h:224
Isis::InterestOperator::mOperatorGrp
Isis::PvlGroup mOperatorGrp
Operator group that created this projection.
Definition: InterestOperator.h:200
Isis::InterestOperator::WorstInterest
double WorstInterest() const
Return the Worst(least value) Interest.
Definition: InterestOperator.h:140
Isis::InterestOperator::operatorName
QString operatorName() const
Return name of the matching operator.
Definition: InterestOperator.h:124
Isis::InterestOperator::InterestResults::msSerialNum
QString msSerialNum
Serial Number of the Measure.
Definition: InterestOperator.h:213
Isis::Chip
A small chip of data used for pattern matching.
Definition: Chip.h:86
Isis::InterestOperator::InterestResults::mdEmission
double mdEmission
Emission angle at most interesting sample,line.
Definition: InterestOperator.h:219
Isis::InterestOperator::InterestResults::mdResolution
double mdResolution
Camera resolution at most interesting sample,line.
Definition: InterestOperator.h:222
Isis::InterestOperator::InterestResults::mdBestSample
double mdBestSample
Most interesting sample.
Definition: InterestOperator.h:215
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::InterestOperator::Operate
bool Operate(Cube &pCube, UniversalGroundMap &pUnivGrndMap, int piSample, int piLine)
Operate used by the app interestcube- to calculate interest by sample,line.
Definition: InterestOperator.cpp:163
Isis::InterestOperator
Interest Operator class.
Definition: InterestOperator.h:109
Isis::InterestOperator::Parse
void Parse(Pvl &pPvl)
Parse the Interest specific keywords.
Definition: InterestOperator.cpp:91
Isis::InterestOperator::FindOverlapByImageFootPrint
const geos::geom::MultiPolygon * FindOverlapByImageFootPrint(Isis::ControlPoint &pCnetPoint)
Find imageoverlaps by finding the intersection of image footprints.
Definition: InterestOperator.cpp:896
Isis::InterestOperator::InterestByMeasure
bool InterestByMeasure(int piMeasure, Isis::ControlMeasure &pCnetMeasure, Isis::Cube &pCube)
Calculate interest for a measure by index.
Definition: InterestOperator.cpp:728
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175