Skip to content

Commit

Permalink
removed XmlStackedHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
amystamile-usgs committed Jan 10, 2024
1 parent 012aa51 commit e5d501f
Show file tree
Hide file tree
Showing 83 changed files with 9 additions and 4,974 deletions.
1 change: 1 addition & 0 deletions isis/src/base/apps/mosrange/mosrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ find files of those names at the top level of this repository. **/

#include <QPair>
#include <QList>
#include <QFile>

#include "Camera.h"
#include "Cube.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 0 additions & 20 deletions isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ find files of those names at the top level of this repository. **/
#include <QObject>
#include <QVector>

#include "XmlStackedHandler.h"

class QDataStream;
class QUuid;
class QXmlStreamWriter;
Expand Down Expand Up @@ -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.*/
Expand Down
1 change: 1 addition & 0 deletions isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ find files of those names at the top level of this repository. **/
#include <QDataStream>
#include <QDebug>
#include <QXmlStreamWriter>
#include <QFile>

#include <iostream>

Expand Down
93 changes: 0 additions & 93 deletions isis/src/base/objs/Statistics/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
30 changes: 1 addition & 29 deletions isis/src/base/objs/Statistics/Statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions isis/src/base/objs/Statistics/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ find files of those names at the top level of this repository. **/
#include <QDebug>
#include <QDataStream>
#include <QXmlStreamWriter>
#include <QFile>

#include <iostream>

Expand Down
7 changes: 0 additions & 7 deletions isis/src/base/objs/XmlStackedHandler/Makefile

This file was deleted.

85 changes: 0 additions & 85 deletions isis/src/base/objs/XmlStackedHandler/XmlStackedHandler.cpp

This file was deleted.

Loading

0 comments on commit e5d501f

Please sign in to comment.