Isis 3.0 Programmer Reference
Back | Home
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 
100  class ImageOverlapSet : private QThread {
101  public:
102  ImageOverlapSet(bool continueOnError = false);
103  virtual ~ImageOverlapSet();
104 
105  void FindImageOverlaps(SerialNumberList &boundaries);
106  void FindImageOverlaps(std::vector<QString> sns,
107  std::vector<geos::geom::MultiPolygon *> polygons);
108  void FindImageOverlaps(SerialNumberList &boundaries, QString outputFile);
109  void ReadImageOverlaps(const QString &filename);
110  void WriteImageOverlaps(const QString &filename);
111 
117  int Size() {
118  return p_lonLatOverlaps.size();
119  }
120 
129  const ImageOverlap *operator[](int index) {
130  return p_lonLatOverlaps[index];
131  };
132 
133  std::vector<ImageOverlap *> operator[](QString serialNumber);
134 
136  const std::vector<PvlGroup> &Errors() {
137  return p_errorLog;
138  }
139  protected:
140  void FindAllOverlaps(SerialNumberList *snlist = NULL);
141  void AddSerialNumbers(ImageOverlap *to, ImageOverlap *from);
142 
144  std::vector<PvlGroup> p_errorLog;
145 
146  private:
148  void run() {
150  }
151 
152  void DespikeLonLatOverlaps();
153 
155 
156  ImageOverlap *CreateNewOverlap(QString serialNumber,
157  geos::geom::MultiPolygon *lonLatPolygon);
158 
159  bool SetPolygon(geos::geom::Geometry *poly, int position, ImageOverlap *sncopy = NULL, bool insert = false);
160  void HandleError(IException &e, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1);
161  void HandleError(geos::util::GEOSException *exc, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1);
162  void HandleError(SerialNumberList *snlist, QString msg, int overlap1 = -1, int overlap2 = -1);
163 
168 
171 
180  QMutex p_lonLatOverlapsMutex;
181  };
182 };
183 
184 #endif
std::vector< PvlGroup > p_errorLog
This is a list of detailed* errors including all known information.
QList< ImageOverlap * > p_lonLatOverlaps
The list of lat/lon overlaps.
bool SetPolygon(geos::geom::Geometry *poly, int position, ImageOverlap *sncopy=NULL, bool insert=false)
This method inserts or overwrites a polygon in the overlap list based on parameters.
bool p_continueAfterError
If false iExceptions will be thrown from FindImageOverlaps(...)
void DespikeLonLatOverlaps()
Despikes all of the overlaps in p_lonLatOverlaps.
void ReadImageOverlaps(const QString &filename)
Create polygons of overlap from the file specified.
ImageOverlapSet(bool continueOnError=false)
Create FindImageOverlaps object.
virtual ~ImageOverlapSet()
Delete this object.
int Size()
Returns the total number of latitude and longitude overlaps.
void WriteImageOverlaps(const QString &filename)
Write polygons of overlap to the file specified.
This class is used to find the overlaps between all the images in a list of serial numbers...
SerialNumberList * p_snlist
This is used for multi-threaded calls to FindAllOverlaps only; this class never gets ownership of thi...
int p_calculatedSoFar
The index of the last overlap that is done calculating (number calculated-1)
void AddSerialNumbers(ImageOverlap *to, ImageOverlap *from)
Add the serial numbers from the second overlap to the first.
void FindAllOverlaps(SerialNumberList *snlist=NULL)
Find the overlaps between all the existing ImageOverlap Objects.
void HandleError(IException &e, SerialNumberList *snlist, QString msg="", int overlap1=-1, int overlap2=-1)
If a problem occurred when searching for image overlaps, this method will handle it.
QMutex p_calculatePolygonMutex
This mutex will be used to have blocking on the write method when multi-threading (instead of busy wa...
bool p_threadedCalculate
True if we want to do calculations in a threaded way.
int p_writtenSoFar
The index of the last overlap that is done writing (number written-1)
const std::vector< PvlGroup > & Errors()
Return the a list of errors encountered.
Isis exception class.
Definition: IException.h:99
ImageOverlap * CreateNewOverlap(QString serialNumber, geos::geom::MultiPolygon *lonLatPolygon)
Create an overlap item to hold the overlap poly and its SN.
Individual overlap container.
Definition: ImageOverlap.h:56
void FindImageOverlaps(SerialNumberList &boundaries)
Create polygons of overlap from the images specified in the serial number list.
Serial Number list generator.
const ImageOverlap * operator[](int index)
Returns the images which overlap at a given loverlap.
void run()
Find overlaps is all the threaded calculate does.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:20:14