Skip to content

Commit

Permalink
Rename TerrainQuery to TilesetHeightQuery.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Sep 13, 2024
1 parent d9ff8ac commit 11d9f8e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace Cesium3DTilesSelection {
class TilesetContentManager;
class TilesetMetadata;
class TerrainQuery;
class TilesetHeightQuery;

/**
* @brief A <a
Expand Down Expand Up @@ -440,7 +440,7 @@ class CESIUM3DTILESSELECTION_API Tileset final {
bool queuedForLoad);

struct HeightRequest {
std::vector<TerrainQuery> queries;
std::vector<TilesetHeightQuery> queries;
CesiumAsync::Promise<Tileset::HeightResults> promise;
};

Expand Down
12 changes: 6 additions & 6 deletions Cesium3DTilesSelection/src/Tileset.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "TerrainQuery.h"
#include "TileUtilities.h"
#include "TilesetContentManager.h"
#include "TilesetHeightQuery.h"

#include <Cesium3DTilesSelection/ITileExcluder.h>
#include <Cesium3DTilesSelection/TileID.h>
Expand Down Expand Up @@ -317,7 +317,7 @@ bool Tileset::tryCompleteHeightRequest(

bool tileStillNeedsLoading = false;
std::vector<std::string> warnings;
for (TerrainQuery& query : request.queries) {
for (TilesetHeightQuery& query : request.queries) {
if (query.candidateTiles.empty() && query.additiveCandidateTiles.empty()) {
// Find the initial set of tiles whose bounding volume is intersected by
// the query ray.
Expand Down Expand Up @@ -375,7 +375,7 @@ bool Tileset::tryCompleteHeightRequest(
return false;

// Do the intersect tests
for (TerrainQuery& query : request.queries) {
for (TilesetHeightQuery& query : request.queries) {
for (Tile* pTile : query.additiveCandidateTiles) {
query.intersectVisibleTile(pTile);
}
Expand All @@ -391,7 +391,7 @@ bool Tileset::tryCompleteHeightRequest(
results.warnings = std::move(warnings);

// Populate results with completed queries
for (TerrainQuery& query : request.queries) {
for (TilesetHeightQuery& query : request.queries) {
Tileset::HeightResults::CoordinateResult coordinateResult = {
query.intersectResult.hit.has_value(),
std::move(query.inputCoordinate)};
Expand Down Expand Up @@ -678,7 +678,7 @@ Tileset::getHeightsAtCoordinates(const std::vector<Cartographic>& coordinates) {

Promise promise = this->_asyncSystem.createPromise<Tileset::HeightResults>();

std::vector<TerrainQuery> queries;
std::vector<TilesetHeightQuery> queries;
for (const CesiumGeospatial::Cartographic& coordinate : coordinates) {
CesiumGeospatial::Cartographic startCoordinate(
coordinate.longitude,
Expand All @@ -689,7 +689,7 @@ Tileset::getHeightsAtCoordinates(const std::vector<Cartographic>& coordinates) {
Ellipsoid::WGS84.cartographicToCartesian(startCoordinate),
-Ellipsoid::WGS84.geodeticSurfaceNormal(startCoordinate));

queries.push_back(TerrainQuery{coordinate, std::move(ray)});
queries.push_back(TilesetHeightQuery{coordinate, std::move(ray)});
}

_heightRequests.emplace_back(HeightRequest{std::move(queries), promise});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "TerrainQuery.h"
#include "TilesetHeightQuery.h"

#include "TileUtilities.h"
#include "TilesetContentManager.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ bool boundingVolumeContainsCoordinate(

} // namespace

void TerrainQuery::intersectVisibleTile(Tile* pTile) {
void TilesetHeightQuery::intersectVisibleTile(Tile* pTile) {
TileRenderContent* pRenderContent = pTile->getContent().getRenderContent();
if (!pRenderContent)
return;
Expand Down Expand Up @@ -84,7 +84,7 @@ void TerrainQuery::intersectVisibleTile(Tile* pTile) {
}
}

void TerrainQuery::findCandidateTiles(
void TilesetHeightQuery::findCandidateTiles(
Tile* pTile,
std::vector<std::string>& warnings) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#pragma once

#include <Cesium3DTilesSelection/Tileset.h>
#include <CesiumGeometry/Ray.h>
#include <CesiumGeospatial/Cartographic.h>
#include <CesiumGltfContent/GltfUtilities.h>

#include <set>
#include <string>
#include <vector>

namespace Cesium3DTilesSelection {

class TerrainQuery {
class Tile;

class TilesetHeightQuery {
public:
CesiumGeospatial::Cartographic inputCoordinate;
CesiumGeometry::Ray ray;
Expand Down

0 comments on commit 11d9f8e

Please sign in to comment.