small fixes, fix test
This commit is contained in:
parent
a3a9177c96
commit
8724a676e8
|
|
@ -74,7 +74,7 @@ static Future<std::vector<std::byte>> resolveSubtreeBuffer(
|
|||
}
|
||||
|
||||
Future<std::unique_ptr<TileContentLoadResult>>
|
||||
load(const TileContentLoadInput& input) {
|
||||
AvailabilitySubtreeContent::load(const TileContentLoadInput& input) {
|
||||
const AsyncSystem& asyncSystem = input.asyncSystem;
|
||||
const std::shared_ptr<spdlog::logger>& pLogger = input.pLogger;
|
||||
const std::string& url = input.pRequest->url();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "Cesium3DTilesSelection/Library.h"
|
||||
#include "Cesium3DTilesSelection/TileContentLoadInput.h"
|
||||
#include "Cesium3DTilesSelection/TileContentLoadResult.h"
|
||||
#include "Cesium3DTilesSelection/TileContentLoader.h"
|
||||
|
|
@ -10,7 +11,8 @@
|
|||
|
||||
namespace Cesium3DTilesSelection {
|
||||
|
||||
class AvailabilitySubtreeContent : public TileContentLoader {
|
||||
class CESIUM3DTILESSELECTION_API AvailabilitySubtreeContent final
|
||||
: public TileContentLoader {
|
||||
public:
|
||||
CesiumAsync::Future<std::unique_ptr<TileContentLoadResult>>
|
||||
load(const TileContentLoadInput& input) override;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@
|
|||
#include <CesiumAsync/IAssetResponse.h>
|
||||
#include <CesiumAsync/ITaskProcessor.h>
|
||||
#include <CesiumGeometry/Axis.h>
|
||||
#include <CesiumGeometry/OctreeTilingScheme.h>
|
||||
#include <CesiumGeometry/QuadtreeTileAvailability.h>
|
||||
#include <CesiumGeometry/QuadtreeTilingScheme.h>
|
||||
#include <CesiumGeometry/TileAvailabilityFlags.h>
|
||||
#include <CesiumGeospatial/Cartographic.h>
|
||||
#include <CesiumGeospatial/GeographicProjection.h>
|
||||
|
|
@ -917,8 +919,7 @@ static std::optional<BoundingVolume> getBoundingVolumeProperty(
|
|||
*boundingVolume,
|
||||
GeographicProjection(),
|
||||
std::nullopt,
|
||||
// std::nullopt
|
||||
};
|
||||
std::nullopt};
|
||||
|
||||
const char* tilingScheme = tilingSchemeIt->value.GetString();
|
||||
if (!std::strcmp(tilingScheme, "QUADTREE")) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
#include <catch2/catch.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace Cesium3DTilesSelection;
|
||||
using namespace CesiumGeometry;
|
||||
using namespace CesiumGeospatial;
|
||||
|
|
@ -377,7 +379,7 @@ void checkGridMesh(
|
|||
const AccessorView<glm::vec3>& positions,
|
||||
const QuadtreeTilingScheme& tilingScheme,
|
||||
const Ellipsoid& ellipsoid,
|
||||
const Rectangle& tileRectangle,
|
||||
const CesiumGeometry::Rectangle& tileRectangle,
|
||||
uint32_t verticesWidth,
|
||||
uint32_t verticesHeight) {
|
||||
double west = tileRectangle.minimumX;
|
||||
|
|
@ -680,25 +682,35 @@ TEST_CASE("Test converting quantized mesh to gltf with skirt") {
|
|||
|
||||
// mock context
|
||||
Ellipsoid ellipsoid = Ellipsoid::WGS84;
|
||||
Rectangle rectangle(
|
||||
CesiumGeometry::Rectangle rectangle(
|
||||
glm::radians(-180.0),
|
||||
glm::radians(-90.0),
|
||||
glm::radians(180.0),
|
||||
glm::radians(90.0));
|
||||
QuadtreeTilingScheme tilingScheme(rectangle, 2, 1);
|
||||
GeographicProjection projection(ellipsoid);
|
||||
BoundingRegion boundingRegion(
|
||||
unprojectRectangleSimple(projection, rectangle),
|
||||
-1000.0,
|
||||
9000.0);
|
||||
TileContext context{};
|
||||
context.implicitContext = ImplicitTilingContext{
|
||||
std::vector<std::string>{},
|
||||
std::nullopt,
|
||||
tilingScheme,
|
||||
GeographicProjection(ellipsoid),
|
||||
QuadtreeTileAvailability(tilingScheme, 23)};
|
||||
std::nullopt,
|
||||
boundingRegion,
|
||||
projection,
|
||||
QuadtreeTileAvailability(tilingScheme, 23),
|
||||
std::nullopt};
|
||||
|
||||
SECTION("Check quantized mesh that has uint16_t indices") {
|
||||
// mock quantized mesh
|
||||
uint32_t verticesWidth = 3;
|
||||
uint32_t verticesHeight = 3;
|
||||
QuadtreeTileID tileID(10, 0, 0);
|
||||
Rectangle tileRectangle = tilingScheme.tileToRectangle(tileID);
|
||||
CesiumGeometry::Rectangle tileRectangle =
|
||||
tilingScheme.tileToRectangle(tileID);
|
||||
BoundingRegion boundingVolume = BoundingRegion(
|
||||
GlobeRectangle(
|
||||
tileRectangle.minimumX,
|
||||
|
|
@ -774,7 +786,8 @@ TEST_CASE("Test converting quantized mesh to gltf with skirt") {
|
|||
uint32_t verticesWidth = 300;
|
||||
uint32_t verticesHeight = 300;
|
||||
QuadtreeTileID tileID(10, 0, 0);
|
||||
Rectangle tileRectangle = tilingScheme.tileToRectangle(tileID);
|
||||
CesiumGeometry::Rectangle tileRectangle =
|
||||
tilingScheme.tileToRectangle(tileID);
|
||||
BoundingRegion boundingVolume = BoundingRegion(
|
||||
GlobeRectangle(
|
||||
tileRectangle.minimumX,
|
||||
|
|
@ -850,7 +863,8 @@ TEST_CASE("Test converting quantized mesh to gltf with skirt") {
|
|||
uint32_t verticesWidth = 255;
|
||||
uint32_t verticesHeight = 255;
|
||||
QuadtreeTileID tileID(10, 0, 0);
|
||||
Rectangle tileRectangle = tilingScheme.tileToRectangle(tileID);
|
||||
CesiumGeometry::Rectangle tileRectangle =
|
||||
tilingScheme.tileToRectangle(tileID);
|
||||
BoundingRegion boundingVolume = BoundingRegion(
|
||||
GlobeRectangle(
|
||||
tileRectangle.minimumX,
|
||||
|
|
@ -926,7 +940,8 @@ TEST_CASE("Test converting quantized mesh to gltf with skirt") {
|
|||
uint32_t verticesWidth = 3;
|
||||
uint32_t verticesHeight = 3;
|
||||
QuadtreeTileID tileID(10, 0, 0);
|
||||
Rectangle tileRectangle = tilingScheme.tileToRectangle(tileID);
|
||||
CesiumGeometry::Rectangle tileRectangle =
|
||||
tilingScheme.tileToRectangle(tileID);
|
||||
BoundingRegion boundingVolume = BoundingRegion(
|
||||
GlobeRectangle(
|
||||
tileRectangle.minimumX,
|
||||
|
|
@ -1005,24 +1020,34 @@ TEST_CASE("Test converting ill-formed quantized mesh") {
|
|||
|
||||
// mock context
|
||||
Ellipsoid ellipsoid = Ellipsoid::WGS84;
|
||||
Rectangle rectangle(
|
||||
CesiumGeometry::Rectangle rectangle(
|
||||
glm::radians(-180.0),
|
||||
glm::radians(-90.0),
|
||||
glm::radians(180.0),
|
||||
glm::radians(90.0));
|
||||
QuadtreeTilingScheme tilingScheme(rectangle, 2, 1);
|
||||
GeographicProjection projection(ellipsoid);
|
||||
BoundingRegion boundingRegion(
|
||||
unprojectRectangleSimple(projection, rectangle),
|
||||
-1000.0,
|
||||
9000.0);
|
||||
TileContext context{};
|
||||
context.implicitContext = ImplicitTilingContext{
|
||||
std::vector<std::string>{},
|
||||
std::nullopt,
|
||||
tilingScheme,
|
||||
GeographicProjection(ellipsoid),
|
||||
QuadtreeTileAvailability(tilingScheme, 23)};
|
||||
std::nullopt,
|
||||
boundingRegion,
|
||||
projection,
|
||||
QuadtreeTileAvailability(tilingScheme, 23),
|
||||
std::nullopt};
|
||||
|
||||
// mock quantized mesh
|
||||
uint32_t verticesWidth = 3;
|
||||
uint32_t verticesHeight = 3;
|
||||
QuadtreeTileID tileID(10, 0, 0);
|
||||
Rectangle tileRectangle = tilingScheme.tileToRectangle(tileID);
|
||||
CesiumGeometry::Rectangle tileRectangle =
|
||||
tilingScheme.tileToRectangle(tileID);
|
||||
BoundingRegion boundingVolume = BoundingRegion(
|
||||
GlobeRectangle(
|
||||
tileRectangle.minimumX,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "CesiumGeometry/Library.h"
|
||||
#include "Library.h"
|
||||
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ namespace CesiumGeometry {
|
|||
|
||||
struct CESIUMGEOMETRY_API AxisAlignedBox final {
|
||||
|
||||
constexpr AxisAlignedBox() noexcept
|
||||
AxisAlignedBox() noexcept
|
||||
: minimumX(0.0),
|
||||
minimumY(0.0),
|
||||
minimumZ(0.0),
|
||||
|
|
@ -20,7 +20,7 @@ struct CESIUMGEOMETRY_API AxisAlignedBox final {
|
|||
lengthZ(0.0),
|
||||
center(0.0) {}
|
||||
|
||||
constexpr AxisAlignedBox(
|
||||
AxisAlignedBox(
|
||||
double minimumX_,
|
||||
double minimumY_,
|
||||
double minimumZ_,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
* @param rootTilesZ The number of tiles at the root of the quadtree in the Z
|
||||
* direction.
|
||||
*/
|
||||
constexpr OctreeTilingScheme(
|
||||
OctreeTilingScheme(
|
||||
const AxisAlignedBox& box,
|
||||
uint32_t rootTilesX,
|
||||
uint32_t rootTilesY,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace CesiumGeometry {
|
||||
|
||||
constexpr OctreeTilingScheme::OctreeTilingScheme(
|
||||
OctreeTilingScheme::OctreeTilingScheme(
|
||||
const AxisAlignedBox& box,
|
||||
uint32_t rootTilesX,
|
||||
uint32_t rootTilesY,
|
||||
|
|
|
|||
Loading…
Reference in New Issue