Isis 3 Programmer Reference
BundleSolutionInfo.h
Go to the documentation of this file.
1 #ifndef BundleSolutionInfo_h
2 #define BundleSolutionInfo_h
3 
25 #include <QList>
26 #include <QObject>
27 #include <QString>
28 
29 #include "BundleSettings.h"
30 #include "SurfacePoint.h"
31 
32 #include "XmlStackedHandler.h"
33 
34 class QDataStream;
35 class QUuid;
36 class QXmlStreamWriter;
37 
38 namespace Isis {
39  class BundleResults;
40  class Control;
41  class FileName;
42  class ImageList;
43  class Project; //TODO does xml stuff need project???
44  class PvlObject;
46 
171  class BundleSolutionInfo : public QObject {
172  Q_OBJECT
173  public:
175  FileName controlNetworkFileName,
176  BundleResults outputStatistics,
177  QList<ImageList *> imgList,
178  QObject *parent = 0);
179  BundleSolutionInfo(Project *project,
180  XmlStackedHandlerReader *xmlReader,
181  QObject *parent = 0); //TODO does xml stuff need project???
182  BundleSolutionInfo() = default;
183 
185 
186  QString savedBundleOutputFilename();
187  QString savedImagesFilename();
188  QString savedPointsFilename();
189  QString savedResidualsFilename();
190 
191  void addAdjustedImages(ImageList *images);
192  void setOutputStatistics(BundleResults statisticsResults);
193  void setOutputControl(Control *outputControl);
194  void setOutputControlName(QString name);
195  void setRunTime(QString runTime);
196  void setName(QString name);
197 
199  QString id() const;
200  QString inputControlNetFileName() const;
201  QString outputControlNetFileName() const;
202  Control *control() const;
203  QString outputControlName() const;
207  QString runTime() const;
208  QString name() const;
209 
210 
211  bool outputImagesCSVHeader(std::ofstream &fpOut);
212  bool outputHeader(std::ofstream &fpOut);
213  bool outputText();
214  bool outputImagesCSV();
215  bool outputPointsCSV();
216  bool outputResiduals();
217 
218  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
219 
221  SurfacePoint::CoordIndex coordInx) const;
222 
223  public slots:
224  void updateFileName(Project *);
225 
226  private:
237  class XmlHandler : public XmlStackedHandler {
238  public:
239  //TODO does xml stuff need project???
240  XmlHandler(BundleSolutionInfo *bundleSolutionInfo, Project *project);
241  ~XmlHandler();
242 
243  virtual bool startElement(const QString &namespaceURI, const QString &localName,
244  const QString &qName, const QXmlAttributes &atts);
245  virtual bool characters(const QString &ch);
246  virtual bool endElement(const QString &namespaceURI, const QString &localName,
247  const QString &qName);
248  QString surfacePointCoordName(SurfacePoint::CoordinateType type,
249  SurfacePoint::CoordIndex coordIdx) const;
250 
251  private:
252  Q_DISABLE_COPY(XmlHandler);
253 
255  Project *m_xmlHandlerProject; //TODO does xml stuff need project???
257  };
258 
259  private:
260 
263  QUuid *m_id;
264  QString m_name;
265  QString m_runTime;
268  QString m_outputControlName;
273 
274  // In theory the path in the BundleSettings can change while running. So we save the
275  // filenames actually used when the most recent save of the file was done.
276  QString m_txtBundleOutputFilename;
277  QString m_csvSavedImagesFilename;
278  QString m_csvSavedPointsFilename;
279  QString m_csvSavedResidualsFilename;
280 
281  }; // end BundleSolutionInfo class
282 
283  void setStringAttribute(int locationId, QString locationName,
284  QString attributeName, QString attributeValue);
285  QString getStringAttribute(int locationId, QString locationName, QString attributeName);
286 }; // end namespace Isis
287 
289 
290 #endif // BundleSolutionInfo_h
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:79
Control * control() const
Returns bundle output Control object.
void setRunTime(QString runTime)
Sets the run time, and the name if a name is not already set.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
void updateFileName(Project *)
TODO: change description below to something more like english.
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
bool outputText()
Outputs a text file with the results of the BundleAdjust.
The main project for ipce.
Definition: Project.h:289
QString outputControlName() const
Returns m_outputControlName.
QList< ImageList * > imageList()
Returns the images used in the bundle.
File name manipulation and expansion.
Definition: FileName.h:116
XmlHandler(BundleSolutionInfo *bundleSolutionInfo, Project *project)
Create an XML Handler (reader) that can populate the BundleSolutionInfo class data.
Container class for BundleAdjustment results.
BundleSettingsQsp m_settings
Bundle settings.
BundleSettingsQsp bundleSettings()
Returns bundle settings.
QString savedResidualsFilename()
Returns filename of output bundle residuals csv file.
bool outputHeader(std::ofstream &fpOut)
Output header for bundle results file.
QString m_name
Name of the bundle. Defaults to the id.
QList< ImageList * > * m_images
Input image list.
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QString name() const
Returns the name of the bundle.
QString surfacePointCoordName(SurfacePoint::CoordinateType type, SurfacePoint::CoordIndex coordInx) const
Determine the control point coordinate name.
QString savedPointsFilename()
Returns filename of output bundle points csv file.
bool outputImagesCSV()
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observa...
QString id() const
Get a unique, identifying string associated with this BundleSolutionInfo object.
QList< ImageList * > adjustedImages() const
Returns the list of images that were adjusted after a bundle.
void setOutputStatistics(BundleResults statisticsResults)
Sets the stat results.
bool outputImagesCSVHeader(std::ofstream &fpOut)
Outputs the header for the bundleout_images.csv file.
BundleResults * m_statisticsResults
Bundle statistical results.
BundleSolutionInfo * m_xmlHandlerBundleSolutionInfo
The bundleSolutionInfo object.
QString runTime() const
Returns the run time.
QString outputControlNetFileName() const
Returns the name of the output control network.
void setName(QString name)
Sets the name of the bundle.
QUuid * m_id
A unique ID for this BundleSolutionInfo object (useful for others to reference this object when savin...
void setOutputControlName(QString name)
Sets m_outputControlName.
This class is used to read an images.xml file into an image list.
void addAdjustedImages(ImageList *images)
Adds a list of images that were adjusted (their labels were updated).
XML Handler that parses XMLs in a stack-oriented way.
void setOutputControl(Control *outputControl)
Returns the name of the output control network.
FileName * m_inputControlNetFileName
Input control network file name.
QString m_xmlHandlerCharacters
List of characters that have been handled.
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:155
Control * m_outputControl
Output control.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle an XML end element.
bool outputResiduals()
Outputs image coordinate residuals to a csv file.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Saves the BundleSolutionInfo to the project.
QString m_runTime
Run time of the bundle adjustment.
QList< ImageList * > * m_adjustedImages
Adjusted image list.
BundleResults bundleResults()
Returns the bundle results.
virtual bool characters(const QString &ch)
Adds characters to m_xmlHandlerCharacters.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
A container class for statistical results from a BundleAdjust solution.
Definition: BundleResults.h:96
QString savedBundleOutputFilename()
Returns bundleout text filename.
QString inputControlNetFileName() const
Returns the name of the input control network.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
QString savedImagesFilename()
Returns filename of output bundle images csv file.
Manage a stack of content handlers for reading XML files.
bool outputPointsCSV()
Outputs point data to a csv file.