Isis 3.0 Programmer Reference
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 
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 
186 
191 
195  QString m_fileName;
196 
200  QString m_instrumentId;
201 
206 
210  geos::geom::MultiPolygon *m_footprint;
214  QUuid *m_id;
215 
216  double m_aspectRatio;
217  double m_resolution;
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
void initQuickFootprint()
Creates a default ImagePolygon option which is read into the Cube.
Definition: Image.cpp:750
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
QString m_instrumentId
Instrument id associated with this Image.
Definition: Image.h:200
void deleteFromDisk()
Delete the image data from disk.
Definition: Image.cpp:519
QUuid * m_id
A unique ID for this Image (useful for others to reference this Image when saving to disk)...
Definition: Image.h:214
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
Distance m_localRadius
Local radius of the image.
Definition: Image.h:222
Image * m_image
Pointer to the Image.
Definition: Image.h:164
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
double m_resolution
Resolution of the image.
Definition: Image.h:217
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Angle m_northAzimuth
North Azimuth for the image.
Definition: Image.h:223
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
Angle m_emissionAngle
Emmission angle of the image.
Definition: Image.h:218
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Image.cpp:333
double m_aspectRatio
Aspect ratio of the image.
Definition: Image.h:216
QString m_spacecraftName
Spacecraft name associated with this Image.
Definition: Image.h:205
Cube * m_cube
The cube associated with this Image.
Definition: Image.h:185
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
SpiceInt * m_bodyCode
The NaifBodyCode value, if it exists in the labels.
Definition: Image.h:174
This is the GUI communication mechanism for cubes.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
The XML reader invokes this method at the start of every element in the XML document.
Definition: Image.cpp:783
Angle m_phaseAngle
Phase angle for the image.
Definition: Image.h:224
Angle m_incidenceAngle
Incidence angle of the image.
Definition: Image.h:219
QString m_fileName
The on-disk file name of the cube associated with this Image.
Definition: Image.h:195
Image(QString imageFileName, QObject *parent=0)
Create an image from a cube file on disk.
Definition: Image.cpp:40
virtual bool characters(const QString &ch)
This implementation of a virtual function calls QXmlDefaultHandler::characters(QString &amp;ch) which in ...
Definition: Image.cpp:877
XML Handler that parses XMLs in a stack-oriented way.
QString m_characters
Character data storage found in the content of XML elements.
Definition: Image.h:166
double aspectRatio() const
Get the aspect ratio of this image, as calculated and attached by camstats.
Definition: Image.cpp:385
double m_lineResolution
Line resolution of the image.
Definition: Image.h:220
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
ImageDisplayProperties * m_displayProperties
The GUI information for how this Image ought to be displayed.
Definition: Image.h:190
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
The XML reader invokes this method at the end of every element in the XML document.
Definition: Image.cpp:895
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 initCamStats()
Checks to see if the Cube label contains Camera Statistics.
Definition: Image.cpp:667
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Write the Image properties out to an XML file.
Definition: Image.cpp:559
FileName m_imageFolder
The Name/path of the image.
Definition: Image.h:165
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this image.
Definition: Image.cpp:358
double m_sampleResolution
Sample resolution of the image.
Definition: Image.h:221
XmlHandler(Image *image, FileName imageFolder)
Create an XML Handler (reader) that can populate the Image class data.
Definition: Image.cpp:763
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
Child class for XmlStackedHandler which is used to process XML in a stack-oriented way...
Definition: Image.h:151
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.
Angle phaseAngle() const
Get the phase angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:464
geos::geom::MultiPolygon * m_footprint
A 0-360 ocentric lon,lat degrees footprint of this Image.
Definition: Image.h:210
void closeCube()
Cleans up the Cube pointer.
Definition: Image.cpp:272
geos::geom::MultiPolygon * createFootprint(QMutex *cameraMutex)
Calculates a footprint for an Image using the camera or projection information.
Definition: Image.cpp:639
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