Isis 3 Developer Reference
Shape.h
Go to the documentation of this file.
1 
2 #ifndef Shape_H
3 #define Shape_H
4 
22 #include <QObject>
23 
24 #include <QString>
25 
26 #include "Angle.h"
27 #include "ControlPoint.h"
28 #include "Distance.h"
29 #include "FileName.h"
30 #include "Latitude.h"
31 #include "Longitude.h"
32 #include "XmlStackedHandler.h"
33 
34 #include <SpiceUsr.h>
35 #include <SpiceZfc.h>
36 #include <SpiceZmc.h>
37 
38 class QUuid;
39 class QMutex;
40 class QXmlStreamWriter;
41 
42 namespace geos {
43  namespace geom {
44  class MultiPolygon;
45  }
46 }
47 
48 namespace Isis {
49  class Cube;
50  class FileName;
51  class Image;
52  class Project;
53  class PvlObject;
54  class ShapeDisplayProperties;
55  class XmlStackedHandlerReader;
56 
78  class Shape : public QObject {
79  Q_OBJECT
80  public:
81  enum ShapeType {
82  Dem,
86 
87  explicit Shape(QString shapeFileName, QObject *parent = 0);
88  explicit Shape(Cube *shapeCube, QObject *parent = 0);
89  Shape(FileName shapeFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
90  ~Shape();
91 
92  void fromPvl(const PvlObject &pvl);
93  PvlObject toPvl() const;
94 
95  bool isFootprintable() const;
96  Cube *cube();
97  void closeCube();
103  QString fileName() const;
104  QString serialNumber();
105  geos::geom::MultiPolygon *footprint();
106  const geos::geom::MultiPolygon *footprint() const;
107  void setId(QString id);
108 
109  bool initFootprint(QMutex *cameraMutex);
110 
111  double aspectRatio() const;
112  QString id() const;
113  double resolution() const;
114  Angle emissionAngle() const;
115  Angle incidenceAngle() const;
116  double lineResolution() const;
117  Distance localRadius() const;
118  Angle northAzimuth() const;
119  Angle phaseAngle() const;
120  double sampleResolution() const;
121 
122  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
123  void deleteFromDisk();
124  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
125 
126  public slots:
127  void updateFileName(Project *);
128 
129  private:
130  Shape(const Shape &other);
131  Shape &operator=(const Shape &rhs);
132 
133  void initMemberData();
134  void initShape();
135  void initCamStats();
136  void initMapStats();
137  void initDemStats();
138 
139  geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex);
140  void initQuickFootprint();
141 
148  class XmlHandler : public XmlStackedHandler {
149  public:
150  XmlHandler(Shape *shape, FileName shapeFolder);
151 
152  virtual bool startElement(const QString &namespaceURI, const QString &localName,
153  const QString &qName, const QXmlAttributes &atts);
154  virtual bool characters(const QString &ch);
155  virtual bool endElement(const QString &namespaceURI, const QString &localName,
156  const QString &qName);
157 
158  private:
159  Q_DISABLE_COPY(XmlHandler);
160 
161  Shape *m_shape;
162  FileName m_shapeFolder;
163  QString m_characters;
164  };
165 
166  private:
167  SpiceInt *m_bodyCode;
171 // QString *m_name; //!< Name of the target
172 
173 
178  Cube *m_cube;
179  ControlPoint::SurfacePointSource::Source m_surfacePointSource;
180  ControlPoint::RadiusSource::Source m_radiusSource;
181  ShapeType m_shapeType;
182 
186  ShapeDisplayProperties *m_displayProperties;
190  QString m_fileName;
194  QString m_serialNumber;
198  QString m_instrumentId;
202  QString m_spacecraftName;
206  geos::geom::MultiPolygon *m_footprint;
210  QUuid *m_id;
211 
212  // Level 1 labels
213  double m_aspectRatio;
214  double m_resolution;
215  Angle m_emissionAngle;
216  Angle m_incidenceAngle;
217  double m_lineResolution;
218  Distance m_localRadius;
219  Angle m_northAzimuth;
220  Angle m_phaseAngle;
221  double m_sampleResolution;
222 
223  // Mapping labels
224  QString m_targetName;
225  QString m_projectionName;
226  Longitude m_centerLongitude;
227  Latitude m_centerLatitude;
228  Latitude m_minimumLatitude;
229  Latitude m_maximumLatitude;
230  Longitude m_minimumLongitude;
231  Longitude m_maximumLongitude;
232  double m_pixelResolution;
233  double m_scale;
234 
235  // Dem Labels
236  Distance m_minimumRadius;
237  Distance m_maximumRadius;
238  };
239 
240 }
241 
243 
244 #endif
PvlObject toPvl() const
Convert this Shape to PVL.
Definition: Shape.cpp:268
double resolution() const
Get the resolution of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:471
ControlPoint::RadiusSource::Source radiusSource()
Definition: Shape.cpp:214
The main project for ipce.
Definition: Project.h:289
void closeCube()
Cleans up the Cube *.
Definition: Shape.cpp:343
Source
Definition: ControlPoint.h:466
ShapeType
Definition: Shape.h:81
File name manipulation and expansion.
Definition: FileName.h:116
Angle incidenceAngle() const
Get the incidence angle of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:493
Source
Definition: ControlPoint.h:455
Angle northAzimuth() const
Get the north azimuth of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:526
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this shape into the new project.
Definition: Shape.cpp:556
Distance localRadius() const
Get the local radius of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:515
ShapeDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this shape.
Definition: Shape.cpp:356
This is the GUI communication mechanism for shape objects.
Definition: ShapeDisplayProperties.h:74
~Shape()
Clean up this shape.
Definition: Shape.cpp:89
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double sampleResolution() const
Get the sample resolution of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:548
Distance measurement, usually in meters.
Definition: Distance.h:47
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this shape.
Definition: Shape.cpp:422
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
Definition: Shape.cpp:846
Definition: Shape.h:85
Definition: Shape.h:83
Cube * cube()
Get the Cube * associated with this display property.
Definition: Shape.cpp:325
Angle emissionAngle() const
Get the emission angle of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:482
double lineResolution() const
Get the line resolution of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:504
QString serialNumber()
Get the serial number.
Definition: Shape.cpp:386
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:623
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:112
Shape(QString shapeFileName, QObject *parent=0)
Create an Shape from a cube file on disk.
Definition: Shape.cpp:45
Definition: Image.h:43
geos::geom::MultiPolygon * footprint()
Get the footprint of this shape (if available).
Definition: Shape.cpp:395
QString id() const
Get a unique, identifying string associated with this shape.
Definition: Shape.cpp:460
QString fileName() const
Get the file name of the cube that this shape represents.
Definition: Shape.cpp:377
void fromPvl(const PvlObject &pvl)
Read the shape settings from a Pvl.
Definition: Shape.cpp:236
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Shape.cpp:403
Defines an angle and provides unit conversions.
Definition: Angle.h:62
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void deleteFromDisk()
Delete the shape data from disk.
Definition: Shape.cpp:592
This represents a shape in a project-based GUI interface.
Definition: Shape.h:78
Definition: Shape.h:84
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Q_DECLARE_METATYPE(Isis::Shape *)
Definition: Shape.h:82
double aspectRatio() const
Get the aspect ratio of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:450
Angle phaseAngle() const
Get the phase angle of this shape, as calculated and attached by camstats.
Definition: Shape.cpp:537
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:25
ControlPoint::SurfacePointSource::Source surfacePointSource()
Definition: Shape.cpp:209
bool isFootprintable() const
Test to see if it&#39;s possible to create a footprint from this shape.
Definition: Shape.cpp:294
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
IO Handler for Isis Cubes.
Definition: Cube.h:170
ShapeType shapeType()
Definition: Shape.cpp:219