Isis 3.0 Programmer Reference
Back | Home
Shape.h
1 
2 #ifndef Shape_H
3 #define Shape_H
4 
22 #include <QObject>
23 
24 #include <QString>
25 
26 #include "Angle.h"
27 #include "Distance.h"
28 #include "FileName.h"
29 #include "Latitude.h"
30 #include "Longitude.h"
31 #include "XmlStackedHandler.h"
32 
33 #include <SpiceUsr.h>
34 #include <SpiceZfc.h>
35 #include <SpiceZmc.h>
36 
37 class QUuid;
38 class QMutex;
39 class QXmlStreamWriter;
40 
41 namespace geos {
42  namespace geom {
43  class MultiPolygon;
44  }
45 }
46 
47 namespace Isis {
48  class Cube;
49  class FileName;
50  class Image;
51  class Project;
52  class PvlObject;
53  class ShapeDisplayProperties;
54  class XmlStackedHandlerReader;
55 
70  class Shape : public QObject {
71  Q_OBJECT
72  public:
73  enum ShapeType {
74  Dem,
75  Basemap,
76  Unprojected,
77  Unknown };
78 
79  explicit Shape(QString shapeFileName, QObject *parent = 0);
80  explicit Shape(Cube *shapeCube, QObject *parent = 0);
81  Shape(FileName shapeFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
82  ~Shape();
83 
84  void fromPvl(const PvlObject &pvl);
85  PvlObject toPvl() const;
86 
87  bool isFootprintable() const;
88 // bool hasImage() const;
89 // Image *image();
90  Cube *cube();
91  void closeCube();
92  ShapeType shapeType();
95  QString fileName() const;
96  QString serialNumber();
97  geos::geom::MultiPolygon *footprint();
98  const geos::geom::MultiPolygon *footprint() const;
99  void setId(QString id);
100 
101  bool initFootprint(QMutex *cameraMutex);
102 
103  double aspectRatio() const;
104  QString id() const;
105  double resolution() const;
106  Angle emissionAngle() const;
107  Angle incidenceAngle() const;
108  double lineResolution() const;
109  Distance localRadius() const;
110  Angle northAzimuth() const;
111  Angle phaseAngle() const;
112  double sampleResolution() const;
113 
114  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
115  void deleteFromDisk();
116  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
117 
118  public slots:
119  void updateFileName(Project *);
120 
121  private:
122  Shape(const Shape &other);
123  Shape &operator=(const Shape &rhs);
124 
125  void initMemberData();
126  void initShape();
127  void initCamStats();
128  void initMapStats();
129  void initDemStats();
130 
131  geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex);
132  void initQuickFootprint();
133 
140  class XmlHandler : public XmlStackedHandler {
141  public:
142  XmlHandler(Shape *shape, FileName shapeFolder);
143 
144  virtual bool startElement(const QString &namespaceURI, const QString &localName,
145  const QString &qName, const QXmlAttributes &atts);
146  virtual bool characters(const QString &ch);
147  virtual bool endElement(const QString &namespaceURI, const QString &localName,
148  const QString &qName);
149 
150  private:
151  Q_DISABLE_COPY(XmlHandler);
152 
153  Shape *m_shape;
154  FileName m_shapeFolder;
155  QString m_characters;
156  };
157 
158  private:
159  SpiceInt *m_bodyCode;
163 // QString *m_name; //!< Name of the target
164 
165 
171 
172  ShapeType m_shapeType;
173 
181  QString m_fileName;
185  QString m_instrumentId;
193  geos::geom::MultiPolygon *m_footprint;
197  QUuid *m_id;
198 
199  // Level 1 labels
200  double m_aspectRatio;
201  double m_resolution;
202  Angle m_emissionAngle;
203  Angle m_incidenceAngle;
204  double m_lineResolution;
205  Distance m_localRadius;
206  Angle m_northAzimuth;
207  Angle m_phaseAngle;
208  double m_sampleResolution;
209 
210  // Mapping labels
211  QString m_targetName;
212  QString m_projectionName;
213  Longitude m_centerLongitude;
214  Latitude m_centerLatitude;
215  Latitude m_minimumLatitude;
216  Latitude m_maximumLatitude;
217  Longitude m_minimumLongitude;
218  Longitude m_maximumLongitude;
219  double m_pixelResolution;
220  double m_scale;
221 
222  // Dem Labels
223  Distance m_minimumRadius;
224  Distance m_maximumRadius;
225  };
226  // TODO: add QDataStream >> and << ???
227 }
228 
230 
231 #endif
Distance localRadius() const
Get the local radius of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:472
The main project for cnetsuite.
Definition: Project.h:105
void closeCube()
Cleans up the Cube *.
Definition: Shape.cpp:300
Angle emissionAngle() const
Get the emission angle of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:439
File name manipulation and expansion.
Definition: FileName.h:111
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
Definition: Shape.cpp:800
QString m_spacecraftName
Spacecraft name associated with this Shape.
Definition: Shape.h:189
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this shape into the new project.
Definition: Shape.cpp:513
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:59
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
ShapeDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this shape.
Definition: Shape.cpp:313
geos::geom::MultiPolygon * createFootprint(QMutex *cameraMutex)
Calculate a footprint for an Shape using the camera or projection information.
Definition: Shape.cpp:596
This is the GUI communication mechanism for shape objects.
~Shape()
Clean up this shape.
Definition: Shape.cpp:87
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance measurement, usually in meters.
Definition: Distance.h:47
XmlHandler(Shape *shape, FileName shapeFolder)
Create an XML Handler (reader) that can populate the Shape class data.
Definition: Shape.cpp:784
Angle northAzimuth() const
Get the north azimuth of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:483
QString m_instrumentId
Instrument id associated with this Shape.
Definition: Shape.h:185
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this shape.
Definition: Shape.cpp:379
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
Definition: Shape.cpp:887
double sampleResolution() const
Get the sample resolution of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:505
PvlObject toPvl() const
Convert this Shape to PVL.
Definition: Shape.cpp:225
QUuid * m_id
A unique ID for this Shape (useful for others to reference this Shape when saving to disk)...
Definition: Shape.h:197
Cube * cube()
Get the Cube * associated with this display property.
Definition: Shape.cpp:282
QString serialNumber()
Get the serial number.
Definition: Shape.cpp:343
void updateFileName(Project *)
Change the on-disk file name for this cube to be where the shape ought to be in the given project...
Definition: Shape.cpp:580
XML Handler that parses XMLs in a stack-oriented way.
Shape(QString shapeFileName, QObject *parent=0)
Create an Shape from a cube file on disk.
Definition: Shape.cpp:43
ShapeDisplayProperties * m_displayProperties
The GUI information for how this Shape ought to be displayed.
Definition: Shape.h:177
QString id() const
Get a unique, identifying string associated with this shape.
Definition: Shape.cpp:417
Cube * m_cube
The cube associated with this Shape.
Definition: Shape.h:170
geos::geom::MultiPolygon * footprint()
Get the footprint of this shape (if available).
Definition: Shape.cpp:352
void fromPvl(const PvlObject &pvl)
Read the shape settings from a Pvl.
Definition: Shape.cpp:193
double resolution() const
Get the resolution of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:428
void initCamStats()
TODO.
Definition: Shape.cpp:623
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Shape.cpp:360
Defines an angle and provides unit conversions.
Definition: Angle.h:58
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
bool isFootprintable() const
Test to see if it&#39;s possible to create a footprint from this shape.
Definition: Shape.cpp:251
double aspectRatio() const
Get the aspect ratio of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:407
void deleteFromDisk()
Delete the shape data from disk.
Definition: Shape.cpp:549
This represents a shape in a project-based GUI interface.
Definition: Shape.h:70
Angle phaseAngle() const
Get the phase angle of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:494
QString m_fileName
The on-disk file name of the cube associated with this Shape.
Definition: Shape.h:181
geos::geom::MultiPolygon * m_footprint
A 0-360 ocentric lon,lat degrees footprint of this Shape.
Definition: Shape.h:193
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
Angle incidenceAngle() const
Get the incidence angle of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:450
his enables stack-based XML parsing of XML files.
QString fileName() const
Get the file name of the cube that this shape represents.
Definition: Shape.cpp:334
double lineResolution() const
Get the line resolution of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:461
SpiceInt * m_bodyCode
The NaifBodyCode value, if it exists in the labels.
Definition: Shape.h:159
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
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:29:05