Isis 3 Programmer Reference
BundleSolutionInfo.h
1#ifndef BundleSolutionInfo_h
2#define BundleSolutionInfo_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QList>
13#include <QObject>
14#include <QString>
15
16#include "BundleObservation.h"
17#include "BundleSettings.h"
18#include "LidarData.h"
19#include "SurfacePoint.h"
20
21#include "XmlStackedHandler.h"
22
23class QDataStream;
24class QUuid;
25class QXmlStreamWriter;
26
27namespace Isis {
28 class BundleResults;
29 class Control;
30 class FileName;
31 class ImageList;
32 class Project; //TODO does xml stuff need project???
33 class PvlObject;
35
163 Q_OBJECT
164 public:
166 FileName controlNetworkFileName,
167 BundleResults outputStatistics,
168 QList<ImageList *> imgList,
169 QObject *parent = 0);
171 FileName controlNetworkFileName,
172 FileName lidarDataFileName,
173 BundleResults outputStatistics,
174 QList<ImageList *> imgList,
175 QObject *parent = 0);
177 XmlStackedHandlerReader *xmlReader,
178 QObject *parent = 0); //TODO does xml stuff need project???
179 BundleSolutionInfo() = default;
180
182
184 QString savedImagesFilename();
185 QString savedPointsFilename();
186 QString savedResidualsFilename();
187
188 void addAdjustedImages(ImageList *images);
189 void setOutputStatistics(BundleResults statisticsResults);
190 void setOutputControl(Control *outputControl);
191 void setOutputControlName(QString name);
192 void setRunTime(QString runTime);
193 void setName(QString name);
194
195 QList<ImageList *> adjustedImages() const;
196 QString id() const;
197 QString inputControlNetFileName() const;
198 QString outputControlNetFileName() const;
199 Control *control() const;
200 QString outputControlName() const;
201 QString inputLidarDataFileName() const;
204 QList<ImageList *> imageList();
205 QString runTime() const;
206 QString name() const;
207
208
209 bool outputImagesCSVHeader(std::ofstream &fpOut, BundleObservationQsp observations);
210 bool outputHeader(std::ofstream &fpOut);
211 bool outputText();
212 bool outputImagesCSV();
213 bool outputPointsCSV();
214 bool outputLidarCSV();
215 bool outputResiduals();
216
217 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
218
220 SurfacePoint::CoordIndex coordInx) const;
221
222 public slots:
223 void updateFileName(Project *);
224
225 private:
237 public:
238 //TODO does xml stuff need project???
239 XmlHandler(BundleSolutionInfo *bundleSolutionInfo, Project *project);
240 ~XmlHandler();
241
242 virtual bool startElement(const QString &namespaceURI, const QString &localName,
243 const QString &qName, const QXmlAttributes &atts);
244 virtual bool characters(const QString &ch);
245 virtual bool endElement(const QString &namespaceURI, const QString &localName,
246 const QString &qName);
247 QString surfacePointCoordName(SurfacePoint::CoordinateType type,
248 SurfacePoint::CoordIndex coordIdx) const;
249
250 private:
251 Q_DISABLE_COPY(XmlHandler);
252
254 Project *m_xmlHandlerProject; //TODO does xml stuff need project???
256 };
257
258 private:
259
262 QUuid *m_id;
263 QString m_name;
264 QString m_runTime;
267 QString m_outputControlName;
272 QList<ImageList *> *m_images;
273 QList<ImageList *> *m_adjustedImages;
274
275 // In theory the path in the BundleSettings can change while running. So we save the
276 // filenames actually used when the most recent save of the file was done.
277 QString m_txtBundleOutputFilename;
278 QString m_csvSavedImagesFilename;
279 QString m_csvSavedPointsFilename;
280 QString m_csvSavedResidualsFilename;
281
282 }; // end BundleSolutionInfo class
283
284 void setStringAttribute(int locationId, QString locationName,
285 QString attributeName, QString attributeValue);
286 QString getStringAttribute(int locationId, QString locationName, QString attributeName);
287}; // end namespace Isis
288
289Q_DECLARE_METATYPE(Isis::BundleSolutionInfo *);
290
291#endif // BundleSolutionInfo_h
A container class for statistical results from a BundleAdjust solution.
This class is used to read an images.xml file into an image list.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle an XML end element.
virtual bool characters(const QString &ch)
Adds characters to m_xmlHandlerCharacters.
XmlHandler(BundleSolutionInfo *bundleSolutionInfo, Project *project)
Create an XML Handler (reader) that can populate the BundleSolutionInfo class data.
QString m_xmlHandlerCharacters
List of characters that have been handled.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
BundleSolutionInfo * m_xmlHandlerBundleSolutionInfo
The bundleSolutionInfo object.
Container class for BundleAdjustment results.
bool outputResiduals()
Outputs image coordinate residuals to a csv file.
bool outputImagesCSV()
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observa...
BundleSettingsQsp m_settings
Bundle settings.
QString inputControlNetFileName() const
Returns the name of the input control network.
QString m_runTime
Run time of the bundle adjustment.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Saves the BundleSolutionInfo to the project.
QString inputLidarDataFileName() const
Returns name of input lidar data file (if any).
void addAdjustedImages(ImageList *images)
Adds a list of images that were adjusted (their labels were updated).
QString savedPointsFilename()
Returns filename of output bundle points csv file.
QUuid * m_id
A unique ID for this BundleSolutionInfo object (useful for others to reference this object when savin...
BundleSettingsQsp bundleSettings()
Returns bundle settings.
void setName(QString name)
Sets the name of the bundle.
QList< ImageList * > * m_adjustedImages
Adjusted image list.
FileName * m_inputControlNetFileName
Input control network file name.
void setOutputControl(Control *outputControl)
Returns the name of the output control network.
QList< ImageList * > adjustedImages() const
Returns the list of images that were adjusted after a bundle.
QList< ImageList * > * m_images
Input image list.
FileName * m_inputLidarDataFileName
Input lidar data file name.
QString surfacePointCoordName(SurfacePoint::CoordinateType type, SurfacePoint::CoordIndex coordInx) const
Determine the control point coordinate name.
QString savedResidualsFilename()
Returns filename of output bundle residuals csv file.
void setOutputControlName(QString name)
Sets m_outputControlName.
BundleResults bundleResults()
Returns the bundle results.
QString id() const
Get a unique, identifying string associated with this BundleSolutionInfo object.
void setRunTime(QString runTime)
Sets the run time, and the name if a name is not already set.
bool outputPointsCSV()
Outputs point data to a csv file.
QString outputControlName() const
Returns m_outputControlName.
void updateFileName(Project *)
TODO: change description below to something more like english.
QString outputControlNetFileName() const
Returns the name of the output control network.
BundleResults * m_statisticsResults
Bundle statistical results.
QString runTime() const
Returns the run time.
bool outputHeader(std::ofstream &fpOut)
Output header for bundle results file.
LidarData * m_outputLidarDataSet
QList of adjusted lidar points.
QString name() const
Returns the name of the bundle.
QString savedBundleOutputFilename()
Returns bundleout text filename.
bool outputText()
Outputs a text file with the results of the BundleAdjust.
Control * m_outputControl
Output control.
QString savedImagesFilename()
Returns filename of output bundle images csv file.
QList< ImageList * > imageList()
Returns the images used in the bundle.
void setOutputStatistics(BundleResults statisticsResults)
Sets the stat results.
QString m_name
Name of the bundle. Defaults to the id.
bool outputImagesCSVHeader(std::ofstream &fpOut, BundleObservationQsp observations)
Outputs the header for the bundleout_images.csv file.
Control * control() const
Returns bundle output Control object.
bool outputLidarCSV()
Outputs lidar data to a csv file.
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:66
File name manipulation and expansion.
Definition FileName.h:100
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:55
LidarData class.
Definition LidarData.h:49
The main project for ipce.
Definition Project.h:289
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
XML Handler that parses XMLs in a stack-oriented way.
Manage a stack of content handlers for reading XML files.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16