Skip to content

Commit

Permalink
Added Cesium3DTilesWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Dec 7, 2021
1 parent 44e99f0 commit 2b204aa
Show file tree
Hide file tree
Showing 21 changed files with 1,653 additions and 31 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ add_subdirectory(CesiumGltfWriter)
add_subdirectory(CesiumAsync)
add_subdirectory(Cesium3DTiles)
add_subdirectory(Cesium3DTilesReader)
add_subdirectory(Cesium3DTilesWriter)
add_subdirectory(Cesium3DTilesSelection)
add_subdirectory(CesiumIonClient)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ struct CESIUM3DTILESREADER_API TilesetReaderResult {
std::vector<std::string> warnings;
};

/**
* @brief Options for how to read a tileset.
*/
struct CESIUM3DTILESREADER_API ReadTilesetOptions {};

/**
* @brief Reads tilesets.
*/
Expand Down Expand Up @@ -71,9 +66,7 @@ class CESIUM3DTILESREADER_API TilesetReader {
* @param options Options for how to read the tileset.
* @return The result of reading the tileset.
*/
TilesetReaderResult readTileset(
const gsl::span<const std::byte>& data,
const ReadTilesetOptions& options = ReadTilesetOptions()) const;
TilesetReaderResult readTileset(const gsl::span<const std::byte>& data) const;

private:
CesiumJsonReader::ExtensionReaderContext _context;
Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTilesReader/src/TilesetReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ TilesetReader::getExtensions() const {
return this->_context;
}

TilesetReaderResult TilesetReader::readTileset(
const gsl::span<const std::byte>& data,
const ReadTilesetOptions& /*options*/) const {
TilesetReaderResult
TilesetReader::readTileset(const gsl::span<const std::byte>& data) const {
const CesiumJsonReader::ExtensionReaderContext& context =
this->getExtensions();
TilesetReaderResult result = readTilesetJson(context, data);
Expand Down
64 changes: 64 additions & 0 deletions Cesium3DTilesWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
add_library(Cesium3DTilesWriter "")
configure_cesium_library(Cesium3DTilesWriter)

cesium_glob_files(CESIUM_3DTILES_WRITER_SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/*.cpp
${CMAKE_CURRENT_LIST_DIR}/generated/src/*.cpp
)
cesium_glob_files(CESIUM_3DTILES_WRITER_HEADERS
${CMAKE_CURRENT_LIST_DIR}/src/Cesium3DTilesWriter/*.h
${CMAKE_CURRENT_LIST_DIR}/generated/src/*.h
)
cesium_glob_files(CESIUM_3DTILES_WRITER_PUBLIC_HEADERS
${CMAKE_CURRENT_LIST_DIR}/include/Cesium3DTilesWriter/*.h
${CMAKE_CURRENT_LIST_DIR}/generated/include/Cesium3DTilesWriter/*.h
)
cesium_glob_files(CESIUM_3DTILES_WRITER_TEST_SOURCES
${CMAKE_CURRENT_LIST_DIR}/test/*.cpp
)
cesium_glob_files(CESIUM_3DTILES_WRITER_TEST_HEADERS
${CMAKE_CURRENT_LIST_DIR}/test/*.h
)

set_target_properties(Cesium3DTilesWriter
PROPERTIES
TEST_SOURCES "${CESIUM_3DTILES_WRITER_TEST_SOURCES}"
TEST_HEADERS "${CESIUM_3DTILES_WRITER_TEST_HEADERS}"
TEST_DATA_DIR ${CMAKE_CURRENT_LIST_DIR}/test/data
)

set_target_properties(Cesium3DTilesWriter
PROPERTIES
PUBLIC_HEADER "${CESIUM_3DTILES_WRITER_PUBLIC_HEADERS}"
)

target_sources(
Cesium3DTilesWriter
PRIVATE
${CESIUM_3DTILES_WRITER_SOURCES}
${CESIUM_3DTILES_WRITER_HEADERS}
PUBLIC
${CESIUM_3DTILES_WRITER_PUBLIC_HEADERS}
)

target_include_directories(
Cesium3DTilesWriter
SYSTEM PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/generated/include
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/generated/src
)

target_link_libraries(Cesium3DTilesWriter
PUBLIC
Cesium3DTiles
CesiumJsonWriter
GSL
)

install(TARGETS Cesium3DTilesWriter
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Cesium3DTilesWriter
)
Loading

0 comments on commit 2b204aa

Please sign in to comment.