Isis 3.0
Back | Home
Image.h
Go to the documentation of this file.
1 
2 #ifndef Image_H
3 #define Image_H
4 
26 #include <QObject>
27 
28 #include <QString>
29 
30 #include "Angle.h"
31 #include "Distance.h"
32 #include "FileName.h"
33 #include "XmlStackedHandler.h"
34 
35 #include <SpiceUsr.h>
36 #include <SpiceZfc.h>
37 #include <SpiceZmc.h>
38 
39 class QUuid;
40 class QMutex;
41 class QXmlStreamWriter;
42 
43 namespace geos {
44  namespace geom {
45  class MultiPolygon;
46  }
47 }
48 
49 namespace Isis {
50  class Cube;
51  class FileName;
52  class ImageDisplayProperties;
53  class Project;
54  class PvlObject;
55  class XmlStackedHandlerReader;
56 
91  class Image : public QObject {
92  Q_OBJECT
93  public:
94  explicit Image(QString imageFileName, QObject *parent = 0);
95  explicit Image(Cube *imageCube, QObject *parent = 0);
96  Image(FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
97  ~Image();
98 
99  void fromPvl(const PvlObject &pvl);
100  PvlObject toPvl() const;
101 
102  bool isFootprintable() const;
103  Cube *cube();
104  void closeCube();
107  QString fileName() const;
108  QString serialNumber();
109  geos::geom::MultiPolygon *footprint();
110  const geos::geom::MultiPolygon *footprint() const;
111  void setId(QString id);
112 
113  bool initFootprint(QMutex *cameraMutex);
114 
115  double aspectRatio() const;
116  QString id() const;
117  double resolution() const;
118  Angle emissionAngle() const;
119  Angle incidenceAngle() const;
120  double lineResolution() const;
121  Distance localRadius() const;
122  Angle northAzimuth() const;
123  Angle phaseAngle() const;
124  double sampleResolution() const;
125 
126  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
127  void deleteFromDisk();
128  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
129 
130  public slots:
131  void updateFileName(Project *);
132 
133  private:
134  geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex);
135  void initCamStats();
136  void initQuickFootprint();
137 
138 
139  private:
151  class XmlHandler : public XmlStackedHandler {
152  public:
153  XmlHandler(Image *image, FileName imageFolder);
154 
155  virtual bool startElement(const QString &namespaceURI, const QString &localName,
156  const QString &qName, const QXmlAttributes &atts);
157  virtual bool characters(const QString &ch);
158  virtual bool endElement(const QString &namespaceURI, const QString &localName,
159  const QString &qName);
160 
161  private:
162  Q_DISABLE_COPY(XmlHandler);
163 
164  Image *m_image;
165  FileName m_imageFolder;
166  QString m_characters;
167 
168  };
169 
170  private:
171  Image(const Image &other);
172  Image &operator=(const Image &rhs);
173 
174  SpiceInt *m_bodyCode;
178  // QString *m_name; //!< Name of the target
179 
180 
185  Cube *m_cube;
186 
190  ImageDisplayProperties *m_displayProperties;
191 
195  QString m_fileName;
196 
200  QString m_instrumentId;
201 
205  QString m_spacecraftName;
206 
210  geos::geom::MultiPolygon *m_footprint;
214  QUuid *m_id;
215 
216  double m_aspectRatio;
217  double m_resolution;
218  Angle m_emissionAngle;
219  Angle m_incidenceAngle;
220  double m_lineResolution;
221  double m_sampleResolution;
222  Distance m_localRadius;
223  Angle m_northAzimuth;
224  Angle m_phaseAngle;
225 
226  };
227  // TODO: add QDataStream >> and << ???
228 }
229 
231 
232 #endif
Angle incidenceAngle() const
Get the incidence angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:424
The main project for cnetsuite.
Definition: Project.h:105
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:394
Angle emissionAngle() const
Get the emission angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:414
void updateFileName(Project *)
Change the on-disk file name for this cube to be where the image ought to be in the given project...
Definition: Image.cpp:624
File name manipulation and expansion.
Definition: FileName.h:111
~Image()
Clean up this image.
Definition: Image.cpp:129
void deleteFromDisk()
Delete the image data from disk.
Definition: Image.cpp:519
QString fileName() const
Get the file name of the cube that this image represents.
Definition: Image.cpp:305
bool isFootprintable() const
Test to see if it&#39;s possible to create a footprint from this image.
Definition: Image.cpp:221
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
double sampleResolution() const
Get the sample resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:474
double lineResolution() const
Get the line resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:434
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance measurement, usually in meters.
Definition: Distance.h:47
Distance localRadius() const
Get the local radius of this image, as calculated and attached by camstats.
Definition: Image.cpp:444
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Image.cpp:333
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this image into the new project.
Definition: Image.cpp:483
PvlObject toPvl() const
Convert this Image to PVL.
Definition: Image.cpp:194
This is the GUI communication mechanism for cubes.
Definition: ImageDisplayProperties.h:85
Image(QString imageFileName, QObject *parent=0)
Create an image from a cube file on disk.
Definition: Image.cpp:40
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:47
double aspectRatio() const
Get the aspect ratio of this image, as calculated and attached by camstats.
Definition: Image.cpp:385
This represents a cube in a project-based GUI interface.
Definition: Image.h:91
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:285
double resolution() const
Get the resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:404
Angle northAzimuth() const
Get the north azimuth of this image, as calculated and attached by camstats.
Definition: Image.cpp:454
Defines an angle and provides unit conversions.
Definition: Angle.h:58
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Write the Image properties out to an XML file.
Definition: Image.cpp:559
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this image.
Definition: Image.cpp:358
QString serialNumber()
Returns the serial number of the Cube.
Definition: Image.cpp:314
geos::geom::MultiPolygon * footprint()
Get the footprint of this image (if available).
Definition: Image.cpp:324
Cube * cube()
Get the Cube pointer associated with this display property.
Definition: Image.cpp:254
void fromPvl(const PvlObject &pvl)
Read the image settings from a Pvl.
Definition: Image.cpp:162
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
his enables stack-based XML parsing of XML files.
Definition: XmlStackedHandlerReader.h:26
Angle phaseAngle() const
Get the phase angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:464
void closeCube()
Cleans up the Cube pointer.
Definition: Image.cpp:272
IO Handler for Isis Cubes.
Definition: Cube.h:158

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:19:58