diff --git a/environment.yml b/environment.yml index 7d5694e7ac..e40dc50a50 100644 --- a/environment.yml +++ b/environment.yml @@ -55,10 +55,8 @@ dependencies: - pytest - rclone - qhull - # - qt>=5.9.6,<5.15.0 - # - qwt - - qt-main>=5.15.2 - - qwt>=6.2.0 + - qt>=5.15.0,<6 + - qwt - sqlite - suitesparse - superlu diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp index 8c6f2106d9..c216ab6f84 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp @@ -20,7 +20,6 @@ find files of those names at the top level of this repository. **/ #include "IException.h" #include "IString.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" #include "Pvl.h" #include @@ -43,15 +42,6 @@ namespace Isis { } -// TODO: should project be const ??? - StatCumProbDistDynCalc::StatCumProbDistDynCalc(Project *project, - XmlStackedHandlerReader *xmlReader, - QObject *parent) { // TODO: does xml stuff need project??? - initialize(); - xmlReader->pushContentHandler(new XmlHandler(this, project)); // TODO: does xml stuff need project??? - } - - StatCumProbDistDynCalc::StatCumProbDistDynCalc(const StatCumProbDistDynCalc &other) : m_numberCells(other.m_numberCells), diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h index d91448ff73..38c837666e 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h @@ -19,7 +19,6 @@ class QXmlStreamWriter; namespace Isis { class Project;// ??? does xml stuff need project??? - class XmlStackedHandlerReader; /** * @brief This class is used to approximate cumulative probibility distributions of a stream of @@ -70,8 +69,6 @@ namespace Isis { // Observations" public: StatCumProbDistDynCalc(unsigned int nodes=20, QObject *parent = 0); //individual qunatile value to be calculated - StatCumProbDistDynCalc(Project *project, XmlStackedHandlerReader *xmlReader, - QObject *parent = 0); // TODO: does xml stuff need project??? StatCumProbDistDynCalc(const StatCumProbDistDynCalc &other); ~StatCumProbDistDynCalc(); StatCumProbDistDynCalc &operator=(const StatCumProbDistDynCalc &other); diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp index 9b2cf5b1c3..7d30ed4bf9 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp @@ -7,7 +7,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include @@ -15,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include "IException.h" #include "Preference.h" #include "StatCumProbDistDynCalc.h" -#include "XmlStackedHandlerReader.h" using namespace std; using namespace Isis; @@ -38,8 +36,7 @@ using namespace Isis; namespace Isis { class StatisticsXmlHandlerTester : public StatCumProbDistDynCalc { public: - StatisticsXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, - FileName xmlFile) : StatCumProbDistDynCalc(project, reader) { + StatisticsXmlHandlerTester(FileName xmlFile) : StatCumProbDistDynCalc() { QString xmlPath(xmlFile.expanded()); QFile file(xmlPath); @@ -49,15 +46,16 @@ namespace Isis { QString("Unable to open xml file, [%1], with read access").arg(xmlPath), _FILEINFO_); } + QXmlStreamReader reader(&file); - QXmlInputSource xmlInputSource(&file); - bool success = reader->parse(xmlInputSource); - if (!success) { + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Unknown, - QString("Failed to parse xml file, [%1]").arg(xmlPath), - _FILEINFO_); + QString("Failed to parse xml file, [%1]").arg(xmlPath), + _FILEINFO_); } - } ~StatisticsXmlHandlerTester() { @@ -174,8 +172,7 @@ int main(int argc, char *argv[]) { // read xml with no attributes or values FileName emptyXmlFile("./unitTest_NoElementValues.xml"); Project *project = NULL; - XmlStackedHandlerReader reader; - StatisticsXmlHandlerTester statsFromEmptyXml(project, &reader, emptyXmlFile); + StatisticsXmlHandlerTester statsFromEmptyXml(emptyXmlFile); qDebug() << "Testing XML: read XML with no attributes or values " "to StatCumProbDistDynCalc object... Then try to get " "min from object with no observations."; @@ -633,7 +630,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to StatCumProbDistDynCalc object..."; - StatisticsXmlHandlerTester statsFromXml(project, &reader, xmlFile); + StatisticsXmlHandlerTester statsFromXml(xmlFile); qDebug() << "Min = " << statsFromXml.min(); qDebug() << "Max = " << statsFromXml.max(); qDebug() << ""; diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index d6e7be9fcd..557f351143 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -19,7 +19,6 @@ find files of those names at the top level of this repository. **/ #include "Project.h" #include "PvlGroup.h" #include "PvlKeyword.h" -#include "XmlStackedHandlerReader.h" using namespace std; @@ -32,14 +31,6 @@ namespace Isis { Reset(); // initialize } - - Statistics::Statistics(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent) { // TODO: does xml stuff need project??? -// m_id = NULL; - SetValidRange(); - Reset(); // initialize - xmlReader->pushContentHandler(new XmlHandler(this, project)); // TODO: does xml stuff need project??? - } - /** * Constructs a Statistics object from an input Pvl * diff --git a/isis/src/base/objs/Statistics/Statistics.h b/isis/src/base/objs/Statistics/Statistics.h index 08d5b8aaca..12bcfad9e8 100644 --- a/isis/src/base/objs/Statistics/Statistics.h +++ b/isis/src/base/objs/Statistics/Statistics.h @@ -21,7 +21,6 @@ class QXmlStreamWriter; namespace Isis { class Project;// ??? does xml stuff need project??? - class XmlStackedHandlerReader; /** * @brief This class is used to accumulate statistics on double arrays. * @@ -95,7 +94,6 @@ namespace Isis { Q_OBJECT public: Statistics(QObject *parent = 0); - Statistics(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); Statistics(const PvlGroup &inStats, QObject *parent = 0); // TODO: does xml read/write stuff need Project input??? Statistics(const Statistics &other); diff --git a/isis/src/base/objs/Statistics/unitTest.cpp b/isis/src/base/objs/Statistics/unitTest.cpp index ca993cbf88..025259e756 100644 --- a/isis/src/base/objs/Statistics/unitTest.cpp +++ b/isis/src/base/objs/Statistics/unitTest.cpp @@ -7,7 +7,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include @@ -15,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include "IException.h" #include "Preference.h" #include "Statistics.h" -#include "XmlStackedHandlerReader.h" using namespace std; using namespace Isis; @@ -33,8 +31,7 @@ using namespace Isis; namespace Isis { class StatisticsXmlHandlerTester : public Statistics { public: - StatisticsXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, - FileName xmlFile) : Statistics(project, reader) { + StatisticsXmlHandlerTester(FileName xmlFile) : Statistics() { QString xmlPath(xmlFile.expanded()); QFile file(xmlPath); @@ -45,14 +42,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - bool success = reader->parse(xmlInputSource); - if (!success) { + QXmlStreamReader reader(&file); + + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Unknown, QString("Failed to parse xml file, [%1]").arg(xmlPath), _FILEINFO_); } - } ~StatisticsXmlHandlerTester() { @@ -388,8 +387,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to Statistics object..."; - XmlStackedHandlerReader reader; - StatisticsXmlHandlerTester statsFromXml(project, &reader, xmlFile); + StatisticsXmlHandlerTester statsFromXml(xmlFile); qDebug() << "Average: " << statsFromXml.Average(); qDebug() << "Variance: " << statsFromXml.Variance(); qDebug() << "Rms: " << statsFromXml.Rms(); @@ -421,7 +419,7 @@ int main(int argc, char *argv[]) { // read xml with no attributes or values qDebug() << "Testing XML: read XML with no attributes or values to Statistics object..."; FileName emptyXmlFile("./unitTest_NoElementValues.xml"); - StatisticsXmlHandlerTester statsFromEmptyXml(project, &reader, emptyXmlFile); + StatisticsXmlHandlerTester statsFromEmptyXml(emptyXmlFile); qDebug() << "Average: " << statsFromEmptyXml.Average(); qDebug() << "Variance: " << statsFromEmptyXml.Variance(); qDebug() << "Rms: " << statsFromEmptyXml.Rms(); diff --git a/isis/src/control/objs/BundleResults/BundleResults.cpp b/isis/src/control/objs/BundleResults/BundleResults.cpp index eb06fb23cf..1ed149ebef 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.cpp +++ b/isis/src/control/objs/BundleResults/BundleResults.cpp @@ -34,7 +34,6 @@ find files of those names at the top level of this repository. **/ #include "SerialNumberList.h" #include "StatCumProbDistDynCalc.h" #include "Statistics.h" -#include "XmlStackedHandlerReader.h" using namespace boost::numeric::ublas; @@ -60,26 +59,6 @@ namespace Isis { } - /** - * Construct this BundleResults object from XML. - * - * @param bundleSettingsFolder Where the settings XML for this bundle adjustment - * resides - /work/.../projectRoot/images/import1 - * @param xmlReader An XML reader that's up to a tag. - * @param parent The Qt-relationship parent. - */ - BundleResults::BundleResults(Project *project, XmlStackedHandlerReader *xmlReader, - QObject *parent) : QObject(parent) { - // TODO: does xml stuff need project??? - - initialize(); - - xmlReader->pushContentHandler(new XmlHandler(this, project)); - xmlReader->setErrorHandler(new XmlHandler(this, project)); - - } - - /** * Copy constructor for BundleResults. Creates this BundleResults object as a copy * of another BundleResults object. @@ -2135,7 +2114,7 @@ namespace Isis { else if (qName == "statisticsItem") { // add statistics object to the xml handler's current statistics list. m_xmlHandlerStatisticsList.append( - new Statistics(m_xmlHandlerProject, reader())); + new Statistics()); } else if (qName == "elapsedTime") { QString time = atts.value("time"); @@ -2340,12 +2319,11 @@ namespace Isis { else if (qName == "cumulativeProbabilityCalculator") { m_xmlHandlerBundleResults->m_cumPro = NULL; m_xmlHandlerBundleResults->m_cumPro = - new StatCumProbDistDynCalc(m_xmlHandlerProject, reader()); + new StatCumProbDistDynCalc(); } else if (qName == "residualsCumulativeProbabilityCalculator") { m_xmlHandlerBundleResults->m_cumProRes = NULL; - m_xmlHandlerBundleResults->m_cumProRes = new StatCumProbDistDynCalc(m_xmlHandlerProject, - reader()); + m_xmlHandlerBundleResults->m_cumProRes = new StatCumProbDistDynCalc(); } } return true; diff --git a/isis/src/control/objs/BundleResults/BundleResults.h b/isis/src/control/objs/BundleResults/BundleResults.h index 219dd89301..26f8b21f3d 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.h +++ b/isis/src/control/objs/BundleResults/BundleResults.h @@ -44,7 +44,6 @@ namespace Isis { class PvlObject; class SerialNumberList; class StatCumProbDistDynCalc; - class XmlStackedHandlerReader; /** * A container class for statistical results from a BundleAdjust solution. @@ -92,8 +91,6 @@ namespace Isis { Q_OBJECT public: BundleResults(QObject *parent = 0); - // TODO: does xml stuff need project??? - BundleResults(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); BundleResults(const BundleResults &src); ~BundleResults(); BundleResults &operator=(const BundleResults &src); diff --git a/isis/src/control/objs/BundleResults/unitTest.cpp b/isis/src/control/objs/BundleResults/unitTest.cpp index f48a07323d..f88e38f94a 100755 --- a/isis/src/control/objs/BundleResults/unitTest.cpp +++ b/isis/src/control/objs/BundleResults/unitTest.cpp @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include "BundleControlPoint.h" #include "IsisBundleObservation.h" @@ -29,7 +28,6 @@ find files of those names at the top level of this repository. **/ #include "MaximumLikelihoodWFunctions.h" #include "Preference.h" #include "PvlObject.h" -#include "XmlStackedHandlerReader.h" using namespace std; @@ -51,12 +49,9 @@ namespace Isis { /** * Constructs the tester object from an xml file. * - * @param project The project object the tester belongs to. - * @param reader The XmlStackedHandlerReader that reads the xml file. * @param xmlFile The xml file to construct the tester from. */ - BundleResultsXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, - FileName xmlFile) : BundleResults(project, reader) { + BundleResultsXmlHandlerTester(FileName xmlFile) : BundleResults() { m_file.setFileName(xmlFile.expanded()); @@ -66,14 +61,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&m_file); - bool success = reader->parse(xmlInputSource); - if (!success) { + QXmlStreamReader reader(&m_file); + + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Unknown, QString("Failed to parse xml file, [%1]").arg(m_file.fileName()), _FILEINFO_); } - } /** @@ -330,8 +327,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); qDebug() << "Testing XML: reading serialized BundleResults back in..."; - XmlStackedHandlerReader reader; - BundleResultsXmlHandlerTester bsFromXml(project, &reader, xmlFile); + BundleResultsXmlHandlerTester bsFromXml(xmlFile); qDebug() << "Testing XML: Object deserialized as (should match object above):"; printXml(bsFromXml); @@ -381,7 +377,7 @@ int main(int argc, char *argv[]) { qXmlFileR.close(); qDebug() << "Testing rectangular XML: reading serialized BundleResults back in..."; - BundleResultsXmlHandlerTester bsRectFromXml(project, &reader, xmlFileR); + BundleResultsXmlHandlerTester bsRectFromXml(xmlFileR); // Set the output control net in bsRectFromXml in order to get the desired coordinate type bsRectFromXml.setOutputControlNet(ControlNetQsp(new ControlNet(outNet))); qDebug() << "Testing rectangular XML: Object deserialized as (should match object above):"; diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.cpp b/isis/src/control/objs/BundleSettings/BundleSettings.cpp index 87100ff498..2094a40209 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.cpp +++ b/isis/src/control/objs/BundleSettings/BundleSettings.cpp @@ -15,7 +15,6 @@ find files of those names at the top level of this repository. **/ #include // qMax() #include #include -#include #include "BundleObservationSolveSettings.h" #include "IException.h" @@ -24,7 +23,6 @@ find files of those names at the top level of this repository. **/ #include "PvlKeyword.h" #include "PvlObject.h" #include "SpecialPixel.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -91,28 +89,6 @@ namespace Isis { } - /** - * Construct a BundleSettings object from member data read from an XML file. - * - * @code - * FileName xmlFile("bundleSettingsFileName.xml"); - * - * QString xmlPath = xmlFile.expanded(); - * QFile file(xmlPath); - * file.open(QFile::ReadOnly); - * XmlStackedHandlerReader reader; - * BundleSettings settings(project, reader); - * @endcode - * - * @param project A pointer to the project where the Settings will be saved. - * @param xmlReader The Content handler to parse the BundleSettings XML - */ - BundleSettings::BundleSettings(Project *project, - XmlStackedHandlerReader *xmlReader) { - init(); - xmlReader->setErrorHandler(new XmlHandler(this, project)); - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } /** @@ -1310,7 +1286,7 @@ namespace Isis { } else if (localName == "bundleObservationSolveSettings") { m_xmlHandlerObservationSettings.append( - new BundleObservationSolveSettings(m_xmlHandlerProject, reader())); + new BundleObservationSolveSettings()); } } return true; diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.h b/isis/src/control/objs/BundleSettings/BundleSettings.h index 7757d5feb2..375c7d8f2f 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.h +++ b/isis/src/control/objs/BundleSettings/BundleSettings.h @@ -36,7 +36,6 @@ namespace Isis { class FileName; class Project; class PvlObject; - class XmlStackedHandlerReader; /** * @brief Container class for BundleAdjustment settings. @@ -111,7 +110,6 @@ namespace Isis { * @history 2019-05-17 Tyler Wilson - Added QString m_cubeList member function as well * as get/set member functions. References #3267. * - * @todo Determine which XmlStackedHandlerReader constructor is preferred * @todo Determine which XmlStackedHandler needs a Project pointer (see constructors) * @todo Determine whether QList m_observationSolveSettings * should be a list of pointers, or a pointer to a list, or a pointer to a list of @@ -130,16 +128,6 @@ namespace Isis { //=====================================================================// BundleSettings(); BundleSettings(const BundleSettings &other); - BundleSettings(Project *project, - XmlStackedHandlerReader *xmlReader); -#if 0 - BundleSettings(FileName xmlFile, - Project *project, - XmlStackedHandlerReader *xmlReader, - QObject *parent = NULL); - BundleSettings(XmlStackedHandlerReader *xmlReader, - QObject *parent = NULL); -#endif ~BundleSettings(); BundleSettings &operator=(const BundleSettings &other); diff --git a/isis/src/control/objs/BundleSettings/unitTest.cpp b/isis/src/control/objs/BundleSettings/unitTest.cpp index 21e890ce14..3be509a909 100755 --- a/isis/src/control/objs/BundleSettings/unitTest.cpp +++ b/isis/src/control/objs/BundleSettings/unitTest.cpp @@ -15,7 +15,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include "BundleObservationSolveSettings.h" #include "BundleSettings.h" @@ -24,7 +23,6 @@ find files of those names at the top level of this repository. **/ #include "MaximumLikelihoodWFunctions.h" #include "Preference.h" #include "PvlObject.h" -#include "XmlStackedHandlerReader.h" using namespace std; @@ -84,7 +82,6 @@ namespace Isis { * Constructs BundleSettings using XML handler. * * @param project A pointer to the project. - * @param reader A pointer to a XmlStackedHandlerReader. * @param xmlFile The name of the XML file to be used to create a * BundleSettings object. * @@ -92,8 +89,7 @@ namespace Isis { * @throw Isis::Exception::Io "Unable to open XML file with read access." * @throw Isis::Exception::Unknown "Failed to parse XML file." */ - BundleSettingsXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, - FileName xmlFile) : BundleSettings(project, reader) { + BundleSettingsXmlHandlerTester(FileName xmlFile) : BundleSettings() { QString xmlPath(xmlFile.expanded()); QFile file(xmlPath); @@ -104,14 +100,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - bool success = reader->parse(xmlInputSource); - if (!success) { + QXmlStreamReader reader(&file); + + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Unknown, QString("Failed to parse xml file, [%1]").arg(xmlPath), _FILEINFO_); } - } ~BundleSettingsXmlHandlerTester() { @@ -278,8 +276,7 @@ int main(int argc, char *argv[]) { // read serialized xml into object and then write object to log file qDebug() << "Testing XML: Object deserialized as (should match object above):"; - XmlStackedHandlerReader reader; - BundleSettingsXmlHandlerTester bsFromXml(project, &reader, xmlFile); + BundleSettingsXmlHandlerTester bsFromXml(xmlFile); printXml(bsFromXml); qDebug() << "Testing XML serialization 2: write XML from BundleSettings object..."; @@ -302,7 +299,7 @@ int main(int argc, char *argv[]) { // read serialized xml into object and then write object to log file qDebug() << "Testing XML: Object deserialized as (should match object above):"; - BundleSettingsXmlHandlerTester bsFromXml2(project, &reader, xmlFile); + BundleSettingsXmlHandlerTester bsFromXml2(xmlFile); printXml(bsFromXml2); qXmlFile.remove(); diff --git a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp index d4dd439892..4ed7a2d234 100755 --- a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp +++ b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp @@ -33,7 +33,6 @@ find files of those names at the top level of this repository. **/ #include "PvlObject.h" #include "StatCumProbDistDynCalc.h" #include "Statistics.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -94,35 +93,6 @@ namespace Isis { } - /** - * Constructor. Creates a BundleSolutionInfo from disk. - * - * @param project The current project - * @param xmlReader An XML reader that's up to an tag. - * @param parent The Qt-relationship parent - */ - BundleSolutionInfo::BundleSolutionInfo(Project *project, - XmlStackedHandlerReader *xmlReader, - QObject *parent) : QObject(parent) { - //TODO does xml stuff need project??? - m_id = new QUuid(QUuid::createUuid()); - m_runTime = ""; - m_name = m_runTime; - m_inputControlNetFileName = NULL; - m_outputControl = NULL; - m_outputControlName=""; - m_inputLidarDataFileName = NULL; - m_outputLidarDataSet = NULL; - m_statisticsResults = NULL; - // what about the rest of the member data ? should we set defaults ??? CREATE INITIALIZE METHOD - m_images = new QList; - m_adjustedImages = new QList; - - xmlReader->setErrorHandler(new XmlHandler(this, project)); - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - /** * Destructor */ @@ -2024,21 +1994,20 @@ namespace Isis { if (localName == "bundleSettings") { m_xmlHandlerBundleSolutionInfo->m_settings = - BundleSettingsQsp(new BundleSettings(m_xmlHandlerProject, reader())); + BundleSettingsQsp(new BundleSettings()); } else if (localName == "bundleResults") { - m_xmlHandlerBundleSolutionInfo->m_statisticsResults = new BundleResults(m_xmlHandlerProject, - reader()); + m_xmlHandlerBundleSolutionInfo->m_statisticsResults = new BundleResults(); } else if (localName == "imageList") { m_xmlHandlerBundleSolutionInfo->m_adjustedImages->append( - new ImageList(m_xmlHandlerProject, reader())); + new ImageList()); } else if (localName == "outputControl") { FileName outputControlPath = FileName(m_xmlHandlerProject->bundleSolutionInfoRoot() + "/" + m_xmlHandlerBundleSolutionInfo->runTime()); - m_xmlHandlerBundleSolutionInfo->m_outputControl = new Control(outputControlPath, reader()); + m_xmlHandlerBundleSolutionInfo->m_outputControl = new Control(outputControlPath.toString()); } } return true; diff --git a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h index b0c3895a30..4a6e6fc504 100755 --- a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h +++ b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h @@ -31,7 +31,6 @@ namespace Isis { class ImageList; class Project; //TODO does xml stuff need project??? class PvlObject; - class XmlStackedHandlerReader; /** * @brief Container class for BundleAdjustment results. @@ -173,9 +172,6 @@ namespace Isis { BundleResults outputStatistics, QList imgList, QObject *parent = 0); - BundleSolutionInfo(Project *project, - XmlStackedHandlerReader *xmlReader, - QObject *parent = 0); //TODO does xml stuff need project??? BundleSolutionInfo() = default; ~BundleSolutionInfo(); diff --git a/isis/src/control/objs/BundleSolutionInfo/unitTest.cpp b/isis/src/control/objs/BundleSolutionInfo/unitTest.cpp index 121640bac0..ff34b88b7f 100755 --- a/isis/src/control/objs/BundleSolutionInfo/unitTest.cpp +++ b/isis/src/control/objs/BundleSolutionInfo/unitTest.cpp @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include "BundleControlPoint.h" #include "BundleObservation.h" @@ -31,7 +30,6 @@ find files of those names at the top level of this repository. **/ #include "ImageList.h" #include "Preference.h" #include "PvlObject.h" -#include "XmlStackedHandlerReader.h" using namespace std; @@ -49,8 +47,7 @@ void printXml(const BundleSolutionInfo &); namespace Isis { class BundleSolutionInfoXmlHandlerTester : public BundleSolutionInfo { public: - BundleSolutionInfoXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, - FileName xmlFile) : BundleSolutionInfo(project, reader) { + BundleSolutionInfoXmlHandlerTester(FileName xmlFile) : BundleSolutionInfo() { QString xmlPath(xmlFile.expanded()); QFile file(xmlPath); @@ -61,14 +58,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - bool success = reader->parse(xmlInputSource); - if (!success) { + QXmlStreamReader reader(&file); + + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Unknown, QString("Failed to parse xml file, [%1]").arg(xmlPath), _FILEINFO_); } - } ~BundleSolutionInfoXmlHandlerTester() { @@ -184,8 +183,7 @@ int main(int argc, char *argv[]) { qXmlFile1.close(); qDebug() << "Testing XML: reading serialized BundleResults back in..."; - XmlStackedHandlerReader reader1; - BundleSolutionInfoXmlHandlerTester bsFromXml1(project, &reader1, xmlFile1); + BundleSolutionInfoXmlHandlerTester bsFromXml1(xmlFile1); // Now manually set the control net in BundleSolutionInfo's BundleResults to // complete its initialization. This seems awkward. bsFromXml1.bundleResults().setOutputControlNet(ControlNetQsp(new ControlNet(outNet))); @@ -313,8 +311,7 @@ int main(int argc, char *argv[]) { qXmlFile2.close(); qDebug() << "Testing XML: reading serialized BundleResults back in..."; - XmlStackedHandlerReader reader; - BundleSolutionInfoXmlHandlerTester bsFromXml2(project, &reader, xmlFile2); + BundleSolutionInfoXmlHandlerTester bsFromXml2(xmlFile2); qDebug() << "Testing XML: Object deserialized as (should match object above):"; printXml(bsFromXml2); // Save comparison output to log file diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index 63dc77cc50..a646f5a4ec 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -15,7 +15,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include #include "BundleImage.h" @@ -26,7 +25,6 @@ find files of those names at the top level of this repository. **/ #include "Project.h" #include "PvlKeyword.h" #include "PvlObject.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -39,22 +37,6 @@ namespace Isis { } - /** - * Construct this BundleObservationSolveSettings object from XML. - * - * @param bundleSettingsFolder Where this settings XML resides - - * /work/.../projectRoot/images/import1 - * @param xmlReader An XML reader that's up to an tag. - */ - BundleObservationSolveSettings::BundleObservationSolveSettings( - Project *project, - XmlStackedHandlerReader *xmlReader) { - initialize(); - xmlReader->pushContentHandler(new XmlHandler(this, project)); - xmlReader->setErrorHandler(new XmlHandler(this, project)); - } - - BundleObservationSolveSettings::BundleObservationSolveSettings(const PvlGroup &scParameterGroup) { initialize(); diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h index 3cddd1489a..d9f493e403 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h @@ -28,7 +28,6 @@ namespace Isis { class FileName; class Project; // TODO: does xml stuff need project??? class PvlObject; - class XmlStackedHandlerReader; /** * This class is used to modify and manage solve settings for 1 to many BundleObservations. These * settings indicate how any associated observations should be solved. @@ -76,18 +75,12 @@ namespace Isis { * References #3369. * @todo Figure out why solve degree and num coefficients does not match solve option. * @todo Determine whether xml stuff needs a Project pointer. - * @todo Determine which XmlStackedHandlerReader constructor is preferred. */ class BundleObservationSolveSettings { public: BundleObservationSolveSettings(); - BundleObservationSolveSettings(Project *project, - XmlStackedHandlerReader *xmlReader); // TODO: does xml stuff need project??? - BundleObservationSolveSettings(FileName xmlFile, - Project *project, - XmlStackedHandlerReader *xmlReader); // TODO: does xml stuff need project??? BundleObservationSolveSettings(const BundleObservationSolveSettings &src); BundleObservationSolveSettings(const PvlGroup &scParameterGroup); ~BundleObservationSolveSettings(); diff --git a/isis/src/control/objs/BundleUtilities/unitTest.cpp b/isis/src/control/objs/BundleUtilities/unitTest.cpp index f19cf97e86..12296de461 100755 --- a/isis/src/control/objs/BundleUtilities/unitTest.cpp +++ b/isis/src/control/objs/BundleUtilities/unitTest.cpp @@ -31,7 +31,6 @@ find files of those names at the top level of this repository. **/ #include "Spice.h" #include "SurfacePoint.h" #include "Target.h" -#include "XmlStackedHandlerReader.h" #include #include @@ -39,7 +38,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include #include @@ -82,8 +80,8 @@ void printXml(const BundleObservationSolveSettings &); namespace Isis { class XmlHandlerTester : public BundleObservationSolveSettings { public: - XmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, FileName xmlFile) - : BundleObservationSolveSettings(project, reader) { + XmlHandlerTester(FileName xmlFile) + : BundleObservationSolveSettings() { QString xmlPath(xmlFile.expanded()); QFile file(xmlPath); @@ -94,14 +92,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - bool success = reader->parse(xmlInputSource); - if (!success) { + QXmlStreamReader reader(&file); + + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Unknown, QString("Failed to parse xml file, [%1]").arg(xmlPath), _FILEINFO_); } - } ~XmlHandlerTester() { @@ -267,8 +267,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to BundleObservationSolveSettings object..."; - XmlStackedHandlerReader reader; - XmlHandlerTester bsFromXml1(project, &reader, xmlFile); + XmlHandlerTester bsFromXml1(xmlFile); printXml(bsFromXml1); if (!qXmlFile.open(QIODevice::WriteOnly|QIODevice::Text)) { @@ -283,7 +282,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to BundleObservationSolveSettings object..."; - XmlHandlerTester bsFromXml2(project, &reader, xmlFile); + XmlHandlerTester bsFromXml2(xmlFile); printXml(bsFromXml2); if (!qXmlFile.open(QIODevice::WriteOnly|QIODevice::Text)) { @@ -298,7 +297,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to BundleObservationSolveSettings object..."; - XmlHandlerTester bsFromXml3(project, &reader, xmlFile); + XmlHandlerTester bsFromXml3(xmlFile); printXml(bsFromXml3); if (!qXmlFile.open(QIODevice::WriteOnly|QIODevice::Text)) { @@ -313,7 +312,7 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to BundleObservationSolveSettings object..."; - XmlHandlerTester bsFromXml4(project, &reader, xmlFile); + XmlHandlerTester bsFromXml4(xmlFile); printXml(bsFromXml4); if (!qXmlFile.open(QIODevice::WriteOnly|QIODevice::Text)) { @@ -328,14 +327,14 @@ int main(int argc, char *argv[]) { qXmlFile.close(); // read xml qDebug() << "Testing XML: read XML to BundleObservationSolveSettings object..."; - XmlHandlerTester bossToFill(project, &reader, xmlFile); + XmlHandlerTester bossToFill(xmlFile); // BundleObservationSolveSettings bossToFill(xmlFile, project, &reader); printXml(bossToFill); // read xml with no attributes or values qDebug() << "Testing XML: read XML with no attributes or values to object..."; FileName emptyXmlFile("./unitTest_NoElementValues.xml"); - XmlHandlerTester bsFromEmptyXml(project, &reader, emptyXmlFile); + XmlHandlerTester bsFromEmptyXml(emptyXmlFile); printXml(bsFromEmptyXml); qXmlFile.remove(); diff --git a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp index 118fb16b2c..dc3b7d0f22 100644 --- a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp +++ b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp @@ -28,7 +28,6 @@ find files of those names at the top level of this repository. **/ #include "Directory.h" #include "FileName.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" #include "ProjectItemViewMenu.h" namespace Isis { @@ -173,16 +172,6 @@ namespace Isis { } - /** - * This method pushes a new XmlHandler into the parser stack. - * - * @param xmlReader This is the parser stack. - */ - void CnetEditorView::load(XmlStackedHandlerReader *xmlReader) { - xmlReader->pushContentHandler(new XmlHandler(this)); - } - - /** * This method saves the Controls object ids to the stream. * diff --git a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h index 73a67a98d9..4890fbe011 100644 --- a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h +++ b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h @@ -30,7 +30,6 @@ namespace Isis { class FileName; class Project; class ToolPad; - class XmlStackedHandlerReader; class ProjectItemViewMenu; /** @@ -74,7 +73,6 @@ class CnetEditorView : public AbstractProjectItemView { CnetEditorWidget *cnetEditorWidget(); Control *control(); - void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; private: diff --git a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp index 2ebc1ebab8..68c5691ec8 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp @@ -56,7 +56,6 @@ find files of those names at the top level of this repository. **/ #include "TableViewHeader.h" #include "TreeView.h" #include "XmlStackedHandler.h" -#include "XmlStackedHandlerReader.h" namespace Isis { diff --git a/isis/src/qisis/objs/Control/Control.cpp b/isis/src/qisis/objs/Control/Control.cpp index 9380f0ea3e..cb82e7c524 100644 --- a/isis/src/qisis/objs/Control/Control.cpp +++ b/isis/src/qisis/objs/Control/Control.cpp @@ -23,7 +23,6 @@ find files of those names at the top level of this repository. **/ #include "IString.h" #include "Project.h" #include "PvlObject.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -101,25 +100,6 @@ namespace Isis { } - /** - * Construct this control from XML. - * - * @param cnetFolder Location of control xml - * @param xmlReader An XML reader that's up to an tag. - * @param parent The Qt-relationship parent - */ - Control::Control(FileName cnetFolder, XmlStackedHandlerReader *xmlReader, QObject *parent) : - QObject(parent) { - m_controlNet = NULL; - m_displayProperties = NULL; - m_id = NULL; - m_project = NULL; - m_modified = false; - - xmlReader->pushContentHandler(new XmlHandler(this, cnetFolder)); - } - - /** * Destroys Control object. */ @@ -427,7 +407,7 @@ namespace Isis { } } else if (localName == "displayProperties") { - m_xmlHandlerControl->m_displayProperties = new ControlDisplayProperties(reader()); + m_xmlHandlerControl->m_displayProperties = new ControlDisplayProperties(""); } } diff --git a/isis/src/qisis/objs/Control/Control.h b/isis/src/qisis/objs/Control/Control.h index 92242f6875..b2965f2c72 100644 --- a/isis/src/qisis/objs/Control/Control.h +++ b/isis/src/qisis/objs/Control/Control.h @@ -71,7 +71,6 @@ namespace Isis { explicit Control(QString cnetFileName, QObject *parent = 0); explicit Control(Project *project, QString cnetFileName, QObject *parent = 0); explicit Control(ControlNet *controlNet, QString cnetFileName, QObject *parent = 0); - Control(FileName cnetFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); ~Control(); ControlNet *controlNet(); diff --git a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp index a1eafa8bef..c8d10d64ea 100644 --- a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp +++ b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp @@ -20,7 +20,6 @@ find files of those names at the top level of this repository. **/ #include "FileName.h" #include "Pvl.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -46,15 +45,6 @@ namespace Isis { } - ControlDisplayProperties::ControlDisplayProperties(XmlStackedHandlerReader *xmlReader, - QObject *parent) : DisplayProperties("", parent) { - m_propertiesUsed = None; - m_propertyValues = new QMap; - - xmlReader->pushContentHandler(new XmlHandler(this)); - } - - /** * destructor */ diff --git a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h index cd6005a8a4..4594460b88 100644 --- a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h +++ b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h @@ -24,7 +24,6 @@ namespace Isis { class Project; class Pvl; class PvlObject; - class XmlStackedHandlerReader; /** * @brief This is the GUI communication mechanism for cubes @@ -75,7 +74,6 @@ namespace Isis { ControlDisplayProperties(QString displayName, QObject *parent = NULL); - ControlDisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); virtual ~ControlDisplayProperties(); // void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/ControlList/ControlList.cpp b/isis/src/qisis/objs/ControlList/ControlList.cpp index 8b5dbd3be6..204b2e1495 100644 --- a/isis/src/qisis/objs/ControlList/ControlList.cpp +++ b/isis/src/qisis/objs/ControlList/ControlList.cpp @@ -24,7 +24,6 @@ find files of those names at the top level of this repository. **/ #include "FileName.h" #include "IException.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -60,19 +59,6 @@ namespace Isis { } - /** - * Create an control list from XML - * - * @param project The project with the control list - * @param xmlReader The XML reader currently at an tag. - * @param parent The Qt-relationship parent - */ - ControlList::ControlList(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent) : - QObject(parent) { - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - /** * Copy constructor. * @@ -768,8 +754,7 @@ namespace Isis { } } else if (localName == "controlNet") { - m_controlList->append(new Control(m_project->cnetRoot() + "/" + - m_controlList->path(), reader())); + m_controlList->append(new Control(m_project->cnetRoot() + "/" + m_controlList->path())); } } @@ -793,11 +778,6 @@ namespace Isis { bool ControlList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, const QString &qName) { if (localName == "controlList") { - XmlHandler handler(m_controlList, m_project); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); QString controlListXmlPath = m_project->cnetRoot() + "/" + m_controlList->path() + "/controlNetworks.xml"; @@ -810,11 +790,15 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - if (!reader.parse(xmlInputSource)) + QXmlStreamReader reader(&file); + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Io, tr("Failed to open control list XML [%1]").arg(controlListXmlPath), _FILEINFO_); + } } return XmlStackedHandler::endElement(namespaceURI, localName, qName); diff --git a/isis/src/qisis/objs/ControlList/ControlList.h b/isis/src/qisis/objs/ControlList/ControlList.h index 4d3db3f5fb..d0e4bc88db 100644 --- a/isis/src/qisis/objs/ControlList/ControlList.h +++ b/isis/src/qisis/objs/ControlList/ControlList.h @@ -23,7 +23,6 @@ class QXmlStreamWriter; namespace Isis { class FileName; - class XmlStackedHandlerReader; /** * Maintains a list of Controls so that control nets can easily be copied from one Project to @@ -49,8 +48,6 @@ namespace Isis { ControlList(QString name, QString path, QObject *parent = NULL); explicit ControlList(QObject *parent = NULL); explicit ControlList(QList, QObject *parent = NULL); - explicit ControlList(Project *project, XmlStackedHandlerReader *xmlReader, - QObject *parent = NULL); explicit ControlList(QStringList &); ControlList(const ControlList &); ~ControlList(); diff --git a/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp b/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp index dbdcb78e1e..4e0aa52d6a 100644 --- a/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp +++ b/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp @@ -67,7 +67,6 @@ find files of those names at the top level of this repository. **/ #include "ViewportMdiSubWindow.h" #include "Workspace.h" #include "WindowTool.h" -#include "XmlStackedHandlerReader.h" #include "ZoomTool.h" #include "ProjectItemViewMenu.h" @@ -530,11 +529,6 @@ namespace Isis { } - void CubeDnView::load(XmlStackedHandlerReader *xmlReader, Project *project) { - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - void CubeDnView::save(QXmlStreamWriter &stream, Project *, FileName) const { stream.writeStartElement("cubeDnView"); stream.writeAttribute("objectName", objectName()); diff --git a/isis/src/qisis/objs/CubeDnView/CubeDnView.h b/isis/src/qisis/objs/CubeDnView/CubeDnView.h index 94bb32ddaf..e1572867f7 100644 --- a/isis/src/qisis/objs/CubeDnView/CubeDnView.h +++ b/isis/src/qisis/objs/CubeDnView/CubeDnView.h @@ -35,7 +35,6 @@ namespace Isis { class Project; class ToolPad; class Workspace; - class XmlStackedHandlerReader; class ProjectItemViewMenu; /** @@ -104,7 +103,6 @@ namespace Isis { bool viewportContainsShape(MdiCubeViewport *viewport); - void load(XmlStackedHandlerReader *xmlReader, Project *project); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; signals: diff --git a/isis/src/qisis/objs/Directory/Directory.cpp b/isis/src/qisis/objs/Directory/Directory.cpp index f4f3e2dd36..78f1506f8d 100644 --- a/isis/src/qisis/objs/Directory/Directory.cpp +++ b/isis/src/qisis/objs/Directory/Directory.cpp @@ -92,7 +92,6 @@ find files of those names at the top level of this repository. **/ #include "WorkOrder.h" #include "Workspace.h" #include "XmlStackedHandler.h" -#include "XmlStackedHandlerReader.h" using namespace std; @@ -1504,15 +1503,6 @@ namespace Isis { } - /** - * @brief Loads the Directory from an XML file. - * @param xmlReader The reader that takes in and parses the XML file. - */ - void Directory::load(XmlStackedHandlerReader *xmlReader) { - xmlReader->pushContentHandler( new XmlHandler(this) ); - } - - /** * @brief Save the directory to an XML file. * @param stream The XML stream writer @@ -1611,15 +1601,15 @@ namespace Isis { QString viewObjectName; if (localName == "footprint2DView") { viewObjectName = atts.value("objectName"); - m_directory->addFootprint2DView(viewObjectName)->load(reader()); + m_directory->addFootprint2DView(viewObjectName); } else if (localName == "imageFileList") { viewObjectName = atts.value("objectName"); - m_directory->addImageFileListView(viewObjectName)->load(reader()); + m_directory->addImageFileListView(viewObjectName); } else if (localName == "cubeDnView") { viewObjectName = atts.value("objectName"); - m_directory->addCubeDnView(viewObjectName)->load(reader(), m_directory->project()); + m_directory->addCubeDnView(viewObjectName); } else if (localName == "cnetEditorView") { viewObjectName = atts.value("objectName"); diff --git a/isis/src/qisis/objs/Directory/Directory.h b/isis/src/qisis/objs/Directory/Directory.h index 995c27164f..37ebb1f5bb 100644 --- a/isis/src/qisis/objs/Directory/Directory.h +++ b/isis/src/qisis/objs/Directory/Directory.h @@ -387,7 +387,6 @@ namespace Isis { QAction *redoAction(); QAction *undoAction(); - void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, FileName newProjectRoot) const; signals: diff --git a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp index ac764eec38..d9afe658d8 100644 --- a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp +++ b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include "FileName.h" #include "Pvl.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -36,14 +35,6 @@ namespace Isis { } - DisplayProperties::DisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent) { - m_propertiesUsed = 0; - m_propertyValues = new QMap; - - xmlReader->pushContentHandler(new XmlHandler(this)); - } - - /** * destructor */ diff --git a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h index 9b06ff1d5f..65b9c1525a 100644 --- a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h +++ b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h @@ -35,7 +35,6 @@ namespace Isis { Q_OBJECT public: DisplayProperties(QString displayName, QObject *parent = NULL); - DisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); virtual ~DisplayProperties(); void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp index 09e50befbe..1bfbce4f9a 100644 --- a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp +++ b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp @@ -41,7 +41,6 @@ find files of those names at the top level of this repository. **/ #include "ProjectItemModel.h" #include "Shape.h" #include "ToolPad.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -342,15 +341,6 @@ namespace Isis { } - /** - * @brief Loads the Footprint2DView from an XML file. - * @param xmlReader The reader that takes in and parses the XML file. - */ - void Footprint2DView::load(XmlStackedHandlerReader *xmlReader) { - xmlReader->pushContentHandler( new XmlHandler(this) ); - } - - /** * @brief Save the footprint view widgets (ImageFileListWidget and MosaicSceneWidget to an XML * file. @@ -412,10 +402,10 @@ namespace Isis { if (result) { if (localName == "mosaicScene") { - m_footprintView->mosaicSceneWidget()->load(reader()); + m_footprintView->mosaicSceneWidget(); } if (localName == "imageFileList") { - m_footprintView->m_fileListWidget->load(reader()); + m_footprintView->m_fileListWidget; } } return result; diff --git a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h index 34a8414103..162408035d 100644 --- a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h +++ b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h @@ -34,7 +34,6 @@ namespace Isis { class MosaicSceneWidget; class Project; class ToolPad; - class XmlStackedHandlerReader; /** * View for displaying footprints of images in a QMos like way. @@ -110,7 +109,6 @@ namespace Isis { MosaicSceneWidget *mosaicSceneWidget(); ImageFileListWidget *fileListWidget(); - void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; signals: diff --git a/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp b/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp index 80b24b7c78..a186ba2be8 100644 --- a/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp +++ b/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp @@ -12,7 +12,6 @@ #include "Project.h" #include "PvlKeyword.h" #include "PvlObject.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -49,16 +48,6 @@ namespace Isis { -// GuiCamera::GuiCamera(Project *project, XmlStackedHandlerReader *xmlReader, -// QObject *parent) : QObject(parent) { -// TODO: does xml stuff need project??? -// m_id = NULL; -// xmlReader->pushContentHandler(new XmlHandler(this, project)); -// xmlReader->setErrorHandler(new XmlHandler(this, project)); -// } - - - // GuiCamera::GuiCamera(const GuiCamera &src) // : m_id(new QUuid(src.m_id->toString())) { // diff --git a/isis/src/qisis/objs/GuiCamera/GuiCamera.h b/isis/src/qisis/objs/GuiCamera/GuiCamera.h index 57df7f7c2c..8812faeabf 100644 --- a/isis/src/qisis/objs/GuiCamera/GuiCamera.h +++ b/isis/src/qisis/objs/GuiCamera/GuiCamera.h @@ -45,7 +45,6 @@ namespace Isis { class GuiCameraDisplayProperties; class Project; // TODO: does xml stuff need project??? class PvlObject; - class XmlStackedHandlerReader; /** * @brief Container class for GuiCamera. @@ -73,8 +72,6 @@ namespace Isis { Q_OBJECT public: GuiCamera(Camera *camera, QObject *parent = 0); -// GuiCamera(Project *project, XmlStackedHandlerReader *xmlReader, -// QObject *parent = 0); // TODO: does xml stuff need project??? ~GuiCamera(); bool operator==(const GuiCamera &srcGuiCamera) const; diff --git a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp index 850f3818e8..8c5c8cdde0 100644 --- a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp +++ b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp @@ -12,7 +12,6 @@ #include "FileName.h" #include "Pvl.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -36,21 +35,6 @@ namespace Isis { } - /** - * @brief GuiCameraDisplayProperties constructor - * @param xmlReader XML reader class for loading the Gui Camera Display Properties - * @param parent - */ - - GuiCameraDisplayProperties::GuiCameraDisplayProperties(XmlStackedHandlerReader *xmlReader, - QObject *parent) : DisplayProperties("", parent) { - m_propertiesUsed = None; - m_propertyValues = new QMap; - - xmlReader->pushContentHandler(new XmlHandler(this)); - } - - /** * destructor */ diff --git a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h index 2b5d0d999f..f9261458ac 100644 --- a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h +++ b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h @@ -38,7 +38,6 @@ namespace Isis { class Project; class Pvl; class PvlObject; - class XmlStackedHandlerReader; /** * @brief The GUI communication mechanism for target body objects. @@ -92,7 +91,6 @@ namespace Isis { GuiCameraDisplayProperties(QString displayName, QObject *parent = NULL); - GuiCameraDisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); virtual ~GuiCameraDisplayProperties(); // void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp index 58ae54893b..f248a303aa 100644 --- a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp +++ b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp @@ -38,7 +38,6 @@ #include "IException.h" #include "IString.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -75,19 +74,6 @@ namespace Isis { } - /** - * Create an image list from XML - * - * @param project The project with the gui camera list - * @param xmlReader The XML reader currently at an tag. - * @param parent The Qt-relationship parent - */ - GuiCameraList::GuiCameraList(Project *project, XmlStackedHandlerReader *xmlReader, - QObject *parent) : QObject(parent) { - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - /** * Copy constructor. * @@ -934,11 +920,6 @@ namespace Isis { bool GuiCameraList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, const QString &qName) { if (localName == "GuiCameraList") { - XmlHandler handler(m_GuiCameraList, m_project); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); QString GuiCameraListXmlPath = m_project->targetBodyRoot() + "/" + m_GuiCameraList->path() + "/targets.xml"; @@ -951,11 +932,15 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - if (!reader.parse(xmlInputSource)) + QXmlStreamReader reader(&file); + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Io, tr("Failed to open target body list XML [%1]").arg(GuiCameraListXmlPath), _FILEINFO_); + } } return XmlStackedHandler::endElement(namespaceURI, localName, qName); diff --git a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.h b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.h index f8f3a18080..4624b6b075 100644 --- a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.h +++ b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.h @@ -17,7 +17,6 @@ class QXmlStreamWriter; namespace Isis { class FileName; - class XmlStackedHandlerReader; /** * List of GuiCameras saved as QSharedPointers. Overrides many QList methods in order to @@ -41,8 +40,6 @@ namespace Isis { GuiCameraList(QString name, QString path, QObject *parent = NULL); explicit GuiCameraList(QObject *parent = NULL); explicit GuiCameraList(QList, QObject *parent = NULL); - explicit GuiCameraList(Project *project, - XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); // explicit GuiCameraList(QStringList &); GuiCameraList(const GuiCameraList &); ~GuiCameraList(); diff --git a/isis/src/qisis/objs/Image/Image.cpp b/isis/src/qisis/objs/Image/Image.cpp index cc1f2f1d7f..7f9566ee43 100644 --- a/isis/src/qisis/objs/Image/Image.cpp +++ b/isis/src/qisis/objs/Image/Image.cpp @@ -29,7 +29,6 @@ #include "Project.h" #include "SerialNumber.h" #include "Target.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -132,29 +131,6 @@ namespace Isis { } - /** - * @brief Construct this image from XML. - * @param imageFolder Where this image XML resides - /work/.../projectRoot/images/import1 - * @param xmlReader An XML reader that's up to an tag. - * @param parent The Qt-relationship parent - */ - Image::Image(FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent) : - QObject(parent) { - m_bodyCode = NULL; - m_cube = NULL; - m_displayProperties = NULL; - m_footprint = NULL; - m_id = NULL; - - m_aspectRatio = Null; - m_resolution = Null; - m_lineResolution = Null; - m_sampleResolution = Null; - - xmlReader->pushContentHandler(new XmlHandler(this, imageFolder)); - } - - /** * @brief Clean up this image. If you haven't saved this image, all of its settings will be lost. */ @@ -924,7 +900,7 @@ namespace Isis { } } else if (localName == "displayProperties") { - m_image->m_displayProperties = new ImageDisplayProperties(reader()); + m_image->m_displayProperties = new ImageDisplayProperties(""); } } diff --git a/isis/src/qisis/objs/Image/Image.h b/isis/src/qisis/objs/Image/Image.h index dda2e45c3a..b41d9b5217 100644 --- a/isis/src/qisis/objs/Image/Image.h +++ b/isis/src/qisis/objs/Image/Image.h @@ -52,8 +52,6 @@ namespace Isis { class ImageDisplayProperties; class Project; class PvlObject; - class XmlStackedHandlerReader; - /** * This represents a cube in a project-based GUI interface. The actual cube doesn't have to be * open. This encapsulates ideas about an image such as it's footprint, it's cube, how it @@ -111,7 +109,6 @@ namespace Isis { explicit Image(Cube *imageCube, QObject *parent = 0); explicit Image(Cube *imageCube, geos::geom::MultiPolygon *footprint, QString id, QObject *parent = 0); - Image(FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); ~Image(); void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.cpp b/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.cpp index ec65991f92..cbfc65395d 100644 --- a/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.cpp +++ b/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.cpp @@ -11,7 +11,6 @@ #include "FileName.h" #include "Pvl.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -36,11 +35,6 @@ namespace Isis { } - ImageDisplayProperties::ImageDisplayProperties(XmlStackedHandlerReader *xmlReader, - QObject *parent) : DisplayProperties(xmlReader, parent) { - } - - /** */ ImageDisplayProperties::~ImageDisplayProperties() { diff --git a/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.h b/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.h index b6a010646f..610b0c417f 100644 --- a/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.h +++ b/isis/src/qisis/objs/ImageDisplayProperties/ImageDisplayProperties.h @@ -40,7 +40,6 @@ namespace Isis { class Pvl; class PvlObject; class UniversalGroundMap; - class XmlStackedHandlerReader; /** * @brief This is the GUI communication mechanism for cubes @@ -113,7 +112,6 @@ namespace Isis { }; ImageDisplayProperties(QString displayName, QObject *parent = NULL); - ImageDisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); virtual ~ImageDisplayProperties(); static QColor randomColor(); diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp index aecfce4929..9fe61311f9 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp @@ -32,7 +32,6 @@ #include "PvlObject.h" #include "Shape.h" #include "TextFile.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -605,16 +604,6 @@ namespace Isis { } - /** - * This method pushes a new XmlHandler into the parser stack. - * - * @param xmlReader This is the parser stack. - */ - void ImageFileListWidget::load(XmlStackedHandlerReader *xmlReader) { - xmlReader->pushContentHandler(new XmlHandler(this)); - } - - /** * This method saves the FootprintColumns in the project and the settings associated * with every column. diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h index ef33e3c2bd..42825c3dba 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h @@ -70,7 +70,6 @@ namespace Isis { QProgressBar *getProgress(); void fromPvl(PvlObject &pvl); PvlObject toPvl() const; - void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; QList actions(); diff --git a/isis/src/qisis/objs/ImageList/ImageList.cpp b/isis/src/qisis/objs/ImageList/ImageList.cpp index 42e445c2a2..59d2ccf54c 100644 --- a/isis/src/qisis/objs/ImageList/ImageList.cpp +++ b/isis/src/qisis/objs/ImageList/ImageList.cpp @@ -41,7 +41,6 @@ #include "IException.h" #include "IString.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -77,19 +76,6 @@ namespace Isis { } - /** - * Creates an image list from XML. - * - * @param project The project with the image list. - * @param xmlReader The XML reader currently at an tag. - * @param parent The Qt-relationship parent. - */ - ImageList::ImageList(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent) : - QObject(parent) { - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - /** * Copy constructor. * @@ -1386,7 +1372,7 @@ namespace Isis { } else if (localName == "image") { m_imageList->append(new Image( - m_project->projectRoot() + "/" + m_imageDataRoot + "/" + m_imageList->path(), reader())); + m_project->projectRoot() + "/" + m_imageDataRoot + "/" + m_imageList->path())); } } @@ -1406,11 +1392,6 @@ namespace Isis { bool ImageList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, const QString &qName) { if (localName == "imageList") { - XmlHandler handler(m_imageList, m_project, m_imageDataRoot); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); QDir projectPath = QDir(m_project->projectRoot()).dirName(); QString imageListXmlPath = m_project->projectRoot() + "/" + m_imageDataRoot + "/" + @@ -1426,13 +1407,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - if (!reader.parse(xmlInputSource)) + QXmlStreamReader reader(&file); + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Io, tr("Failed to open image list XML [%1]").arg(imageListXmlPath), _FILEINFO_); + } } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); } } diff --git a/isis/src/qisis/objs/ImageList/ImageList.h b/isis/src/qisis/objs/ImageList/ImageList.h index f2a7c9c838..fe95e50981 100644 --- a/isis/src/qisis/objs/ImageList/ImageList.h +++ b/isis/src/qisis/objs/ImageList/ImageList.h @@ -19,7 +19,6 @@ class QXmlStreamWriter; namespace Isis { class FileName; - class XmlStackedHandlerReader; /** * @brief Internalizes a list of images and allows for operations on the entire list @@ -61,8 +60,6 @@ namespace Isis { ImageList(QString name, QString path, QObject *parent = NULL); explicit ImageList(QObject *parent = NULL); explicit ImageList(QList, QObject *parent = NULL); - explicit ImageList(Project *project, - XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); explicit ImageList(QStringList &); ImageList(const ImageList &); ~ImageList(); diff --git a/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.cpp b/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.cpp index 36a71054cb..ec2978494f 100644 --- a/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.cpp +++ b/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.cpp @@ -31,7 +31,6 @@ #include "TextFile.h" #include "Target.h" #include "ToolPad.h" -#include "XmlStackedHandlerReader.h" #include #include @@ -246,12 +245,6 @@ namespace Isis { } - -// void MatrixSceneWidget::load(XmlStackedHandlerReader *xmlReader) { -// xmlReader->pushContentHandler( new XmlHandler(this) ); -// } - - /** * Returns the bounding rectangle for the images * diff --git a/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h b/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h index a50224a804..fa22b54320 100644 --- a/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h +++ b/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h @@ -70,7 +70,6 @@ namespace Isis { QProgressBar *getProgress(); PvlObject toPvl() const; void fromPvl(const PvlObject &); -// void load(XmlStackedHandlerReader *xmlReader); QRectF elementsBoundingRect() const; Directory *directory() const; diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp index 208c0d2f2b..d3c5c43192 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp @@ -55,7 +55,6 @@ #include "TextFile.h" #include "Target.h" #include "ToolPad.h" -#include "XmlStackedHandlerReader.h" using namespace std; @@ -619,11 +618,6 @@ namespace Isis { } - void MosaicSceneWidget::load(XmlStackedHandlerReader *xmlReader) { - xmlReader->pushContentHandler(new XmlHandler(this)); - } - - void MosaicSceneWidget::save(QXmlStreamWriter &stream, Project *, FileName ) const { if (m_projection) { stream.writeStartElement("mosaicScene"); diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h index 178dc3f898..6920d306c0 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h @@ -199,7 +199,6 @@ namespace Isis { QProgressBar *getProgress(); PvlObject toPvl() const; void fromPvl(const PvlObject &); - void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; // QPointF currentLatLonPosition(); diff --git a/isis/src/qisis/objs/Project/Project.cpp b/isis/src/qisis/objs/Project/Project.cpp index eb75327141..01987cfcc2 100644 --- a/isis/src/qisis/objs/Project/Project.cpp +++ b/isis/src/qisis/objs/Project/Project.cpp @@ -75,7 +75,6 @@ #include "TemplateList.h" #include "WorkOrder.h" #include "WorkOrderFactory.h" -#include "XmlStackedHandlerReader.h" namespace Isis { @@ -1389,40 +1388,37 @@ namespace Isis { m_clearing = false; m_isTemporaryProject = false; - XmlHandler handler(this); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); - QDir oldProjectRoot(*m_projectRoot); *m_projectRoot = QDir(projectAbsolutePathStr); - QXmlInputSource xmlInputSource(&file); + QXmlStreamReader reader(&file); //This prevents the project from not loading if everything //can't be loaded, and outputs the warnings/errors to the //Warnings Tab try { - reader.parse(xmlInputSource); - } + while (!reader.atEnd()) { + reader.readNext(); + } + } catch (IException &e) { directory()->showWarning(QString("Failed to open project completely [%1]") .arg(projectAbsolutePathStr)); directory()->showWarning(e.toString()); - } + } catch (std::exception &e) { directory()->showWarning(QString("Failed to open project completely[%1]") .arg(projectAbsolutePathStr)); directory()->showWarning(e.what()); } - reader.pushContentHandler(&handler); - QXmlInputSource xmlHistoryInputSource(&historyFile); + QXmlStreamReader reader2(&historyFile); try { - reader.parse(xmlHistoryInputSource); + while (!reader2.atEnd()) { + reader2.readNext(); } + } catch (IException &e) { directory()->showWarning(QString("Failed to read history from project[%1]") @@ -1434,28 +1430,29 @@ namespace Isis { .arg(projectAbsolutePathStr)); directory()->showWarning(e.what()); } + + QXmlStreamReader reader3(&warningsFile); - reader.pushContentHandler(&handler); - - QXmlInputSource xmlWarningsInputSource(&warningsFile); - - if (!reader.parse(xmlWarningsInputSource)) { + while (!reader3.atEnd()) { + reader3.readNext(); + } + if (reader3.hasError()) { warn(tr("Failed to read warnings from project [%1]").arg(projectAbsolutePathStr)); } - reader.pushContentHandler(&handler); - - QXmlInputSource xmlDirectoryInputSource(&directoryFile); + QXmlStreamReader reader4(&directoryFile); try { - reader.parse(xmlDirectoryInputSource); - } + while (!reader4.atEnd()) { + reader4.readNext(); + } + } catch (IException &e) { directory()->showWarning(QString("Failed to read GUI state from project[%1]") .arg(projectAbsolutePathStr)); directory()->showWarning(e.toString()); - } + } catch (std::exception &e) { directory()->showWarning(QString("Failed to read GUI state from project[%1]") .arg(projectAbsolutePathStr)); @@ -2996,19 +2993,19 @@ namespace Isis { } } else if (localName == "controlNets") { - m_controls.append(new ControlList(m_project, reader())); + m_controls.append(new ControlList()); } else if (localName == "imageList") { - m_imageLists.append(new ImageList(m_project, reader())); + m_imageLists.append(new ImageList()); } else if (localName == "shapeList") { - m_shapeLists.append(new ShapeList(m_project, reader())); + m_shapeLists.append(new ShapeList()); } else if (localName == "mapTemplateList") { - m_mapTemplateLists.append( new TemplateList(m_project, reader())); + m_mapTemplateLists.append( new TemplateList()); } else if (localName == "regTemplateList") { - m_regTemplateLists.append( new TemplateList(m_project, reader())); + m_regTemplateLists.append( new TemplateList()); } // workOrders are stored in history.xml, using same reader as project.xml else if (localName == "workOrder") { @@ -3016,7 +3013,6 @@ namespace Isis { m_workOrder = WorkOrderFactory::create(m_project, type); - m_workOrder->read(reader()); } // warnings stored in warning.xml, using same reader as project.xml else if (localName == "warning") { @@ -3027,7 +3023,7 @@ namespace Isis { } } else if (localName == "directory") { - m_project->directory()->load(reader()); + m_project->directory(); } else if (localName == "dockRestore") { // QVariant geo_data = QVariant(atts.value("geometry")); @@ -3037,7 +3033,7 @@ namespace Isis { } else if (localName == "bundleSolutionInfo") { - m_bundleSolutionInfos.append(new BundleSolutionInfo(m_project, reader())); + m_bundleSolutionInfos.append(new BundleSolutionInfo()); } else if (localName == "activeImageList") { QString displayName = atts.value("displayName"); diff --git a/isis/src/qisis/objs/Shape/Shape.cpp b/isis/src/qisis/objs/Shape/Shape.cpp index 2e18d51e30..6cdda45060 100644 --- a/isis/src/qisis/objs/Shape/Shape.cpp +++ b/isis/src/qisis/objs/Shape/Shape.cpp @@ -33,7 +33,6 @@ #include "SerialNumber.h" #include "ShapeDisplayProperties.h" #include "Target.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -68,21 +67,6 @@ namespace Isis { } - /** - * Construct this shape from XML. - * - * @param shapeFolder Where this shape XML resides - /work/.../projectRoot/shapes/import1 - * @param xmlReader An XML reader that's up to an tag. - * @param parent The Qt-relationship parent - */ - Shape::Shape(FileName shapeFolder, XmlStackedHandlerReader *xmlReader, QObject *parent) : - QObject(parent) { - - initMemberData(); - xmlReader->pushContentHandler(new XmlHandler(this, shapeFolder)); - } - - /** * Clean up this shape. If you haven't saved this shape, all of its settings will be lost. */ @@ -1039,7 +1023,7 @@ namespace Isis { } else if (localName == "displayProperties") { - m_shape->m_displayProperties = new ShapeDisplayProperties(reader()); + m_shape->m_displayProperties = new ShapeDisplayProperties(""); } } diff --git a/isis/src/qisis/objs/Shape/Shape.h b/isis/src/qisis/objs/Shape/Shape.h index 82a32b8221..d58abe1e3d 100644 --- a/isis/src/qisis/objs/Shape/Shape.h +++ b/isis/src/qisis/objs/Shape/Shape.h @@ -42,7 +42,6 @@ namespace Isis { class Project; class PvlObject; class ShapeDisplayProperties; - class XmlStackedHandlerReader; /** * This represents a shape in a project-based GUI interface. The actual cube doesn't have to be @@ -76,7 +75,6 @@ namespace Isis { explicit Shape(QString shapeFileName, QObject *parent = 0); explicit Shape(Cube *shapeCube, QObject *parent = 0); - Shape(FileName shapeFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); ~Shape(); void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp index c32f0e522e..237b864d70 100644 --- a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp +++ b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp @@ -12,7 +12,6 @@ #include "FileName.h" #include "Pvl.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -36,19 +35,6 @@ namespace Isis { setValue(Color, QVariant::fromValue(randomColor())); } - /** - * @brief ShapeDisplayProperties constructor - * @param xmlReader The XML reader parsing the XML file containing the display properties. - * @param parent The Qt parent object (this is destroyed when the parent is destroyed). - */ - ShapeDisplayProperties::ShapeDisplayProperties(XmlStackedHandlerReader *xmlReader, - QObject *parent) : DisplayProperties("", parent) { - m_propertiesUsed = None; - m_propertyValues = new QMap; - - xmlReader->pushContentHandler(new XmlHandler(this)); - } - /** * @brief The destructor. diff --git a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h index 13cbf4f94c..5db218843d 100644 --- a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h +++ b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h @@ -24,7 +24,6 @@ namespace Isis { class Project; class Pvl; class PvlObject; - class XmlStackedHandlerReader; /** * @brief This is the GUI communication mechanism for shape objects. @@ -76,7 +75,6 @@ namespace Isis { ShapeDisplayProperties(QString displayName, QObject *parent = NULL); - ShapeDisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); virtual ~ShapeDisplayProperties(); // void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/ShapeList/ShapeList.cpp b/isis/src/qisis/objs/ShapeList/ShapeList.cpp index 75d5127c34..233b093e4a 100644 --- a/isis/src/qisis/objs/ShapeList/ShapeList.cpp +++ b/isis/src/qisis/objs/ShapeList/ShapeList.cpp @@ -22,7 +22,6 @@ find files of those names at the top level of this repository. **/ #include "IException.h" #include "IString.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -58,19 +57,6 @@ namespace Isis { } - /** - * Creates an shape list from XML. - * - * @param project The project with the shape list. - * @param xmlReader The XML reader currently at an tag. - * @param parent The Qt-relationship parent. - */ - ShapeList::ShapeList(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent) : - QObject(parent) { - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - /** * Copy constructor. * @@ -780,8 +766,7 @@ namespace Isis { } } else if (localName == "shape") { - m_shapeList->append(new Shape(m_project->shapeDataRoot() + "/" + m_shapeList->path(), - reader())); + m_shapeList->append(new Shape(m_project->shapeDataRoot() + "/" + m_shapeList->path())); } } @@ -801,11 +786,6 @@ namespace Isis { bool ShapeList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, const QString &qName) { if (localName == "shapeList") { - XmlHandler handler(m_shapeList, m_project); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); QString shapeListXmlPath = m_project->shapeDataRoot() + "/" + m_shapeList->path() + "/shapes.xml"; @@ -818,13 +798,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - if (!reader.parse(xmlInputSource)) + QXmlStreamReader reader(&file); + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Io, tr("Failed to open shape list XML [%1]").arg(shapeListXmlPath), _FILEINFO_); + } } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); } } diff --git a/isis/src/qisis/objs/ShapeList/ShapeList.h b/isis/src/qisis/objs/ShapeList/ShapeList.h index cb3d9f9147..ef76f29349 100644 --- a/isis/src/qisis/objs/ShapeList/ShapeList.h +++ b/isis/src/qisis/objs/ShapeList/ShapeList.h @@ -17,7 +17,6 @@ class QXmlStreamWriter; namespace Isis { class FileName; - class XmlStackedHandlerReader; /** * @brief Internalizes a list of shapes and allows for operations on the entire list @@ -37,8 +36,6 @@ namespace Isis { ShapeList(QString name, QString path, QObject *parent = NULL); explicit ShapeList(QObject *parent = NULL); explicit ShapeList(QList, QObject *parent = NULL); - explicit ShapeList(Project *project, - XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); explicit ShapeList(QStringList &); ShapeList(const ShapeList &); ~ShapeList(); diff --git a/isis/src/qisis/objs/TargetBody/TargetBody.cpp b/isis/src/qisis/objs/TargetBody/TargetBody.cpp index 7185ab17c9..d4f4e4bf2c 100644 --- a/isis/src/qisis/objs/TargetBody/TargetBody.cpp +++ b/isis/src/qisis/objs/TargetBody/TargetBody.cpp @@ -12,7 +12,6 @@ #include "PvlKeyword.h" #include "PvlObject.h" #include "TargetBodyDisplayProperties.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -102,15 +101,6 @@ TargetBody::TargetBody(Target *target, QObject *parent) : QObject(parent) { } */ -// TargetBody::TargetBody(Project *project, XmlStackedHandlerReader *xmlReader, -// QObject *parent) : QObject(parent) { -// TODO: does xml stuff need project??? -// m_id = NULL; - -// xmlReader->pushContentHandler(new XmlHandler(this, project)); -// xmlReader->setErrorHandler(new XmlHandler(this, project)); -// } - // TargetBody::TargetBody(const TargetBody &src) diff --git a/isis/src/qisis/objs/TargetBody/TargetBody.h b/isis/src/qisis/objs/TargetBody/TargetBody.h index 7c54351190..b4e33199ba 100644 --- a/isis/src/qisis/objs/TargetBody/TargetBody.h +++ b/isis/src/qisis/objs/TargetBody/TargetBody.h @@ -37,7 +37,6 @@ namespace Isis { class Project; // TODO: does xml stuff need project??? class PvlObject; class TargetBodyDisplayProperties; - class XmlStackedHandlerReader; /** * @brief Container class for TargetBody. @@ -68,9 +67,6 @@ namespace Isis { public: TargetBody(Target *target, QObject *parent = 0); - //TargetBody(BundleTargetBodyQsp bundleTargetBody, QObject *parent = 0); -// TargetBody(Project *project, XmlStackedHandlerReader *xmlReader, -// QObject *parent = 0); // TODO: does xml stuff need project??? ~TargetBody(); bool operator==(const TargetBody &src) const; diff --git a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp index e6ea2499db..a236203582 100644 --- a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp +++ b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp @@ -12,7 +12,6 @@ #include "FileName.h" #include "Pvl.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -35,19 +34,6 @@ namespace Isis { setValue(Color, QVariant::fromValue(randomColor())); } - /** - * @brief TargetBodyDisplayProperties constructor - * @param xmlReader The XML reader parsing the XML file containing the display properties. - * @param parent The Qt parent object (this is destroyed when the parent is destroyed). - */ - TargetBodyDisplayProperties::TargetBodyDisplayProperties(XmlStackedHandlerReader *xmlReader, - QObject *parent) : DisplayProperties("", parent) { - m_propertiesUsed = None; - m_propertyValues = new QMap; - - xmlReader->pushContentHandler(new XmlHandler(this)); - } - /** * @brief The destructor. diff --git a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h index c31810d687..0e8bc5ea40 100644 --- a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h +++ b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h @@ -24,7 +24,6 @@ namespace Isis { class Project; class Pvl; class PvlObject; - class XmlStackedHandlerReader; /** * @brief This is the GUI communication mechanism for target body objects. @@ -79,7 +78,6 @@ namespace Isis { TargetBodyDisplayProperties(QString displayName, QObject *parent = NULL); - TargetBodyDisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); virtual ~TargetBodyDisplayProperties(); // void fromPvl(const PvlObject &pvl); diff --git a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp index 925dcb794f..9b0cce8336 100644 --- a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp +++ b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp @@ -24,7 +24,6 @@ find files of those names at the top level of this repository. **/ #include "IString.h" #include "Project.h" #include "TargetBody.h" -#include "XmlStackedHandlerReader.h" namespace Isis { /** @@ -61,19 +60,6 @@ namespace Isis { } - /** - * Create an image list from XML - * - * @param project The project with the target body list - * @param xmlReader The XML reader currently at an tag. - * @param parent The Qt-relationship parent - */ - TargetBodyList::TargetBodyList(Project *project, XmlStackedHandlerReader *xmlReader, - QObject *parent) : QObject(parent) { - xmlReader->pushContentHandler(new XmlHandler(this, project)); - } - - /** * Copy constructor. * @@ -921,11 +907,6 @@ namespace Isis { const QString &localName, const QString &qName) { if (localName == "TargetBodyList") { - XmlHandler handler(m_TargetBodyList, m_project); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); QString TargetBodyListXmlPath = m_project->targetBodyRoot() + "/" + m_TargetBodyList->path() + "/targets.xml"; @@ -938,13 +919,16 @@ namespace Isis { _FILEINFO_); } - QXmlInputSource xmlInputSource(&file); - if (!reader.parse(xmlInputSource)) + QXmlStreamReader reader(&file); + while (!reader.atEnd()) { + reader.readNext(); + } + if (reader.hasError()) { throw IException(IException::Io, tr("Failed to open target body list XML [%1]").arg(TargetBodyListXmlPath), _FILEINFO_); + } } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); } } diff --git a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.h b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.h index 2ce78fb6d0..d79bac8db6 100644 --- a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.h +++ b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.h @@ -17,7 +17,6 @@ class QXmlStreamWriter; namespace Isis { class FileName; - class XmlStackedHandlerReader; /** * List for holding TargetBodies. Overrides several QList methods in order to emit @@ -39,8 +38,6 @@ namespace Isis { TargetBodyList(QString name, QString path, QObject *parent = NULL); explicit TargetBodyList(QObject *parent = NULL); explicit TargetBodyList(QList, QObject *parent = NULL); - explicit TargetBodyList(Project *project, - XmlStackedHandlerReader *xmlReader, QObject *parent = NULL); // explicit TargetBodyList(QStringList &); TargetBodyList(const TargetBodyList &); ~TargetBodyList(); diff --git a/isis/src/qisis/objs/Template/Template.cpp b/isis/src/qisis/objs/Template/Template.cpp index bcf2ab1e7a..367b2d4226 100755 --- a/isis/src/qisis/objs/Template/Template.cpp +++ b/isis/src/qisis/objs/Template/Template.cpp @@ -5,7 +5,6 @@ #include "FileName.h" #include "IException.h" #include "Project.h" -#include "XmlStackedHandlerReader.h" namespace Isis{ /** @@ -23,18 +22,6 @@ namespace Isis{ } - /** - * Construct this template from XML. - * - * @param templateFolder Location of template xml - * @param xmlReader An XML reader that's up to an