4 #include "geos/io/WKBReader.h"
5 #include "geos/io/WKBWriter.h"
33 geos::geom::MultiPolygon &polygon) {
47 geos::io::WKBReader geosReader;
50 getline(inputStream, fileData);
52 QString serialNums = fileData.c_str();
53 foreach (QString serialNum, serialNums.split(
",")) {
58 getline(inputStream, fileData);
60 std::stringstream multiPolygon;
61 multiPolygon << fileData;
62 multiPolygon.seekg(0, std::ios::beg);
65 geosReader.readHEX(multiPolygon));
83 p_serialNumbers.clear();
96 if(p_polygon != NULL) {
113 if(p_polygon != NULL) {
122 void ImageOverlap::Write(std::ostream &outputStream) {
124 geos::io::WKBWriter geosWriter;
128 for(
unsigned int sn = 0; sn < p_serialNumbers.size(); sn++) {
133 serialNums += p_serialNumbers[sn];
138 outputStream << serialNums;
140 geosWriter.writeHEX(*p_polygon, outputStream);
152 for(
unsigned int s = 0; s < p_serialNumbers.size(); ++s) {
153 if(sn == p_serialNumbers[s]) {
154 QString msg =
"Duplicate SN added to [" +
155 QString::fromStdString(p_polygon->toString()) +
"]";
160 p_serialNumbers.push_back(sn);
172 return p_polygon->getArea();
181 for(
int thisSn = 0; thisSn < this->Size(); ++thisSn) {
182 for(
int otherSn = 0; otherSn < other.Size(); ++otherSn) {
183 if(p_serialNumbers[thisSn] == other.p_serialNumbers[otherSn]) {
202 for(
int thisSn = 0; thisSn < Size(); ++thisSn) {
203 if(p_serialNumbers[thisSn] == sn) {
virtual ~ImageOverlap()
Destroy this ImageOverlap object.
void Add(QString &sn)
This method will add a new serial number to the list of serial numbers alread associated with the ove...
virtual void SetPolygon(const geos::geom::MultiPolygon &polygon)
This method will replace the existing polygon that defines the overlap with a new one...
void Init()
Initialize this object to a known state.
bool HasAnySameSerialNumber(ImageOverlap &other) const
This method will return true if any serial number from this ImageOverlap is also in the other ImageOv...
This error is for when a programmer made an API call that was illegal.
#define _FILEINFO_
Macro for the filename and line number.
virtual double Area()
This method will return the area of the polygon.
ImageOverlap()
Construct an empty ImageOverlap object.
Individual overlap container.
bool HasSerialNumber(QString &sn) const
This method will return true if input serial number exists in the ImageOverlap.