Commit 75ca5448 authored by Marjorie Hahn's avatar Marjorie Hahn
Browse files

PROG Attempting to fix the error that findimageoverlaps has been having. References 2199.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7123 41f8697f-d340-4b68-9986-7bafba869bb8
parent 25bfede2
Loading
Loading
Loading
Loading
+23 −19
Original line number Diff line number Diff line
@@ -438,15 +438,11 @@ namespace Isis {
        
    IString file = FileName(filename).expanded();
    bool failed = false;
    bool noOverlaps = false;
    if (p_threadedCalculate) {
      p_calculatePolygonMutex.lock();
    }

    if (p_lonLatOverlaps.size() == 0) {
      IString msg = "No overlaps were found.";
      throw IException(IException::User, msg, _FILEINFO_);
    }

    try {
      // Let's get an ostream pointed at our file
      std::ofstream outStream;
@@ -465,6 +461,10 @@ namespace Isis {
        // Let's not try anything during a possible reallocate
        QMutexLocker locker(&p_lonLatOverlapsMutex);
        
        if (p_lonLatOverlaps.size() == 0) {
          noOverlaps = true;
        }
        else {
          if (overlap < p_lonLatOverlaps.size() && p_lonLatOverlaps[overlap]) {
                   
            if (!p_lonLatOverlaps[overlap]->Polygon()->isEmpty()) {
@@ -482,7 +482,7 @@ namespace Isis {
            p_writtenSoFar ++;                
          }          
        }

      }
      failed |= outStream.fail();
      outStream.close();

@@ -506,6 +506,10 @@ namespace Isis {
      IString msg = "Unable to write the image overlap list to [" + filename + "]";
      throw IException(IException::Io, msg, _FILEINFO_);
    }
    else if (noOverlaps) {
      IString msg = "No overlaps were found.";
      throw IException(IException::User, msg, _FILEINFO_);
    }
  }


+3 −0
Original line number Diff line number Diff line
@@ -88,6 +88,9 @@ namespace Isis {
   *           are calculated. (i.e. All overlaps contain only a single Serial Number)
   *  @history 2011-03-29 Steven Lambright - Added some safety around
   *           p_lonLatOverlaps to (hopefully) get rid of a race condition.
   *  @history 2016-09-14 Marjorie Hahn - Modified FindAllOverlaps()'s check to ensure 
   *           that at least one overlap has been calculated by adding in the 
   *           "foundOverlap" boolean. References #2199.
   */
  class ImageOverlapSet : private QThread {
    public: