Isis 3 Developer Reference
ImageOverlapSet.h
Go to the documentation of this file.
1 #ifndef ImageOverlapSet_h
2 #define ImageOverlapSet_h
3 
26 #include <vector>
27 #include <string>
28 
29 #include <QList>
30 #include <QThread>
31 #include <QMutex>
32 
33 #include "geos/geom/MultiPolygon.h"
34 #include "geos/geom/LinearRing.h"
35 #include "geos/util/GEOSException.h"
36 
37 #include "ImageOverlap.h"
38 #include "IException.h"
39 #include "PvlGroup.h"
40 
41 namespace Isis {
42 
43  // Forward declarations
44  class SerialNumberList;
45 
102  class ImageOverlapSet : private QThread {
103  public:
104  ImageOverlapSet(bool continueOnError = false);
105  virtual ~ImageOverlapSet();
106 
107  void FindImageOverlaps(SerialNumberList &boundaries);
108  void FindImageOverlaps(std::vector<QString> sns,
109  std::vector<geos::geom::MultiPolygon *> polygons);
110  void FindImageOverlaps(SerialNumberList &boundaries, QString outputFile);
111  void ReadImageOverlaps(const QString &filename);
112  void WriteImageOverlaps(const QString &filename);
113 
119  int Size() {
120  return p_lonLatOverlaps.size();
121  }
122 
131  const ImageOverlap *operator[](int index) {
132  return p_lonLatOverlaps[index];
133  };
134 
135  std::vector<ImageOverlap *> operator[](QString serialNumber);
136 
138  const std::vector<PvlGroup> &Errors() {
139  return p_errorLog;
140  }
141  protected:
142  void FindAllOverlaps(SerialNumberList *snlist = NULL);
143  void AddSerialNumbers(ImageOverlap *to, ImageOverlap *from);
144 
146  std::vector<PvlGroup> p_errorLog;
147 
148  private:
150  void run() {
151  FindAllOverlaps(p_snlist);
152  }
153 
154  void DespikeLonLatOverlaps();
155 
156  QList<ImageOverlap *> p_lonLatOverlaps;
157 
158  ImageOverlap *CreateNewOverlap(QString serialNumber,
159  geos::geom::MultiPolygon *lonLatPolygon);
160 
161  bool SetPolygon(geos::geom::Geometry *poly, int position, ImageOverlap *sncopy = NULL, bool insert = false);
162  void HandleError(IException &e, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1);
163  void HandleError(geos::util::GEOSException *exc, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1);
164  void HandleError(SerialNumberList *snlist, QString msg, int overlap1 = -1, int overlap2 = -1);
165 
166  bool p_continueAfterError;
167  bool p_threadedCalculate;
168  int p_writtenSoFar;
169  int p_calculatedSoFar;
170 
172  SerialNumberList *p_snlist;
173 
181  QMutex p_calculatePolygonMutex;
182  QMutex p_lonLatOverlapsMutex;
183  };
184 };
185 
186 #endif
std::vector< PvlGroup > p_errorLog
This is a list of detailed* errors including all known information.
Definition: ImageOverlapSet.h:146
void ReadImageOverlaps(const QString &filename)
Create polygons of overlap from the file specified.
Definition: ImageOverlapSet.cpp:328
ImageOverlapSet(bool continueOnError=false)
Create FindImageOverlaps object.
Definition: ImageOverlapSet.cpp:36
virtual ~ImageOverlapSet()
Delete this object.
Definition: ImageOverlapSet.cpp:52
int Size()
Returns the total number of latitude and longitude overlaps.
Definition: ImageOverlapSet.h:119
void WriteImageOverlaps(const QString &filename)
Write polygons of overlap to the file specified.
Definition: ImageOverlapSet.cpp:446
This class is used to find the overlaps between all the images in a list of serial numbers...
Definition: ImageOverlapSet.h:102
void AddSerialNumbers(ImageOverlap *to, ImageOverlap *from)
Add the serial numbers from the second overlap to the first.
Definition: ImageOverlapSet.cpp:825
void FindAllOverlaps(SerialNumberList *snlist=NULL)
Find the overlaps between all the existing ImageOverlap Objects.
Definition: ImageOverlapSet.cpp:540
const std::vector< PvlGroup > & Errors()
Return the a list of errors encountered.
Definition: ImageOverlapSet.h:138
Isis exception class.
Definition: IException.h:107
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Individual overlap container.
Definition: ImageOverlap.h:56
void FindImageOverlaps(SerialNumberList &boundaries)
Create polygons of overlap from the images specified in the serial number list.
Definition: ImageOverlapSet.cpp:71
Serial Number list generator.
Definition: SerialNumberList.h:80
const ImageOverlap * operator[](int index)
Returns the images which overlap at a given loverlap.
Definition: ImageOverlapSet.h:131