[core] rename query options for query rendered features

This commit is contained in:
Ivo van Dongen
2017-03-04 18:44:13 -08:00
committed by Jesse Bounds
parent d82092d606
commit 4d325879b8
14 changed files with 26 additions and 26 deletions

View File

@@ -182,9 +182,9 @@ public:
double getDefaultPitch() const;
// Feature queries
std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const QueryOptions& options = {});
std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const QueryOptions& options = {});
std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const RenderedQueryOptions& options = {});
std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const RenderedQueryOptions& options = {});
AnnotationIDs queryPointAnnotations(const ScreenBox&);
// Memory

View File

@@ -6,9 +6,9 @@
namespace mbgl {
/**
* Options for Map queries.
* Options for query rendered features.
*/
class QueryOptions {
class RenderedQueryOptions {
public:
/** layerIDs to include in the query */
optional<std::vector<std::string>> layerIDs;

View File

@@ -882,7 +882,7 @@ void NodeMap::QueryRenderedFeatures(const Nan::FunctionCallbackInfo<v8::Value>&
return Nan::ThrowTypeError("First argument must have two components");
}
mbgl::QueryOptions queryOptions;
mbgl::RenderedQueryOptions queryOptions;
if (!info[1]->IsNull() && !info[1]->IsUndefined()) {
if (!info[1]->IsObject()) {
return Nan::ThrowTypeError("options argument must be an object");

View File

@@ -59,7 +59,7 @@ void FeatureIndex::query(
const float bearing,
const double tileSize,
const double scale,
const QueryOptions& queryOptions,
const RenderedQueryOptions& queryOptions,
const GeometryTileData& geometryTileData,
const CanonicalTileID& tileID,
const style::Style& style,
@@ -98,7 +98,7 @@ void FeatureIndex::addFeature(
std::unordered_map<std::string, std::vector<Feature>>& result,
const IndexedSubfeature& indexedFeature,
const GeometryCoordinates& queryGeometry,
const QueryOptions& options,
const RenderedQueryOptions& options,
const GeometryTileData& geometryTileData,
const CanonicalTileID& tileID,
const style::Style& style,

View File

@@ -11,7 +11,7 @@
namespace mbgl {
class QueryOptions;
class RenderedQueryOptions;
namespace style {
class Style;
@@ -41,7 +41,7 @@ public:
const float bearing,
const double tileSize,
const double scale,
const QueryOptions& options,
const RenderedQueryOptions& options,
const GeometryTileData&,
const CanonicalTileID&,
const style::Style&,
@@ -61,7 +61,7 @@ private:
std::unordered_map<std::string, std::vector<Feature>>& result,
const IndexedSubfeature&,
const GeometryCoordinates& queryGeometry,
const QueryOptions& options,
const RenderedQueryOptions& options,
const GeometryTileData&,
const CanonicalTileID&,
const style::Style&,

View File

@@ -809,7 +809,7 @@ void Map::removeAnnotation(AnnotationID annotation) {
#pragma mark - Feature query api
std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, const QueryOptions& options) {
std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, const RenderedQueryOptions& options) {
if (!impl->style) return {};
return impl->style->queryRenderedFeatures(
@@ -819,7 +819,7 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, c
);
}
std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const QueryOptions& options) {
std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const RenderedQueryOptions& options) {
if (!impl->style) return {};
return impl->style->queryRenderedFeatures(
@@ -836,7 +836,7 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const Quer
}
AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) {
QueryOptions options;
RenderedQueryOptions options;
options.layerIDs = {{ AnnotationManager::PointLayerID }};
auto features = queryRenderedFeatures(box, options);
std::set<AnnotationID> set;

View File

@@ -206,7 +206,7 @@ void Source::Impl::reloadTiles() {
std::unordered_map<std::string, std::vector<Feature>> Source::Impl::queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
const QueryOptions& options) const {
const RenderedQueryOptions& options) const {
std::unordered_map<std::string, std::vector<Feature>> result;
if (renderTiles.empty() || geometry.empty()) {
return result;

View File

@@ -24,6 +24,7 @@ class Painter;
class FileSource;
class TransformState;
class RenderTile;
class RenderedQueryOptions;
namespace algorithm {
class ClipIDGenerator;
@@ -32,7 +33,6 @@ class ClipIDGenerator;
namespace style {
class UpdateParameters;
class QueryParameters;
class SourceObserver;
class Source::Impl : public TileObserver, private util::noncopyable {
@@ -68,7 +68,7 @@ public:
std::unordered_map<std::string, std::vector<Feature>>
queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
const QueryOptions& options) const;
const RenderedQueryOptions& options) const;
void setCacheSize(size_t);
void onLowMemory();

View File

@@ -505,7 +505,7 @@ RenderData Style::getRenderData(MapDebugOptions debugOptions, float angle) const
std::vector<Feature> Style::queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
const QueryOptions& options) const {
const RenderedQueryOptions& options) const {
std::unordered_set<std::string> sourceFilter;
if (options.layerIDs) {

View File

@@ -29,7 +29,7 @@ class SpriteAtlas;
class LineAtlas;
class RenderData;
class TransformState;
class QueryOptions;
class RenderedQueryOptions;
namespace style {
@@ -99,8 +99,8 @@ public:
std::vector<Feature> queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
const QueryOptions& options) const;
const RenderedQueryOptions& options) const;
float getQueryRadius() const;
void setSourceTileCacheSize(size_t);

View File

@@ -142,7 +142,7 @@ void GeometryTile::queryRenderedFeatures(
std::unordered_map<std::string, std::vector<Feature>>& result,
const GeometryCoordinates& queryGeometry,
const TransformState& transformState,
const QueryOptions& options) {
const RenderedQueryOptions& options) {
if (!featureIndex || !data) return;

View File

@@ -44,7 +44,7 @@ public:
std::unordered_map<std::string, std::vector<Feature>>& result,
const GeometryCoordinates& queryGeometry,
const TransformState&,
const QueryOptions& options) override;
const RenderedQueryOptions& options) override;
void cancel() override;

View File

@@ -33,6 +33,6 @@ void Tile::queryRenderedFeatures(
std::unordered_map<std::string, std::vector<Feature>>&,
const GeometryCoordinates&,
const TransformState&,
const QueryOptions&) {}
const RenderedQueryOptions&) {}
} // namespace mbgl

View File

@@ -21,7 +21,7 @@ class DebugBucket;
class TransformState;
class TileObserver;
class PlacementConfig;
class QueryOptions;
class RenderedQueryOptions;
namespace style {
class Layer;
@@ -56,7 +56,7 @@ public:
std::unordered_map<std::string, std::vector<Feature>>& result,
const GeometryCoordinates& queryGeometry,
const TransformState&,
const QueryOptions& options);
const RenderedQueryOptions& options);
void setTriedOptional();