Isis Developer Reference
FeatureNomenclature.h
Go to the documentation of this file.
1 #ifndef FeatureNomenclature_h
2 #define FeatureNomenclature_h
3 
4 #include <QObject>
5 
6 // This is needed for the QVariant macro
7 #include <QMetaType>
8 
9 class QDomDocument;
10 class QDomElement;
11 class QNetworkAccessManager;
12 class QNetworkReply;
13 class QNetworkRequest;
14 class QString;
15 class QUrl;
16 class QWidget;
17 
18 template <typename T> class QList;
19 
20 namespace Isis {
21  class Distance;
22  class iTime;
23  class Latitude;
24  class Longitude;
25 
51  class FeatureNomenclature : public QObject {
52  Q_OBJECT
53 
54  public:
55 
57  enum IAUStatus {
80 
84 
85  void queryFeatures(QString target,
86  Latitude startLat, Longitude startLon,
87  Latitude endLat, Longitude endLon);
88 
89  class Feature;
90  QList<Feature> features() const;
91  bool hasResult() const;
92 
93  void swap(FeatureNomenclature &other);
95 
96  static bool featureDiameterGreaterThan(
98  const FeatureNomenclature::Feature &rhs);
99 
117  class Feature {
118  public:
119  Feature();
120  Feature(QDomElement searchResultFeature, IAUStatus status);
121  Feature(const Feature &other);
122  ~Feature();
123 
124  QWidget *toWidget() const;
125 
126  QString id() const;
127  QString name() const;
128  QString cleanName() const;
129  QString controlNet() const;
130  QString displayName() const;
131  QString target() const;
132  QString system() const;
133  Distance diameter() const;
134  QString diameterString() const;
135  Latitude centerLatitude() const;
136  QString centerLatitudeString() const;
137  Longitude centerLongitude() const;
138  QString centerLongitudeString() const;
139  Latitude northernLatitude() const;
140  QString northernLatitudeString() const;
141  Latitude southernLatitude() const;
142  QString southernLatitudeString() const;
143  Longitude easternLongitude() const;
144  QString easternLongitudeString() const;
145  Longitude westernLongitude() const;
146  QString westernLongitudeString() const;
147  QString originatingContinent() const;
148  QString originatingEthnicity() const;
149  QString approvalStatus() const;
150  QString approvalDate() const;
151  QString featureType() const;
152  QString referenceString() const;
153  QString origin() const;
154  QString lastUpdated() const;
155  QUrl referenceUrl() const;
156  QString referenceUrlString() const;
157  IAUStatus status() const;
158 
159  void swap(Feature &other);
160  Feature &operator=(const Feature &rhs);
161 
162  private:
163  QString getTagText(QString tagName) const;
164 
165  private:
170  QDomElement * m_xmlRepresenation;
172  IAUStatus m_approvalStatus;
173  };
174 
175  signals:
181 
182  private slots:
183  void requestFinished(QNetworkReply *);
184 
185  private:
186  void readSearchResults(QDomElement);
187  void runQuery(QString target,
188  Latitude startLat, Longitude startLon,
189  Latitude endLat, Longitude endLon);
190 
191  private:
192  QNetworkAccessManager *m_networkMgr;
193  QNetworkRequest *m_request;
194 
196  QList<Feature> *m_features;
198  IAUStatus m_statusApproval;
200  bool m_lastQuery;
201  };
202 
203 };
204 
207 
208 #endif
Isis::Angle::Degrees
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
Isis::FeatureNomenclature::Feature::status
IAUStatus status() const
Definition: FeatureNomenclature.cpp:740
Isis::FeatureNomenclature::Feature::approvalDate
QString approvalDate() const
Definition: FeatureNomenclature.cpp:682
QWidget
Isis::FeatureNomenclature::Feature::originatingEthnicity
QString originatingEthnicity() const
Definition: FeatureNomenclature.cpp:666
Isis::FeatureNomenclature::queryFeatures
void queryFeatures(QString target, Latitude startLat, Longitude startLon, Latitude endLat, Longitude endLon)
Makes sure the longitudinal ranges are correct.
Definition: FeatureNomenclature.cpp:100
Isis::FeatureNomenclature::Feature::westernLongitudeString
QString westernLongitudeString() const
Definition: FeatureNomenclature.cpp:649
Isis::FeatureNomenclature::Feature::referenceUrl
QUrl referenceUrl() const
Definition: FeatureNomenclature.cpp:722
Isis::FeatureNomenclature::Feature::diameter
Distance diameter() const
Definition: FeatureNomenclature.cpp:481
Isis::FeatureNomenclature::Feature::centerLatitude
Latitude centerLatitude() const
Definition: FeatureNomenclature.cpp:506
Isis::FeatureNomenclature::Feature::lastUpdated
QString lastUpdated() const
Definition: FeatureNomenclature.cpp:714
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::FeatureNomenclature
Feature nomenclature database querier.
Definition: FeatureNomenclature.h:51
Isis::FeatureNomenclature::Feature::referenceUrlString
QString referenceUrlString() const
Definition: FeatureNomenclature.cpp:730
Isis::FeatureNomenclature::Feature::northernLatitudeString
QString northernLatitudeString() const
Definition: FeatureNomenclature.cpp:572
Isis::FeatureNomenclature::Feature::approvalStatus
QString approvalStatus() const
Definition: FeatureNomenclature.cpp:674
Isis::FeatureNomenclature::Feature::displayName
QString displayName() const
Definition: FeatureNomenclature.cpp:449
Isis::FeatureNomenclature::swap
void swap(FeatureNomenclature &other)
Swap the instances *this and other.
Definition: FeatureNomenclature.cpp:162
Isis::FeatureNomenclature::Feature::northernLatitude
Latitude northernLatitude() const
Definition: FeatureNomenclature.cpp:555
Longitude.h
Isis::FeatureNomenclature::Feature::controlNet
QString controlNet() const
Definition: FeatureNomenclature.cpp:431
Isis::FeatureNomenclature::Feature::target
QString target() const
Definition: FeatureNomenclature.cpp:465
Isis::FeatureNomenclature::Feature::Feature
Feature()
Construct a feature with no data.
Definition: FeatureNomenclature.cpp:214
Isis::FeatureNomenclature::Feature::system
QString system() const
Definition: FeatureNomenclature.cpp:473
Isis::FeatureNomenclature::NoStatus
@ NoStatus
When this status is assigned to a feature, there will be no status displayed and the feature will not...
Definition: FeatureNomenclature.h:62
Isis::FeatureNomenclature::Feature::westernLongitude
Longitude westernLongitude() const
Definition: FeatureNomenclature.cpp:631
Isis::FeatureNomenclature::Feature::~Feature
~Feature()
Clean up allocated memory by this feature.
Definition: FeatureNomenclature.cpp:246
Isis::FeatureNomenclature::Feature
A named feature on a target.
Definition: FeatureNomenclature.h:117
IString.h
Isis::FeatureNomenclature::hasResult
bool hasResult() const
Test if any understandable results have been received from the nomenclature database.
Definition: FeatureNomenclature.cpp:152
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Longitude
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:40
Isis::FeatureNomenclature::Feature::centerLongitude
Longitude centerLongitude() const
Definition: FeatureNomenclature.cpp:530
Isis::Distance::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Distance.h:45
FeatureNomenclature.h
Isis::FeatureNomenclature::Feature::southernLatitude
Latitude southernLatitude() const
Definition: FeatureNomenclature.cpp:580
Latitude.h
Isis::FeatureNomenclature::Feature::featureType
QString featureType() const
Definition: FeatureNomenclature.cpp:690
Isis::FeatureNomenclature::Approved
@ Approved
When this status is assigned to a feature, the displayed status will be "Adopted by the IAU" and the ...
Definition: FeatureNomenclature.h:67
Isis::FeatureNomenclature::Feature::diameterString
QString diameterString() const
Definition: FeatureNomenclature.cpp:498
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::FeatureNomenclature::featureDiameterGreaterThan
static bool featureDiameterGreaterThan(const FeatureNomenclature::Feature &lhs, const FeatureNomenclature::Feature &rhs)
Compare the diameter of two features.
Definition: FeatureNomenclature.cpp:193
Isis::FeatureNomenclature::Feature::operator=
Feature & operator=(const Feature &rhs)
Assign the values of this feature from the values of rhs.
Definition: FeatureNomenclature.cpp:763
Isis::FeatureNomenclature::Feature::name
QString name() const
Definition: FeatureNomenclature.cpp:413
Isis::FeatureNomenclature::Dropped
@ Dropped
When this status is assigned to a feature, the displayed status will be "Dropped, disallowed" and the...
Definition: FeatureNomenclature.h:73
Isis::Distance::isValid
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:192
Isis::FeatureNomenclature::features
QList< Feature > features() const
This gives you the features found in all of the queries so far.
Definition: FeatureNomenclature.cpp:136
Isis::FeatureNomenclature::Feature::origin
QString origin() const
Definition: FeatureNomenclature.cpp:706
Isis::FeatureNomenclature::~FeatureNomenclature
~FeatureNomenclature()
Frees allocated memory.
Definition: FeatureNomenclature.cpp:77
Isis::IException
Isis exception class.
Definition: IException.h:91
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::FeatureNomenclature::featuresIdentified
void featuresIdentified(FeatureNomenclature *)
This is emitted when a query is completed.
Isis::FeatureNomenclature::IAUStatus
IAUStatus
Enumeration of approval statuses.
Definition: FeatureNomenclature.h:57
Isis::FeatureNomenclature::FeatureNomenclature
FeatureNomenclature()
Instantiate a feature nomenclature.
Definition: FeatureNomenclature.cpp:29
Isis::FeatureNomenclature::Unapproved
@ Unapproved
When this status is assigned to a feature, the displayed status will be "Never approved by the IAU" a...
Definition: FeatureNomenclature.h:79
Isis::FeatureNomenclature::operator=
FeatureNomenclature & operator=(const FeatureNomenclature &other)
This takes on the data from rhs.
Definition: FeatureNomenclature.cpp:176
Isis::FeatureNomenclature::Feature::easternLongitudeString
QString easternLongitudeString() const
Definition: FeatureNomenclature.cpp:623
IException.h
Isis::toDouble
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::FeatureNomenclature::Feature::swap
void swap(Feature &other)
Swap the member data of this feature with another feature.
Definition: FeatureNomenclature.cpp:750
Isis::Longitude::to360Range
static QList< QPair< Longitude, Longitude > > to360Range(Longitude startLon, Longitude endLon)
Calculates where the longitude range is in 0-360.
Definition: Longitude.cpp:364
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis::FeatureNomenclature::Feature::id
QString id() const
Definition: FeatureNomenclature.cpp:405
Isis::FeatureNomenclature::Feature::cleanName
QString cleanName() const
Definition: FeatureNomenclature.cpp:421
Isis::FeatureNomenclature::Feature::centerLongitudeString
QString centerLongitudeString() const
Definition: FeatureNomenclature.cpp:547
Isis::FeatureNomenclature::Feature::toWidget
QWidget * toWidget() const
This converts the data in this feature to a widget.
Definition: FeatureNomenclature.cpp:259
iTime.h
QObject
Distance.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Isis::FeatureNomenclature::Feature)
This allows Nomenclature Features to be stored in a QVariant.
IsisDebug.h
Isis::FeatureNomenclature::Feature::originatingContinent
QString originatingContinent() const
Definition: FeatureNomenclature.cpp:658
Isis::FeatureNomenclature::Feature::referenceString
QString referenceString() const
Definition: FeatureNomenclature.cpp:698
Isis::FeatureNomenclature::Feature::centerLatitudeString
QString centerLatitudeString() const
Definition: FeatureNomenclature.cpp:522
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::FeatureNomenclature::Feature::southernLatitudeString
QString southernLatitudeString() const
Definition: FeatureNomenclature.cpp:597
Isis::FeatureNomenclature::Feature::easternLongitude
Longitude easternLongitude() const
Definition: FeatureNomenclature.cpp:605