Isis 3 Programmer Reference
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 
107  class Image : public QObject {
108  Q_OBJECT
109  public:
110  explicit Image(QString imageFileName, QObject *parent = 0);
111  explicit Image(Cube *imageCube, QObject *parent = 0);
112  explicit Image(Cube *imageCube, geos::geom::MultiPolygon *footprint, QString id,
113  QObject *parent = 0);
114  Image(FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
115  ~Image();
116 
117  void fromPvl(const PvlObject &pvl);
118  PvlObject toPvl() const;
119 
120  bool isFootprintable() const;
121  Cube *cube();
122  void closeCube();
125  QString fileName() const;
126  QString observationNumber();
127  QString serialNumber();
128  geos::geom::MultiPolygon *footprint();
129  const geos::geom::MultiPolygon *footprint() const;
130  void setId(QString id);
131 
132  bool initFootprint(QMutex *cameraMutex);
133 
134  double aspectRatio() const;
135  QString id() const;
136  double resolution() const;
137  Angle emissionAngle() const;
138  Angle incidenceAngle() const;
139  double lineResolution() const;
140  Distance localRadius() const;
141  Angle northAzimuth() const;
142  Angle phaseAngle() const;
143  double sampleResolution() const;
144 
145  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
146  void deleteFromDisk();
147  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
148 
149  public slots:
150  void updateFileName(Project *);
151 
152  private:
153  geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex);
154  void initCamStats();
155  void initQuickFootprint();
156 
157 
158  private:
172  class XmlHandler : public XmlStackedHandler {
173  public:
174  XmlHandler(Image *image, FileName imageFolder);
175 
176  virtual bool startElement(const QString &namespaceURI, const QString &localName,
177  const QString &qName, const QXmlAttributes &atts);
178  virtual bool characters(const QString &ch);
179  virtual bool endElement(const QString &namespaceURI, const QString &localName,
180  const QString &qName);
181 
182  private:
183  Q_DISABLE_COPY(XmlHandler);
184 
187  QString m_characters;
188 
189  };
190 
191  private:
192  Image(const Image &other);
193  Image &operator=(const Image &rhs);
194 
195  SpiceInt *m_bodyCode;
199  // QString *m_name; //!< Name of the target
200 
201 
207 
212 
216  QString m_fileName;
217 
221  QString m_instrumentId;
222 
227 
231  QString m_serialNumber;
232 
237 
241  geos::geom::MultiPolygon *m_footprint;
245  QUuid *m_id;
246 
247  double m_aspectRatio;
248  double m_resolution;
256 
257  };
258  // TODO: add QDataStream >> and << ???
259 }
260 
262 
263 #endif
Isis::Image::m_cube
Cube * m_cube
The cube associated with this Image.
Definition: Image.h:206
Isis::Image::m_localRadius
Distance m_localRadius
Local radius of the image.
Definition: Image.h:253
Isis::Image::m_phaseAngle
Angle m_phaseAngle
Phase angle for the image.
Definition: Image.h:255
Isis::Image::XmlHandler::XmlHandler
XmlHandler(Image *image, FileName imageFolder)
Create an XML Handler (reader) that can populate the Image class data.
Definition: Image.cpp:829
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::Image::serialNumber
QString serialNumber()
Returns the serial number of the Cube.
Definition: Image.cpp:361
Isis::Image::m_resolution
double m_resolution
Resolution of the image.
Definition: Image.h:248
Isis::Image::m_footprint
geos::geom::MultiPolygon * m_footprint
A 0-360 ocentric lon,lat degrees footprint of this Image.
Definition: Image.h:241
Isis::Image::lineResolution
double lineResolution() const
Get the line resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:485
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::Image::XmlHandler::m_image
Image * m_image
Pointer to the Image.
Definition: Image.h:185
Isis::Image::m_spacecraftName
QString m_spacecraftName
Spacecraft name associated with this Image.
Definition: Image.h:236
Isis::Image::m_displayProperties
ImageDisplayProperties * m_displayProperties
The GUI information for how this Image ought to be displayed.
Definition: Image.h:211
Isis::Image::initQuickFootprint
void initQuickFootprint()
Creates a default ImagePolygon option which is read into the Cube.
Definition: Image.cpp:817
Isis::Image::initFootprint
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this image.
Definition: Image.cpp:409
Isis::Image::fileName
QString fileName() const
Get the file name of the cube that this image represents.
Definition: Image.cpp:340
Isis::Image::phaseAngle
Angle phaseAngle() const
Get the phase angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:515
Isis::Image::XmlHandler::m_imageFolder
FileName m_imageFolder
The Name/path of the image.
Definition: Image.h:186
Isis::Image::m_id
QUuid * m_id
A unique ID for this Image (useful for others to reference this Image when saving to disk).
Definition: Image.h:245
Isis::Image::XmlHandler::m_characters
QString m_characters
Character data storage found in the content of XML elements.
Definition: Image.h:187
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::Image::resolution
double resolution() const
Get the resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:455
Isis::Image::localRadius
Distance localRadius() const
Get the local radius of this image, as calculated and attached by camstats.
Definition: Image.cpp:495
Isis::Image::m_observationNumber
QString m_observationNumber
The observation number for this image.
Definition: Image.h:226
Isis::Image::deleteFromDisk
void deleteFromDisk()
Delete the image data from disk.
Definition: Image.cpp:586
Isis::Image::aspectRatio
double aspectRatio() const
Get the aspect ratio of this image, as calculated and attached by camstats.
Definition: Image.cpp:436
Isis::Image::northAzimuth
Angle northAzimuth() const
Get the north azimuth of this image, as calculated and attached by camstats.
Definition: Image.cpp:505
Isis::Image::createFootprint
geos::geom::MultiPolygon * createFootprint(QMutex *cameraMutex)
Calculates a footprint for an Image using the camera or projection information.
Definition: Image.cpp:706
Isis::Image::m_northAzimuth
Angle m_northAzimuth
North Azimuth for the image.
Definition: Image.h:254
Isis::Image::save
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Write the Image properties out to an XML file.
Definition: Image.cpp:626
Isis::Image::footprint
geos::geom::MultiPolygon * footprint()
Get the footprint of this image (if available).
Definition: Image.cpp:374
Isis::Image::cube
Cube * cube()
Get the Cube pointer associated with this display property.
Definition: Image.cpp:287
Isis::Image::closeCube
void closeCube()
Cleans up the Cube pointer.
Definition: Image.cpp:307
Isis::Image::fromPvl
void fromPvl(const PvlObject &pvl)
Read the image settings from a Pvl.
Definition: Image.cpp:194
Isis::Image::isFootprintable
bool isFootprintable() const
Test to see if it's possible to create a footprint from this image.
Definition: Image.cpp:253
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Image::sampleResolution
double sampleResolution() const
Get the sample resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:525
Isis::Image::copyToNewProjectRoot
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this image into the new project.
Definition: Image.cpp:534
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::Image::XmlHandler::endElement
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:963
Isis::Image::m_incidenceAngle
Angle m_incidenceAngle
Incidence angle of the image.
Definition: Image.h:250
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
Isis::Image::XmlHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Read mage class attributes.
Definition: Image.cpp:851
Isis::Image::updateFileName
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:691
Isis::Image::Image
Image(QString imageFileName, QObject *parent=0)
Create an image from a cube file on disk.
Definition: Image.cpp:42
Isis::Image::displayProperties
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:320
Isis::Image::m_serialNumber
QString m_serialNumber
The serial number for this image.
Definition: Image.h:231
Isis::Image::m_emissionAngle
Angle m_emissionAngle
Emmission angle of the image.
Definition: Image.h:249
Isis::Image::m_instrumentId
QString m_instrumentId
Instrument id associated with this Image.
Definition: Image.h:221
Isis::Image::id
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:445
Isis::Image::m_lineResolution
double m_lineResolution
Line resolution of the image.
Definition: Image.h:251
Isis::Image::XmlHandler::characters
virtual bool characters(const QString &ch)
This implementation of a virtual function calls QXmlDefaultHandler::characters(QString &ch) which in ...
Definition: Image.cpp:945
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::Image::initCamStats
void initCamStats()
Checks to see if the Cube label contains Camera Statistics.
Definition: Image.cpp:734
Isis::Image::toPvl
PvlObject toPvl() const
Convert this Image to PVL.
Definition: Image.cpp:226
Isis::Image::m_fileName
QString m_fileName
The on-disk file name of the cube associated with this Image.
Definition: Image.h:216
Isis::Image::XmlHandler
Process XML in a stack-oriented fashion.
Definition: Image.h:172
QObject
Isis::Image::incidenceAngle
Angle incidenceAngle() const
Get the incidence angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:475
Isis::Image::emissionAngle
Angle emissionAngle() const
Get the emission angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:465
Isis::Image::observationNumber
QString observationNumber()
Returns the observation number of the Cube.
Definition: Image.cpp:349
Isis::Image::~Image
~Image()
Clean up this image.
Definition: Image.cpp:161
Isis::Image::m_sampleResolution
double m_sampleResolution
Sample resolution of the image.
Definition: Image.h:252
Isis::Image::setId
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Image.cpp:383
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Image::m_bodyCode
SpiceInt * m_bodyCode
The NaifBodyCode value, if it exists in the labels.
Definition: Image.h:195
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Isis::PlotWindow *)
We have plot windows as QVariant data types, so here it's enabled.
Isis::Image::m_aspectRatio
double m_aspectRatio
Aspect ratio of the image.
Definition: Image.h:247
Isis::ImageDisplayProperties
This is the GUI communication mechanism for cubes.
Definition: ImageDisplayProperties.h:85