USGS

Isis 3.0 Developer's Reference (API)

Home

FeatureNomenclature.h

Go to the documentation of this file.
00001 #ifndef FeatureNomenclature_h
00002 #define FeatureNomenclature_h
00003 
00004 #include <QObject>
00005 
00006 // This is needed for the QVariant macro
00007 #include <QMetaType>
00008 
00009 class QDomDocument;
00010 class QDomElement;
00011 class QNetworkAccessManager;
00012 class QNetworkReply;
00013 class QNetworkRequest;
00014 class QString;
00015 class QUrl;
00016 class QWidget;
00017 
00018 template <typename T> class QList;
00019 
00020 namespace Isis {
00021   class Distance;
00022   class iTime;
00023   class Latitude;
00024   class Longitude;
00025 
00048   class FeatureNomenclature : public QObject {
00049       Q_OBJECT
00050 
00051     public:
00052 
00054       enum IAUStatus {
00059         NoStatus, 
00064         Approved,
00070         Dropped,
00076         Unapproved };
00077       
00078       FeatureNomenclature();
00079       FeatureNomenclature(const FeatureNomenclature &other);
00080       ~FeatureNomenclature();
00081       
00082       void queryFeatures(QString target,
00083                          Latitude startLat, Longitude startLon,
00084                          Latitude endLat, Longitude endLon);
00085 
00086       class Feature;
00087       QList<Feature> features() const;
00088       bool hasResult() const;
00089 
00090       void swap(FeatureNomenclature &other);
00091       FeatureNomenclature &operator=(const FeatureNomenclature &other);
00092 
00093       static bool featureDiameterGreaterThan(
00094           const FeatureNomenclature::Feature &lhs,
00095           const FeatureNomenclature::Feature &rhs);
00096 
00112       class Feature {
00113       public:          
00114           Feature();
00115           Feature(QDomElement searchResultFeature, IAUStatus status);
00116           Feature(const Feature &other);
00117           ~Feature();
00118 
00119           QWidget *toWidget() const;
00120 
00121           QString id() const;
00122           QString name() const;
00123           QString cleanName() const;
00124           QString controlNet() const;
00125           QString displayName() const;
00126           QString target() const;
00127           QString system() const;
00128           Distance diameter() const;
00129           QString diameterString() const;
00130           Latitude centerLatitude() const;
00131           QString centerLatitudeString() const;
00132           Longitude centerLongitude() const;
00133           QString centerLongitudeString() const;
00134           Latitude northernLatitude() const;
00135           QString northernLatitudeString() const;
00136           Latitude southernLatitude() const;
00137           QString southernLatitudeString() const;
00138           Longitude easternLongitude() const;
00139           QString easternLongitudeString() const;
00140           Longitude westernLongitude() const;
00141           QString westernLongitudeString() const;
00142           QString originatingContinent() const;
00143           QString originatingEthnicity() const;
00144           QString approvalStatus() const;
00145           QString approvalDate() const;
00146           QString featureType() const;
00147           QString referenceString() const;
00148           QString origin() const;
00149           QString lastUpdated() const;
00150           QUrl referenceUrl() const;
00151           QString referenceUrlString() const;
00152           IAUStatus status() const;
00153 
00154           void swap(Feature &other);
00155           Feature &operator=(const Feature &rhs);
00156 
00157         private:
00158           QString getTagText(QString tagName) const;
00159 
00160         private:
00165           QDomElement * m_xmlRepresenation;
00167           IAUStatus  m_approvalStatus;
00168       };
00169 
00170     signals:
00175       void featuresIdentified(FeatureNomenclature *);
00176 
00177     private slots:
00178       void requestFinished(QNetworkReply *);
00179 
00180     private:
00181       void readSearchResults(QDomElement);
00182       void runQuery(QString target,
00183                          Latitude startLat, Longitude startLon,
00184                          Latitude endLat, Longitude endLon);
00185 
00186     private:
00187       QNetworkAccessManager *m_networkMgr; 
00188       QNetworkRequest *m_request; 
00189 
00191       QList<Feature> *m_features;
00193       IAUStatus m_statusApproval;
00195       bool m_lastQuery;
00196   };
00197 
00198 };
00199 
00201 Q_DECLARE_METATYPE(Isis::FeatureNomenclature::Feature);
00202 
00203 #endif