Isis Developer Reference
ImageOverlapSet.h
Go to the documentation of this file.
1 #ifndef ImageOverlapSet_h
2 #define ImageOverlapSet_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <vector>
11 #include <string>
12 
13 #include <QList>
14 #include <QThread>
15 #include <QMutex>
16 
17 #include "geos/geom/MultiPolygon.h"
18 #include "geos/geom/LinearRing.h"
19 #include "geos/util/GEOSException.h"
20 
21 #include "ImageOverlap.h"
22 #include "IException.h"
23 #include "PvlGroup.h"
24 
25 namespace Isis {
26 
27  // Forward declarations
28  class SerialNumberList;
29 
86  class ImageOverlapSet : private QThread {
87  public:
88  ImageOverlapSet(bool continueOnError = false, bool useThread = true);
89  virtual ~ImageOverlapSet();
90 
91  void FindImageOverlaps(SerialNumberList &boundaries);
92  void FindImageOverlaps(std::vector<QString> sns,
93  std::vector<geos::geom::MultiPolygon *> polygons);
94  void FindImageOverlaps(SerialNumberList &boundaries, QString outputFile);
95  void ReadImageOverlaps(const QString &filename);
96  void WriteImageOverlaps(const QString &filename);
97 
103  int Size() {
104  return p_lonLatOverlaps.size();
105  }
106 
115  const ImageOverlap *operator[](int index) {
116  return p_lonLatOverlaps[index];
117  };
118 
119  std::vector<ImageOverlap *> operator[](QString serialNumber);
120 
122  const std::vector<PvlGroup> &Errors() {
123  return p_errorLog;
124  }
125  protected:
126  void FindAllOverlaps(SerialNumberList *snlist = NULL);
127  void AddSerialNumbers(ImageOverlap *to, ImageOverlap *from);
128 
130  std::vector<PvlGroup> p_errorLog;
131 
132  private:
134  void run() {
135  FindAllOverlaps(p_snlist);
136  }
137 
138  void DespikeLonLatOverlaps();
139 
140  QList<ImageOverlap *> p_lonLatOverlaps;
141 
142  ImageOverlap *CreateNewOverlap(QString serialNumber,
143  geos::geom::MultiPolygon *lonLatPolygon);
144 
145  bool SetPolygon(geos::geom::Geometry *poly, int position, ImageOverlap *sncopy = NULL, bool insert = false);
146  void HandleError(IException &e, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1);
147  void HandleError(geos::util::GEOSException *exc, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1);
148  void HandleError(SerialNumberList *snlist, QString msg, int overlap1 = -1, int overlap2 = -1);
149 
150  bool p_continueAfterError;
151  bool p_threadedCalculate;
152  int p_writtenSoFar;
153  int p_calculatedSoFar;
154 
156  SerialNumberList *p_snlist;
157 
165  QMutex p_calculatePolygonMutex;
166  QMutex p_lonLatOverlapsMutex;
167  };
168 };
169 
170 #endif
FileName.h
Isis::ImageOverlapSet::~ImageOverlapSet
virtual ~ImageOverlapSet()
Delete this object.
Definition: ImageOverlapSet.cpp:58
Cube.h
Isis::ImageOverlap
Individual overlap container.
Definition: ImageOverlap.h:40
Isis::Progress::CheckStatus
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::ImageOverlapSet::operator[]
const ImageOverlap * operator[](int index)
Returns the images which overlap at a given loverlap.
Definition: ImageOverlapSet.h:115
Isis::SerialNumberList::size
int size() const
How many serial number / filename combos are in the list.
Definition: SerialNumberList.cpp:384
ImageOverlap.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ImageOverlapSet::p_errorLog
std::vector< PvlGroup > p_errorLog
This is a list of detailed* errors including all known information.
Definition: ImageOverlapSet.h:130
Isis::ImageOverlap::Size
int Size() const
Definition: ImageOverlap.h:56
Isis::Progress::SetMaximumSteps
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
Isis::Cube::readFootprint
ImagePolygon readFootprint() const
Read the footprint polygon for the Cube.
Definition: Cube.cpp:866
PvlGroup.h
Isis::Progress::AddSteps
void AddSteps(const int steps)
If the initial step size was a guess, it can be modified using this method.
Definition: Progress.cpp:199
Isis::Cube::close
void close(bool remove=false)
Closes the cube and updates the labels.
Definition: Cube.cpp:260
Isis::ImageOverlapSet::AddSerialNumbers
void AddSerialNumbers(ImageOverlap *to, ImageOverlap *from)
Add the serial numbers from the second overlap to the first.
Definition: ImageOverlapSet.cpp:823
Isis::globalFactory
static geos::geom::GeometryFactory::Ptr globalFactory
Definition: PolygonTools.h:51
Isis::ImagePolygon
Create cube polygons, read/write polygons to blobs.
Definition: ImagePolygon.h:153
Isis::SerialNumberList
Serial Number list generator.
Definition: SerialNumberList.h:64
Isis::ImageOverlap::Add
void Add(QString &sn)
This method will add a new serial number to the list of serial numbers alread associated with the ove...
Definition: ImageOverlap.cpp:157
Isis::ImageOverlapSet::FindAllOverlaps
void FindAllOverlaps(SerialNumberList *snlist=NULL)
Find the overlaps between all the existing ImageOverlap Objects.
Definition: ImageOverlapSet.cpp:538
Isis::IException::what
const char * what() const
Returns a string representation of this exception in its current state.
Definition: IException.cpp:375
Isis::ImageOverlapSet::FindImageOverlaps
void FindImageOverlaps(SerialNumberList &boundaries)
Create polygons of overlap from the images specified in the serial number list.
Definition: ImageOverlapSet.cpp:77
Isis::SerialNumberList::serialNumber
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Definition: SerialNumberList.cpp:426
ImageOverlapSet.h
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::ImageOverlapSet::WriteImageOverlaps
void WriteImageOverlaps(const QString &filename)
Write polygons of overlap to the file specified.
Definition: ImageOverlapSet.cpp:445
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::ImageOverlapSet::Size
int Size()
Returns the total number of latitude and longitude overlaps.
Definition: ImageOverlapSet.h:103
Isis::Progress::SetText
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:61
SerialNumberList.h
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ImageOverlapSet::ImageOverlapSet
ImageOverlapSet(bool continueOnError=false, bool useThread=true)
Create FindImageOverlaps object.
Definition: ImageOverlapSet.cpp:42
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
IException.h
std
Namespace for the standard library.
QThread
Isis::ImageOverlapSet::ReadImageOverlaps
void ReadImageOverlaps(const QString &filename)
Create polygons of overlap from the file specified.
Definition: ImageOverlapSet.cpp:327
Isis::SerialNumberList::fileName
QString fileName(const QString &sn)
Return a filename given a serial number.
Definition: SerialNumberList.cpp:399
PolygonTools.h
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
Isis::ImageOverlapSet::Errors
const std::vector< PvlGroup > & Errors()
Return the a list of errors encountered.
Definition: ImageOverlapSet.h:122
Progress.h
Isis::ImagePolygon::Polys
geos::geom::MultiPolygon * Polys()
Return a geos Multipolygon.
Definition: ImagePolygon.h:210
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
ImagePolygon.h