Isis 3 Programmer Reference
|
Feature nomenclature database querier. More...
#include <FeatureNomenclature.h>
Classes | |
class | Feature |
A named feature on a target. More... | |
Public Types | |
enum | IAUStatus { NoStatus , Approved , Dropped , Unapproved } |
Enumeration of approval statuses. More... | |
Signals | |
void | featuresIdentified (FeatureNomenclature *) |
This is emitted when a query is completed. | |
Public Member Functions | |
FeatureNomenclature () | |
Instantiate a feature nomenclature. | |
FeatureNomenclature (const FeatureNomenclature &other) | |
Copy a feature nomenclature. | |
~FeatureNomenclature () | |
Frees allocated memory. | |
void | queryFeatures (QString target, Latitude startLat, Longitude startLon, Latitude endLat, Longitude endLon) |
Makes sure the longitudinal ranges are correct. | |
QList< Feature > | features () const |
This gives you the features found in all of the queries so far. | |
bool | hasResult () const |
Test if any understandable results have been received from the nomenclature database. | |
void | swap (FeatureNomenclature &other) |
Swap the instances *this and other. | |
FeatureNomenclature & | operator= (const FeatureNomenclature &other) |
This takes on the data from rhs. | |
Static Public Member Functions | |
static bool | featureDiameterGreaterThan (const FeatureNomenclature::Feature &lhs, const FeatureNomenclature::Feature &rhs) |
Compare the diameter of two features. | |
Private Slots | |
void | requestFinished (QNetworkReply *) |
This is called when a query is done. | |
Private Member Functions | |
void | readSearchResults (QDomElement) |
This is a helper method for requestFinished. | |
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. | |
Private Attributes | |
QNetworkAccessManager * | m_networkMgr |
Network manager does request. | |
QNetworkRequest * | m_request |
Network request sent. | |
QList< Feature > * | m_features |
These are the features identified by the nomenclature database. | |
IAUStatus | m_statusApproval |
The approval status of the feature from the database. | |
bool | m_lastQuery |
True if all queries have finished. | |
Feature nomenclature database querier.
This class queries the nomenclature database for features. To use this class, you create a blank instance. Then you connect to the featuresIdentified() signal. Finally, you call query with the appropriate input data. You can call query as many times as you want; featuresIdentified() will be emitted the same number of times. Finally, you can access the features with features().
2012-06-06 Steven Lambright and Kimbelry Oyama - Added an enumerator for the approval status of each feature. Modified queryFeatures() to ensure the correct longitude domain is used. References #852. Fixes #892. Fixes #855.
2012-06-29 Steven Lambright and Kimberly Oyama - Separated queryFeatures() into: 1) queryFeatures(), which makes sure the longitude range is between 0 and 360 and that it is in the 360 domain, and calls the request method, and 2) runQuery(), which makes the request. Fixes #958.
2018-01-05 Cole Neubauer - The URL for request was moved. Updated the URL to the new URL and added an error to be thrown if it is moved again Fixes #4963.
Definition at line 51 of file FeatureNomenclature.h.
Enumeration of approval statuses.
Definition at line 57 of file FeatureNomenclature.h.
Isis::FeatureNomenclature::FeatureNomenclature | ( | ) |
Instantiate a feature nomenclature.
This prepares to make network requests.
Definition at line 28 of file FeatureNomenclature.cpp.
References m_features, m_lastQuery, m_networkMgr, m_request, and requestFinished().
Isis::FeatureNomenclature::FeatureNomenclature | ( | const FeatureNomenclature & | other | ) |
Copy a feature nomenclature.
Data being queried currently will not be available in the copy, but ready results will be available.
other | The feature nomenclature to copy |
Definition at line 55 of file FeatureNomenclature.cpp.
References m_features, m_lastQuery, m_networkMgr, m_request, and requestFinished().
Isis::FeatureNomenclature::~FeatureNomenclature | ( | ) |
Frees allocated memory.
Definition at line 76 of file FeatureNomenclature.cpp.
References m_features, m_networkMgr, and m_request.
|
static |
Compare the diameter of two features.
This is very useful for sorting with std::sort(). If lhs > rhs, then this returns true. This considers valid data
invalid data.
lhs | The left hand side of the '>' operator |
rhs | The right hand side of the '>' operator |
Definition at line 192 of file FeatureNomenclature.cpp.
Referenced by Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::ViewportFeatureDisplay().
QList< FeatureNomenclature::Feature > Isis::FeatureNomenclature::features | ( | ) | const |
This gives you the features found in all of the queries so far.
If all of the queries are finished, then this list will contain all of the results. The list will be empty if no queries have succeeded so far.
Definition at line 135 of file FeatureNomenclature.cpp.
References m_features.
|
signal |
This is emitted when a query is completed.
When emitted, the this pointer is provided.
Referenced by requestFinished().
bool Isis::FeatureNomenclature::hasResult | ( | ) | const |
Test if any understandable results have been received from the nomenclature database.
Definition at line 151 of file FeatureNomenclature.cpp.
References m_features.
FeatureNomenclature & Isis::FeatureNomenclature::operator= | ( | const FeatureNomenclature & | rhs | ) |
This takes on the data from rhs.
Active queries will not be copied. This is exception safe.
rhs | The FeatureNomenclature on the right hand side of the '=' |
Definition at line 175 of file FeatureNomenclature.cpp.
References swap().
void Isis::FeatureNomenclature::queryFeatures | ( | QString | target, |
Latitude | startLat, | ||
Longitude | startLon, | ||
Latitude | endLat, | ||
Longitude | endLon ) |
Makes sure the longitudinal ranges are correct.
If the range intersects with the 0 line the range is split into two ranges, the minimum to 360 and 0 to the maximum. Then it runs a query on each range.
target | The target for which features might be present |
startLat | The minimum latitude of the ground range to search |
startLon | The minimum longitude of the ground range to search |
endLat | The maximum latitude of the ground range to search |
endLon | The maximum longitude of the ground range to search |
Definition at line 99 of file FeatureNomenclature.cpp.
References m_lastQuery, runQuery(), and Isis::Longitude::to360Range().
|
private |
This is a helper method for requestFinished.
This takes the search results and creates a Feature for each equivalent XML feature element.
xmlSearchResults | The searchresults XML from the nomenclature server. |
Definition at line 859 of file FeatureNomenclature.cpp.
References Approved, Dropped, m_features, m_statusApproval, NoStatus, and Unapproved.
Referenced by requestFinished().
|
privateslot |
This is called when a query is done.
This adds the features to our feature list and emits featuresIdentified().
reply | The server's response to our request, containing features in XML form. |
Definition at line 800 of file FeatureNomenclature.cpp.
References featuresIdentified(), m_lastQuery, Isis::IException::Programmer, and readSearchResults().
Referenced by FeatureNomenclature(), and FeatureNomenclature().
|
private |
Query the nomenclature database for features inside the given range on the target.
When the last query for the cube is done, featuresIdentified() will be emitted.
You can call query as many times as you'd like, but the results will be cumulative. Errors are reported in the form of a message box.
target | The target for which features might be present |
startLat | The minimum latitude of the ground range to search |
startLon | The minimum longitude of the ground range to search |
endLat | The maximum latitude of the ground range to search |
endLon | The maximum longitude of the ground range to search |
Definition at line 905 of file FeatureNomenclature.cpp.
References m_networkMgr, and m_request.
Referenced by queryFeatures().
void Isis::FeatureNomenclature::swap | ( | FeatureNomenclature & | other | ) |
Swap the instances *this and other.
This cannot throw an exception.
other | The FeatureNomenclature to trade data with. |
Definition at line 161 of file FeatureNomenclature.cpp.
References m_features, m_networkMgr, and m_request.
Referenced by Isis::FeatureNomenclature::Feature::operator=(), and operator=().
These are the features identified by the nomenclature database.
Definition at line 196 of file FeatureNomenclature.h.
Referenced by FeatureNomenclature(), FeatureNomenclature(), features(), hasResult(), readSearchResults(), swap(), and ~FeatureNomenclature().
|
private |
True if all queries have finished.
Definition at line 200 of file FeatureNomenclature.h.
Referenced by FeatureNomenclature(), FeatureNomenclature(), queryFeatures(), and requestFinished().
|
private |
Network manager does request.
Definition at line 192 of file FeatureNomenclature.h.
Referenced by FeatureNomenclature(), FeatureNomenclature(), runQuery(), swap(), and ~FeatureNomenclature().
|
private |
Network request sent.
Definition at line 193 of file FeatureNomenclature.h.
Referenced by FeatureNomenclature(), FeatureNomenclature(), runQuery(), swap(), and ~FeatureNomenclature().
|
private |
The approval status of the feature from the database.
Definition at line 198 of file FeatureNomenclature.h.
Referenced by readSearchResults().