Unverified Commit dbfb0048 authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Blob Refactor (#4348)



* Updated to new blob structure

* Clean up after being able to look at all of the changes at once

* Changed the history read to return a history object rather than a pointer

* Addressed PR feedback

* Imagepolygon Update (#4308)

* Converted Imagepolygon to no longer be a subclass of blob

* Updated Imagepolygon with constructor chaining

* Fixed error message

* Refactor OriginalLabel class to remove inheritance from Blob (#4309)

* Initial refactor of OriginalLabel class

* Addressed PR feedback

* Fixed error message

Co-authored-by: default avatarJesse Mapel <jmapel@usgs.gov>

* Modified Table to not inherit from Blob anymore (#4312)

* Ported Table test to gtest

* Table refactor

* Fixed merge issue

* Fixed merge issues

* Removes blob inheritance from OriginalXmlLabel (#4316)

* Initial refactor of OriginalLabel class

* Addressed PR feedback

* Fixed error message

* Remove blob inheritance from originalxmllabel

* Removed commented / old code

* Added byte order specification

* History object tests (#4314)

* Adds History object tests

* Updated blob tests to use a non-pointer variable

* Removed gisblob from isis (#4329)

* Removed blob inheritance from stretchblob (#4331)

* Removed blob inheritance from stretchblob

* Addressed feedback + working read/write

* Updated cubestretch with the stretch blob functionality

* Removed stretchBlob and updated cubestretch/cube with read write functionality

* Replaced readStretchBlob with readCubeStretch

* Fixed segfault

* Removed debug print statements

* Added check for existence of OriginalLabel before attempting to propagate

* Addressed PR feedback

Co-authored-by: default avatarAdam Paquette <acpaquette@usgs.gov>

* Removed StringBlob Class (#4321)

* Converted StringBlob

* Removed StretchBlob class

* Changed Blob setData to copy

* Added csminit change and docs

* Removed old memcopy

* History Blob Old Implementation (#4342)

* Implemented old history functionality

* Removed old history unit test

* Fixed original label reading

* Fixed Blob branch test failures (#4344)

* Fixed test failures

* More clean-up

* Fixed marci2isis test

* Blob final clean-up (#4346)

* Redid Blob writing

* Added docs

* Review feedback

* Fixed int comparison

Co-authored-by: default avatarAdam Paquette <acpaquette@usgs.gov>
Co-authored-by: default avatarAustinSanders <arsanders@usgs.gov>
parent a394b82d
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -169,15 +169,14 @@ namespace Isis {
        }

        if (cube->label()->hasObject("History")) {
            PvlObject histObj = cube->label()->findObject("History");
            // Record apollofindrx history to the cube
            QString histName = (QString)cube->label()->findObject("History")["Name"];
            // create a History Blob with value found in the History PvlObject's Name keyword
            Isis::History histBlob( (QString)histObj["Name"] );
            // read cube's History PvlObject data into the History Blob
            cube->read(histBlob);
            History hist = cube->readHistory(histName);
            // add apollofindrx History PvlObject into the History Blob and write to cube
            histBlob.AddEntry();
            cube->write(histBlob);
            hist.AddEntry();
            cube->write(hist);
            cube->close();
        }
    }
+0 −2
Original line number Diff line number Diff line
@@ -261,8 +261,6 @@ void IsisMain() {
  //create a table from starttime to endtime (stretched by 3%) with NODES entries
  spPos->LoadCache(time0-0.015*(time1-time0), time1+0.015*(time1-time0), NODES);
  Table tableSunPos = spPos->Cache("SunPosition");
  tableSunPos.Label() += PvlKeyword("SpkTableStartTime", toString(time0-0.015*(time1-time0)));
  tableSunPos.Label() += PvlKeyword("SpkTablleEndTime", toString(time1+0.015*(time1-time0)));
  tableSunPos.Label() += PvlKeyword("Description", "Created by apollopaninit");
  panCube.write(tableSunPos);  //attach the table to the cube

+2 −8
Original line number Diff line number Diff line
@@ -334,14 +334,8 @@ namespace Isis {

      if (getFootBlob && band == 0) {
        // Read the footprint from the image labels
        ImagePolygon poly;
        try {
          cube.read(poly);
        }
        catch (IException &e) {
          QString msg = "Error reading footprint blob from image labels";
          throw IException(e, IException::User, msg, _FILEINFO_);
        }
        ImagePolygon poly = cube.readFootprint();
        cube.close();
        geos::geom::MultiPolygon *multiP = poly.Polys();
        _polys.push_back(multiP->clone());
        _combined = multiP->clone();
+2 −4
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
#include "iTime.h"
#include "LineManager.h"
#include "OriginalLabel.h"
#include "Process.h"
#include "ProgramLauncher.h"
#include "Progress.h"
#include "Pvl.h"
@@ -82,8 +81,7 @@ namespace Isis{

      // Add the orginal label blob
      if(ui.GetBoolean("ORIGINALLABEL") && incube->label()->hasObject("OriginalLabel")) {
        OriginalLabel orig;
        incube->read(orig);
        OriginalLabel orig = incube->readOriginalLabel();
        Pvl p = orig.ReturnLabels();
        p.setName("OriginalLabel");
        params.addObject(p);
@@ -372,7 +370,7 @@ namespace Isis{
          if (getFootBlob) {
            // Need to read history to obtain parameters that were used to
            // create the footprint
            History hist("IsisCube", incube->fileName());
            History hist = incube->readHistory();
            Pvl pvl = hist.ReturnHist();
            PvlObject::PvlObjectIterator objIter;
            bool found = false;
+3 −2
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ void IsisMain() {
  }

  // Extract history from file
  History hist("IsisCube", fromfile.expanded());
  Blob historyBlob("IsisCube", "History", fromfile.expanded());
  History hist(historyBlob);
  Pvl pvl = hist.ReturnHist();

  // Print full history
Loading