diff --git a/isis/src/base/apps/mosrange/mosrange.cpp b/isis/src/base/apps/mosrange/mosrange.cpp index df876e85b1..221ea38987 100644 --- a/isis/src/base/apps/mosrange/mosrange.cpp +++ b/isis/src/base/apps/mosrange/mosrange.cpp @@ -11,6 +11,7 @@ find files of those names at the top level of this repository. **/ #include #include +#include #include "Camera.h" #include "Cube.h" diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp index c216ab6f84..f44e949ed4 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp @@ -504,82 +504,6 @@ namespace Isis { } - -// TODO: should project be const ??? - StatCumProbDistDynCalc::XmlHandler::XmlHandler(StatCumProbDistDynCalc *probabilityCalc, - Project *project) { // TODO: does xml stuff need project??? - m_xmlHandlerCumProbCalc = probabilityCalc; - m_xmlHandlerProject = project; // TODO: does xml stuff need project??? - m_xmlHandlerCharacters = ""; - } - - - - StatCumProbDistDynCalc::XmlHandler::~XmlHandler() { - // do not delete this pointer... we don't own it, do we??? passed into StatCumProbDistDynCalc constructor as pointer -// delete m_xmlHandlerProject; // TODO: does xml stuff need project??? - m_xmlHandlerProject = NULL; - } - - - - bool StatCumProbDistDynCalc::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) { - - m_xmlHandlerCharacters = ""; - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (qName == "quantileInfo") { - - QString quantile = atts.value("quantile"); - QString obsValue = atts.value("dataValue"); - QString idealObs = atts.value("idealNumObsBelowQuantile"); - QString actualObs = atts.value("actualNumObsBelowQuantile"); - - if (!quantile.isEmpty() && !obsValue.isEmpty() - && !idealObs.isEmpty() && !actualObs.isEmpty()) { - m_xmlHandlerCumProbCalc->m_quantiles.append(toDouble(quantile)); - m_xmlHandlerCumProbCalc->m_observationValues.append(toDouble(obsValue)); - m_xmlHandlerCumProbCalc->m_idealNumObsBelowQuantile.append(toDouble(idealObs)); - m_xmlHandlerCumProbCalc->m_numObsBelowQuantile.append(toDouble(actualObs)); - } - } - - } - return true; - } - - - - bool StatCumProbDistDynCalc::XmlHandler::characters(const QString &ch) { - m_xmlHandlerCharacters += ch; - return XmlStackedHandler::characters(ch); - } - - - - bool StatCumProbDistDynCalc::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName) { - if (!m_xmlHandlerCharacters.isEmpty()) { - if (qName == "numberCells") { - m_xmlHandlerCumProbCalc->m_numberCells = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberQuantiles") { - m_xmlHandlerCumProbCalc->m_numberQuantiles = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberObservations") { - m_xmlHandlerCumProbCalc->m_numberObservations = toInt(m_xmlHandlerCharacters); - } - - m_xmlHandlerCharacters = ""; - } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - - QDataStream &StatCumProbDistDynCalc::write(QDataStream &stream) const { stream << (qint32)m_numberCells << (qint32)m_numberQuantiles diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h index 38c837666e..ac2efac62e 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h @@ -11,8 +11,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include "XmlStackedHandler.h" - class QDataStream; class QUuid; class QXmlStreamWriter; @@ -96,24 +94,6 @@ namespace Isis { * * @internal */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(StatCumProbDistDynCalc *probabilityCalc, Project *project); // TODO: does xml stuff need project??? - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - StatCumProbDistDynCalc *m_xmlHandlerCumProbCalc; - Project *m_xmlHandlerProject; // TODO: does xml stuff need project??? - QString m_xmlHandlerCharacters; - }; unsigned int m_numberCells; /**< The number of cells or histogram bins that are being used to model the probility density function.*/ diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp index 7d30ed4bf9..f26686824d 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp @@ -7,6 +7,7 @@ find files of those names at the top level of this repository. **/ #include #include #include +#include #include diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index 557f351143..67c14a4903 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -747,99 +747,6 @@ namespace Isis { } - Statistics::XmlHandler::XmlHandler(Statistics *statistics, Project *project) { // TODO: does xml stuff need project??? - m_xmlHandlerStatistics = statistics; - m_xmlHandlerProject = project; // TODO: does xml stuff need project??? - m_xmlHandlerCharacters = ""; - } - - - Statistics::XmlHandler::~XmlHandler() { - // do not delete this pointer... we don't own it, do we??? passed into StatCumProbDistDynCalc constructor as pointer - // delete m_xmlHandlerProject; // TODO: does xml stuff need project??? - m_xmlHandlerProject = NULL; - } - - - bool Statistics::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) { - m_xmlHandlerCharacters = ""; - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - // no element attibutes to evaluate - } - return true; - } - - - bool Statistics::XmlHandler::characters(const QString &ch) { - m_xmlHandlerCharacters += ch; - return XmlStackedHandler::characters(ch); - } - - - bool Statistics::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (!m_xmlHandlerCharacters.isEmpty()) { - if (localName == "id") { -// m_xmlHandlerStatistics->m_id = NULL; -// m_xmlHandlerStatistics->m_id = new QUuid(m_xmlHandlerCharacters); - } - if (localName == "sum") { - m_xmlHandlerStatistics->m_sum = toDouble(m_xmlHandlerCharacters); - } - if (localName == "sumSquares") { - m_xmlHandlerStatistics->m_sumsum = toDouble(m_xmlHandlerCharacters); - } - if (localName == "minimum") { - m_xmlHandlerStatistics->m_minimum = toDouble(m_xmlHandlerCharacters); - } - if (localName == "maximum") { - m_xmlHandlerStatistics->m_maximum = toDouble(m_xmlHandlerCharacters); - } - if (localName == "validMinimum") { - m_xmlHandlerStatistics->m_validMinimum = toDouble(m_xmlHandlerCharacters); - } - if (localName == "validMaximum") { - m_xmlHandlerStatistics->m_validMaximum = toDouble(m_xmlHandlerCharacters); - } - if (localName == "totalPixels") { - m_xmlHandlerStatistics->m_totalPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "validPixels") { - m_xmlHandlerStatistics->m_validPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "nullPixels") { - m_xmlHandlerStatistics->m_nullPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "lisPixels") { - m_xmlHandlerStatistics->m_lisPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "lrsPixels") { - m_xmlHandlerStatistics->m_lrsPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "hisPixels") { - m_xmlHandlerStatistics->m_hisPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "hrsPixels") { - m_xmlHandlerStatistics->m_hrsPixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "underRangePixels") { - m_xmlHandlerStatistics->m_underRangePixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "overRangePixels") { - m_xmlHandlerStatistics->m_overRangePixels = toBigInt(m_xmlHandlerCharacters); - } - if (localName == "removedData") { - m_xmlHandlerStatistics->m_removedData = toBool(m_xmlHandlerCharacters); - } - m_xmlHandlerCharacters = ""; - } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - /** * Order saved must match the offsets in the static compoundH5DataType() * method. diff --git a/isis/src/base/objs/Statistics/Statistics.h b/isis/src/base/objs/Statistics/Statistics.h index 12bcfad9e8..ac93e194e6 100644 --- a/isis/src/base/objs/Statistics/Statistics.h +++ b/isis/src/base/objs/Statistics/Statistics.h @@ -13,7 +13,6 @@ find files of those names at the top level of this repository. **/ #include "Constants.h" #include "PvlGroup.h" #include "SpecialPixel.h" -#include "XmlStackedHandler.h" class QDataStream; class QUuid; @@ -155,34 +154,7 @@ namespace Isis { private: void fromPvl(const PvlGroup &inStats); - - /** - * - * @author 2014-07-28 Jeannie Backer - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Statistics *statistics, Project *project); - // TODO: does xml stuff need project??? - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - Statistics *m_xmlHandlerStatistics; - Project *m_xmlHandlerProject; - // TODO: does xml stuff need project??? - QString m_xmlHandlerCharacters; - }; - + // QUuid *m_id; /**< A unique ID for this object (useful for others to reference // this object when saving to disk).*/ double m_sum; //!< The sum accumulator, i.e. the sum of added data values. diff --git a/isis/src/base/objs/Statistics/unitTest.cpp b/isis/src/base/objs/Statistics/unitTest.cpp index 025259e756..a6d833b308 100644 --- a/isis/src/base/objs/Statistics/unitTest.cpp +++ b/isis/src/base/objs/Statistics/unitTest.cpp @@ -7,6 +7,7 @@ find files of those names at the top level of this repository. **/ #include #include #include +#include #include diff --git a/isis/src/base/objs/XmlStackedHandler/Makefile b/isis/src/base/objs/XmlStackedHandler/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/base/objs/XmlStackedHandler/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.cpp b/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.cpp deleted file mode 100644 index b5c3e20e61..0000000000 --- a/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "XmlStackedHandler.h" - -#include -#include -#include - -#include "XmlStackedHandlerReader.h" - -namespace Isis { - XmlStackedHandler::XmlStackedHandler() { - m_reader = NULL; - m_depth = 0; - } - - - XmlStackedHandler::~XmlStackedHandler() { - m_reader = NULL; - m_depth = 0; - } - - - void XmlStackedHandler::setReader(XmlStackedHandlerReader *reader) { - m_reader = reader; - } - - - /** - * @brief Switch to a new content handler and continue processing using the new handler. - * - */ - void XmlStackedHandler::switchToNewHandler(XmlStackedHandler *nextHandler) { - nextHandler->startElement(m_lastStartNamespaceURI, m_lastStartLocalName, - m_lastStartQName, m_lastStartAtts); - } - - - bool XmlStackedHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - m_lastStartNamespaceURI = namespaceURI; - m_lastStartLocalName = localName; - m_lastStartQName = qName; - m_lastStartAtts = atts; - m_depth++; - - return true; - } - - bool XmlStackedHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - m_depth--; - - if (m_depth == 0 && reader()) { - reader()->popContentHandler(); - - if (reader()->topContentHandler()) - reader()->topContentHandler()->endElement(namespaceURI, localName, qName); - } - - return true; - } - - XmlStackedHandlerReader *XmlStackedHandler::reader() { - return m_reader; - } - - - const XmlStackedHandlerReader *XmlStackedHandler::reader() const { - return m_reader; - } - - - bool XmlStackedHandler::fatalError(const QXmlParseException &exception) { - qDebug() << "Parse error at line " << exception.lineNumber() - << ", " << "column " << exception.columnNumber() << ": " - << qPrintable(exception.message()); - return false; - } - -} diff --git a/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.h b/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.h deleted file mode 100644 index ab5e69ff37..0000000000 --- a/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef XmlStackedHandler_H -#define XmlStackedHandler_H -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ - -#include - -template class QStack; - -class QXmlParseException; -namespace Isis { - class XmlStackedHandlerReader; - - /** - * @brief XML Handler that parses XMLs in a stack-oriented way - * - * IPCE does not have a single XML file for the whole project - * but breaks the project into multiple XML files with the Project.xml file - * being the top level. @see Project - * - * **Serialization Basics** - * - * IPCE mostly follows the standard convention of each object being responsible for - * serializing itself. Each Object to be serialized must have a "save" method to - * write the object out as XML. The first thing the save method does is write an XML element - * indicating what type of object is being serialized. This allows the deserialization to know - * how to parse the data (in our case what type of XmlHandler to push). If the object being - * serialized contains another object the save method of the contained object is called. This - * results in a XML file hierarchy as shown below. - * - * For deserialization each serialized object implements an XmlHandler class. The - * XmlHandler::startElement method handles reading of the XML file and initializing the - * member variables for the object. The class must also define a constructor that takes a - * XmlStackedHandlerReader as a parameter (Note the IPCE signatures vary on this method). - * The constructor pushes it's own content handler (the XmlHandler class) on the reader - * to allow parsing to continue with this object. Note the push of the content handler - * does not return until the XML is parsed, specifically the push of the content handler - * calls XmlHandler::startElement() for the handler just pushed. (Actually the behavior - * of XmlStackedHandlerReader::pushContentHandler() varies - if there are no contentHandlers - * on the content handler stack when it is called it returns immediately and parse() - * must be called to start parsing. If there is a content handler already on the stack - * the push results in a call to startElement() and it does not return until the - * corresponding end element.) - * - * If a contained object - * is found while parsing the XML, the constructor for the contained object that takes a - * XmlStackedHandlerReader as a parameter is called. This will result in the contained - * object pushing it's content handler and parsing the relevant XML. When the constructor - * returns, XML parsing can continue for this object. - * - * *Potential issue* - * There appears to be no support for cycles or joins in the object graph when serializing - * or deserializing. This means that if multiple pointers point to the same object ensure - * the object is only serialized once and that all pointers are properly restored on - * deserialization. Currently many of the ISIS objects have unique IDs and IPCE encapsulates - * the underlying ISIS object. One option would be to use the ISIS ids to uniquely identify - * the objects during serialization. - * - * *Versioning* - * To ensure backwards compatibility versioning is done per object. This keeps version - * information for a class within a single source file with no need to know Project file - * structure and where Project level file information is saved. The version number - * for a class should be incremented by 1 each time the XML for that object changes. - * When reading old version XML, files the class should choose a sensible default for the - * missing XML elements and write out the XML in the newest format. - * - * This XML handler is designed to work with the XmlStackedHandlerReader. This XML handler class - * handles passing off parsing to another handler. For example, if your XML is: - * - *
-   *     
-   *        
-   *        
-   *             
-   *             
-   *                
-   *             
-   *             
-   *        
-   *        
-   *     
-   *   
- * - * To start the processing of the XML, an initial XML content handler is pushed onto the - * stack of content handlers. In the example above this initial content handler only - * processes elements associated with xmlTag1. In IPCE the xmlTag1 elements will be the - * member variables associated with a class. The xmlTag2 contains XML for an object - * contained within the first class. When the xmlTag2 element is encountered the - * XML content handler (the xmlTag2::XmlHandler class) will be pushed and take over - * parsing. - * - * If this handler is pushed onto the reader (which is the parser stack) when the startElement - * of xmlTag2 is seen, then this XML handler will see all of the xml data up to and including - * the xmlTag2 close tag. This handler would never see xmlTag1. Here is an example of how - * this works: - * - *
-   *   --> Push initial XML content handler for xmlTag1 (Handler1)
-   *    -- Handler1::startElement
-   *      -- Handler1::startElement: calls reader()->pushContentHandler(HandlerForXmlTag2)
-   *               -- HandlerForXmlTag2::startElement
-   *        -- HandlerForXmlTag3::startElement
-   *                   -- HandlerForXmlTag3::endElement
-   *      -- HandlerForXmlTag2::endElement
-   *    -- Handler1::endElement
-   * 
- * - * - * - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlStackedHandler : public QXmlDefaultHandler { - public: - XmlStackedHandler(); - ~XmlStackedHandler(); - - virtual void setReader(XmlStackedHandlerReader *); - void switchToNewHandler(XmlStackedHandler *nextHandler); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - protected: - XmlStackedHandlerReader *reader(); - const XmlStackedHandlerReader *reader() const; - bool fatalError(const QXmlParseException &exception); - - private: - Q_DISABLE_COPY(XmlStackedHandler); - - XmlStackedHandlerReader *m_reader; - int m_depth; - - QString m_lastStartNamespaceURI; - QString m_lastStartLocalName; - QString m_lastStartQName; - QXmlAttributes m_lastStartAtts; - }; -} - -#endif diff --git a/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.truth b/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.truth deleted file mode 100644 index 264584b648..0000000000 --- a/isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.truth +++ /dev/null @@ -1,32 +0,0 @@ -project: Start Element [project] -project: Start Element [controlNets] -controlNets: Start Element [controlNets] -controlNets: Start Element [controlNet] - path = /some/path/to/a/network/FileName.net -controlNet: Start Element [controlNet] - path = /some/path/to/a/network/FileName.net -controlNet: End Element [controlNet] -controlNets: End Element [controlNet] -controlNets: Start Element [controlNet] - path = /some/path/to/a/network/FileName2.net -controlNet: Start Element [controlNet] - path = /some/path/to/a/network/FileName2.net -controlNet: End Element [controlNet] -controlNets: End Element [controlNet] -controlNets: Start Element [controlNet] - path = /some/path/to/a/network/FileName3.net -controlNet: Start Element [controlNet] - path = /some/path/to/a/network/FileName3.net -controlNet: End Element [controlNet] -controlNets: End Element [controlNet] -controlNets: End Element [controlNets] -project: End Element [controlNets] -project: Start Element [anotherTag] - name = a - path = b -anotherTag: Start Element [anotherTag] - name = a - path = b -anotherTag: End Element [anotherTag] -project: End Element [anotherTag] -project: End Element [project] diff --git a/isis/src/base/objs/XmlStackedHandler/testFile.xml b/isis/src/base/objs/XmlStackedHandler/testFile.xml deleted file mode 100644 index e3c3178a3c..0000000000 --- a/isis/src/base/objs/XmlStackedHandler/testFile.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/isis/src/base/objs/XmlStackedHandler/unitTest.cpp b/isis/src/base/objs/XmlStackedHandler/unitTest.cpp deleted file mode 100644 index 3cfdf3f8de..0000000000 --- a/isis/src/base/objs/XmlStackedHandler/unitTest.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -#include - -#include "IException.h" -#include "IString.h" -#include "XmlStackedHandler.h" -#include "XmlStackedHandlerReader.h" - -using namespace Isis; -using namespace std; - -namespace Isis { - class XmlHandlerTester : public XmlStackedHandler { - public: - XmlHandlerTester(QString name) { - m_name = name; - } - - ~XmlHandlerTester() { - } - - - bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - cerr << m_name.toStdString() << ": Start Element [" - << localName.toStdString() << "]" << endl; - - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - - for (int attIndex = 0; attIndex < atts.count(); attIndex++) { - cerr << "\t" << atts.localName(attIndex).toStdString() - << " = " << atts.value(attIndex).toStdString() << endl; - } - - if (localName != m_name) { - reader()->pushContentHandler(new XmlHandlerTester(localName)); - } - } - - return true; - } - - bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName) { - cerr << m_name.toStdString() << ": End Element [" - << localName.toStdString() << "]" << endl; - - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - private: - QString m_name; - }; -} - -// XmlStackedHandlerReader's unit test is relying on this test to adequetly test its functionality. -int main(int argc, char **argv) { - XmlHandlerTester handler("project"); - - XmlStackedHandlerReader reader; - reader.pushContentHandler(&handler); - reader.setErrorHandler(&handler); - - QString xmlPath("./testFile.xml"); - QFile file(xmlPath); - - if (!file.open(QFile::ReadOnly)) { - throw IException(IException::Unknown, - QString("Unable to open [%1] with read access") - .arg(xmlPath), - _FILEINFO_); - } - - QXmlInputSource xmlInputSource(&file); - if (!reader.parse(xmlInputSource)) - cerr << QString("Failed to read [%1]").arg(xmlPath).toStdString(); - - return 0; -} diff --git a/isis/src/base/objs/XmlStackedHandlerReader/Makefile b/isis/src/base/objs/XmlStackedHandlerReader/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/base/objs/XmlStackedHandlerReader/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.cpp b/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.cpp deleted file mode 100644 index 2d50250314..0000000000 --- a/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "XmlStackedHandlerReader.h" - -#include -#include - -#include "XmlStackedHandler.h" - -namespace Isis { - XmlStackedHandlerReader::XmlStackedHandlerReader() { - m_contentHandlers = NULL; - m_contentHandlers = new QStack; - } - - - XmlStackedHandlerReader::~XmlStackedHandlerReader() { - delete m_contentHandlers; - m_contentHandlers = NULL; - } - - - void XmlStackedHandlerReader::popContentHandler() { - m_contentHandlers->pop(); - - if (m_contentHandlers->size()) { - m_contentHandlers->top()->setReader(this); - setContentHandler(m_contentHandlers->top()); - } - else { - setContentHandler(NULL); - } - } - - - /** - * @brief Push a contentHandler and maybe continue parsing... - * - * Push a contentHadler on the content handler stack. If there are currently - * no other handlers on the stack that is all that happens. - * - * If there are other content handlers on the stack it is assumed that - * a XML file is being processed and processing continues by calling - * startElement() of the newly pushed handler. In this case - * pushContentHandler() will not return until the element has been - * fully processed. - * - * @see XmlStackedHandler - * - */ - void XmlStackedHandlerReader::pushContentHandler(XmlStackedHandler *newHandler) { - XmlStackedHandler *old = topContentHandler(); - - newHandler->setReader(this); - m_contentHandlers->push(newHandler); - - setContentHandler(m_contentHandlers->top()); - - if (old) { - // Switch to newHandler and continue parsing - // This will call newHandler->startElement(...) - old->switchToNewHandler(topContentHandler()); - } - } - - - XmlStackedHandler *XmlStackedHandlerReader::topContentHandler() { - XmlStackedHandler *result = NULL; - - if (m_contentHandlers->size()) - result = m_contentHandlers->top(); - - return result; - } -} - diff --git a/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.h b/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.h deleted file mode 100644 index f26cfdcdc2..0000000000 --- a/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef XmlStackedHandlerReader_H -#define XmlStackedHandlerReader_H -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -template class QStack; - -namespace Isis { - class XmlStackedHandler; - - /** - * - * @brief Manage a stack of content handlers for reading XML files. - * - * This class is designed to work with the XmlStackedHandler class. Use this - * in-place of a QXmlSimpleReader if you want to use stack-based Xml parsing. The - * XmlStackedHandler class has an explanation as to how this is designed to work. - * - * @see XmlStackedHandler - * - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlStackedHandlerReader : public QXmlSimpleReader { - public: - XmlStackedHandlerReader(); - ~XmlStackedHandlerReader(); - - virtual void popContentHandler(); - virtual void pushContentHandler(XmlStackedHandler *newHandler); - XmlStackedHandler *topContentHandler(); - - private: - Q_DISABLE_COPY(XmlStackedHandlerReader); - - QStack *m_contentHandlers; - }; -} - -#endif diff --git a/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.truth b/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.truth deleted file mode 100644 index 5614d66e7e..0000000000 --- a/isis/src/base/objs/XmlStackedHandlerReader/XmlStackedHandlerReader.truth +++ /dev/null @@ -1 +0,0 @@ -This is tested by XmlStackedHandler's unit test diff --git a/isis/src/base/objs/XmlStackedHandlerReader/unitTest.cpp b/isis/src/base/objs/XmlStackedHandlerReader/unitTest.cpp deleted file mode 100644 index e63979b566..0000000000 --- a/isis/src/base/objs/XmlStackedHandlerReader/unitTest.cpp +++ /dev/null @@ -1,13 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -using namespace std; - -int main(int argc, char **argv) { - cerr << "This is tested by XmlStackedHandler's unit test" << endl; -} \ No newline at end of file diff --git a/isis/src/control/objs/BundleResults/BundleResults.cpp b/isis/src/control/objs/BundleResults/BundleResults.cpp index 1ed149ebef..2ef609520d 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.cpp +++ b/isis/src/control/objs/BundleResults/BundleResults.cpp @@ -1926,638 +1926,4 @@ namespace Isis { stream.writeEndElement(); // end maximumLikelihoodEstimation stream.writeEndElement(); // end bundleResults } - - - /** - * Constructs an XmlHandler used to save a BundleResults object. - * - * @param statistics The BundleResults that the XmlHandler will save. - * @param project The project that the BundleResults object belongs to. - */ - BundleResults::XmlHandler::XmlHandler(BundleResults *statistics, Project *project) { - // TODO: does xml stuff need project??? - m_xmlHandlerCumProCalc = NULL; - m_xmlHandlerBundleResults = NULL; - m_xmlHandlerProject = NULL; - - m_xmlHandlerBundleResults = statistics; - m_xmlHandlerProject = project; // TODO: does xml stuff need project??? - m_xmlHandlerCharacters = ""; - - m_xmlHandlerResidualsListSize = 0; - m_xmlHandlerSampleResidualsListSize = 0; - m_xmlHandlerLineResidualsListSize = 0; - m_xmlHandlerXSigmasListSize = 0; - m_xmlHandlerYSigmasListSize = 0; - m_xmlHandlerZSigmasListSize = 0; - m_xmlHandlerRASigmasListSize = 0; - m_xmlHandlerDECSigmasListSize = 0; - m_xmlHandlerTWISTSigmasListSize = 0; - m_xmlHandlerStatisticsList.clear(); - - } - - - /** - * Destroys an XmlHandler. - */ - BundleResults::XmlHandler::~XmlHandler() { - // do not delete this pointer... we don't own it, do we??? - // passed into StatCumProbDistDynCalc constructor as pointer - // delete m_xmlHandlerProject; // TODO: does xml stuff need project??? - m_xmlHandlerProject = NULL; - - // delete m_xmlHandlerBundleResults; - // m_xmlHandlerBundleResults = NULL; - - } - - - /** - * Handle an XML start element. This method is called when the reader finds an open tag. - * handle the read when the startElement with the name localName has been found. - * - * @param qName SAX namespace for this tag - * @param localName SAX local name - * @param qName SAX qualified name of the tag. - * @param attributes The list of attributes for the tag. - * - * @return @b bool Indicates whether to continue reading the XML (usually true). - */ - bool BundleResults::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) { - m_xmlHandlerCharacters = ""; - - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - - if (qName == "correlationMatrix") { - m_xmlHandlerBundleResults->m_correlationMatrix = NULL; - m_xmlHandlerBundleResults->m_correlationMatrix = new CorrelationMatrix(); - - QString correlationFileName = atts.value("correlationFileName"); - if (!correlationFileName.isEmpty()) { - FileName correlationFile(correlationFileName); - m_xmlHandlerBundleResults->m_correlationMatrix->setCorrelationFileName(correlationFile); - } - - QString covarianceFileName = atts.value("covarianceFileName"); - if (!covarianceFileName.isEmpty()) { - FileName covarianceFile(covarianceFileName); - m_xmlHandlerBundleResults->m_correlationMatrix->setCovarianceFileName(covarianceFile); - } - } - else if (qName == "image") { - QString correlationMatrixImageId = atts.value("id"); - if (!correlationMatrixImageId.isEmpty()) { - m_xmlHandlerCorrelationImageId = correlationMatrixImageId; - } - } - else if (qName == "residuals") { - QString rx = atts.value("x"); - if (!rx.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsXResiduals = toDouble(rx); - } - - QString ry = atts.value("y"); - if (!ry.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsYResiduals = toDouble(ry); - } - - QString rxy = atts.value("xy"); - if (!rxy.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsXYResiduals = toDouble(rxy); - } - } - else if (qName == "sigmas") { - QString lat = atts.value("lat"); - if (!lat.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsSigmaCoord1Stats = toDouble(lat); - } - QString lon = atts.value("lon"); - if (!lon.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsSigmaCoord2Stats = toDouble(lon); - } - QString rad = atts.value("rad"); - if (!rad.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsSigmaCoord3Stats = toDouble(rad); - } - QString x = atts.value("x"); - if (!x.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsSigmaCoord1Stats = toDouble(x); - } - QString y = atts.value("y"); - if (!y.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsSigmaCoord2Stats = toDouble(y); - } - QString z = atts.value("z"); - if (!z.isEmpty()) { - m_xmlHandlerBundleResults->m_rmsSigmaCoord3Stats = toDouble(z); - } - } - else if (qName == "residualsList") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerResidualsListSize = toInt(listSizeStr); - } - } - else if (qName == "sampleList") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerSampleResidualsListSize = toInt(listSizeStr); - } - } - else if (qName == "lineList") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerLineResidualsListSize = toInt(listSizeStr); - } - } - else if (qName == "xSigmas") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerXSigmasListSize = toInt(listSizeStr); - } - } - else if (qName == "ySigmas") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerYSigmasListSize = toInt(listSizeStr); - } - } - else if (qName == "zSigmas") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerZSigmasListSize = toInt(listSizeStr); - } - } - else if (qName == "raSigmas") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerRASigmasListSize = toInt(listSizeStr); - } - - } - else if (qName == "decSigmas") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerDECSigmasListSize = toInt(listSizeStr); - } - } - else if (qName == "twistSigmas") { - QString listSizeStr = atts.value("listSize"); - if (!listSizeStr.isEmpty()) { - m_xmlHandlerTWISTSigmasListSize = toInt(listSizeStr); - } - } - else if (qName == "statisticsItem") { - // add statistics object to the xml handler's current statistics list. - m_xmlHandlerStatisticsList.append( - new Statistics()); - } - else if (qName == "elapsedTime") { - QString time = atts.value("time"); - if (!time.isEmpty()) { - m_xmlHandlerBundleResults->m_elapsedTime = toDouble(time); - } - - QString errorProp = atts.value("errorProp"); - if (!errorProp.isEmpty()) { - m_xmlHandlerBundleResults->m_elapsedTimeErrorProp = toDouble(errorProp); - } - - } -// ??? else if (qName == "minMaxSigmaDistances") { -// ??? QString units = atts.value("units"); -// ??? if (!QString::compare(units, "meters", Qt::CaseInsensitive)) { -// ??? QString msg = "Unable to read BundleResults xml. Sigma distances must be " -// ??? "provided in meters."; -// ??? throw IException(IException::Io, msg, _FILEINFO_); -// ??? } -// ??? } - else if (qName == "minLat") { - QString minLat = atts.value("value"); - if (!minLat.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord1Distance.setMeters(toDouble(minLat)); - } - - QString minLatPointId = atts.value("pointId"); - if (!minLatPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord1PointId = minLatPointId; - } - - } - else if (qName == "minX") { - QString minX = atts.value("value"); - if (!minX.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord1Distance.setMeters(toDouble(minX)); - } - - QString minXPointId = atts.value("pointId"); - if (!minXPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord1PointId = minXPointId; - } - } - else if (qName == "maxLat") { - QString maxLat = atts.value("value"); - if (!maxLat.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord1Distance.setMeters(toDouble(maxLat)); - } - - QString maxLatPointId = atts.value("pointId"); - if (!maxLatPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord1PointId = maxLatPointId; - } - - } - else if (qName == "maxX") { - - QString maxX = atts.value("value"); - if (!maxX.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord1Distance.setMeters(toDouble(maxX)); - } - - QString maxXPointId = atts.value("pointId"); - if (!maxXPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord1PointId = maxXPointId; - } - - } - else if (qName == "minLon") { - - QString minLon = atts.value("value"); - if (!minLon.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord2Distance.setMeters(toDouble(minLon)); - } - - QString minLonPointId = atts.value("pointId"); - if (!minLonPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord2PointId = minLonPointId; - } - - } - else if (qName == "minY") { - - QString minY = atts.value("value"); - if (!minY.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord2Distance.setMeters(toDouble(minY)); - } - - QString minYPointId = atts.value("pointId"); - if (!minYPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord2PointId = minYPointId; - } - - } - else if (qName == "maxLon") { - - QString maxLon = atts.value("value"); - if (!maxLon.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord2Distance.setMeters(toDouble(maxLon)); - } - - QString maxLonPointId = atts.value("pointId"); - if (!maxLonPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord2PointId = maxLonPointId; - } - - } - else if (qName == "maxY") { - QString maxY = atts.value("value"); - if (!maxY.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord2Distance.setMeters(toDouble(maxY)); - } - - QString maxYPointId = atts.value("pointId"); - if (!maxYPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord2PointId = maxYPointId; - } - - } - else if (qName == "minRad") { - - QString minRad = atts.value("value"); - if (!minRad.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord3Distance.setMeters(toDouble(minRad)); - } - - QString minRadPointId = atts.value("pointId"); - if (!minRadPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord3PointId = minRadPointId; - } - - } - else if (qName == "minZ") { - - QString minZ = atts.value("value"); - if (!minZ.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord3Distance.setMeters(toDouble(minZ)); - } - - QString minZPointId = atts.value("pointId"); - if (!minZPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_minSigmaCoord3PointId = minZPointId; - } - - } - else if (qName == "maxRad") { - - QString maxRad = atts.value("value"); - if (!maxRad.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord3Distance.setMeters(toDouble(maxRad)); - } - - QString maxRadPointId = atts.value("pointId"); - if (!maxRadPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord3PointId = maxRadPointId; - } - - } - else if (qName == "maxZ") { - - QString maxZ = atts.value("value"); - if (!maxZ.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord3Distance.setMeters(toDouble(maxZ)); - } - - QString maxZPointId = atts.value("pointId"); - if (!maxZPointId.isEmpty()) { - m_xmlHandlerBundleResults->m_maxSigmaCoord3PointId = maxZPointId; - } - - } - else if (qName == "maximumLikelihoodEstimation") { - QString maximumLikelihoodIndex = atts.value("maximumLikelihoodIndex"); - if (!maximumLikelihoodIndex.isEmpty()) { - m_xmlHandlerBundleResults->m_maximumLikelihoodIndex = toInt(maximumLikelihoodIndex); - } - - QString maximumLikelihoodMedianR2Residuals = - atts.value("maximumLikelihoodMedianR2Residuals"); - if (!maximumLikelihoodMedianR2Residuals.isEmpty()) { - m_xmlHandlerBundleResults->m_maximumLikelihoodMedianR2Residuals = - toDouble(maximumLikelihoodMedianR2Residuals); - } - } - else if (qName == "model") { - QString model = atts.value("modelSelection"); - QString tweakingConstant = atts.value("tweakingConstant"); - QString quantile = atts.value("quantile"); - bool validModel = true; - if (model.isEmpty()) validModel = false; - if (tweakingConstant.isEmpty()) validModel = false; - if (quantile.isEmpty()) validModel = false; - if (validModel) { - m_xmlHandlerBundleResults->m_maximumLikelihoodFunctions.append( - qMakePair(MaximumLikelihoodWFunctions( - MaximumLikelihoodWFunctions::stringToModel(model), - toDouble(tweakingConstant)), - toDouble(quantile))); - } - } - else if (qName == "cumulativeProbabilityCalculator") { - m_xmlHandlerBundleResults->m_cumPro = NULL; - m_xmlHandlerBundleResults->m_cumPro = - new StatCumProbDistDynCalc(); - } - else if (qName == "residualsCumulativeProbabilityCalculator") { - m_xmlHandlerBundleResults->m_cumProRes = NULL; - m_xmlHandlerBundleResults->m_cumProRes = new StatCumProbDistDynCalc(); - } - } - return true; - } - - - /** - * Adds a QString to the XmlHandler's internal character data. - * - * @param ch The data to be added. - * - * @return @b bool true - */ - bool BundleResults::XmlHandler::characters(const QString &ch) { - m_xmlHandlerCharacters += ch; - return XmlStackedHandler::characters(ch); - } - - - /** - * @brief Handle end tags for the BundleResults serialized XML. - * - * @param namespaceURI URI of the specified tags namespce - * @param localName SAX localName - * @param qName SAX qualified name - * - * @return true - */ - bool BundleResults::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - - if (!m_xmlHandlerCharacters.isEmpty()) { - if (qName == "parameter") { - // add the parameter to the current list - m_xmlHandlerCorrelationParameterList.append(m_xmlHandlerCharacters); - } - if (qName == "image") { - // add this image and its parameters to the map - if (m_xmlHandlerCorrelationImageId != "") { - m_xmlHandlerCorrelationMap.insert(m_xmlHandlerCorrelationImageId, - m_xmlHandlerCorrelationParameterList); - } - m_xmlHandlerCorrelationImageId = ""; - m_xmlHandlerCorrelationParameterList.clear(); - - } - if (qName == "imagesAndParameters") { - // set the map after all images and parameters have been added - if (!m_xmlHandlerCorrelationMap.isEmpty()) { - m_xmlHandlerBundleResults->setCorrMatImgsAndParams(m_xmlHandlerCorrelationMap); - } - } - else if (qName == "numberFixedPoints") { - m_xmlHandlerBundleResults->m_numberFixedPoints = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberIgnoredPoints") { - m_xmlHandlerBundleResults->m_numberIgnoredPoints = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberHeldImages") { - m_xmlHandlerBundleResults->m_numberHeldImages = toInt(m_xmlHandlerCharacters); - } - else if (qName == "rejectionLimit") { - m_xmlHandlerBundleResults->m_rejectionLimit = toDouble(m_xmlHandlerCharacters); - } - else if (qName == "numberRejectedObservations") { - m_xmlHandlerBundleResults->m_numberRejectedObservations = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberLidarRangeConstraintEquations") { - m_xmlHandlerBundleResults->m_numberLidarRangeConstraintEquations = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberObservations") { - m_xmlHandlerBundleResults->m_numberObservations = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberImageObservations") { - m_xmlHandlerBundleResults->m_numberImageObservations = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberLidarImageObservations") { - m_xmlHandlerBundleResults->m_numberLidarImageObservations = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberImageParameters") { - m_xmlHandlerBundleResults->m_numberImageParameters = toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberConstrainedPointParameters") { - m_xmlHandlerBundleResults->m_numberConstrainedPointParameters = - toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberConstrainedImageParameters") { - m_xmlHandlerBundleResults->m_numberConstrainedImageParameters = - toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberConstrainedTargetParameters") { - m_xmlHandlerBundleResults->m_numberConstrainedTargetParameters = - toInt(m_xmlHandlerCharacters); - } - else if (qName == "numberUnknownParameters") { - m_xmlHandlerBundleResults->m_numberUnknownParameters = toInt(m_xmlHandlerCharacters); - } - else if (qName == "degreesOfFreedom") { - m_xmlHandlerBundleResults->m_degreesOfFreedom = toInt(m_xmlHandlerCharacters); - } - else if (qName == "sigma0") { - m_xmlHandlerBundleResults->m_sigma0 = toDouble(m_xmlHandlerCharacters); - } - else if (qName == "converged") { - m_xmlHandlerBundleResults->m_converged = toBool(m_xmlHandlerCharacters); - } - else if (qName == "iterations") { - m_xmlHandlerBundleResults->m_iterations = toInt(m_xmlHandlerCharacters); - } - // copy the xml handler's statistics list to the appropriate bundle statistics list - else if (qName == "residualsList") { - if (m_xmlHandlerResidualsListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid residualsList", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageResiduals.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "sampleList") { - if (m_xmlHandlerSampleResidualsListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid sampleList", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageSampleResiduals.append( - m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "lineList") { - if (m_xmlHandlerLineResidualsListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid lineList", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageLineResiduals.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "lidarResidualsList") { - if (m_xmlHandlerResidualsListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid residualsList", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsLidarImageResiduals.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "lidarSampleList") { - if (m_xmlHandlerSampleResidualsListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid sampleList", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsLidarImageSampleResiduals.append( - m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "lidarLineList") { - if (m_xmlHandlerLineResidualsListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid lineList", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsLidarImageLineResiduals.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "xSigmas") { - if (m_xmlHandlerXSigmasListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid xSigmas", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageXSigmas.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "ySigmas") { - if (m_xmlHandlerYSigmasListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid ySigmas", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageYSigmas.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "zSigmas") { - if (m_xmlHandlerZSigmasListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid zSigmas", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageZSigmas.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "raSigmas") { - if (m_xmlHandlerRASigmasListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid raSigmas", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageRASigmas.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "decSigmas") { - if (m_xmlHandlerDECSigmasListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid decSigmas", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageDECSigmas.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - else if (qName == "twistSigmas") { - if (m_xmlHandlerTWISTSigmasListSize != m_xmlHandlerStatisticsList.size()) { - throw IException(IException::Unknown, - "Unable to read xml file. Invalid twistSigmas", _FILEINFO_); - } - for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) { - m_xmlHandlerBundleResults->m_rmsImageTWISTSigmas.append(m_xmlHandlerStatisticsList[i]); - } - m_xmlHandlerStatisticsList.clear(); - } - } - m_xmlHandlerCharacters = ""; - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } } diff --git a/isis/src/control/objs/BundleResults/BundleResults.h b/isis/src/control/objs/BundleResults/BundleResults.h index 26f8b21f3d..a9ec012493 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.h +++ b/isis/src/control/objs/BundleResults/BundleResults.h @@ -28,7 +28,6 @@ find files of those names at the top level of this repository. **/ #include "PvlObject.h" #include "Statistics.h" // ??? #include "SurfacePoint.h" -#include "XmlStackedHandler.h" // Qt Library class QDataStream; @@ -262,52 +261,6 @@ namespace Isis { // TODO: does xml stuff need project??? void save(QXmlStreamWriter &stream, const Project *project) const; - - private: - /** - * This class is an XmlHandler used to read and write BundleResults objects - * from and to XML files. Documentation will be updated when it is decided - * if XML support will remain. - * - * @author 2014-07-28 Jeannie Backer - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - // TODO: does xml stuff need project??? - XmlHandler(BundleResults *statistics, Project *project); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - BundleResults *m_xmlHandlerBundleResults; - Project *m_xmlHandlerProject; // TODO: does xml stuff need project??? - QString m_xmlHandlerCharacters; - int m_xmlHandlerResidualsListSize; - int m_xmlHandlerSampleResidualsListSize; - int m_xmlHandlerLineResidualsListSize; - int m_xmlHandlerXSigmasListSize; - int m_xmlHandlerYSigmasListSize; - int m_xmlHandlerZSigmasListSize; - int m_xmlHandlerRASigmasListSize; - int m_xmlHandlerDECSigmasListSize; - int m_xmlHandlerTWISTSigmasListSize; - QList m_xmlHandlerStatisticsList; - StatCumProbDistDynCalc *m_xmlHandlerCumProCalc; - - QString m_xmlHandlerCorrelationImageId; - QStringList m_xmlHandlerCorrelationParameterList; - QMap m_xmlHandlerCorrelationMap; - }; - CorrelationMatrix *m_correlationMatrix; //!< The correlation matrix from the BundleAdjust. int m_numberFixedPoints; //!< number of 'fixed' (ground) points (define) diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.cpp b/isis/src/control/objs/BundleSettings/BundleSettings.cpp index 2094a40209..0c96c51a29 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.cpp +++ b/isis/src/control/objs/BundleSettings/BundleSettings.cpp @@ -1108,242 +1108,4 @@ namespace Isis { } stream.writeEndElement(); } - - - /** - * @brief Create an XML Handler (reader) that can populate the BundleSettings class data. - * See BundleSettings::save() for the expected format. This contructor is called - * inside the BundleSettings constructor that takes an XmlStackedHandlerReader. - * - * @param bundleSettings The BundleSettings we're going to be initializing - * @param project The project that contains the settings - */ - BundleSettings::XmlHandler::XmlHandler(BundleSettings *bundleSettings, Project *project) { - m_xmlHandlerBundleSettings = bundleSettings; - m_xmlHandlerProject = project; - m_xmlHandlerCharacters = ""; - m_xmlHandlerObservationSettings.clear(); - } - - - /** - * @brief Destroys BundleSettings::XmlHandler object. - */ - BundleSettings::XmlHandler::~XmlHandler() { - } - - - /** - * Handle an XML start element. This method is called when the reader finds an open tag. - * handle the read when the startElement with the name localName has been found. - * - * @param qName SAX namespace for this tag - * @param localName SAX local name - * @param qName SAX qualified name of the tag. - * @param attributes The list of attributes for the tag. - * - * @return @b bool Indicates whether to continue reading the XML (usually true). - * - * @internal - * @history 2017-05-30 Debbie A. Cook - Added controlPointCoordTypes to the pvl - * and made global coordinate names generic. - */ - bool BundleSettings::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &attributes) { - m_xmlHandlerCharacters = ""; - - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, attributes)) { - - if (localName == "solveOptions") { - - QString solveObservationModeStr = attributes.value("solveObservationMode"); - if (!solveObservationModeStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_solveObservationMode = toBool(solveObservationModeStr); - } - - QString solveRadiusStr = attributes.value("solveRadius"); - if (!solveRadiusStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_solveRadius = toBool(solveRadiusStr); - } - - QString coordTypeReportsStr = attributes.value("controlPointCoordinateTypeReports"); - if (!coordTypeReportsStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_cpCoordTypeReports = - SurfacePoint::stringToCoordinateType(coordTypeReportsStr); - } - - QString coordTypeBundleStr = attributes.value("controlPointCoordinateTypeBundle"); - if (!coordTypeBundleStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_cpCoordTypeBundle = - SurfacePoint::stringToCoordinateType(coordTypeBundleStr); - } - - QString updateCubeLabelStr = attributes.value("updateCubeLabel"); - if (!updateCubeLabelStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_updateCubeLabel = toBool(updateCubeLabelStr); - } - - QString errorPropagationStr = attributes.value("errorPropagation"); - if (!errorPropagationStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_errorPropagation = toBool(errorPropagationStr); - } - - QString createInverseMatrixStr = attributes.value("createInverseMatrix"); - if (!createInverseMatrixStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_createInverseMatrix = toBool(createInverseMatrixStr); - } - } - else if (localName == "aprioriSigmas") { - - QString globalPointCoord1AprioriSigmaStr = attributes.value("pointCoord1"); - m_xmlHandlerBundleSettings->m_globalPointCoord1AprioriSigma = Isis::Null; - // TODO: why do I need to init this one and not other sigmas??? - if (!globalPointCoord1AprioriSigmaStr.isEmpty()) { - if (globalPointCoord1AprioriSigmaStr == "N/A") { - m_xmlHandlerBundleSettings->m_globalPointCoord1AprioriSigma = Isis::Null; - } - else { - m_xmlHandlerBundleSettings->m_globalPointCoord1AprioriSigma - = toDouble(globalPointCoord1AprioriSigmaStr); - } - } - - QString globalPointCoord2AprioriSigmaStr = attributes.value("pointCoord2"); - if (!globalPointCoord2AprioriSigmaStr.isEmpty()) { - if (globalPointCoord2AprioriSigmaStr == "N/A") { - m_xmlHandlerBundleSettings->m_globalPointCoord2AprioriSigma = Isis::Null; - } - else { - m_xmlHandlerBundleSettings->m_globalPointCoord2AprioriSigma - = toDouble(globalPointCoord2AprioriSigmaStr); - } - } - - QString globalPointCoord3AprioriSigmaStr = attributes.value("radius"); - if (!globalPointCoord3AprioriSigmaStr.isEmpty()) { - if (globalPointCoord3AprioriSigmaStr == "N/A") { - m_xmlHandlerBundleSettings->m_globalPointCoord3AprioriSigma = Isis::Null; - } - else { - m_xmlHandlerBundleSettings->m_globalPointCoord3AprioriSigma - = toDouble(globalPointCoord3AprioriSigmaStr); - } - } - } - else if (localName == "outlierRejectionOptions") { - QString outlierRejectionStr = attributes.value("rejection"); - if (!outlierRejectionStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_outlierRejection = toBool(outlierRejectionStr); - } - - QString outlierRejectionMultiplierStr = attributes.value("multiplier"); - if (!outlierRejectionMultiplierStr.isEmpty()) { - if (outlierRejectionMultiplierStr != "N/A") { - m_xmlHandlerBundleSettings->m_outlierRejectionMultiplier - = toDouble(outlierRejectionMultiplierStr); - } - else { - m_xmlHandlerBundleSettings->m_outlierRejectionMultiplier = 3.0; - } - } - } - else if (localName == "convergenceCriteriaOptions") { - - QString convergenceCriteriaStr = attributes.value("convergenceCriteria"); - if (!convergenceCriteriaStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_convergenceCriteria - = stringToConvergenceCriteria(convergenceCriteriaStr); - } - - QString convergenceCriteriaThresholdStr = attributes.value("threshold"); - if (!convergenceCriteriaThresholdStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_convergenceCriteriaThreshold - = toDouble(convergenceCriteriaThresholdStr); - } - - QString convergenceCriteriaMaximumIterationsStr = attributes.value("maximumIterations"); - if (!convergenceCriteriaMaximumIterationsStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_convergenceCriteriaMaximumIterations - = toInt(convergenceCriteriaMaximumIterationsStr); - } - } - else if (localName == "model") { - QString type = attributes.value("type"); - QString quantile = attributes.value("quantile"); - if (!type.isEmpty() && !quantile.isEmpty()) { - m_xmlHandlerBundleSettings->m_maximumLikelihood.append( - qMakePair(MaximumLikelihoodWFunctions::stringToModel(type), - toDouble(quantile))); - } - } - else if (localName == "outputFileOptions") { - QString outputFilePrefixStr = attributes.value("fileNamePrefix"); - if (!outputFilePrefixStr.isEmpty()) { - m_xmlHandlerBundleSettings->m_outputFilePrefix = outputFilePrefixStr; - } - } - else if (localName == "bundleObservationSolveSettings") { - m_xmlHandlerObservationSettings.append( - new BundleObservationSolveSettings()); - } - } - return true; - } - - - /** - * @brief Add a character from an XML element to the content handler. - * - * @param ch charater from XML element - * @return true - */ - bool BundleSettings::XmlHandler::characters(const QString &ch) { - m_xmlHandlerCharacters += ch; - return XmlStackedHandler::characters(ch); - } - - - /** - * @brief Handle end tags for the BundleSettings serialized XML. - * - * @param namespaceURI URI of the specified tags namespce - * @param localName SAX localName - * @param qName SAX qualified name - * - * @return true - */ - bool BundleSettings::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (!m_xmlHandlerCharacters.isEmpty()) { - if (localName == "validateNetwork") { - m_xmlHandlerBundleSettings->m_validateNetwork = toBool(m_xmlHandlerCharacters); - } - else if (localName == "observationSolveSettingsList") { - for (int i = 0; i < m_xmlHandlerObservationSettings.size(); i++) { - m_xmlHandlerBundleSettings->m_observationSolveSettings.append( - *m_xmlHandlerObservationSettings[i]); - } - m_xmlHandlerObservationSettings.clear(); - } - - m_xmlHandlerCharacters = ""; - } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - - /** - * @brief Format an error message indicating a problem with BundleSettings. - * - * @param QXmlParseException Execption thrown by parser. - * @return false - */ - bool BundleSettings::XmlHandler::fatalError(const QXmlParseException &exception) { - qDebug() << "Parse error with BundleSettings at line " << exception.lineNumber() - << ", " << "column " << exception.columnNumber() << ": " - << qPrintable(exception.message()); - return false; - } } diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.h b/isis/src/control/objs/BundleSettings/BundleSettings.h index 375c7d8f2f..3591eb8348 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.h +++ b/isis/src/control/objs/BundleSettings/BundleSettings.h @@ -23,7 +23,6 @@ find files of those names at the top level of this repository. **/ #include "MaximumLikelihoodWFunctions.h" #include "SpecialPixel.h" #include "SurfacePoint.h" -#include "XmlStackedHandler.h" class QDataStream; class QUuid; @@ -110,7 +109,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 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 * pointers, etc... @@ -284,42 +282,6 @@ namespace Isis { //============= Saving/Restoring a BundleSettings object ==============// //=====================================================================// - /** - * This class is needed to read/write BundleSettings from/to an XML - * formateed file. - * - * @author 2014-07-21 Ken Edmundson - * - * @internal - * @history 2014-07-21 Ken Edmundson - Original version. - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(BundleSettings *bundleSettings, - Project *project); - XmlHandler(BundleSettings *bundleSettings); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName); - bool fatalError(const QXmlParseException &exception); - - private: - Q_DISABLE_COPY(XmlHandler); - - BundleSettings *m_xmlHandlerBundleSettings ; - Project *m_xmlHandlerProject; // TODO: does xml stuff need project??? - QString m_xmlHandlerCharacters; - QList m_xmlHandlerObservationSettings; - }; - - /** * This struct is needed to write the m_maximumLikelihood variable as an * HDF5 table. Each table record has 3 field values: index, name, and diff --git a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp index 4ed7a2d234..2a655d6d1c 100755 --- a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp +++ b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp @@ -1939,138 +1939,6 @@ namespace Isis { } - /** - * Create an XML Handler (reader) that can populate the BundleSolutionInfo class data. See - * BundleSolutionInfo::save() for the expected format. - * - * @param bundleSolutionInfo The bundle solution we're going to be initializing - * @param project The project we are working in - */ - BundleSolutionInfo::XmlHandler::XmlHandler(BundleSolutionInfo *bundleSolutionInfo, - Project *project) { - m_xmlHandlerBundleSolutionInfo = bundleSolutionInfo; - m_xmlHandlerProject = project; - m_xmlHandlerCharacters = ""; - } - - - /** - * Destructor - */ - BundleSolutionInfo::XmlHandler::~XmlHandler() { - } - - - /** - * Adds characters to m_xmlHandlerCharacters - * - * @param ch QString of characters to add - * - * @return @b bool Almost always true. Only false if the characters cannot be read - */ - bool BundleSolutionInfo::XmlHandler::characters(const QString &ch) { - m_xmlHandlerCharacters += ch; - return XmlStackedHandler::characters(ch); - } - - - /** - * Handle an XML start element. This expects and elements. - * - * @param namespaceURI ??? - * @param localName The keyword name given to the member variable in the XML. - * @param qName ??? - * @param atts The attribute containing the keyword value for the given local name. - * - * @return @b bool True if we should continue reading the XML. - */ - bool BundleSolutionInfo::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) { - m_xmlHandlerCharacters = ""; - - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - - if (localName == "bundleSettings") { - m_xmlHandlerBundleSolutionInfo->m_settings = - BundleSettingsQsp(new BundleSettings()); - } - else if (localName == "bundleResults") { - m_xmlHandlerBundleSolutionInfo->m_statisticsResults = new BundleResults(); - } - else if (localName == "imageList") { - m_xmlHandlerBundleSolutionInfo->m_adjustedImages->append( - new ImageList()); - } - else if (localName == "outputControl") { - FileName outputControlPath = FileName(m_xmlHandlerProject->bundleSolutionInfoRoot() + "/" - + m_xmlHandlerBundleSolutionInfo->runTime()); - - m_xmlHandlerBundleSolutionInfo->m_outputControl = new Control(outputControlPath.toString()); - } - } - return true; - } - - - /** - * Handle an XML end element. - * - * @param namespaceURI ??? - * @param localName The keyword name given to the member variable in the XML. - * @param qName ??? - * - * @return @b bool Returns XmlStackedHandler's endElement() - */ - bool BundleSolutionInfo::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName) { - // This is done for unitTest which has no Project - QString projectRoot; - if (m_xmlHandlerProject) { - projectRoot = m_xmlHandlerProject->projectRoot() + "/"; - } - - if (localName == "id") { - // all constructors assign a Uuid - we need to give it a one from the XML - assert(m_xmlHandlerBundleSolutionInfo->m_id); - delete m_xmlHandlerBundleSolutionInfo->m_id; - m_xmlHandlerBundleSolutionInfo->m_id = new QUuid(m_xmlHandlerCharacters); - } - else if (localName == "name") { - m_xmlHandlerBundleSolutionInfo->m_name = m_xmlHandlerCharacters; - } - else if (localName == "runTime") { - m_xmlHandlerBundleSolutionInfo->m_runTime = m_xmlHandlerCharacters; - } - else if (localName == "inputFileName") { - assert(m_xmlHandlerBundleSolutionInfo->m_inputControlNetFileName == NULL); - m_xmlHandlerBundleSolutionInfo->m_inputControlNetFileName = new FileName( - projectRoot + m_xmlHandlerCharacters); - } - else if (localName == "bundleOutTXT") { - m_xmlHandlerBundleSolutionInfo->m_txtBundleOutputFilename = - projectRoot + m_xmlHandlerCharacters; - } - else if (localName == "imagesCSV") { - m_xmlHandlerBundleSolutionInfo->m_csvSavedImagesFilename = - projectRoot + m_xmlHandlerCharacters; - } - else if (localName == "pointsCSV") { - m_xmlHandlerBundleSolutionInfo->m_csvSavedPointsFilename = - projectRoot + m_xmlHandlerCharacters; - } - else if (localName == "residualsCSV") { - m_xmlHandlerBundleSolutionInfo->m_csvSavedResidualsFilename = - projectRoot + m_xmlHandlerCharacters; - } - - m_xmlHandlerCharacters = ""; - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - /** * Determine the control point coordinate name. * diff --git a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h index 4a6e6fc504..2581890c0d 100755 --- a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h +++ b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h @@ -18,8 +18,6 @@ find files of those names at the top level of this repository. **/ #include "LidarData.h" #include "SurfacePoint.h" -#include "XmlStackedHandler.h" - class QDataStream; class QUuid; class QXmlStreamWriter; @@ -218,39 +216,6 @@ namespace Isis { public slots: void updateFileName(Project *); - private: - /** - * This class is used to read an images.xml file into an image list - * - * @see QXmlDefaultHandler documentation - * @author 2014-07-21 Ken Edmundson - * - * @internal - * @history 2016-06-13 Makayla Shepherd - Added updateFileName() and updated documentation. - * Fixes #2298. - */ - class XmlHandler : public XmlStackedHandler { - public: - //TODO does xml stuff need project??? - XmlHandler(BundleSolutionInfo *bundleSolutionInfo, Project *project); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - QString surfacePointCoordName(SurfacePoint::CoordinateType type, - SurfacePoint::CoordIndex coordIdx) const; - - private: - Q_DISABLE_COPY(XmlHandler); - - BundleSolutionInfo *m_xmlHandlerBundleSolutionInfo; //!< The bundleSolutionInfo object - Project *m_xmlHandlerProject; //TODO does xml stuff need project??? - QString m_xmlHandlerCharacters; //!< List of characters that have been handled - }; - private: //! A unique ID for this BundleSolutionInfo object (useful for others to reference this diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index a646f5a4ec..fa41749949 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -1248,208 +1248,4 @@ namespace Isis { stream.writeEndElement(); // end bundleObservationSolveSettings } - - - /** - * Constructs an XmlHandler for serialization. - * - * @param settings Pointer to the BundleObservationSolveSettings to handle - * @param project Pointer to the current project - * - * @internal - * @todo Does xml stuff need project??? - */ - BundleObservationSolveSettings::XmlHandler::XmlHandler(BundleObservationSolveSettings *settings, - Project *project) { - m_xmlHandlerObservationSettings = settings; - m_xmlHandlerProject = project; // TODO: does xml stuff need project??? - m_xmlHandlerCharacters = ""; - } - - - /** - * XmlHandler destructor. - */ - BundleObservationSolveSettings::XmlHandler::~XmlHandler() { - // do not delete this pointer... we don't own it, do we??? - // passed into StatCumProbDistDynCalc constructor as pointer - // delete m_xmlHandlerProject; // TODO: does xml stuff need project??? - m_xmlHandlerProject = NULL; - } - - - /** - * @param namespaceURI - * @param localName - * @param qName - * @param atts - * - * @return @b bool - * - * @internal - * @todo Document if we decide to use Xml handlers for serialization - */ - bool BundleObservationSolveSettings::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) { - m_xmlHandlerCharacters = ""; - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "instrumentPointingOptions") { - - QString pointingSolveOption = atts.value("solveOption"); - if (!pointingSolveOption.isEmpty()) { - m_xmlHandlerObservationSettings->m_instrumentPointingSolveOption - = stringToInstrumentPointingSolveOption(pointingSolveOption); - } - - QString numberCoefSolved = atts.value("numberCoefSolved"); - if (!numberCoefSolved.isEmpty()) { - m_xmlHandlerObservationSettings->m_numberCamAngleCoefSolved = toInt(numberCoefSolved); - } - - QString ckDegree = atts.value("degree"); - if (!ckDegree.isEmpty()) { - m_xmlHandlerObservationSettings->m_ckDegree = toInt(ckDegree); - } - - QString ckSolveDegree = atts.value("solveDegree"); - if (!ckSolveDegree.isEmpty()) { - m_xmlHandlerObservationSettings->m_ckSolveDegree = toInt(ckSolveDegree); - } - - QString solveTwist = atts.value("solveTwist"); - if (!solveTwist.isEmpty()) { - m_xmlHandlerObservationSettings->m_solveTwist = toBool(solveTwist); - } - - QString solveOverExisting = atts.value("solveOverExisting"); - if (!solveOverExisting.isEmpty()) { - m_xmlHandlerObservationSettings->m_solvePointingPolynomialOverExisting = - toBool(solveOverExisting); - } - - QString interpolationType = atts.value("interpolationType"); - if (!interpolationType.isEmpty()) { - m_xmlHandlerObservationSettings->m_pointingInterpolationType = - SpiceRotation::Source(toInt(interpolationType)); - } - - } - else if (localName == "aprioriPointingSigmas") { - m_xmlHandlerAprioriSigmas.clear(); - } - else if (localName == "instrumentPositionOptions") { - - QString positionSolveOption = atts.value("solveOption"); - if (!positionSolveOption.isEmpty()) { - m_xmlHandlerObservationSettings->m_instrumentPositionSolveOption - = stringToInstrumentPositionSolveOption(positionSolveOption); - } - - QString numberCoefSolved = atts.value("numberCoefSolved"); - if (!numberCoefSolved.isEmpty()) { - m_xmlHandlerObservationSettings->m_numberCamPosCoefSolved = toInt(numberCoefSolved); - } - - QString spkDegree = atts.value("degree"); - if (!spkDegree.isEmpty()) { - m_xmlHandlerObservationSettings->m_spkDegree = toInt(spkDegree); - } - - QString spkSolveDegree = atts.value("solveDegree"); - if (!spkSolveDegree.isEmpty()) { - m_xmlHandlerObservationSettings->m_spkSolveDegree = toInt(spkSolveDegree); - } - - QString solveOverHermiteSpline = atts.value("solveOverHermiteSpline"); - if (!solveOverHermiteSpline.isEmpty()) { - m_xmlHandlerObservationSettings->m_solvePositionOverHermiteSpline = - toBool(solveOverHermiteSpline); - } - - QString interpolationType = atts.value("interpolationType"); - if (!interpolationType.isEmpty()) { - m_xmlHandlerObservationSettings->m_positionInterpolationType = - SpicePosition::Source(toInt(interpolationType)); - } - } - else if (localName == "aprioriPositionSigmas") { - m_xmlHandlerAprioriSigmas.clear(); - } - } - return true; - } - - - /** - * @param ch - * - * @return @b bool - * - * @internal - * @todo Document if we use Xml handlers for serialization. - */ - bool BundleObservationSolveSettings::XmlHandler::characters(const QString &ch) { - m_xmlHandlerCharacters += ch; - return XmlStackedHandler::characters(ch); - } - - - /** - * @param namespaceURI - * @param localName - * @param qName - * - * @return @b bool - * - * @internal - * @todo Document if we use Xml handlers for serialization. - */ - bool BundleObservationSolveSettings::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName) { - if (!m_xmlHandlerCharacters.isEmpty()) { - if (localName == "id") { - m_xmlHandlerObservationSettings->m_id = NULL; - m_xmlHandlerObservationSettings->m_id = new QUuid(m_xmlHandlerCharacters); - } - else if (localName == "instrumentId") { - m_xmlHandlerObservationSettings->setInstrumentId(m_xmlHandlerCharacters); - } -// else if (localName == "bundleObservationSolveSettings") { -// // end tag for this entire class... how to get out??? -// // call parse, as in Control List??? -// } - else if (localName == "sigma") { - m_xmlHandlerAprioriSigmas.append(m_xmlHandlerCharacters); - } - else if (localName == "aprioriPointingSigmas") { - m_xmlHandlerObservationSettings->m_anglesAprioriSigma.clear(); - for (int i = 0; i < m_xmlHandlerAprioriSigmas.size(); i++) { - if (m_xmlHandlerAprioriSigmas[i] == "N/A") { - m_xmlHandlerObservationSettings->m_anglesAprioriSigma.append(Isis::Null); - } - else { - m_xmlHandlerObservationSettings->m_anglesAprioriSigma.append( - toDouble(m_xmlHandlerAprioriSigmas[i])); - } - } - } - else if (localName == "aprioriPositionSigmas") { - m_xmlHandlerObservationSettings->m_positionAprioriSigma.clear(); - for (int i = 0; i < m_xmlHandlerAprioriSigmas.size(); i++) { - if (m_xmlHandlerAprioriSigmas[i] == "N/A") { - m_xmlHandlerObservationSettings->m_positionAprioriSigma.append(Isis::Null); - } - else { - m_xmlHandlerObservationSettings->m_positionAprioriSigma.append( - toDouble(m_xmlHandlerAprioriSigmas[i])); - } - } - } - m_xmlHandlerCharacters = ""; - } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } } diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h index d9f493e403..a5992661e0 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.h @@ -18,7 +18,6 @@ find files of those names at the top level of this repository. **/ #include "SpicePosition.h" #include "SpiceRotation.h" -#include "XmlStackedHandler.h" class QDataStream; class QUuid; @@ -181,36 +180,6 @@ class BundleObservationSolveSettings { // TODO: does xml stuff need project??? void save(QXmlStreamWriter &stream, const Project *project) const; - - private: - /** - * - * @author 2014-07-28 Jeannie Backer - * - * @internal - * @todo To be docuemnted if XML handler code is used for serialization. - */ - class XmlHandler : public XmlStackedHandler { - public: - // TODO: does xml stuff need project??? - XmlHandler(BundleObservationSolveSettings *settings, Project *project); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - BundleObservationSolveSettings *m_xmlHandlerObservationSettings; - Project *m_xmlHandlerProject; // TODO: does xml stuff need project??? - QString m_xmlHandlerCharacters; - QStringList m_xmlHandlerAprioriSigmas; - }; - /** * A unique ID for this object (useful for others to reference this object * when saving to disk). diff --git a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp index dc3b7d0f22..140bc9251e 100644 --- a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp +++ b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp @@ -187,59 +187,4 @@ namespace Isis { stream.writeEndElement(); } - - /** - * Creates an XmlHandler for cnetEditor - * - * @param cnetEditor The widget to be serialized - */ - CnetEditorView::XmlHandler::XmlHandler(CnetEditorView *cnetEditorView) { - m_cnetEditorView = cnetEditorView; - } - - - /** - * Destructor - */ - CnetEditorView::XmlHandler::~XmlHandler() { - delete m_cnetEditorView; - m_cnetEditorView = NULL; - } - - - /** - * Placeholder for later serialization of CnetEditorViews - * - * @param cnetEditor The CnetEditorView to be serialized - * @param namespaceURI ??? - * @param localName Determines what attributes to retrieve from atts. - * @param qName ??? - * @param atts Stores the attributes. - * - * @return @b bool The result of XmlStackedHandler's startElement() method. - */ - bool CnetEditorView::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - - bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts); - return result; - } - - - /** - * This method calls XmlStackedHandler's endElement() and dereferences pointers according to - * the value of localName. - * - * @param namespaceURI ??? - * @param localName Determines which pointers to dereference. - * @param qName ??? - * - * @return @b bool The result of XmlStackedHandler's endElement() method. - */ - bool CnetEditorView::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - - bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName); - return result; - } } diff --git a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h index 4890fbe011..8ef4c87fc8 100644 --- a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h +++ b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.h @@ -16,7 +16,6 @@ find files of those names at the top level of this repository. **/ #include "AbstractProjectItemView.h" #include "FileName.h" -#include "XmlStackedHandler.h" class QAction; class QToolBar; @@ -80,29 +79,6 @@ class CnetEditorView : public AbstractProjectItemView { void createMenus(); void leaveEvent(QEvent *event); - - /** - * @author 2012-09-?? Steven Lambright - * - * @internal - * @history 2018-04-04 Tracie Sucharski - Implemented for CnetEditorView - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(CnetEditorView *cnetEditorView); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - CnetEditorView *m_cnetEditorView; //!< The view we are working with - }; - private: QPointer m_cnetEditorWidget; QPointer m_control; diff --git a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp index 68c5691ec8..3cf0cd13aa 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp @@ -55,7 +55,6 @@ find files of those names at the top level of this repository. **/ #include "TableView.h" #include "TableViewHeader.h" #include "TreeView.h" -#include "XmlStackedHandler.h" namespace Isis { diff --git a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.h b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.h index 07aa672c0f..d80fbad635 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.h +++ b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.h @@ -12,7 +12,6 @@ find files of those names at the top level of this repository. **/ #include -#include "XmlStackedHandler.h" class QAction; class QBoxLayout; @@ -24,7 +23,6 @@ class QSplitter; class QString; class QToolBar; class QXmlStreamWriter; -class QXmlAttributes; namespace Isis { class AbstractTableModel; diff --git a/isis/src/qisis/objs/Control/Control.cpp b/isis/src/qisis/objs/Control/Control.cpp index cb82e7c524..7bedf8b51b 100644 --- a/isis/src/qisis/objs/Control/Control.cpp +++ b/isis/src/qisis/objs/Control/Control.cpp @@ -361,56 +361,4 @@ namespace Isis { stream.writeEndElement(); } - - - /** - * Constructor for the Control object's XmlHandler - * - * @param control A pointer to the Control object. - * @param cnetFolder The name of the folder for the Control xml - * - */ - Control::XmlHandler::XmlHandler(Control *control, FileName cnetFolder) { - m_xmlHandlerControl = control; - m_xmlHandlerCnetFolderName = cnetFolder; - } - - - /** - * Method to read the given XML formatted attribute for a Control object - * into the XmlHandler. - * - * @param namespaceURI ??? - * @param localName The keyword name given to the member variable in the XML. - * @param qName ??? - * @param atts The attribute containing the keyword value for the given - * localName. - * - * @return @b bool Indicates whether the localName is recognized. - */ - bool Control::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "controlNet") { - QString id = atts.value("id"); - QString path = atts.value("path"); - QString fileName = atts.value("fileName"); - - if (!id.isEmpty()) { - delete m_xmlHandlerControl->m_id; - m_xmlHandlerControl->m_id = NULL; - m_xmlHandlerControl->m_id = new QUuid(id.toLatin1()); - } - - if (!fileName.isEmpty()) { - m_xmlHandlerControl->m_fileName = m_xmlHandlerCnetFolderName.expanded() + "/" + fileName; - } - } - else if (localName == "displayProperties") { - m_xmlHandlerControl->m_displayProperties = new ControlDisplayProperties(""); - } - } - - return true; - } } diff --git a/isis/src/qisis/objs/Control/Control.h b/isis/src/qisis/objs/Control/Control.h index b2965f2c72..d54a38f233 100644 --- a/isis/src/qisis/objs/Control/Control.h +++ b/isis/src/qisis/objs/Control/Control.h @@ -13,7 +13,6 @@ find files of those names at the top level of this repository. **/ #include #include "FileName.h" -#include "XmlStackedHandler.h" class QMutex; class QUuid; @@ -93,30 +92,6 @@ namespace Isis { void updateFileName(Project *); void closeControlNet(); - private: - /** - * Nested class used to write the Control object information to an XML file for the - * purpose of saving and restoring the state of the project. - * - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Control *control, FileName cnetFolder); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - private: - Q_DISABLE_COPY(XmlHandler); - - Control *m_xmlHandlerControl; /**< A pointer to the Control object to be read or - written.*/ - FileName m_xmlHandlerCnetFolderName; /**< The name of the folder for the control xml.*/ - }; - private: Control(const Control &other); Control &operator=(const Control &rhs); diff --git a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp index c8d10d64ea..7a3acca9bb 100644 --- a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp +++ b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.cpp @@ -169,46 +169,6 @@ namespace Isis { } - ControlDisplayProperties::XmlHandler::XmlHandler(ControlDisplayProperties *displayProperties) { - m_displayProperties = displayProperties; - } - - - bool ControlDisplayProperties::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "displayProperties") { - QString displayName = atts.value("displayName"); - - if (!displayName.isEmpty()) { - m_displayProperties->setDisplayName(displayName); - } - } - } - - return true; - } - - - bool ControlDisplayProperties::XmlHandler::characters(const QString &ch) { - m_hexData += ch; - - return XmlStackedHandler::characters(ch); - } - - - bool ControlDisplayProperties::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - if (localName == "displayProperties") { - QByteArray hexValues(m_hexData.toLatin1()); - QDataStream valuesStream(QByteArray::fromHex(hexValues)); - valuesStream >> *m_displayProperties->m_propertyValues; - } - - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - /** * This is the generic mutator for properties. Given a value, this will * change it and emit propertyChanged if its different and supported. diff --git a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h index 4594460b88..b2913779f2 100644 --- a/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h +++ b/isis/src/qisis/objs/ControlDisplayProperties/ControlDisplayProperties.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include // This is required since QColor is in a slot #include "DisplayProperties.h" -#include "XmlStackedHandler.h" class QAction; class QXmlStreamWriter; @@ -100,31 +99,6 @@ namespace Isis { private slots: void toggleShowLabel(); - private: - /** - * @author 2012-??-?? ??? - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(ControlDisplayProperties *displayProperties); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - virtual bool characters(const QString &ch); - - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - ControlDisplayProperties *m_displayProperties; - QString m_hexData; - }; - private: ControlDisplayProperties(const ControlDisplayProperties &); ControlDisplayProperties &operator=(const ControlDisplayProperties &); diff --git a/isis/src/qisis/objs/ControlList/ControlList.cpp b/isis/src/qisis/objs/ControlList/ControlList.cpp index 204b2e1495..bcfbd8a1bc 100644 --- a/isis/src/qisis/objs/ControlList/ControlList.cpp +++ b/isis/src/qisis/objs/ControlList/ControlList.cpp @@ -712,95 +712,4 @@ namespace Isis { m_newProjectRoot = rhs.m_newProjectRoot; return *this; } - - - /** - * Create an XML Handler (reader/writer) that can populate the ControlList class data. See - * ControlList::save() for the expected format. - * - * @param controlList The control list we're going to be initializing - * @param project The project that contains the control list - */ - ControlList::XmlHandler::XmlHandler(ControlList *controlList, Project *project) { - m_controlList = controlList; - m_project = project; - } - - - /** - * Handle an XML start element. This expects and elements (it reads both - * the project XML and the controls.xml file). - * - * @param namespaceURI ??? - * @param localName The keyword name given to the member variable in the XML - * @param qName ??? - * @param atts The attribute containing the keyword value given for the given localName - * - * @return @b bool If we should continue reading the XML (usually true). - */ - bool ControlList::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "controlList") { - QString name = atts.value("name"); - QString path = atts.value("path"); - - if (!name.isEmpty()) { - m_controlList->setName(name); - } - - if (!path.isEmpty()) { - m_controlList->setPath(path); - } - } - else if (localName == "controlNet") { - m_controlList->append(new Control(m_project->cnetRoot() + "/" + m_controlList->path())); - } - } - - return true; - } - - - /** - * Handle an XML end element. This handles by opening and reading the controls.xml - * file. - * - * @param namespaceURI ??? - * @param localName The keyword name given to the member variable in the XML - * @param qName ??? - * - * @return @b bool If we should continue reading the XML (usually true). - * - * @throws IException::Io "Unable to open with read access" - * @throws IException::Io "Failed to open control list XML" - */ - bool ControlList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "controlList") { - - QString controlListXmlPath = m_project->cnetRoot() + "/" + m_controlList->path() + - "/controlNetworks.xml"; - QFile file(controlListXmlPath); - - if (!file.open(QFile::ReadOnly)) { - throw IException(IException::Io, - QString("Unable to open [%1] with read access") - .arg(controlListXmlPath), - _FILEINFO_); - } - - 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 d0e4bc88db..10509087a6 100644 --- a/isis/src/qisis/objs/ControlList/ControlList.h +++ b/isis/src/qisis/objs/ControlList/ControlList.h @@ -16,7 +16,6 @@ find files of those names at the top level of this repository. **/ #include "Control.h" #include "ControlDisplayProperties.h" -#include "XmlStackedHandler.h" class QStringList; class QXmlStreamWriter; @@ -135,33 +134,6 @@ namespace Isis { FileName m_newProjectRoot; //!< The filename of the destination project's root }; - /** - * Nested class used to write the ControlList object information to an XML file for the - * purposes of saving an restoring the state of the object. - * - * @see ControlList::save for the expected format - * - * @author 2012-09-27 Tracie Sucharski - Adapted from ImageList::XmlHandler - * - * @internal - * @history 2012-09-27 Tracie Sucharski - Original version. - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(ControlList *controlList, Project *project); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - ControlList *m_controlList; //!< Control list to be read or written - Project *m_project; //!< Project that contains the control list - }; - private: QString m_name; //!< Name of the ControlList diff --git a/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp b/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp index 4e0aa52d6a..d4ce36f9fd 100644 --- a/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp +++ b/isis/src/qisis/objs/CubeDnView/CubeDnView.cpp @@ -547,55 +547,4 @@ namespace Isis { } stream.writeEndElement(); } - - - CubeDnView::XmlHandler::XmlHandler(CubeDnView *cubeDnView, Project *project) { - - m_cubeDnView = cubeDnView; - m_project = project; - } - - - CubeDnView::XmlHandler::~XmlHandler() { - } - - - bool CubeDnView::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts); - - if (result) { - ProjectItemProxyModel *proxy = (ProjectItemProxyModel *) m_cubeDnView->internalModel(); - ProjectItemModel *source = proxy->sourceModel(); - QString id = atts.value("id"); - - ProjectItem *item = NULL; - if (localName == "image") { - Image *image = m_project->image(id); - if (image) { - // Find ProjectItem and append to list - item = source->findItemData(QVariant::fromValue(image)); - } - } - else if (localName == "shape") { - Shape *shape = m_project->shape(id); - if (shape) { - item = source->findItemData(QVariant::fromValue(shape)); - } - } - if (item) { - proxy->addItem(item); - } - } - - return result; - } - - - bool CubeDnView::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName); - - return result; - } } diff --git a/isis/src/qisis/objs/CubeDnView/CubeDnView.h b/isis/src/qisis/objs/CubeDnView/CubeDnView.h index e1572867f7..fb116cc09d 100644 --- a/isis/src/qisis/objs/CubeDnView/CubeDnView.h +++ b/isis/src/qisis/objs/CubeDnView/CubeDnView.h @@ -15,7 +15,6 @@ find files of those names at the top level of this repository. **/ #include "AbstractProjectItemView.h" #include "FileName.h" -#include "XmlStackedHandler.h" class QAction; class QMenu; @@ -134,30 +133,6 @@ namespace Isis { void leaveEvent(QEvent *event); void enableActions(); - private: - /** - * @author 2012-09-?? Steven Lambright - * - * @internal - * @history 2016-11-07 Tracie Sucharski - Implemented for CubeDnView - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(CubeDnView *cubeDnView, Project *project); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - Project *m_project; //!< The current project - CubeDnView *m_cubeDnView; //!< The view we are working with - }; - private: QMap m_cubeItemMap; //!< Maps cubes to their items Workspace *m_workspace; //!< The workspace diff --git a/isis/src/qisis/objs/Directory/Directory.cpp b/isis/src/qisis/objs/Directory/Directory.cpp index 78f1506f8d..71324e2580 100644 --- a/isis/src/qisis/objs/Directory/Directory.cpp +++ b/isis/src/qisis/objs/Directory/Directory.cpp @@ -91,7 +91,6 @@ find files of those names at the top level of this repository. **/ #include "WarningTreeWidget.h" #include "WorkOrder.h" #include "Workspace.h" -#include "XmlStackedHandler.h" using namespace std; @@ -1562,66 +1561,6 @@ namespace Isis { stream.writeEndElement(); } - - /** - * @brief This function sets the Directory pointer for the Directory::XmlHandler class - * @param directory The new directory we are setting XmlHandler's member variable to. - */ - Directory::XmlHandler::XmlHandler(Directory *directory) { - m_directory = directory; - } - - - /** - * @brief The Destructor for Directory::XmlHandler - */ - Directory::XmlHandler::~XmlHandler() { - } - - - /** - * @brief The XML reader invokes this method at the start of every element in the - * XML document. This method expects and - * elements. - * A quick example using this function: - * startElement("xsl","stylesheet","xsl:stylesheet",attributes) - * - * @param namespaceURI The Uniform Resource Identifier of the element's namespace - * @param localName The local name string - * @param qName The XML qualified string (or empty, if QNames are not available). - * @param atts The XML attributes attached to each element - * @return @b bool Returns True signalling to the reader the start of a valid XML element. If - * False is returned, something bad happened. - * - */ - bool Directory::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts); - if (result) { - QString viewObjectName; - if (localName == "footprint2DView") { - viewObjectName = atts.value("objectName"); - m_directory->addFootprint2DView(viewObjectName); - } - else if (localName == "imageFileList") { - viewObjectName = atts.value("objectName"); - m_directory->addImageFileListView(viewObjectName); - } - else if (localName == "cubeDnView") { - viewObjectName = atts.value("objectName"); - m_directory->addCubeDnView(viewObjectName); - } - else if (localName == "cnetEditorView") { - viewObjectName = atts.value("objectName"); - QString id = atts.value("id"); - m_directory->addCnetEditorView(m_directory->project()->control(id), viewObjectName); - } - } - - return result; - } - - /** * @brief Reformat actionPairings to be user friendly for use in menus. * diff --git a/isis/src/qisis/objs/Directory/Directory.h b/isis/src/qisis/objs/Directory/Directory.h index 37ebb1f5bb..e0dbe9a5c4 100644 --- a/isis/src/qisis/objs/Directory/Directory.h +++ b/isis/src/qisis/objs/Directory/Directory.h @@ -435,25 +435,6 @@ namespace Isis { void newActiveControl(bool newControl); void reloadActiveControlInCnetEditorView(); - private: - /** - * @author 2012-08-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Directory *directory); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - private: - Q_DISABLE_COPY(XmlHandler); - - Directory *m_directory; //!< Pointer to a Directory which is set by the XmlHandler class. - }; private: Directory(const Directory &other); diff --git a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp index d9afe658d8..42124041b9 100644 --- a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp +++ b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp @@ -164,44 +164,4 @@ namespace Isis { stream.writeEndElement(); } - - - DisplayProperties::XmlHandler::XmlHandler(DisplayProperties *displayProperties) { - m_displayProperties = displayProperties; - } - - - bool DisplayProperties::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "displayProperties") { - QString displayName = atts.value("displayName"); - - if (!displayName.isEmpty()) { - m_displayProperties->setDisplayName(displayName); - } - } - } - - return true; - } - - - bool DisplayProperties::XmlHandler::characters(const QString &ch) { - m_hexData += ch; - - return XmlStackedHandler::characters(ch); - } - - - bool DisplayProperties::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - if (localName == "displayProperties") { - QByteArray hexValues(m_hexData.toLatin1()); - QDataStream valuesStream(QByteArray::fromHex(hexValues)); - valuesStream >> *m_displayProperties->m_propertyValues; - } - - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } } diff --git a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h index 65b9c1525a..769f704784 100644 --- a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h +++ b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.h @@ -14,8 +14,6 @@ find files of those names at the top level of this repository. **/ // This is required since QColor is in a slot #include -#include "XmlStackedHandler.h" - class QAction; class QBitArray; class QXmlStreamWriter; @@ -61,30 +59,6 @@ namespace Isis { private: Q_DISABLE_COPY(DisplayProperties); - /** - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(DisplayProperties *displayProperties); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - virtual bool characters(const QString &ch); - - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - DisplayProperties *m_displayProperties; - QString m_hexData; - }; - private: diff --git a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp index 1bfbce4f9a..054a8cc0e8 100644 --- a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp +++ b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp @@ -362,60 +362,4 @@ namespace Isis { stream.writeEndElement(); } - - - /** - * @brief This function sets the Directory pointer for the Directory::XmlHandler class - * @param directory The new directory we are setting XmlHandler's member variable to. - */ - Footprint2DView::XmlHandler::XmlHandler(Footprint2DView *footprintView) { - - m_footprintView = footprintView; - } - - - /** - * @brief The Destructor for Directory::XmlHandler - */ - Footprint2DView::XmlHandler::~XmlHandler() { - } - - - /** - * @brief The XML reader invokes this method at the start of every element in the - * XML document. This method expects and - * elements. - * A quick example using this function: - * startElement("xsl","stylesheet","xsl:stylesheet",attributes) - * - * @param namespaceURI The Uniform Resource Identifier of the element's namespace - * @param localName The local name string - * @param qName The XML qualified string (or empty, if QNames are not available). - * @param atts The XML attributes attached to each element - * @return @b bool Returns True signalling to the reader the start of a valid XML element. If - * False is returned, something bad happened. - * - */ - bool Footprint2DView::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts); - - if (result) { - if (localName == "mosaicScene") { - m_footprintView->mosaicSceneWidget(); - } - if (localName == "imageFileList") { - m_footprintView->m_fileListWidget; - } - } - return result; - } - - - bool Footprint2DView::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName); - - return result; - } } diff --git a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h index 162408035d..0874960742 100644 --- a/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h +++ b/isis/src/qisis/objs/Footprint2DView/Footprint2DView.h @@ -16,7 +16,6 @@ find files of those names at the top level of this repository. **/ #include "AbstractProjectItemView.h" #include "FileName.h" #include "ImageList.h" -#include "XmlStackedHandler.h" class QAction; class QEvent; @@ -135,27 +134,6 @@ namespace Isis { private: void enableActions(); - /** - * @author 2018-05-11 Tracie Sucharski - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Footprint2DView *footprintView); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - Footprint2DView *m_footprintView; //!< The Footprint2DView - }; - private: MosaicSceneWidget *m_sceneWidget; //!< The scene widget ImageFileListWidget *m_fileListWidget; //!< The file list widget diff --git a/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp b/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp index a186ba2be8..254ff24f8b 100644 --- a/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp +++ b/isis/src/qisis/objs/GuiCamera/GuiCamera.cpp @@ -182,104 +182,6 @@ namespace Isis { // } - - /** - * Create an XML Handler (reader) that can populate the BundleSettings class data. See - * BundleSettings::save() for the expected format. - * - * @param bundleSettings The image we're going to be initializing - * @param imageFolder The folder that contains the Cube - */ -// GuiCamera::XmlHandler::XmlHandler(GuiCamera *GuiCamera, Project *project) { -// m_xmlHandlerGuiCamera = GuiCamera; -// m_xmlHandlerProject = NULL; -// m_xmlHandlerProject = project; -// m_xmlHandlerCharacters = ""; -// } - - - -// GuiCamera::XmlHandler::~XmlHandler() { - // GuiCamera passed in is "this" delete+null will cause problems,no? -// delete m_xmlHandlerGuiCamera; -// m_xmlHandlerGuiCamera = NULL; - - // we do not delete this pointer since it was set to a passed in pointer in constructor and we - // don't own it... is that right??? -// delete m_xmlHandlerProject; -// m_xmlHandlerProject = NULL; -// } - - - - /** - * Handle an XML start element. This expects and elements. - * - * @return If we should continue reading the XML (usually true). - */ -// bool GuiCamera::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, -// const QString &qName, const QXmlAttributes &atts) { -// m_xmlHandlerCharacters = ""; -// -// if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { -// -// if (localName == "GuiCamera") { -// m_xmlHandlerGuiCamera = -// BundleSettingsQsp(new GuiCamera(m_xmlHandlerProject, reader())); -// } -// else if (localName == "bundleResults") { -// delete m_xmlHandlerBundleResults; -// m_xmlHandlerBundleResults = NULL; -// m_xmlHandlerBundleResults = new BundleResults(m_xmlHandlerProject, reader()); -//TODO: need to add constructor for this??? -// } -// else if (localName == "imageList") { -// m_xmlHandlerImages->append(new ImageList(m_xmlHandlerProject, reader())); -// } -// } -// return true; -// } - - - -// bool GuiCamera::XmlHandler::characters(const QString &ch) { -// m_xmlHandlerCharacters += ch; -// return XmlStackedHandler::characters(ch); -// } - - - -// bool GuiCamera::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, -// const QString &qName) { -// if (localName == "id") { -// m_xmlHandlerGuiCamera->m_id = NULL; -// m_xmlHandlerGuiCamera->m_id = new QUuid(m_xmlHandlerCharacters); -// } -// else if (localName == "runTime") { -// m_xmlHandlerGuiCamera->m_runTime = m_xmlHandlerCharacters; -// } -// else if (localName == "fileName") { -// m_xmlHandlerGuiCamera->m_controlNetworkFileName = NULL; -// m_xmlHandlerGuiCamera->m_controlNetworkFileName = new FileName(m_xmlHandlerCharacters); -// } -// else if (localName == "bundleSettings") { -// m_xmlHandlerGuiCamera->m_settings = -// BundleSettingsQsp(new BundleSettings(*m_xmlHandlerBundleSettings)); -// } -// else if (localName == "bundleResults") { -// m_xmlHandlerGuiCamera->m_statisticsResults = new BundleResults(*m_xmlHandlerBundleResults); -// } -// if (localName == "imageLists") { -// for (int i = 0; i < m_xmlHandlerImages->size(); i++) { -// m_xmlHandlerGuiCamera->m_images->append(m_xmlHandlerImages->at(i)); -// } -// m_xmlHandlerImages->clear(); -// } -// m_xmlHandlerCharacters = ""; -// return XmlStackedHandler::endElement(namespaceURI, localName, qName); -// } - - /** * @brief Retrieves a unique, identifying string associated with this GuiCamera object. * @return @b QString returns m_id diff --git a/isis/src/qisis/objs/GuiCamera/GuiCamera.h b/isis/src/qisis/objs/GuiCamera/GuiCamera.h index 8812faeabf..654725bad4 100644 --- a/isis/src/qisis/objs/GuiCamera/GuiCamera.h +++ b/isis/src/qisis/objs/GuiCamera/GuiCamera.h @@ -32,7 +32,6 @@ #include #include #include -#include "XmlStackedHandler.h" class QDataStream; class QUuid; @@ -108,33 +107,6 @@ namespace Isis { // QDataStream &write(QDataStream &stream) const; // QDataStream &read(QDataStream &stream); - - private: - /** - * - * @author 2015-06-08 Ken Edmundson - * - * @internal - */ -// class XmlHandler : public XmlStackedHandler { -// public: -// XmlHandler(GuiCamera *GuiCamera, Project *project); // TODO: does xml stuff need project??? -// ~XmlHandler(); - -// virtual bool startElement(const QString &namespaceURI, const QString &localName, -// const QString &qName, const QXmlAttributes &atts); -// virtual bool characters(const QString &ch); -// virtual bool endElement(const QString &namespaceURI, const QString &localName, -// const QString &qName); - -// private: -// Q_DISABLE_COPY(XmlHandler); - -// GuiCamera *m_xmlHandlerGuiCamera; -// Project *m_xmlHandlerProject; // TODO: does xml stuff need project??? -// QString m_xmlHandlerCharacters; -// }; - private: GuiCamera(const GuiCamera &other); // NOTE: copy constructor & assignment operators GuiCamera &operator=(const GuiCamera &src); // are private so compiler will generate error diff --git a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp index 8c5c8cdde0..1c90041a65 100644 --- a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp +++ b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.cpp @@ -200,86 +200,6 @@ namespace Isis { } - /** - * @brief Sets the GuiCameraDisplayProperties variable pointer. - * @param displayProperties The new pointer. - */ - - GuiCameraDisplayProperties::XmlHandler::XmlHandler(GuiCameraDisplayProperties *displayProperties) { - m_displayProperties = displayProperties; - } - - - /** - * @brief The XML reader invokes this method at the start of every element in the - * XML document. - * A quick example using this function: - * startElement("xsl","stylesheet","xsl:stylesheet",attributes) - * - * @param namespaceURI The Uniform Resource Identifier of the element's namespace - * @param localName The local name string - * @param qName The XML qualified string (or empty, if QNames are not available). - * @param atts The XML attributes attached to each element - * @return @b bool Returns True signalling to the reader the start of a valid XML element. If - * False is returned, something bad happened. - * - */ - bool GuiCameraDisplayProperties::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "displayProperties") { - QString displayName = atts.value("displayName"); - - if (!displayName.isEmpty()) { - m_displayProperties->setDisplayName(displayName); - } - } - } - - return true; - } - - - /** - * @brief This implementation of a virtual function calls - * QXmlDefaultHandler::characters(QString &ch) - * which in turn calls QXmlContentHandler::characters(QString &ch) which - * is called when the XML processor has parsed a chunk of character data. - * @see XmlStackedHandler, QXmlDefaultHandler,QXmlContentHandler - * @param ch The character data. - * @return @b bool Returns True if there were no problems with the character processing. - * It returns False if there was a problem, and the XML reader stops. - */ - bool GuiCameraDisplayProperties::XmlHandler::characters(const QString &ch) { - m_hexData += ch; - - return XmlStackedHandler::characters(ch); - } - - - /** - * @brief The XML reader invokes this method at the end of every element in the - * XML document. - * @param namespaceURI The Uniform Resource Identifier of the namespace (eg. "xmlns") - * @param localName The local name string (eg. "xhtml") - * @param qName The XML qualified string (eg. "xmlns:xhtml"). This can be empty if - * QNames are not available. - * @return @b bool If this function returns True, then a signal is sent to the reader indicating - * the end of the element. If this function returns False, something bad - * happened and processing stops. - */ - bool GuiCameraDisplayProperties::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - if (localName == "displayProperties") { - QByteArray hexValues(m_hexData.toLatin1()); - QDataStream valuesStream(QByteArray::fromHex(hexValues)); - valuesStream >> *m_displayProperties->m_propertyValues; - } - - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - /** * @brief This is the generic mutator for properties. * diff --git a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h index f9261458ac..4570c8a90d 100644 --- a/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h +++ b/isis/src/qisis/objs/GuiCameraDisplayProperties/GuiCameraDisplayProperties.h @@ -28,7 +28,6 @@ #include "DisplayProperties.h" -#include "XmlStackedHandler.h" class QAction; class QXmlStreamWriter; @@ -117,51 +116,6 @@ namespace Isis { private slots: void toggleShowLabel(); - private: - /** - * @brief Process a GuiCameraDisplayProperties in a stack-oriented way - * - * Child class for XmlStackedHandler which is used to process XML in - * a stack-oriented way. It's been modified to process a GuiCameraDisplayProperties - * object. - * - * @author 2015-09-08 Ken Edmundson - * - * @internal - * @history 2015-09-08 Ken Edmundson - Creation. - * @history 2016-06-08 Tyler Wilson - Added documentation to many of the - * member functions, and cleaned up the formatting. - * Fixes #3997. - * - * - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(GuiCameraDisplayProperties *displayProperties); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - virtual bool characters(const QString &ch); - - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - /** - * An internal pointer to GuiCameraDisplayProperties object. - */ - GuiCameraDisplayProperties *m_displayProperties; - - /** - * An internal QString variable used to store character data found in the - * content of XML elements. - */ - QString m_hexData; - }; - private: GuiCameraDisplayProperties(const GuiCameraDisplayProperties &); GuiCameraDisplayProperties &operator=(const GuiCameraDisplayProperties &); diff --git a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp index f248a303aa..d6a7be9dfa 100644 --- a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp +++ b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.cpp @@ -853,96 +853,4 @@ namespace Isis { // return results; // } - - - /** - * Create an XML Handler (reader) that can populate the GuiCameraList class data. See - * GuiCameraList::save() for the expected format. - * - * @param GuiCameraList The gui camera list we're going to be initializing - * @param project The project that contains the gui camera list - */ - GuiCameraList::XmlHandler::XmlHandler(GuiCameraList *GuiCameraList, Project *project) { - m_GuiCameraList = GuiCameraList; - m_project = project; - } - - - /** - * Handle an XML start element. This expects and elements (it reads both - * the project XML and the targets.xml file). - * - * @param namespaceURI ??? - * @param localName The name of the element the XmlHandler is at - * @param qName ??? - * @param atts The attributes of the element the XmlHanler is at - * - * @return @b bool If we should continue reading the XML (usually true). - */ - bool GuiCameraList::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "GuiCameraList") { - QString name = atts.value("name"); - QString path = atts.value("path"); - - if (!name.isEmpty()) { - m_GuiCameraList->setName(name); - } - - if (!path.isEmpty()) { - m_GuiCameraList->setPath(path); - } - } - else if (localName == "target") { -// m_GuiCameraList->append(GuiCameraQsp(new TargetBody(m_project->targetBodyRoot() + "/" + m_GuiCameraList->path(), -// reader()))); - } - } - - return true; - } - - - /** - * Handle an XML end element. This handles by opening and reading the images.xml - * file. - * - * @param namespaceURI ??? - * @param localName The name of the element the XmlHandler is at - * @param qName ??? - * - * @return @b bool If we should continue reading the XML (usually true). - * - * @throws IException::Io "Unable to open with read access" - * @throws IException::Io "Failed to open target body list XML" - */ - bool GuiCameraList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "GuiCameraList") { - - QString GuiCameraListXmlPath = m_project->targetBodyRoot() + "/" + m_GuiCameraList->path() + - "/targets.xml"; - QFile file(GuiCameraListXmlPath); - - if (!file.open(QFile::ReadOnly)) { - throw IException(IException::Io, - QString("Unable to open [%1] with read access") - .arg(GuiCameraListXmlPath), - _FILEINFO_); - } - - 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 4624b6b075..75f169ffb0 100644 --- a/isis/src/qisis/objs/GuiCameraList/GuiCameraList.h +++ b/isis/src/qisis/objs/GuiCameraList/GuiCameraList.h @@ -10,7 +10,6 @@ #include "GuiCameraDisplayProperties.h" //#include "GuiCameraListActionWorkOrder.h" TODO - will we need this? #include "WorkOrder.h" -#include "XmlStackedHandler.h" class QStringList; class QXmlStreamWriter; @@ -101,32 +100,6 @@ namespace Isis { */ void countChanged(int newCount); - private: - /** - * XmlHandler used to save to xml files. - * - * JAM - The save() method that uses this is currently not implemented. - * - * @author 2012-07-01 Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(GuiCameraList *GuiCameraList, Project *project); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - GuiCameraList *m_GuiCameraList; - Project *m_project; - }; - /** * This functor is used for copying the GuiCamera objects between two projects quickly. This is designed diff --git a/isis/src/qisis/objs/Image/Image.cpp b/isis/src/qisis/objs/Image/Image.cpp index 7f9566ee43..4aee66ab7e 100644 --- a/isis/src/qisis/objs/Image/Image.cpp +++ b/isis/src/qisis/objs/Image/Image.cpp @@ -794,162 +794,4 @@ namespace Isis { ImagePolygon poly = cube()->readFootprint(); m_footprint = PolygonTools::MakeMultiPolygon(poly.Polys()->clone().release()); } - - - /** - * @brief Create an XML Handler (reader) that can populate the Image class data. - * @see Image::save() for the expected format. - * @param image The image we're going to be initializing - * @param imageFolder The folder that contains the Cube - */ - Image::XmlHandler::XmlHandler(Image *image, FileName imageFolder) { - m_image = image; - m_imageFolder = imageFolder; - } - - - - /** - * @brief Read mage class attributes - * - * The XML reader invokes this method at the start of every element in the - * XML document. This expects and elements. - * A quick example using this function: - * startElement("xsl","stylesheet","xsl:stylesheet",attributes) - * - * @param namespaceURI The Uniform Resource Identifier of the element's namespace - * @param localName The local name string - * @param qName The XML qualified string (or empty, if QNames are not available). - * @param atts The XML attributes attached to each element - * @return @b bool Returns True signalling to the reader the start of a valid XML element. If - * False is returned, something bad happened. - */ - bool Image::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - m_characters = ""; - - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "image") { - QString id = atts.value("id"); - QString fileName = atts.value("fileName"); - QString instrumentId = atts.value("instrumentId"); - QString spacecraftName = atts.value("spacecraftName"); - - QString aspectRatioStr = atts.value("aspectRatio"); - QString resolutionStr = atts.value("resolution"); - QString emissionAngleStr = atts.value("emissionAngle"); - QString incidenceAngleStr = atts.value("incidenceAngle"); - QString lineResolutionStr = atts.value("lineResolution"); - QString localRadiusStr = atts.value("localRadius"); - QString northAzimuthStr = atts.value("northAzimuth"); - QString phaseAngleStr = atts.value("phaseAngle"); - QString sampleResolutionStr = atts.value("sampleResolution"); - - if (!id.isEmpty()) { - delete m_image->m_id; - m_image->m_id = NULL; - m_image->m_id = new QUuid(id.toLatin1()); - } - - if (!fileName.isEmpty()) { - m_image->m_fileName = m_imageFolder.expanded() + "/" + fileName; - } - - if (!instrumentId.isEmpty()) { - m_image->m_instrumentId = instrumentId; - } - - if (!spacecraftName.isEmpty()) { - m_image->m_spacecraftName = spacecraftName; - } - - if (!aspectRatioStr.isEmpty()) { - m_image->m_aspectRatio = aspectRatioStr.toDouble(); - } - - if (!resolutionStr.isEmpty()) { - m_image->m_resolution = resolutionStr.toDouble(); - } - - if (!emissionAngleStr.isEmpty()) { - m_image->m_emissionAngle = Angle(emissionAngleStr.toDouble(), Angle::Radians); - } - - if (!incidenceAngleStr.isEmpty()) { - m_image->m_incidenceAngle = Angle(incidenceAngleStr.toDouble(), Angle::Radians); - } - - if (!lineResolutionStr.isEmpty()) { - m_image->m_lineResolution = lineResolutionStr.toDouble(); - } - - if (!localRadiusStr.isEmpty()) { - m_image->m_localRadius = Distance(localRadiusStr.toDouble(), Distance::Meters); - } - - if (!northAzimuthStr.isEmpty()) { - m_image->m_northAzimuth = Angle(northAzimuthStr.toDouble(), Angle::Radians); - } - - if (!phaseAngleStr.isEmpty()) { - m_image->m_phaseAngle = Angle(phaseAngleStr.toDouble(), Angle::Radians); - } - - if (!sampleResolutionStr.isEmpty()) { - m_image->m_sampleResolution = sampleResolutionStr.toDouble(); - } - } - else if (localName == "displayProperties") { - m_image->m_displayProperties = new ImageDisplayProperties(""); - } - } - - return true; - } - - - /** - * @brief This implementation of a virtual function calls - * QXmlDefaultHandler::characters(QString &ch) - * which in turn calls QXmlContentHandler::characters(QString &ch) which - * is called when the XML processor has parsed a chunk of character data. - * @see XmlStackedHandler, QXmlDefaultHandler,QXmlContentHandler - * @param ch The character data. - * @return @b bool Returns True if there were no problems with the character processing. - * It returns False if there was a problem, and the XML reader stops. - */ - bool Image::XmlHandler::characters(const QString &ch) { - m_characters += ch; - - return XmlStackedHandler::characters(ch); - } - - - /** - * @brief The XML reader invokes this method at the end of every element in the - * XML document. This expects and elements. - * @param namespaceURI The Uniform Resource Identifier of the namespace (eg. "xmlns") - * @param localName The local name string (eg. "xhtml") - * @param qName The XML qualified string (eg. "xmlns:xhtml"). This can be empty if - * QNames are not available. - * @return @b bool If this function returns True, then a signal is sent to the reader indicating - * the end of the element. If this function returns False, something bad - * happened and processing stops. - */ - bool Image::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "footprint" && !m_characters.isEmpty()) { - geos::io::WKTReader wktReader(*globalFactory); - m_image->m_footprint = PolygonTools::MakeMultiPolygon( - wktReader.read(m_characters.toStdString()).release()); - } - else if (localName == "image" && !m_image->m_footprint) { - QMutex mutex; - m_image->initFootprint(&mutex); - m_image->closeCube(); - } - - m_characters = ""; - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } } diff --git a/isis/src/qisis/objs/Image/Image.h b/isis/src/qisis/objs/Image/Image.h index b41d9b5217..cb836b378f 100644 --- a/isis/src/qisis/objs/Image/Image.h +++ b/isis/src/qisis/objs/Image/Image.h @@ -30,7 +30,6 @@ #include "Angle.h" #include "Distance.h" #include "FileName.h" -#include "XmlStackedHandler.h" #include #include @@ -151,40 +150,6 @@ namespace Isis { void initCamStats(); void initQuickFootprint(); - - private: - /** - * @brief Process XML in a stack-oriented fashion - * - * Child class for XmlStackedHandler which is used to process XML in - * a stack-oriented way. It's been modified to process an Image object - * object. - * @author 2012-??-?? Steven Lambright - * - * @history 2016-06-23 Tyler Wilson - Added documention to the member functions. - * Fixes #3950. - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Image *image, FileName imageFolder); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - Image *m_image; //!< Pointer to the Image. - FileName m_imageFolder; //!< The Name/path of the image. - QString m_characters; //!< Character data storage found in the content of XML elements. - - }; - private: Image(const Image &other); Image &operator=(const Image &rhs); diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp index 9fe61311f9..6de2e9eb77 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp @@ -722,147 +722,6 @@ namespace Isis { stream.writeEndElement(); } - /** - * Creates a XmlHandler for fileList - * - * @param fileList The image file list we are handling - */ - ImageFileListWidget::XmlHandler::XmlHandler(ImageFileListWidget *fileList) { - m_fileList = fileList; - m_currentImageList = NULL; - m_currentImageListItem = NULL; - m_currentGroup = NULL; - } - - /** - * Destructor - */ - ImageFileListWidget::XmlHandler::~XmlHandler() { - } - - /** - * This method calls XmlStackedHandler's startElement() and retrieves attributes from - * atts according to what localName is and stores that in m_fileList. - * - * @param namespaceURI ??? - * @param localName Determines what attributes to retrieve from atts. - * @param qName ??? - * @param atts Stores the attributes. - * - * @return @b bool The result of XmlStackedHandler's startElement() method. - */ - bool ImageFileListWidget::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts); - - if (result) { - -// if (localName == "geometry") { -// QByteArray -// restoreGeometry(atts.value("value").toLatin1()); -// } - - if (localName == "position") { - QPoint pos = QPoint(atts.value("x").toInt(), atts.value("y").toInt()); - //qDebug()<<" ::startElement pos = "<move(pos); - } - else if (localName == "size") { - QSize size = QSize(atts.value("width").toInt(), atts.value("height").toInt()); - //qDebug()<<" ::startElement size = "<resize(size); - } - else if (localName == "column") { - QString colName = atts.value("name"); - QString colVisibleStr = atts.value("visible"); - QString colSortedStr = atts.value("sorted"); - - - ImageTreeWidgetItem::TreeColumn col = - ImageTreeWidgetItem::NameColumn; - while (col < ImageTreeWidgetItem::BlankColumn) { - QString curColName = ImageTreeWidgetItem::treeColumnToString(col); - - if (curColName == colName) { - if (colVisibleStr != "false") { - m_fileList->m_tree->showColumn(col); - } - else { - m_fileList->m_tree->hideColumn(col); - } - - if (colSortedStr == "true") { - m_fileList->m_tree->sortItems(col, Qt::AscendingOrder); - } - } - - col = (ImageTreeWidgetItem::TreeColumn)(col + 1); - } - } - - else if (localName == "group") { - if (atts.value("isImageList") == "true") { - if (!m_currentImageList) { - QString name = atts.value("name"); - m_currentImageListItem = m_fileList->m_tree->createImageListNameItem(name); - m_currentImageList = m_fileList->m_directory->project()->imageList(name); - m_fileList->m_tree->addTopLevelItem(m_currentImageListItem); - m_currentImageListItem->setExpanded(true); - } - } - else { - m_currentGroup = m_fileList->m_tree->createGroup(m_currentImageListItem, - atts.value("name")); - } - } - - else if (localName == "image" && m_currentGroup) { - Image *image = m_fileList->m_directory->project()->image(atts.value("id")); - // If Image for id doesn't exist, check shapes. If corresponds to Shape, new Image will - // need to be created. - if (!image) { - Shape *shape = m_fileList->m_directory->project()->shape(atts.value("id")); - if (shape) { - image = new Image(shape->cube(), shape->footprint(), atts.value("id")); - } - } - m_currentGroup->addChild(m_fileList->m_tree->prepCube(m_currentImageList, image)); - } - - } - - return result; - } - - /** - * This method calls XmlStackedHandler's endElement() and dereferences pointers according to - * the value of localName. - * - * @param namespaceURI ??? - * @param localName Determines which pointers to dereference. - * @param qName ??? - * - * @return @b bool The result of XmlStackedHandler's endElement() method. - */ - bool ImageFileListWidget::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName); - - if (result) { - if (localName == "group") { - if (m_currentGroup) { - m_currentGroup = NULL; - } - else { - m_currentImageList = NULL; - m_currentImageListItem = NULL; - } - } - } - - return result; - } - void ImageFileListWidget::filterFileList() { QString filterString = m_searchLineEdit->text(); diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h index 42825c3dba..2c16a27e46 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.h @@ -97,31 +97,6 @@ namespace Isis { void restoreExpandedStates(QVariant expandedStates, QTreeWidgetItem *item); QVariant saveExpandedStates(QTreeWidgetItem *item); - private: - /** - * @author 2012-09-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(ImageFileListWidget *fileList); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - ImageFileListWidget *m_fileList; //!< The widget we are working with - ImageList *m_currentImageList; //!< The list of images being worked on - QTreeWidgetItem *m_currentImageListItem; //!< The image being worked on - QTreeWidgetItem *m_currentGroup; //!< The group of cubes being worked on - }; - private: QPointer m_progress; //!< The ProgressBar of the ImageFileListWidget //! Serialized (file) version of this object diff --git a/isis/src/qisis/objs/ImageList/ImageList.cpp b/isis/src/qisis/objs/ImageList/ImageList.cpp index 59d2ccf54c..2674d66df2 100644 --- a/isis/src/qisis/objs/ImageList/ImageList.cpp +++ b/isis/src/qisis/objs/ImageList/ImageList.cpp @@ -1331,92 +1331,4 @@ namespace Isis { return results; } - - - /** - * Create an XML Handler (reader) that can populate the Image list class data. - * - * @param imageList The image list we're going to be initializing - * @param project The project that contains the image list - * - * @see ImageList::save() - */ - ImageList::XmlHandler::XmlHandler(ImageList *imageList, Project *project, QString dataRoot) { - m_imageList = imageList; - m_project = project; - m_imageDataRoot = dataRoot; - } - - - /** - * Handle an XML start element. This expects and elements (it reads both - * the project XML and the images.xml file). - * - * @return @b bool If we should continue reading the XML (usually true). - */ - bool ImageList::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "imageList") { - QString name = atts.value("name"); - QString path = atts.value("path"); - m_imageDataRoot = atts.value("dataRoot"); - - if (!name.isEmpty()) { - m_imageList->setName(name); - } - - if (!path.isEmpty()) { - m_imageList->setPath(path); - } - } - else if (localName == "image") { - m_imageList->append(new Image( - m_project->projectRoot() + "/" + m_imageDataRoot + "/" + m_imageList->path())); - } - } - - return true; - } - - - /** - * Handle an XML end element. This handles by opening and reading the images.xml - * file. - * - * @return @b bool If we should continue reading the XML (usually true). - * - * @throws IException::Io "Unable to open with read access" - * @throws IException::Io "Failed to open image list XML" - */ - bool ImageList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "imageList") { - - QDir projectPath = QDir(m_project->projectRoot()).dirName(); - QString imageListXmlPath = m_project->projectRoot() + "/" + m_imageDataRoot + "/" + - m_imageList->path() + "/images.xml"; - imageListXmlPath = QDir::cleanPath(imageListXmlPath); - - QFile file(imageListXmlPath); - - if (!file.open(QFile::ReadOnly)) { - throw IException(IException::Io, - QString("Unable to open [%1] with read access") - .arg(imageListXmlPath), - _FILEINFO_); - } - - 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 fe95e50981..f634266f32 100644 --- a/isis/src/qisis/objs/ImageList/ImageList.h +++ b/isis/src/qisis/objs/ImageList/ImageList.h @@ -12,7 +12,6 @@ #include "ImageListActionWorkOrder.h" #include "SerialNumberList.h" #include "WorkOrder.h" -#include "XmlStackedHandler.h" class QStringList; class QXmlStreamWriter; @@ -120,39 +119,6 @@ namespace Isis { void countChanged(int newCount); private: - /** - * This class is used to read an images.xml file into an image list - * - * @author 2012-07-01 Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(ImageList *imageList, Project *project, QString dataRoot=""); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - /** - * This stores a pointer to the image list that will be read into - */ - ImageList *m_imageList; - /** - * This stores a pointer to the project that the images in the image list will be a part of - */ - Project *m_project; - /** - * This is a relative path to the image data. - * e.g. project/images or project/bundle/results/TIMESTAMP/images - */ - QString m_imageDataRoot; - }; /** diff --git a/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h b/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h index fa22b54320..489a38d327 100644 --- a/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h +++ b/isis/src/qisis/objs/MatrixSceneWidget/MatrixSceneWidget.h @@ -3,8 +3,6 @@ #include -#include "XmlStackedHandler.h" - template class QList; class QGraphicsPolygonItem; class QGraphicsRectItem; diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp index d3c5c43192..38f7ce73aa 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp @@ -2099,119 +2099,4 @@ namespace Isis { MosaicSceneItem *second) { return first->zValue() > second->zValue(); } - - - MosaicSceneWidget::XmlHandler::XmlHandler(MosaicSceneWidget *scene) { - m_scene = scene; - m_scrollBarXValue = -1; - m_scrollBarYValue = -1; - m_imagesToAdd = NULL; - - m_imagesToAdd = new ImageList; - } - - - MosaicSceneWidget::XmlHandler::~XmlHandler() { - delete m_imagesToAdd; - m_imagesToAdd = NULL; - } - - - bool MosaicSceneWidget::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts); - - m_characterData = ""; - - if (result) { - if (localName == "image" && m_scene->m_directory) { - QString id = atts.value("id"); - double zValue = atts.value("zValue").toDouble(); - Image *image = m_scene->m_directory->project()->image(id); - // If Image for id doesn't exist, check shapes. If corresponds to Shape, new Image will - // need to be created. - if (!image) { - Shape *shape = m_scene->m_directory->project()->shape(id); - if (shape) { - image = new Image(shape->cube(), shape->footprint(), id); - } - } - if (image) { - m_imagesToAdd->append(image); - m_imageZValues.append(zValue); -// m_scene->cubeToMosaic(image)->setZValue(zValue); - } - } - else if (localName == "viewTransform") { - m_scrollBarXValue = atts.value("scrollBarXValue").toInt(); - m_scrollBarYValue = atts.value("scrollBarYValue").toInt(); - } - } - - return result; - } - - - bool MosaicSceneWidget::XmlHandler::characters(const QString &ch) { - bool result = XmlStackedHandler::characters(ch); - - if (result) { - m_characterData += ch; - } - - return result; - } - - - bool MosaicSceneWidget::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName); - - if (result) { - if (localName == "projection") { - std::stringstream strStream(m_characterData.toStdString()); - PvlGroup mappingGroup; - strStream >> mappingGroup; - m_scene->setProjection(mappingGroup); - } - else if (localName == "viewTransform") { - QByteArray hexValues(m_characterData.toLatin1()); - QDataStream transformStream(QByteArray::fromHex(hexValues)); - - QTransform viewTransform; - transformStream >> viewTransform; - m_scene->getView()->show(); - QCoreApplication::processEvents(); - m_scene->getView()->setTransform(viewTransform); - m_scene->getView()->horizontalScrollBar()->setValue(m_scrollBarXValue); - m_scene->getView()->verticalScrollBar()->setValue(m_scrollBarYValue); - } - else if (localName == "toolData") { - PvlObject toolSettings; - std::stringstream strStream(m_characterData.toStdString()); - strStream >> toolSettings; - - foreach (MosaicTool *tool, *m_scene->m_tools) { - if (tool->projectPvlObjectName() == toolSettings.name()) { - tool->fromPvl(toolSettings); - } - } - } - else if (localName == "images" && m_imagesToAdd->count()) { - m_scene->addImages(*m_imagesToAdd); - - for (int i = 0; i < m_imageZValues.count(); i++) { - m_scene->cubeToMosaic(m_imagesToAdd->at(i))->setZValue(m_imageZValues[i]); - m_scene->m_currentMinimumFootprintZ = qMin(m_scene->m_currentMinimumFootprintZ, - m_imageZValues[i]); - m_scene->m_currentMaximumFootprintZ = qMax(m_scene->m_currentMaximumFootprintZ, - m_imageZValues[i]); - } - } - } - - m_characterData = ""; - - return result; - } } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h index 6920d306c0..3eb848aa20 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.h @@ -323,36 +323,6 @@ namespace Isis { static bool zOrderGreaterThan(MosaicSceneItem *first, MosaicSceneItem *second); - private: - /** - * @author 2012-09-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(MosaicSceneWidget *scene); - ~XmlHandler(); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - QString m_characterData; - MosaicSceneWidget *m_scene; - - int m_scrollBarXValue; - int m_scrollBarYValue; - - ImageList *m_imagesToAdd; - QList m_imageZValues; - }; - private: Directory *m_directory; diff --git a/isis/src/qisis/objs/Project/Project.cpp b/isis/src/qisis/objs/Project/Project.cpp index 01987cfcc2..d1ef5b04b3 100644 --- a/isis/src/qisis/objs/Project/Project.cpp +++ b/isis/src/qisis/objs/Project/Project.cpp @@ -2960,13 +2960,6 @@ namespace Isis { m_idToShapeMap->remove(m_idToShapeMap->key((Shape *)imageObj)); } - - Project::XmlHandler::XmlHandler(Project *project) { - m_project = project; - m_workOrder = NULL; - } - - /** * This function returns a QMutex. This was needed to be able to deal with a threading issue with * Work Order functions returning a member variable. This is used by creating a QMutexLocker @@ -2980,135 +2973,4 @@ namespace Isis { QMutex *Project::workOrderMutex() { return m_workOrderMutex; } - - - bool Project::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - - if (localName == "project") { - QString name = atts.value("name"); - if (!name.isEmpty()) { - m_project->setName(name); - } - } - else if (localName == "controlNets") { - m_controls.append(new ControlList()); - } - else if (localName == "imageList") { - m_imageLists.append(new ImageList()); - } - else if (localName == "shapeList") { - m_shapeLists.append(new ShapeList()); - } - else if (localName == "mapTemplateList") { - m_mapTemplateLists.append( new TemplateList()); - } - else if (localName == "regTemplateList") { - m_regTemplateLists.append( new TemplateList()); - } - // workOrders are stored in history.xml, using same reader as project.xml - else if (localName == "workOrder") { - QString type = atts.value("type"); - - m_workOrder = WorkOrderFactory::create(m_project, type); - - } - // warnings stored in warning.xml, using same reader as project.xml - else if (localName == "warning") { - QString warningText = atts.value("text"); - - if (!warningText.isEmpty()) { - m_project->warn(warningText); - } - } - else if (localName == "directory") { - m_project->directory(); - } - else if (localName == "dockRestore") { -// QVariant geo_data = QVariant(atts.value("geometry")); -// restoreGeometry(geo_data); -// QVariant layout_data = QVariant(atts.value("state")); -// restoreState(layout_data); - } - - else if (localName == "bundleSolutionInfo") { - m_bundleSolutionInfos.append(new BundleSolutionInfo()); - } - else if (localName == "activeImageList") { - QString displayName = atts.value("displayName"); - m_project->setActiveImageList(displayName); - } - else if (localName == "activeControl") { - // Find Control - QString displayName = atts.value("displayName"); - m_project->setActiveControl(displayName); - } - } - - return true; - } - - - /** - * The xml parser for ending tags - * - * @internal - * @history 2016-12-02 Tracie Sucharski - Changed localName == "project" to - * localName == "imageLists", so that images and shapes - * are added to the project as soon as their end tag is found. - * Restoring activeImageList was not working since the project had - * no images until the end tag for "project" was reached. - * - */ - bool Project::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "imageLists") { - foreach (ImageList *imageList, m_imageLists) { - m_project->imagesReady(*imageList); - } - } - else if (localName == "shapeLists") { - // TODO does this go here under project or should it be under shapes? - foreach (ShapeList *shapeList, m_shapeLists) { - m_project->shapesReady(*shapeList); - } - } - else if (localName == "mapTemplateLists") { - foreach (TemplateList *templateList, m_mapTemplateLists) { - m_project->addTemplates(templateList); - } - } - else if (localName == "regTemplateLists") { - foreach (TemplateList *templateList, m_regTemplateLists) { - m_project->addTemplates(templateList); - } - } - else if (localName == "workOrder") { - m_project->m_workOrderHistory->append(m_workOrder); - m_workOrder = NULL; - } - else if (localName == "controlNets") { - foreach (ControlList *list, m_controls) { - foreach (Control *control, *list) { - m_project->addControl(control); - } - delete list; - } - m_controls.clear(); - } - else if (localName == "results") { - foreach (BundleSolutionInfo *bundleInfo, m_bundleSolutionInfos) { - m_project->addBundleSolutionInfo(bundleInfo); - - // If BundleSolutionInfo contains adjusted images, add to the project id map. - if (bundleInfo->adjustedImages().count()) { - foreach (ImageList *adjustedImageList, bundleInfo->adjustedImages()) { - m_project->addImagesToIdMap(*adjustedImageList); - } - } - } - } - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } } diff --git a/isis/src/qisis/objs/Project/Project.h b/isis/src/qisis/objs/Project/Project.h index 49da64fdd9..43e785b66e 100644 --- a/isis/src/qisis/objs/Project/Project.h +++ b/isis/src/qisis/objs/Project/Project.h @@ -30,7 +30,6 @@ class QMutex; class QProgressBar; -class QXmlAttributes; class QXmlStreamWriter; #include "ControlList.h" @@ -40,7 +39,6 @@ class QXmlStreamWriter; #include "ShapeList.h" #include "TargetBody.h" #include "TemplateList.h" -#include "XmlStackedHandler.h" namespace Isis { class BundleSolutionInfo; @@ -587,34 +585,6 @@ namespace Isis { void storeWarning(QString text); void storeWarning(QString text, const ImageList &relevantData); - private: - /** - * @author 2012-09-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Project *project); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - Project *m_project; - QList m_imageLists; - QList m_shapeLists; - QList m_controls; - QList m_bundleSolutionInfos; - QList m_mapTemplateLists; - QList m_regTemplateLists; - WorkOrder *m_workOrder; - }; - private: static const int m_maxRecentProjects = 5; diff --git a/isis/src/qisis/objs/Shape/Shape.cpp b/isis/src/qisis/objs/Shape/Shape.cpp index 6cdda45060..6add8ed45e 100644 --- a/isis/src/qisis/objs/Shape/Shape.cpp +++ b/isis/src/qisis/objs/Shape/Shape.cpp @@ -801,20 +801,6 @@ namespace Isis { m_footprint = PolygonTools::MakeMultiPolygon(poly.Polys()->clone().release()); } - - /** - * Create an XML Handler (reader) that can populate the Shape class data. See Shape::save() for - * the expected format. - * - * @param shape The shape we're going to be initializing - * @param shapeFolder The folder that contains the Cube - */ - Shape::XmlHandler::XmlHandler(Shape *shape, FileName shapeFolder) { - m_shape = shape; - m_shapeFolder = shapeFolder; - } - - /** * Output format: * @@ -910,160 +896,4 @@ namespace Isis { stream.writeEndElement(); } - - - /** - * Handle an XML start element. This expects and elements. - * - * @return If we should continue reading the XML (usually true). - */ - bool Shape::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - m_characters = ""; - - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "shape") { - QString id = atts.value("id"); - QString fileName = atts.value("fileName"); - m_shape->m_serialNumber = atts.value("serialNumber"); - - if (!id.isEmpty()) { - delete m_shape->m_id; - m_shape->m_id = NULL; - m_shape->m_id = new QUuid(id.toLatin1()); - } - - if (!fileName.isEmpty()) { - m_shape->m_fileName = m_shapeFolder.expanded() + "/" + fileName; - } - - if (m_shape->m_serialNumber.isEmpty()) { - m_shape->m_serialNumber = SerialNumber::Compose(*m_shape->cube(), true); - } - - m_shape->m_surfacePointSource = - ControlPoint::StringToSurfacePointSource(atts.value("surfacePointSource")); - m_shape->m_radiusSource = - ControlPoint::StringToRadiusSource(atts.value("radiusSource")); - QString shapeType = atts.value("shapeType"); - - if (shapeType == "Unprojected") { - m_shape->m_shapeType = Unprojected; - QString instrumentId = atts.value("instrumentId"); - QString spacecraftName = atts.value("spacecraftName"); - - QString aspectRatioStr = atts.value("aspectRatio"); - QString resolutionStr = atts.value("resolution"); - QString emissionAngleStr = atts.value("emissionAngle"); - QString incidenceAngleStr = atts.value("incidenceAngle"); - QString lineResolutionStr = atts.value("lineResolution"); - QString localRadiusStr = atts.value("localRadius"); - QString northAzimuthStr = atts.value("northAzimuth"); - QString phaseAngleStr = atts.value("phaseAngle"); - QString sampleResolutionStr = atts.value("sampleResolution"); - - if (!instrumentId.isEmpty()) { - m_shape->m_instrumentId = m_shapeFolder.expanded() + "/" + instrumentId; - } - - if (!instrumentId.isEmpty()) { - m_shape->m_instrumentId = m_shapeFolder.expanded() + "/" + instrumentId; - } - - if (!spacecraftName.isEmpty()) { - m_shape->m_spacecraftName = m_shapeFolder.expanded() + "/" + spacecraftName; - } - - if (!aspectRatioStr.isEmpty()) { - m_shape->m_aspectRatio = aspectRatioStr.toDouble(); - } - - if (!resolutionStr.isEmpty()) { - m_shape->m_resolution = resolutionStr.toDouble(); - } - - if (!emissionAngleStr.isEmpty()) { - m_shape->m_emissionAngle = Angle(emissionAngleStr.toDouble(), Angle::Radians); - } - - if (!incidenceAngleStr.isEmpty()) { - m_shape->m_incidenceAngle = Angle(incidenceAngleStr.toDouble(), Angle::Radians); - } - - if (!lineResolutionStr.isEmpty()) { - m_shape->m_lineResolution = lineResolutionStr.toDouble(); - } - - if (!localRadiusStr.isEmpty()) { - m_shape->m_localRadius = Distance(localRadiusStr.toDouble(), Distance::Meters); - } - - if (!northAzimuthStr.isEmpty()) { - m_shape->m_northAzimuth = Angle(northAzimuthStr.toDouble(), Angle::Radians); - } - - if (!phaseAngleStr.isEmpty()) { - m_shape->m_phaseAngle = Angle(phaseAngleStr.toDouble(), Angle::Radians); - } - - if (!sampleResolutionStr.isEmpty()) { - m_shape->m_sampleResolution = sampleResolutionStr.toDouble(); - } - } - else if (shapeType == "Basemap") { - m_shape->m_shapeType = Basemap; - } - else if (shapeType == "Dem") { - m_shape->m_shapeType = Dem; - } - else { - m_shape->m_shapeType = Unknown; - } - - - } - else if (localName == "displayProperties") { - m_shape->m_displayProperties = new ShapeDisplayProperties(""); - } - } - - return true; - } - - - - bool Shape::XmlHandler::characters(const QString &ch) { - m_characters += ch; - - return XmlStackedHandler::characters(ch); - } - - - - bool Shape::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "footprint" && !m_characters.isEmpty()) { - geos::io::WKTReader wktReader(*globalFactory); - try { - m_shape->m_footprint = PolygonTools::MakeMultiPolygon( - wktReader.read(m_characters.toStdString()).release()); - } - catch (IException &e) { - e.print(); - } - } - else if (localName == "shape" && !m_shape->m_footprint) { - try { - QMutex mutex; - m_shape->initFootprint(&mutex); - m_shape->closeCube(); - } - catch (IException &e) { - e.print(); - } - } - - m_characters = ""; - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } } diff --git a/isis/src/qisis/objs/Shape/Shape.h b/isis/src/qisis/objs/Shape/Shape.h index d58abe1e3d..43e2df83be 100644 --- a/isis/src/qisis/objs/Shape/Shape.h +++ b/isis/src/qisis/objs/Shape/Shape.h @@ -19,7 +19,6 @@ find files of those names at the top level of this repository. **/ #include "FileName.h" #include "Latitude.h" #include "Longitude.h" -#include "XmlStackedHandler.h" #include #include @@ -127,30 +126,6 @@ namespace Isis { geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex); void initQuickFootprint(); - /** - * - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Shape *shape, FileName shapeFolder); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool characters(const QString &ch); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - Shape *m_shape; - FileName m_shapeFolder; - QString m_characters; - }; - private: SpiceInt *m_bodyCode; /**< The NaifBodyCode value, if it exists in the labels. Otherwise, if the target is sky, diff --git a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp index 237b864d70..eae5d9fcdc 100644 --- a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp +++ b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.cpp @@ -173,87 +173,6 @@ namespace Isis { } - /** - * @brief Constructor for the XmlHandler class. - * - * This is a child class of XmlStackedHandler, - * which is used by XmlStackedHandlerReader to parse an XML file. - * @param displayProperties Pointer to a ShapeDisplayProperties object. - */ - ShapeDisplayProperties::XmlHandler::XmlHandler(ShapeDisplayProperties *displayProperties) { - m_displayProperties = displayProperties; - } - - - /** - * @brief This overrides the parent startElement function in XmlStackedHandler so the parser can - * handle an XML file containing ShapeDisplayProperties information. - * @param namespaceURI The Uniform Resource Identifier of the element's namespace - * @param localName The local name string - * @param qName The XML qualified string (or empty, if QNames are not available). - * @param atts The XML attributes attached to each element - * @return @b bool Returns True signalling to the reader the start of a valid XML element. If - * False is returned, something bad happened. - */ - bool ShapeDisplayProperties::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "displayProperties") { - QString displayName = atts.value("displayName"); - - if (!displayName.isEmpty()) { - m_displayProperties->setDisplayName(displayName); - } - } - } - - return true; - } - - - /** - * @brief This is called when the XML processor has parsed a chunk of character data. - * - * This implementation of a virtual function calls - * QXmlDefaultHandler::characters(QString &ch) - * which in turn calls QXmlContentHandler::characters(QString &ch) which - * is called when the XML processor has parsed a chunk of character data. - * @see XmlStackedHandler, QXmlDefaultHandler,QXmlContentHandler - * @param ch The character data. - * @return @b bool Returns True if there were no problems with the character processing. - * It returns False if there was a problem, and the XML reader stops. - */ - bool ShapeDisplayProperties::XmlHandler::characters(const QString &ch) { - m_hexData += ch; - - return XmlStackedHandler::characters(ch); - } - - - - /** - * @brief The XML reader invokes this method at the end of every element in the - * XML document. - * @param namespaceURI The Uniform Resource Identifier of the namespace (eg. "xmlns") - * @param localName The local name string (eg. "xhtml") - * @param qName The XML qualified string (eg. "xmlns:xhtml"). This can be empty if - * QNames are not available. - * @return @b bool If this function returns True, then a signal is sent to the reader indicating - * the end of the element. If this function returns False, something bad - * happened and processing stops. - */ - bool ShapeDisplayProperties::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - if (localName == "displayProperties") { - QByteArray hexValues(m_hexData.toLatin1()); - QDataStream valuesStream(QByteArray::fromHex(hexValues)); - valuesStream >> *m_displayProperties->m_propertyValues; - } - - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - /** * @brief This is the generic mutator for properties. diff --git a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h index 5db218843d..378c90c1df 100644 --- a/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h +++ b/isis/src/qisis/objs/ShapeDisplayProperties/ShapeDisplayProperties.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include "DisplayProperties.h" -#include "XmlStackedHandler.h" class QAction; class QXmlStreamWriter; @@ -101,34 +100,6 @@ namespace Isis { private slots: void toggleShowLabel(); - private: - /** - * @brief This class is used for processing an XML file containing information - * about a WorkOrder. - * - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(ShapeDisplayProperties *displayProperties); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - virtual bool characters(const QString &ch); - - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - ShapeDisplayProperties *m_displayProperties; - QString m_hexData; - }; - private: ShapeDisplayProperties(const ShapeDisplayProperties &); ShapeDisplayProperties &operator=(const ShapeDisplayProperties &); diff --git a/isis/src/qisis/objs/ShapeList/ShapeList.cpp b/isis/src/qisis/objs/ShapeList/ShapeList.cpp index 233b093e4a..d150f1f3c4 100644 --- a/isis/src/qisis/objs/ShapeList/ShapeList.cpp +++ b/isis/src/qisis/objs/ShapeList/ShapeList.cpp @@ -728,86 +728,4 @@ namespace Isis { m_newProjectRoot = rhs.m_newProjectRoot; return *this; } - - - /** - * Create an XML Handler (reader) that can populate the Shape list class data. - * - * @param shapeList The shape list we're going to be initializing - * @param project The project that contains the shape list - * - * @see ShapeList::save() - */ - ShapeList::XmlHandler::XmlHandler(ShapeList *shapeList, Project *project) { - m_shapeList = shapeList; - m_project = project; - } - - - /** - * Handle an XML start element. This expects and elements (it reads both - * the project XML and the shapes.xml file). - * - * @return @b bool If we should continue reading the XML (usually true). - */ - bool ShapeList::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "shapeList") { - QString name = atts.value("name"); - QString path = atts.value("path"); - - if (!name.isEmpty()) { - m_shapeList->setName(name); - } - - if (!path.isEmpty()) { - m_shapeList->setPath(path); - } - } - else if (localName == "shape") { - m_shapeList->append(new Shape(m_project->shapeDataRoot() + "/" + m_shapeList->path())); - } - } - - return true; - } - - - /** - * Handle an XML end element. This handles by opening and reading the shapes.xml - * file. - * - * @return @b bool If we should continue reading the XML (usually true). - * - * @throws IException::Io "Unable to open with read access" - * @throws IException::Io "Failed to open shape list XML" - */ - bool ShapeList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, - const QString &qName) { - if (localName == "shapeList") { - - QString shapeListXmlPath = m_project->shapeDataRoot() + "/" + m_shapeList->path() + - "/shapes.xml"; - QFile file(shapeListXmlPath); - - if (!file.open(QFile::ReadOnly)) { - throw IException(IException::Io, - QString("Unable to open [%1] with read access") - .arg(shapeListXmlPath), - _FILEINFO_); - } - - 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 ef76f29349..3a15d7ba4c 100644 --- a/isis/src/qisis/objs/ShapeList/ShapeList.h +++ b/isis/src/qisis/objs/ShapeList/ShapeList.h @@ -10,7 +10,6 @@ #include "ShapeDisplayProperties.h" #include "SerialNumberList.h" #include "WorkOrder.h" -#include "XmlStackedHandler.h" class QStringList; class QXmlStreamWriter; @@ -92,35 +91,6 @@ namespace Isis { void countChanged(int newCount); private: - /** - * This class is used to read an shapes.xml file into an shape list - * - * @author 2012-07-01 Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(ShapeList *shapeList, Project *project); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - /** - * This stores a pointer to the shape list that will be read into - */ - ShapeList *m_shapeList; - /** - * This stores a pointer to the project that the shapes in the shape list will be a part of - */ - Project *m_project; - }; - /** * This functor is used for copying the shapes between two projects quickly. This is designed diff --git a/isis/src/qisis/objs/TargetBody/TargetBody.cpp b/isis/src/qisis/objs/TargetBody/TargetBody.cpp index d4f4e4bf2c..a7cb8beeb2 100644 --- a/isis/src/qisis/objs/TargetBody/TargetBody.cpp +++ b/isis/src/qisis/objs/TargetBody/TargetBody.cpp @@ -464,104 +464,6 @@ TargetBody::TargetBody(Target *target, QObject *parent) : QObject(parent) { - /** - * Create an XML Handler (reader) that can populate the BundleSettings class data. See - * BundleSettings::save() for the expected format. - * - * @param bundleSettings The image we're going to be initializing - * @param imageFolder The folder that contains the Cube - */ -// TargetBody::XmlHandler::XmlHandler(TargetBody *TargetBody, Project *project) { -// m_xmlHandlerTargetBody = TargetBody; -// m_xmlHandlerProject = NULL; -// m_xmlHandlerProject = project; -// m_xmlHandlerCharacters = ""; -// } - - - -// TargetBody::XmlHandler::~XmlHandler() { - // TargetBody passed in is "this" delete+null will cause problems,no? -// delete m_xmlHandlerTargetBody; -// m_xmlHandlerTargetBody = NULL; - - // we do not delete this pointer since it was set to a passed in pointer in constructor and we - // don't own it... is that right??? -// delete m_xmlHandlerProject; -// m_xmlHandlerProject = NULL; -// } - - - - /** - * Handle an XML start element. This expects and elements. - * - * @return If we should continue reading the XML (usually true). - */ -// bool TargetBody::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, -// const QString &qName, const QXmlAttributes &atts) { -// m_xmlHandlerCharacters = ""; -// -// if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { -// -// if (localName == "targetBody") { -// m_xmlHandlerTargetBody = -// BundleSettingsQsp(new TargetBody(m_xmlHandlerProject, reader())); -// } -// else if (localName == "bundleResults") { -// delete m_xmlHandlerBundleResults; -// m_xmlHandlerBundleResults = NULL; -// m_xmlHandlerBundleResults = new BundleResults(m_xmlHandlerProject, reader()); -//TODO: need to add constructor for this??? -// } -// else if (localName == "imageList") { -// m_xmlHandlerImages->append(new ImageList(m_xmlHandlerProject, reader())); -// } -// } -// return true; -// } - - - -// bool TargetBody::XmlHandler::characters(const QString &ch) { -// m_xmlHandlerCharacters += ch; -// return XmlStackedHandler::characters(ch); -// } - - - -// bool TargetBody::XmlHandler::endElement(const QString &namespaceURI, const QString &localName, -// const QString &qName) { -// if (localName == "id") { -// m_xmlHandlerTargetBody->m_id = NULL; -// m_xmlHandlerTargetBody->m_id = new QUuid(m_xmlHandlerCharacters); -// } -// else if (localName == "runTime") { -// m_xmlHandlerTargetBody->m_runTime = m_xmlHandlerCharacters; -// } -// else if (localName == "fileName") { -// m_xmlHandlerTargetBody->m_controlNetworkFileName = NULL; -// m_xmlHandlerTargetBody->m_controlNetworkFileName = new FileName(m_xmlHandlerCharacters); -// } -// else if (localName == "bundleSettings") { -// m_xmlHandlerTargetBody->m_settings = -// BundleSettingsQsp(new BundleSettings(*m_xmlHandlerBundleSettings)); -// } -// else if (localName == "bundleResults") { -// m_xmlHandlerTargetBody->m_statisticsResults = new BundleResults(*m_xmlHandlerBundleResults); -// } -// if (localName == "imageLists") { -// for (int i = 0; i < m_xmlHandlerImages->size(); i++) { -// m_xmlHandlerTargetBody->m_images->append(m_xmlHandlerImages->at(i)); -// } -// m_xmlHandlerImages->clear(); -// } -// m_xmlHandlerCharacters = ""; -// return XmlStackedHandler::endElement(namespaceURI, localName, qName); -// } - - - /** * @brief Get a unique, identifying string associated with this TargetBody object. * diff --git a/isis/src/qisis/objs/TargetBody/TargetBody.h b/isis/src/qisis/objs/TargetBody/TargetBody.h index b4e33199ba..e69ea23814 100644 --- a/isis/src/qisis/objs/TargetBody/TargetBody.h +++ b/isis/src/qisis/objs/TargetBody/TargetBody.h @@ -24,7 +24,6 @@ find files of those names at the top level of this repository. **/ //#include "BundleTargetBody.h" #include "Distance.h" #include "Target.h" -#include "XmlStackedHandler.h" class QDataStream; @@ -112,33 +111,6 @@ namespace Isis { // QDataStream &write(QDataStream &stream) const; // QDataStream &read(QDataStream &stream); - private: - /** - * - * @author 2015-06-08 Ken Edmundson - * - * @internal - */ -// class XmlHandler : public XmlStackedHandler { -// public: -// XmlHandler(TargetBody *TargetBody, Project *project); -// TODO: does xml stuff need project??? -// ~XmlHandler(); -// -// virtual bool startElement(const QString &namespaceURI, const QString &localName, -// const QString &qName, const QXmlAttributes &atts); -// virtual bool characters(const QString &ch); -// virtual bool endElement(const QString &namespaceURI, const QString &localName, -// const QString &qName); -// -// private: -// Q_DISABLE_COPY(XmlHandler); -// -// TargetBody *m_xmlHandlerTargetBody; -// Project *m_xmlHandlerProject; // TODO: does xml stuff need project??? -// QString m_xmlHandlerCharacters; -// }; - private: TargetBody(const TargetBody &other); // NOTE: copy constructor & assignment operators TargetBody &operator=(const TargetBody &rhs); // are private so compiler will generate error diff --git a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp index a236203582..5c15c843fe 100644 --- a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp +++ b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.cpp @@ -204,86 +204,6 @@ namespace Isis { } - /** - * @brief Constructor for the XmlHandler class. - * - * This is a child class of XmlStackedHandler, - * which is used by XmlStackedHandlerReader to parse an XML file. - * @param displayProperties Pointer to a TargetBodyDisplayProperties object. - */ - TargetBodyDisplayProperties::XmlHandler::XmlHandler(TargetBodyDisplayProperties *displayProperties) { - m_displayProperties = displayProperties; - } - - - /** - * @brief This overrides the parent startElement function in XmlStackedHandler so the parser can - * handle an XML file containing TargetBodyDisplayProperties information. - * @param namespaceURI The Uniform Resource Identifier of the element's namespace - * @param localName The local name string - * @param qName The XML qualified string (or empty, if QNames are not available). - * @param atts The XML attributes attached to each element - * @return @b bool Returns True signalling to the reader the start of a valid XML element. If - * False is returned, something bad happened. - */ - bool TargetBodyDisplayProperties::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "displayProperties") { - QString displayName = atts.value("displayName"); - - if (!displayName.isEmpty()) { - m_displayProperties->setDisplayName(displayName); - } - } - } - - return true; - } - - - /** - * @brief This implementation of a virtual function calls - * QXmlDefaultHandler::characters(QString &ch) - * which in turn calls QXmlContentHandler::characters(QString &ch) which - * is called when the XML processor has parsed a chunk of character data. - * @see XmlStackedHandler, QXmlDefaultHandler,QXmlContentHandler - * @param ch The character data. - * @return @b bool Returns True if there were no problems with the character processing. - * It returns False if there was a problem, and the XML reader stops. - */ - bool TargetBodyDisplayProperties::XmlHandler::characters(const QString &ch) { - m_hexData += ch; - - return XmlStackedHandler::characters(ch); - } - - - - /** - * @brief The XML reader invokes this method at the end of every element in the - * XML document. - * @param namespaceURI The Uniform Resource Identifier of the namespace (eg. "xmlns") - * @param localName The local name string (eg. "xhtml") - * @param qName The XML qualified string (eg. "xmlns:xhtml"). This can be empty if - * QNames are not available. - * @return @b bool If this function returns True, then a signal is sent to the reader indicating - * the end of the element. If this function returns False, something bad - * happened and processing stops. - */ - bool TargetBodyDisplayProperties::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) { - if (localName == "displayProperties") { - QByteArray hexValues(m_hexData.toLatin1()); - QDataStream valuesStream(QByteArray::fromHex(hexValues)); - valuesStream >> *m_displayProperties->m_propertyValues; - } - - return XmlStackedHandler::endElement(namespaceURI, localName, qName); - } - - - /** * @brief This is the generic mutator for properties. * diff --git a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h index 0e8bc5ea40..ffc05a5667 100644 --- a/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h +++ b/isis/src/qisis/objs/TargetBodyDisplayProperties/TargetBodyDisplayProperties.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include "DisplayProperties.h" -#include "XmlStackedHandler.h" class QAction; class QXmlStreamWriter; @@ -104,33 +103,6 @@ namespace Isis { private slots: void toggleShowLabel(); - private: - /** - * @brief Process an XML file containing information about a WorkOrder. - * - * @author 2012-??-?? Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(TargetBodyDisplayProperties *displayProperties); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - virtual bool characters(const QString &ch); - - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - TargetBodyDisplayProperties *m_displayProperties; - QString m_hexData; - }; - private: TargetBodyDisplayProperties(const TargetBodyDisplayProperties &); TargetBodyDisplayProperties &operator=(const TargetBodyDisplayProperties &); diff --git a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp index 9b0cce8336..ff700f37e1 100644 --- a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp +++ b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.cpp @@ -836,99 +836,4 @@ namespace Isis { // return results; // } - - - /** - * Create an XML Handler (reader) that can populate the TargetBodyList class data. See - * TargetBodyList::save() for the expected format. - * - * @param TargetBodyList The target body list we're going to be initializing - * @param project The project that contains the target body list - */ - TargetBodyList::XmlHandler::XmlHandler(TargetBodyList *TargetBodyList, Project *project) { - m_TargetBodyList = TargetBodyList; - m_project = project; - } - - - /** - * Handle an XML start element. This expects and elements - * (it reads both the project XML and the targets.xml file). - * - * @param namespaceURI ??? - * @param localName The name of the element the XmlReader is at - * @param qName ??? - * @param atts The attributes of the element the XmlReader is at - * - * @return @b bool If we should continue reading the XML (usually true). - */ - bool TargetBodyList::XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "TargetBodyList") { - QString name = atts.value("name"); - QString path = atts.value("path"); - - if (!name.isEmpty()) { - m_TargetBodyList->setName(name); - } - - if (!path.isEmpty()) { - m_TargetBodyList->setPath(path); - } - } - else if (localName == "target") { -// m_TargetBodyList->append(TargetBodyQsp(new TargetBody(m_project->targetBodyRoot() -// + "/" + m_TargetBodyList->path(), -// reader()))); - } - } - - return true; - } - - - /** - * Handle an XML end element. This handles by opening and reading the - * images.xml file. - * - * @param namespaceURI ??? - * @param localName The name of the element the XmlReader is at - * @param qName ??? - * - * @return @b bool If we should continue reading the XML (usually true). - * - * @throws IException::Io "Unable to open with read access" - * @throws IException::Io "Failed to open target body list XML" - */ - bool TargetBodyList::XmlHandler::endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName) { - if (localName == "TargetBodyList") { - - QString TargetBodyListXmlPath = m_project->targetBodyRoot() + "/" + - m_TargetBodyList->path() + "/targets.xml"; - QFile file(TargetBodyListXmlPath); - - if (!file.open(QFile::ReadOnly)) { - throw IException(IException::Io, - QString("Unable to open [%1] with read access") - .arg(TargetBodyListXmlPath), - _FILEINFO_); - } - - 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 d79bac8db6..e0207dadde 100644 --- a/isis/src/qisis/objs/TargetBodyList/TargetBodyList.h +++ b/isis/src/qisis/objs/TargetBodyList/TargetBodyList.h @@ -10,7 +10,6 @@ #include "TargetBodyDisplayProperties.h" //#include "TargetBodyListActionWorkOrder.h" TODO - will we need this? #include "WorkOrder.h" -#include "XmlStackedHandler.h" class QStringList; class QXmlStreamWriter; @@ -96,29 +95,6 @@ namespace Isis { void countChanged(int newCount); private: - /** - * XmlReader for working with TargetBody XML files - * - * @author 2012-07-01 Steven Lambright - * - * @internal - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(TargetBodyList *TargetBodyList, Project *project); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - virtual bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - - private: - Q_DISABLE_COPY(XmlHandler); - - TargetBodyList *m_TargetBodyList; //!< The TargetBodyList to read into/save from - Project *m_project; //!< The project that contains the TargetBodies - }; - /** * This functor is used for copying the TargetBody objects between two projects quickly. This diff --git a/isis/src/qisis/objs/Template/Template.cpp b/isis/src/qisis/objs/Template/Template.cpp index 367b2d4226..fc117f738f 100755 --- a/isis/src/qisis/objs/Template/Template.cpp +++ b/isis/src/qisis/objs/Template/Template.cpp @@ -98,57 +98,4 @@ namespace Isis{ stream.writeEndElement(); } - - - /** - * Constructor for the Template object's XmlHandler - * - * @param currentTemplate A pointer to the Template object. - * @param templateFolder The name of the folder for the Template xml - * - */ - Template::XmlHandler::XmlHandler(Template *currentTemplate, FileName templateFolder) { - m_xmlHandlerTemplate = currentTemplate; - m_xmlHandlerTemplateFolderName = templateFolder; - } - - - /** - * Method to read the given XML formatted attribute for a Template object - * into the XmlHandler. - * - * @param namespaceURI ??? - * @param localName The keyword name given to the member variable in the XML. - * @param qName ??? - * @param atts The attribute containing the keyword value for the given - * localName. - * - * @return @b bool Indicates whether the localName is recognized. - */ - bool Template::XmlHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts) { - if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) { - if (localName == "template") { - QString fileName = atts.value("fileName"); - QString templateType = atts.value("templateType"); - QString importName = atts.value("importName"); - - if (!fileName.isEmpty()) { - m_xmlHandlerTemplate->m_fileName = m_xmlHandlerTemplateFolderName.expanded() - + "/" + templateType - + "/" + importName - + "/" + fileName; - } - - if (!templateType.isEmpty()) { - m_xmlHandlerTemplate->m_templateType = templateType; - } - - if (!importName.isEmpty()) { - m_xmlHandlerTemplate->m_importName = importName; - } - } - } - return true; - } } diff --git a/isis/src/qisis/objs/Template/Template.h b/isis/src/qisis/objs/Template/Template.h index a6fa7fe714..8ac490e177 100755 --- a/isis/src/qisis/objs/Template/Template.h +++ b/isis/src/qisis/objs/Template/Template.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include "FileName.h" - #include "XmlStackedHandler.h" namespace Isis { class FileName; @@ -44,30 +43,6 @@ find files of those names at the top level of this repository. **/ public slots: void updateFileName(Project * project); - private: - /** - * @author ????-??-?? Steven Lambright - * - * @internal - * @history ????-??-?? Steven Lambright - Nested class used to write the Template object - * information to an XML file for the purpose of saving and - * restoring the state of the project. - */ - class XmlHandler : public XmlStackedHandler { - public: - XmlHandler(Template *currentTemplate, FileName templateFolder); - - virtual bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - - private: - Q_DISABLE_COPY(XmlHandler); - - Template *m_xmlHandlerTemplate; /**< A pointer to the Template object to be read or - written.*/ - FileName m_xmlHandlerTemplateFolderName; /**< The name of the folder for the template xml.*/ - }; - private: QString m_fileName; // File name of the template associated with this object QString m_templateType; // Type of template (maps/registrations) diff --git a/isis/src/qisis/objs/TemplateList/TemplateList.cpp b/isis/src/qisis/objs/TemplateList/TemplateList.cpp index df3a389e21..1b5fe74f44 100755 --- a/isis/src/qisis/objs/TemplateList/TemplateList.cpp +++ b/isis/src/qisis/objs/TemplateList/TemplateList.cpp @@ -222,102 +222,4 @@ namespace Isis { stream.writeEndElement(); } - - - /** - * Create an XML Handler (reader/writer) that can populate the TemplateList class data. See - * TemplateList::save() for the expected format. - * - * @param templateList The template list we're going to be initializing - * @param project The project that contains the TemplateList - */ - TemplateList::XmlHandler::XmlHandler(TemplateList *templateList, Project *project) { - m_templateList = templateList; - m_project = project; - } - - - /** - * Handle an XML start element. This expects and