Isis 3 Programmer Reference
ImageOverlap.h
1 #ifndef ImageOverlap_h
2 #define ImageOverlap_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <vector>
11 
12 #include <QString>
13 
14 #include <geos/geom/MultiPolygon.h>
15 
16 namespace Isis {
17 
40  class ImageOverlap {
41  public:
42  ImageOverlap();
43  ImageOverlap(QString serialNumber, geos::geom::MultiPolygon &polygon);
44  ImageOverlap(std::istream &inputStream);
45 
46  virtual ~ImageOverlap();
47 
48  // Set a new polygon
49  virtual void SetPolygon(const geos::geom::MultiPolygon &polygon);
50  virtual void SetPolygon(const geos::geom::MultiPolygon *polygon);
51 
52  // Add a serial number
53  void Add(QString &sn);
54 
55  // Return the number of serial numbers in this overlap area
56  int Size() const {
57  return p_serialNumbers.size();
58  };
59 
60  // Return the ith serial number
61  QString operator[](int index) const {
62  return p_serialNumbers[index];
63  };
64 
65  // Return the polygon
66  const geos::geom::MultiPolygon *Polygon() const {
67  return p_polygon;
68  };
69 
70  // Return the area of the polygon
71  virtual double Area();
72 
73  // Compare the serial numbers with another ImageOverlap
74  bool HasAnySameSerialNumber(ImageOverlap &other) const;
75 
76  // Does serial number exist in this ImageOverlap
77  bool HasSerialNumber(QString &sn) const;
78 
79  void Write(std::ostream &outputStream);
80  private:
81 
82  std::vector<QString> p_serialNumbers;
83  geos::geom::MultiPolygon *p_polygon;
84 
85  void Init();
86 
87  };
88 };
89 
90 #endif
Isis::ImageOverlap
Individual overlap container.
Definition: ImageOverlap.h:40
Isis::ImageOverlap::SetPolygon
virtual void SetPolygon(const geos::geom::MultiPolygon &polygon)
This method will replace the existing polygon that defines the overlap with a new one.
Definition: ImageOverlap.cpp:101
Isis::ImageOverlap::HasSerialNumber
bool HasSerialNumber(QString &sn) const
This method will return true if input serial number exists in the ImageOverlap.
Definition: ImageOverlap.cpp:207
Isis::ImageOverlap::HasAnySameSerialNumber
bool HasAnySameSerialNumber(ImageOverlap &other) const
This method will return true if any serial number from this ImageOverlap is also in the other ImageOv...
Definition: ImageOverlap.cpp:186
Isis::ImageOverlap::~ImageOverlap
virtual ~ImageOverlap()
Destroy this ImageOverlap object.
Definition: ImageOverlap.cpp:79
Isis::ImageOverlap::Init
void Init()
Initialize this object to a known state.
Definition: ImageOverlap.cpp:88
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::ImageOverlap::ImageOverlap
ImageOverlap()
Construct an empty ImageOverlap object.
Definition: ImageOverlap.cpp:25
Isis::ImageOverlap::Area
virtual double Area()
This method will return the area of the polygon.
Definition: ImageOverlap.cpp:177
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16