Isis 3 Programmer Reference
FeatureNomenclature.h
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;
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 
201  };
202 
203 };
204 
207 
208 #endif
When this status is assigned to a feature, there will be no status displayed and the feature will not...
void queryFeatures(QString target, Latitude startLat, Longitude startLon, Latitude endLat, Longitude endLon)
Makes sure the longitudinal ranges are correct.
QNetworkRequest * m_request
Network request sent.
void readSearchResults(QDomElement)
This is a helper method for requestFinished.
When this status is assigned to a feature, the displayed status will be "Dropped, disallowed" and the...
IAUStatus m_statusApproval
The approval status of the feature from the database.
FeatureNomenclature()
Instantiate a feature nomenclature.
Feature nomenclature database querier.
IAUStatus m_approvalStatus
The approval status of the feature.
QList< Feature > features() const
This gives you the features found in all of the queries so far.
When this status is assigned to a feature, the displayed status will be "Adopted by the IAU" and the ...
void swap(Feature &other)
Swap the member data of this feature with another feature.
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:63
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
~FeatureNomenclature()
Frees allocated memory.
Feature & operator=(const Feature &rhs)
Assign the values of this feature from the values of rhs.
Feature()
Construct a feature with no data.
Distance measurement, usually in meters.
Definition: Distance.h:47
QList< Feature > * m_features
These are the features identified by the nomenclature database.
QNetworkAccessManager * m_networkMgr
Network manager does request.
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
bool m_lastQuery
True if all queries have finished.
QString getTagText(QString tagName) const
Get the string value of an element of the XML.
When this status is assigned to a feature, the displayed status will be "Never approved by the IAU" a...
void runQuery(QString target, Latitude startLat, Longitude startLon, Latitude endLat, Longitude endLon)
Query the nomenclature database for features inside the given range on the target.
void swap(FeatureNomenclature &other)
Swap the instances *this and other.
QWidget * toWidget() const
This converts the data in this feature to a widget.
QDomElement * m_xmlRepresenation
This is the XML returned by the nomenclature DB.
~Feature()
Clean up allocated memory by this feature.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void requestFinished(QNetworkReply *)
This is called when a query is done.
static bool featureDiameterGreaterThan(const FeatureNomenclature::Feature &lhs, const FeatureNomenclature::Feature &rhs)
Compare the diameter of two features.
void featuresIdentified(FeatureNomenclature *)
This is emitted when a query is completed.
bool hasResult() const
Test if any understandable results have been received from the nomenclature database.
FeatureNomenclature & operator=(const FeatureNomenclature &other)
This takes on the data from rhs.
A named feature on a target.
IAUStatus
Enumeration of approval statuses.