Isis Developer Reference
Shape.h
Go to the documentation of this file.
1#ifndef Shape_H
2#define Shape_H
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QObject>
13
14#include <QString>
15
16#include "Angle.h"
17#include "ControlPoint.h"
18#include "Distance.h"
19#include "FileName.h"
20#include "Latitude.h"
21#include "Longitude.h"
22#include "XmlStackedHandler.h"
23
24#include <SpiceUsr.h>
25#include <SpiceZfc.h>
26#include <SpiceZmc.h>
27
28class QUuid;
29class QMutex;
30class QXmlStreamWriter;
31
32namespace geos {
33 namespace geom {
34 class MultiPolygon;
35 }
36}
37
38namespace Isis {
39 class Cube;
40 class FileName;
41 class Image;
42 class Project;
43 class PvlObject;
44 class ShapeDisplayProperties;
45 class XmlStackedHandlerReader;
46
68 class Shape : public QObject {
69 Q_OBJECT
70 public:
76
77 explicit Shape(QString shapeFileName, QObject *parent = 0);
78 explicit Shape(Cube *shapeCube, QObject *parent = 0);
79 Shape(FileName shapeFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
80 ~Shape();
81
82 void fromPvl(const PvlObject &pvl);
83 PvlObject toPvl() const;
84
85 bool isFootprintable() const;
86 Cube *cube();
87 void closeCube();
91 ShapeType shapeType();
93 QString fileName() const;
94 QString serialNumber();
95 geos::geom::MultiPolygon *footprint();
96 const geos::geom::MultiPolygon *footprint() const;
97 void setId(QString id);
98
99 bool initFootprint(QMutex *cameraMutex);
100
101 double aspectRatio() const;
102 QString id() const;
103 double resolution() const;
104 Angle emissionAngle() const;
105 Angle incidenceAngle() const;
106 double lineResolution() const;
107 Distance localRadius() const;
108 Angle northAzimuth() const;
109 Angle phaseAngle() const;
110 double sampleResolution() const;
111
112 void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
113 void deleteFromDisk();
114 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
115
116 public slots:
117 void updateFileName(Project *);
118
119 private:
120 Shape(const Shape &other);
121 Shape &operator=(const Shape &rhs);
122
123 void initMemberData();
124 void initShape();
125 void initCamStats();
126 void initMapStats();
127 void initDemStats();
128
129 geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex);
130 void initQuickFootprint();
131
138 class XmlHandler : public XmlStackedHandler {
139 public:
140 XmlHandler(Shape *shape, FileName shapeFolder);
141
142 virtual bool startElement(const QString &namespaceURI, const QString &localName,
143 const QString &qName, const QXmlAttributes &atts);
144 virtual bool characters(const QString &ch);
145 virtual bool endElement(const QString &namespaceURI, const QString &localName,
146 const QString &qName);
147
148 private:
149 Q_DISABLE_COPY(XmlHandler);
150
151 Shape *m_shape;
152 FileName m_shapeFolder;
153 QString m_characters;
154 };
155
156 private:
157 SpiceInt *m_bodyCode;
161// QString *m_name; //!< Name of the target
162
163
168 Cube *m_cube;
169 ControlPoint::SurfacePointSource::Source m_surfacePointSource;
171 ShapeType m_shapeType;
172
176 ShapeDisplayProperties *m_displayProperties;
180 QString m_fileName;
184 QString m_serialNumber;
188 QString m_instrumentId;
192 QString m_spacecraftName;
196 geos::geom::MultiPolygon *m_footprint;
200 QUuid *m_id;
201
202 // Level 1 labels
203 double m_aspectRatio;
204 double m_resolution;
205 Angle m_emissionAngle;
206 Angle m_incidenceAngle;
207 double m_lineResolution;
208 Distance m_localRadius;
209 Angle m_northAzimuth;
210 Angle m_phaseAngle;
211 double m_sampleResolution;
212
213 // Mapping labels
214 QString m_targetName;
215 QString m_projectionName;
216 Longitude m_centerLongitude;
217 Latitude m_centerLatitude;
218 Latitude m_minimumLatitude;
219 Latitude m_maximumLatitude;
220 Longitude m_minimumLongitude;
221 Longitude m_maximumLongitude;
222 double m_pixelResolution;
223 double m_scale;
224
225 // Dem Labels
226 Distance m_minimumRadius;
227 Distance m_maximumRadius;
228 };
229
230}
231
233
234#endif
Q_DECLARE_METATYPE(Isis::Shape *)
Defines an angle and provides unit conversions.
Definition Angle.h:45
IO Handler for Isis Cubes.
Definition Cube.h:168
Distance measurement, usually in meters.
Definition Distance.h:34
File name manipulation and expansion.
Definition FileName.h:100
The main project for ipce.
Definition Project.h:289
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This is the GUI communication mechanism for shape objects.
Definition ShapeDisplayProperties.h:60
This represents a shape in a project-based GUI interface.
Definition Shape.h:68
~Shape()
Clean up this shape.
Definition Shape.cpp:89
Shape(QString shapeFileName, QObject *parent=0)
Create an Shape from a cube file on disk.
Definition Shape.cpp:45
void closeCube()
Cleans up the Cube *.
Definition Shape.cpp:342
PvlObject toPvl() const
Convert this Shape to PVL.
Definition Shape.cpp:268
bool isFootprintable() const
Test to see if it's possible to create a footprint from this shape.
Definition Shape.cpp:294
Distance localRadius() const
Get the local radius of this shape, as calculated and attached by camstats.
Definition Shape.cpp:514
Angle phaseAngle() const
Get the phase angle of this shape, as calculated and attached by camstats.
Definition Shape.cpp:536
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:622
double resolution() const
Get the resolution of this shape, as calculated and attached by camstats.
Definition Shape.cpp:470
QString serialNumber()
Get the serial number.
Definition Shape.cpp:385
double sampleResolution() const
Get the sample resolution of this shape, as calculated and attached by camstats.
Definition Shape.cpp:547
ShapeDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this shape.
Definition Shape.cpp:355
double lineResolution() const
Get the line resolution of this shape, as calculated and attached by camstats.
Definition Shape.cpp:503
void deleteFromDisk()
Delete the shape data from disk.
Definition Shape.cpp:591
Angle emissionAngle() const
Get the emission angle of this shape, as calculated and attached by camstats.
Definition Shape.cpp:481
QString id() const
Get a unique, identifying string associated with this shape.
Definition Shape.cpp:459
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
Definition Shape.cpp:844
double aspectRatio() const
Get the aspect ratio of this shape, as calculated and attached by camstats.
Definition Shape.cpp:449
QString fileName() const
Get the file name of the cube that this shape represents.
Definition Shape.cpp:376
Cube * cube()
Get the Cube * associated with this display property.
Definition Shape.cpp:324
Angle incidenceAngle() const
Get the incidence angle of this shape, as calculated and attached by camstats.
Definition Shape.cpp:492
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this shape into the new project.
Definition Shape.cpp:555
ControlPoint::RadiusSource::Source radiusSource()
Definition Shape.cpp:214
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this shape.
Definition Shape.cpp:421
void fromPvl(const PvlObject &pvl)
Read the shape settings from a Pvl.
Definition Shape.cpp:236
ShapeType shapeType()
Definition Shape.cpp:219
ShapeType
Definition Shape.h:71
@ Unknown
Definition Shape.h:75
@ Unprojected
Definition Shape.h:74
@ Dem
Definition Shape.h:72
@ Basemap
Definition Shape.h:73
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition Shape.cpp:402
Angle northAzimuth() const
Get the north azimuth of this shape, as calculated and attached by camstats.
Definition Shape.cpp:525
ControlPoint::SurfacePointSource::Source surfacePointSource()
Definition Shape.cpp:209
geos::geom::MultiPolygon * footprint()
Get the footprint of this shape (if available).
Definition Shape.cpp:394
XML Handler that parses XMLs in a stack-oriented way.
Definition XmlStackedHandler.h:118
Manage a stack of content handlers for reading XML files.
Definition XmlStackedHandlerReader.h:30
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Definition Image.h:43
Source
Definition ControlPoint.h:453
Source
Definition ControlPoint.h:442