Isis 3.0
Back | Home
BundleSolutionInfo.h
Go to the documentation of this file.
1 #ifndef BundleSolutionInfo_h
2 #define BundleSolutionInfo_h
3 
27 #include <QList>
28 #include <QObject>
29 #include <QString>
30 
31 #include "BundleSettings.h"
32 
33 #include "XmlStackedHandler.h"
34 
35 class QDataStream;
36 class QUuid;
37 class QXmlStreamWriter;
38 
39 namespace Isis {
40  class BundleResults;
41  class FileName;
42  class ImageList;
43  class Project; //TODO does xml stuff need project???
44  class PvlObject;
46 
98  class BundleSolutionInfo : public QObject {
99  Q_OBJECT
100  public:
103  BundleResults outputStatistics,
104  QObject *parent = 0);
105  BundleSolutionInfo(Project *project,
106  XmlStackedHandlerReader *xmlReader,
107  QObject *parent = 0); //TODO does xml stuff need project???
108  BundleSolutionInfo(FileName bundleSolutionInfoFile);
112 
113  void setOutputStatistics(BundleResults statisticsResults);
114  void setRunTime(QString runTime);
115 
116  QString id() const;
117  QString controlNetworkFileName() const;
120  QString runTime() const;
121 
122 
123  bool outputImagesCSVHeader(std::ofstream &fpOut);
124  bool outputHeader(std::ofstream &fpOut);
125  bool outputText();
126  bool outputImagesCSV();
127  bool outputPointsCSV();
128  bool outputResiduals();
129 
130  PvlObject pvlObject(QString resultsName = "BundleSolutionInfo",
131  QString settingsName = "InputSettings",
132  QString statisticsName = "StatisticsResults");
133 
134  //TODO does xml stuff need project and newRoot???
135  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
136 
137  //TODO does xml stuff need project???
138  void save(QXmlStreamWriter &stream, const Project *project) const;
139 
140  QDataStream &write(QDataStream &stream) const;
141  QDataStream &read(QDataStream &stream);
142 
143  void writeH5File(FileName outputFileName) const;
144  void readH5File(FileName outputFileName) const;
145 
146  void createH5File(FileName outputFileName) const;
147  void openH5File(FileName outputFileName);
148 // BundleSolutionInfo(FileName bundleSolutionInfoFile);
149 
150  public slots:
151  void updateFileName(Project *);
152 
153  private:
164  class XmlHandler : public XmlStackedHandler {
165  public:
166  //TODO does xml stuff need project???
167  XmlHandler(BundleSolutionInfo *bundleSolutionInfo, Project *project);
168  ~XmlHandler();
169 
170  virtual bool startElement(const QString &namespaceURI, const QString &localName,
171  const QString &qName, const QXmlAttributes &atts);
172  virtual bool characters(const QString &ch);
173  virtual bool endElement(const QString &namespaceURI, const QString &localName,
174  const QString &qName);
175 
176  private:
177  Q_DISABLE_COPY(XmlHandler);
178 
179  BundleSolutionInfo *m_xmlHandlerBundleSolutionInfo;
180  Project *m_xmlHandlerProject; //TODO does xml stuff need project???
181  QString m_xmlHandlerCharacters;
182  QList<ImageList *> *m_xmlHandlerImages;
183  BundleSettingsQsp m_xmlHandlerBundleSettings;
184  BundleResults *m_xmlHandlerBundleResults;
185  };
186 
187  private:
189 
192  QUuid *m_id;
193  QString m_runTime;
194  FileName *m_controlNetworkFileName;
195  BundleSettingsQsp m_settings;
196  BundleResults *m_statisticsResults;
197  QList<ImageList *> *m_images;
198  }; // end BundleSolutionInfo class
199 
200  // operators to read/write BundleSolutionInfo to/from binary data
201  QDataStream &operator<<(QDataStream &stream, const BundleSolutionInfo &bundleSolutionInfo);
202  QDataStream &operator>>(QDataStream &stream, BundleSolutionInfo &bundleSolutionInfo);
203 
204  void setStringAttribute(int locationId, QString locationName,
205  QString attributeName, QString attributeValue);
206  QString getStringAttribute(int locationId, QString locationName, QString attributeName);
207 }; // end namespace Isis
208 
210 
211 #endif // BundleSolutionInfo_h
void setRunTime(QString runTime)
Sets the run time.
Definition: BundleSolutionInfo.cpp:461
void updateFileName(Project *)
Change the on-disk file name for the control network used to be where the control network ought to be...
Definition: BundleSolutionInfo.cpp:302
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:44
bool outputText()
Outputs a text file with the results of the BundleAdjust.
Definition: BundleSolutionInfo.cpp:1287
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
Definition: BundleSettings.h:404
The main project for cnetsuite.
Definition: Project.h:105
File name manipulation and expansion.
Definition: FileName.h:111
Container class for BundleAdjustment results.
Definition: BundleSolutionInfo.h:98
BundleSettingsQsp bundleSettings()
Returns the bundle settings.
Definition: BundleSolutionInfo.cpp:500
void readH5File(FileName outputFileName) const
bool outputHeader(std::ofstream &fpOut)
Output header for bundle results file.
Definition: BundleSolutionInfo.cpp:691
QString id() const
Get a unique, identifying string associated with this BundleSolutionInfo object.
Definition: BundleSolutionInfo.cpp:451
void writeH5File(FileName outputFileName) const
QString getStringAttribute(int locationId, QString locationName, QString attributeName)
QString runTime() const
Returns the run time.
Definition: BundleSolutionInfo.cpp:480
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
BundleSolutionInfo & operator=(const BundleSolutionInfo &src)
Creates an equal operator for BundleSolutionInfos.
Definition: BundleSolutionInfo.cpp:146
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
bool outputImagesCSV()
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observa...
Definition: BundleSolutionInfo.cpp:1199
void setStringAttribute(int locationId, QString locationName, QString attributeName, QString attributeValue)
void setOutputStatistics(BundleResults statisticsResults)
Sets the stat results.
Definition: BundleSolutionInfo.cpp:179
bool outputImagesCSVHeader(std::ofstream &fpOut)
Outputs the header for the bundleout_images.csv file.
Definition: BundleSolutionInfo.cpp:538
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Saves the BundleSolutionInfo to the project.
Definition: BundleSolutionInfo.cpp:226
void createH5File(FileName outputFileName) const
Creates a new file using H5F_ACC_EXCL.
Definition: BundleSolutionInfo.cpp:1900
PvlObject pvlObject(QString resultsName="BundleSolutionInfo", QString settingsName="InputSettings", QString statisticsName="StatisticsResults")
Writes the results from BundleAdjust to a Pvl.
Definition: BundleSolutionInfo.cpp:194
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:463
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:47
QDataStream & read(QDataStream &stream)
Reads the data from the stream.
Definition: BundleSolutionInfo.cpp:1688
QString controlNetworkFileName() const
Returns the name of the control network.
Definition: BundleSolutionInfo.cpp:490
bool outputResiduals()
Outputs image coordinate residuals to a csv file.
Definition: BundleSolutionInfo.cpp:1580
~BundleSolutionInfo()
Destructor.
Definition: BundleSolutionInfo.cpp:124
BundleResults bundleResults()
Returns the bundle results.
Definition: BundleSolutionInfo.cpp:512
Definition: BoxcarCachingAlgorithm.h:29
A container class for statistical results from a BundleAdjust solution.
Definition: BundleResults.h:90
void openH5File(FileName outputFileName)
Reads the settings and results from another BundleSolutionInfo.
Definition: BundleSolutionInfo.cpp:1764
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:308
QDataStream & write(QDataStream &stream) const
Writes the data to the stream.
Definition: BundleSolutionInfo.cpp:1669
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
his enables stack-based XML parsing of XML files.
Definition: XmlStackedHandlerReader.h:26
bool outputPointsCSV()
Outputs point data to a csv file.
Definition: BundleSolutionInfo.cpp:1466

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:15:21