Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This PR adds support for 3D Tiles Next #58

Open
wants to merge 254 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 241 commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
fd55197
Add 3d tiles next option
ErixenCruz Jan 25, 2021
ef4a87e
Add libmorton as external repo
ErixenCruz Jan 26, 2021
f140fe5
Hidden options fix
ErixenCruz Jan 26, 2021
2aaf5b3
Libmorton include dir
ErixenCruz Jan 26, 2021
01f0bf0
Libmorton include directory from external repo
ErixenCruz Jan 26, 2021
3ab941d
Availability buffer for elevation
ErixenCruz Jan 26, 2021
4709ed6
Fix seg fault when more than one geocell
ErixenCruz Jan 26, 2021
0d0aba3
elevation subtree json
ErixenCruz Jan 26, 2021
b10f7f7
Make converter class and add unit test
ErixenCruz Feb 1, 2021
15e31d1
Availability test
ErixenCruz Feb 1, 2021
ed47fa1
Sanity building check.
ErixenCruz Feb 1, 2021
545fdc2
add FileUtil for writing subtree binary files
ErixenCruz Feb 3, 2021
0578271
Child availability, combine into subtree binary
ErixenCruz Feb 3, 2021
230838b
Fix availability test
ErixenCruz Feb 3, 2021
4f6f7c4
Adds function to write EXT_feature_metadata
sanjeetsuhag Feb 3, 2021
6c5f6f4
Adds _FEATURE_ID attribute to primitive
sanjeetsuhag Feb 3, 2021
c4efccf
Adds individual buffers/bufferViews to integer properties
sanjeetsuhag Feb 3, 2021
8b80c2b
Adds codepath to add feature metadata for 3D Tiles Next
sanjeetsuhag Feb 3, 2021
26b7849
Create implicit tileset json and make b3dms
ErixenCruz Feb 3, 2021
68a10f7
Move content to under root tile
ErixenCruz Feb 3, 2021
28e65e0
Fix subtree file names
ErixenCruz Feb 3, 2021
82a7ffa
Adds alternative method for adding extension
sanjeetsuhag Feb 3, 2021
a208003
Fix buffer length in subtree json
ErixenCruz Feb 3, 2021
9dfb3f5
Add buffers object to subtree json
ErixenCruz Feb 3, 2021
6eb659e
Fix buffers in subtree json
ErixenCruz Feb 3, 2021
fb37725
Byte length smaller if constant avail
ErixenCruz Feb 3, 2021
926c79c
bytelength accounts for constant
ErixenCruz Feb 3, 2021
7ba081b
buffer byte length fix
ErixenCruz Feb 3, 2021
5ce0783
Temporarily fixes extension writing
sanjeetsuhag Feb 3, 2021
4e2ee4c
Removes EXT_feature_metadata from extensionsRequired
sanjeetsuhag Feb 3, 2021
01ea93d
Remove _BATCHID for 3D Tiles Next
sanjeetsuhag Feb 3, 2021
b81d96c
Fixes namespace warnings
sanjeetsuhag Feb 3, 2021
f8e7573
Temporarily adds elementCount property to test in CesiumJS
sanjeetsuhag Feb 5, 2021
574945d
Combine geocells as external tilesets
ErixenCruz Feb 5, 2021
d4590ba
use relative uris
ErixenCruz Feb 5, 2021
2ef2e42
Fix geocell tileset uri. Add levels option
ErixenCruz Feb 8, 2021
4683936
Adds support for FLOAT64 types
sanjeetsuhag Feb 9, 2021
a98949e
Fixes buffer size for FLOAT64 properties
sanjeetsuhag Feb 9, 2021
5bd3cb2
Adds support for STRING type
sanjeetsuhag Feb 9, 2021
c6ab291
Adds schema property to metadata extension
sanjeetsuhag Feb 11, 2021
9fce6c8
negative levels, variable subtree level (broken)
ErixenCruz Feb 15, 2021
fff1f14
Reverted changes from gltf-refactor branch
sanjeetsuhag Feb 17, 2021
fb98df5
input subtree level logic. implicit under level-1
ErixenCruz Feb 18, 2021
52d8ced
fix availability buffer size, pointer logic
ErixenCruz Feb 18, 2021
37fec80
Swap x and y to match RREF UREF
ErixenCruz Feb 19, 2021
d962458
fix subtree uri. Fix bounding region height
ErixenCruz Feb 20, 2021
203829a
Adds tests for extensionsUsed and extensionsRequired in glTF
sanjeetsuhag Feb 21, 2021
cdcb860
Adds CDB Feature Dictionary
sanjeetsuhag Feb 21, 2021
c218a23
Moved CDB attribute maps to CDBAttributes
sanjeetsuhag Feb 22, 2021
6c4a526
Fixes extension checking tests
sanjeetsuhag Feb 22, 2021
a47c6fc
Fixes extensionsRequired test
sanjeetsuhag Feb 22, 2021
84973f1
Fix morton index when more than one subtree
ErixenCruz Feb 24, 2021
437fe1e
Adds WIP data tests for EXT_feature_metadata function
sanjeetsuhag Feb 24, 2021
2823e37
Adds 3DTILES_content_gltf extension to tileset.json
sanjeetsuhag Feb 25, 2021
77825fa
Added schema, count
sanjeetsuhag Feb 26, 2021
58f7dec
Updates README for 3D Tiles Next
sanjeetsuhag Feb 26, 2021
c9357f4
Updated Sandcastle with info tooltip
sanjeetsuhag Feb 26, 2021
aaa0584
Uses existing glTF buffer to write metadata
sanjeetsuhag Feb 26, 2021
3252eb9
Remove zero padding for b3dms
ErixenCruz Feb 26, 2021
f8fd648
Remove faulty delete call
sanjeetsuhag Feb 26, 2021
1432758
Merge pull request #40 from CesiumGS/feature-metadata
ErixenCruz Feb 26, 2021
d2d4187
Updates README.md
sanjeetsuhag Feb 26, 2021
e94b94d
Changes Sandcastle link for 3D Tiles Next demo to standalone version
sanjeetsuhag Feb 26, 2021
30e5278
Merge branch 'feature-metadata' of https://github.com/CesiumGS/cdb-to…
sanjeetsuhag Mar 1, 2021
cf6f8c0
Comments out new instancing code
sanjeetsuhag Mar 1, 2021
7118706
Adds function to create extension, initial writing of buffers with in…
sanjeetsuhag Mar 2, 2021
0f8358e
Adds EXT_mesh_gpu_instancing JSON and node translation for RTC_CENTER
sanjeetsuhag Mar 2, 2021
47758a1
Extensions required and maxLevel
ErixenCruz Mar 2, 2021
7d7aee3
Dont create separate json file for implicit
ErixenCruz Mar 2, 2021
e0d631a
Changes instancing attribute data types from double to float
sanjeetsuhag Mar 2, 2021
9a05c8c
Fixes typo in extension, adds instancing extension as required
sanjeetsuhag Mar 3, 2021
8563e90
Adds ability to write one instances glTF, fixes extension name
sanjeetsuhag Mar 3, 2021
5ea3fcd
Adds fix for image URIs for instanced glTFs
sanjeetsuhag Mar 3, 2021
7439d6e
Adds fix for extension being added to incorrect node
sanjeetsuhag Mar 3, 2021
42d33a3
Fix original tests (zero padding filename etc)
ErixenCruz Mar 4, 2021
5a0e480
Adds initial implementation of combineGltfs
sanjeetsuhag Mar 4, 2021
8ff526d
Adds support for EXT_mesh_gpu_instancing in combineGltfs
sanjeetsuhag Mar 4, 2021
cc4bc7d
Implicit elevation tests
ErixenCruz Mar 4, 2021
dbc8e5e
Remove comments. FileUtil namespace. Tilepath test
ErixenCruz Mar 5, 2021
4cd8b5c
Moves feature ID attribute naming logic to Gltf.cpp
sanjeetsuhag Mar 5, 2021
9d8b4b9
Verify implicit tileset and subtree jsons.
ErixenCruz Mar 5, 2021
eb1c22a
Refactors EXT_feature_metadata creation code
sanjeetsuhag Mar 5, 2021
1a82512
Removes redundant GTModel workaround
sanjeetsuhag Mar 5, 2021
888b12a
local x, y for morton. Fix empty buffer in subtree
ErixenCruz Mar 6, 2021
51868f2
Constant buffers test
ErixenCruz Mar 8, 2021
d0bdd0b
Adds EXT_feature_metadata support in combineGltfs
Mar 8, 2021
6aaf250
Adds command to remove test output for CombineTilesetsTest
Mar 9, 2021
c852da6
Removes redundant unused tags
Mar 9, 2021
097e727
Changes how EXT_feature_metadata extension is added to glTFs
Mar 9, 2021
1487811
initial commit
ErixenCruz Mar 10, 2021
b62e4d7
delete comments, unused function, fix namespace
ErixenCruz Mar 10, 2021
c6ba973
Changes ConverterImpl to CDBTilesetBuilder
Mar 10, 2021
e71d69a
Merge remote-tracking branch 'origin/3d-tiles-next' into availability
Mar 10, 2021
459afc9
Tests for multiple contents json syntax
ErixenCruz Mar 10, 2021
41b5bf9
func for adding availability to general dataset
ErixenCruz Mar 10, 2021
c956f11
Availability subtree json, buffers
ErixenCruz Mar 10, 2021
135bb65
Merge pull request #41 from CesiumGS/availability
sanjeetsuhag Mar 11, 2021
e71d89d
formatting, saving buffers, multicont in json
ErixenCruz Mar 11, 2021
25ce3cf
Merge branch '3d-tiles-next' into multicontent
ErixenCruz Mar 11, 2021
8f24978
Fix namespace of new functions in tileset builder
ErixenCruz Mar 11, 2021
bfb8804
Gremlins from the merge of 3d-tiles-next
ErixenCruz Mar 11, 2021
46c2614
remove dataset as param in flush. syntax errors
ErixenCruz Mar 11, 2021
0ab058d
Move alignTo8 to Utility.h
ErixenCruz Mar 11, 2021
58350ec
save buffers and external buffers in subtree json
ErixenCruz Mar 11, 2021
1639eed
Syntax errors, typos
ErixenCruz Mar 11, 2021
4bbcd0b
Add function for counting set bits in buffer
ErixenCruz Mar 11, 2021
7994440
Update subtree tests for external buffer
ErixenCruz Mar 11, 2021
aaf3cc7
Fix dataset code in implicit content uri
ErixenCruz Mar 11, 2021
db96ce4
Type casting to get around conversion warning
ErixenCruz Mar 11, 2021
2038f24
Merge branch '3d-tiles-next' of https://github.com/CesiumGS/cdb-to-3d…
sanjeetsuhag Mar 12, 2021
c22f803
Typos fixing segfaults, tests. Remove old comments
ErixenCruz Mar 12, 2021
ca3bb5f
fix byteLength in subtree json buffer, bufferView
ErixenCruz Mar 12, 2021
6890864
Adds function to pad JSON bin chunk in GLB to 8 bytes
sanjeetsuhag Mar 15, 2021
a09ca0f
Subtree and tileset json syntax. memcpy buffer fix
ErixenCruz Mar 15, 2021
e5c254a
memcpy availability bin fix
ErixenCruz Mar 15, 2021
5b7b0ce
update subtree and tileset json tests
ErixenCruz Mar 15, 2021
7f50a34
Adds back double attributes, fixes padding for JSON
sanjeetsuhag Mar 15, 2021
5e68377
function for getting tile at level within tileset
ErixenCruz Mar 15, 2021
d479fed
flush multicontent tileset collection
ErixenCruz Mar 15, 2021
5988a0f
Ads glb padding test
Mar 15, 2021
3dfe4f5
Enables writing Feature ID textures
sanjeetsuhag Mar 16, 2021
e576a1a
MultipleContents CDBDataset
ErixenCruz Mar 16, 2021
d92af8d
Make tile bounding region mutable
ErixenCruz Mar 16, 2021
0e34349
Make getTileAtLevel const
ErixenCruz Mar 16, 2021
96028e7
Write geocell json with correct content uris
ErixenCruz Mar 16, 2021
f2905cf
Explicit multicontent json syntax
ErixenCruz Mar 16, 2021
178181d
Dont write availability for absent dataset
ErixenCruz Mar 16, 2021
0e1baea
Unused parameters and clean up comments
ErixenCruz Mar 16, 2021
36fcb20
Remove useless comments
ErixenCruz Mar 16, 2021
bd5d783
Update tests for geocell and subtree json
ErixenCruz Mar 16, 2021
220aa92
typo
ErixenCruz Mar 16, 2021
251de74
Adds featureIdTextures in extension in Elevation mesh primitive
sanjeetsuhag Mar 16, 2021
2ba79c1
Adds CDBRMDescriptor.h/.cpp, adds rapidxml as submodule
sanjeetsuhag Mar 17, 2021
8cf8ef1
Updates LICENSE.md with libmorton and rapidxml MIT licenses
sanjeetsuhag Mar 17, 2021
06a1fe4
Add isGTModelExist fuhnction to CDB
ErixenCruz Mar 17, 2021
6d4f311
change addAvailability to take func pointer, tests
ErixenCruz Mar 17, 2021
a354213
Adds addFeatureTable functionality to RMDescriptor class
sanjeetsuhag Mar 17, 2021
b7f6f2c
Dataset groups for splitting into different refine
ErixenCruz Mar 17, 2021
3e0e878
Combine dataset groups in one tileset and tests
ErixenCruz Mar 17, 2021
8472813
Fix seg fault when first child is null
ErixenCruz Mar 17, 2021
96cf014
datasetGroups, combining jsons, and tests
ErixenCruz Mar 17, 2021
0ae16d7
Connects CDBRMDescriptor feature table writing function to CDBTileset…
sanjeetsuhag Mar 17, 2021
ed9efe2
Adds debug ID property
sanjeetsuhag Mar 18, 2021
dd7f37d
More robust test for getFirstTileAtLevel
ErixenCruz Mar 18, 2021
c8e3aa3
subtreeAvail as param. parent bit setting func
ErixenCruz Mar 18, 2021
0f4d6e2
builder helper functions, tests
ErixenCruz Mar 18, 2021
0d34506
Fixes min and mag filter for Feature ID textures
sanjeetsuhag Mar 18, 2021
90e0432
Typo and set parent bits
ErixenCruz Mar 18, 2021
1d58529
update tests with zero padded uris. delete commets
ErixenCruz Mar 18, 2021
3622b06
Fis GTModel multicontent test
ErixenCruz Mar 18, 2021
0345976
Add cdb, datasetsubtrees as builder member
ErixenCruz Mar 19, 2021
a3231b0
GSFeature write avail when b3dm written
ErixenCruz Mar 19, 2021
221ea18
Make maxLevel depend on datasetGroup
ErixenCruz Mar 19, 2021
f128328
Multi component selector
ErixenCruz Mar 19, 2021
fa03cc6
insertTile also takes bounding volume
ErixenCruz Mar 22, 2021
8ea9d40
Add roadNetwork with multicontent
ErixenCruz Mar 22, 2021
d1ca6c2
Fix URI parsing logic
ErixenCruz Mar 22, 2021
b920c50
Update elevation tests for bounding region fix
ErixenCruz Mar 22, 2021
1d8da2e
Fix GTModels test for fixed bounding region
ErixenCruz Mar 22, 2021
38fa28b
Update GSModel test for fixed bound region
ErixenCruz Mar 22, 2021
e6b7a88
Fix childSubtree bit setting
ErixenCruz Mar 22, 2021
17a964a
Test for RoadNetwork in json
ErixenCruz Mar 22, 2021
cae70dc
Adds CDBMaterials to use enums for base materials to store composite …
sanjeetsuhag Mar 22, 2021
74c79db
ExtensionsUsed/required in root/geocell json
ErixenCruz Mar 22, 2021
ac4e8ad
Adds empty entry to starting of Feature Tables
sanjeetsuhag Mar 22, 2021
f6f3a49
Adds file check for RMTexture
sanjeetsuhag Mar 23, 2021
898a7fb
Adds tinyutf8
sanjeetsuhag Mar 23, 2021
ff08881
make nodeCount formula human friendly
ErixenCruz Mar 23, 2021
42c0909
Fixes string writing bug
sanjeetsuhag Mar 23, 2021
31bed27
fix setParentBits, setMorton, and tests
ErixenCruz Mar 23, 2021
57b8030
datasetGroup dependent tile and childsubtree avail
ErixenCruz Mar 23, 2021
bb640ec
typo
ErixenCruz Mar 23, 2021
d26e9b7
Ensure consistent order of content b/w jsons
ErixenCruz Mar 24, 2021
3a97f70
Content order consistency test
ErixenCruz Mar 24, 2021
90da37a
Cleanup comments, write constant 0 for absent data
ErixenCruz Mar 24, 2021
b3809e1
Remove debugging comments
ErixenCruz Mar 24, 2021
af8ba98
Removes duplicate license for libmorton
sanjeetsuhag Mar 25, 2021
f238dd3
Adds support for external schema for RMDescriptor
sanjeetsuhag Mar 25, 2021
b2e94dd
Ignore repeat URIs at level 0
ErixenCruz Mar 25, 2021
ea7f1d4
Adds --external-schema flag to enable writing materials schema to ext…
sanjeetsuhag Mar 25, 2021
860ae02
Adds integration tests for RMTexture and RMDescriptor processing, add…
sanjeetsuhag Mar 25, 2021
5f97528
Make cdb object pass by reference again
ErixenCruz Mar 25, 2021
315bd96
Remove unused functions and comments
ErixenCruz Mar 25, 2021
d08dd74
Remove CDBDataset::MultipleContents
ErixenCruz Mar 25, 2021
1402868
Capitalize struct names
ErixenCruz Mar 25, 2021
2987c06
Auto formatting
ErixenCruz Mar 25, 2021
3a60ede
Fix geo error on tile level -1
ErixenCruz Mar 25, 2021
c9f2a67
Fixes JSON 8-byte alignment in GLB
sanjeetsuhag Mar 25, 2021
4539ece
Adds back in STRING type support
sanjeetsuhag Mar 25, 2021
54026cf
Adds names and descriptions for STRING CDB attributes
sanjeetsuhag Mar 25, 2021
0a917b5
Adds clarity to GLB padding function and fixes test
sanjeetsuhag Mar 26, 2021
884d3e8
Parent bounding volume contain children, tests
ErixenCruz Mar 26, 2021
bc3fe81
Get rid of datasetgroups, multicontent
ErixenCruz Mar 26, 2021
8d1cb86
Remove dataset group struct
ErixenCruz Mar 29, 2021
bbb44b3
Remove max level tracking in addAvailability
ErixenCruz Mar 29, 2021
50fa339
Unused parameter in tileformatIO
ErixenCruz Mar 29, 2021
07fbfa8
Renames readMaterialsFile function
sanjeetsuhag Mar 29, 2021
9be1507
Renames addFeatureTable function
sanjeetsuhag Mar 29, 2021
1a4cfcd
Remove multiple contents from subtree, tests
ErixenCruz Mar 29, 2021
008bd5a
Adds file exists check for external schemas for RMDescriptor
sanjeetsuhag Mar 29, 2021
2a7e58e
Refactors CDBRMDescriptor::addFeatureTableToGltf to use createMetadat…
sanjeetsuhag Mar 29, 2021
08cfc06
Improves test for external schema for RMDescriptor
sanjeetsuhag Mar 29, 2021
5b0652d
Adds global ParseJsonAsValue function in Gltf.h
sanjeetsuhag Mar 29, 2021
7514f62
Adds global ParseJsonAsValue function in Gltf.h
sanjeetsuhag Mar 29, 2021
0132d89
Move subtree/avail writing within TilesetBuilder
ErixenCruz Mar 29, 2021
ef0ecb0
Formatting
ErixenCruz Mar 29, 2021
15a3f2c
Removes debugIds from CDBRMDescriptor
sanjeetsuhag Mar 29, 2021
5e37c6c
Removes usless variable
sanjeetsuhag Mar 29, 2021
4049db8
Return count instead of updating reference
ErixenCruz Mar 30, 2021
f145908
Check for nullptr, simplify logic in getFirstTile
ErixenCruz Mar 30, 2021
1f2762e
Remove debuggin comment
ErixenCruz Mar 30, 2021
23190e4
Remove useless assignment. Bettter error msg
ErixenCruz Mar 30, 2021
4c11b6b
CDBTo3DTiles namespace comment in tileset builder
ErixenCruz Mar 30, 2021
76fa6b2
Remove multicontent in extensionsUsed/Rquired
ErixenCruz Mar 30, 2021
a115fb5
Adds test for combineGltfs function
sanjeetsuhag Mar 31, 2021
643dc02
Merge pull request #47 from CesiumGS/multicontent
sanjeetsuhag Mar 31, 2021
dc20b33
Fixes formatting, adds default parameters for createGltf and addEleva…
sanjeetsuhag Mar 31, 2021
a70964f
Puts expectedMaterialsCount in a variable for the RMTexture test
sanjeetsuhag Mar 31, 2021
f1049bb
Removes unused functions from CDBImagery and CDBRMTexture
sanjeetsuhag Mar 31, 2021
0c33462
Merge branch 'instancing' of https://github.com/CesiumGS/cdb-to-3dtil…
sanjeetsuhag Mar 31, 2021
7495f6b
Merge pull request #46 from CesiumGS/rmtexture
ErixenCruz Mar 31, 2021
eb00686
Enforces non RTC positions to be written in glTF POSITION attribute w…
Apr 1, 2021
5dd3414
Revert "Enforces non RTC positions to be written in glTF POSITION att…
Apr 1, 2021
7b10ed7
Fixes POSITION RTC calculation error in EXT_mesh_gpu_instancing
sanjeetsuhag Apr 2, 2021
9d72353
Fixes metadata padding for FLOAT64 and UINT32
sanjeetsuhag Apr 2, 2021
40872b2
Refactors adding nodeMatrix to EXT_mesh_gpu_instancing
sanjeetsuhag Apr 2, 2021
dd5f391
Merge branch 'instancing' into instancing-old
sanjeetsuhag Apr 2, 2021
d16f4e9
Merge pull request #48 from CesiumGS/instancing-old
sanjeetsuhag Apr 2, 2021
286004f
Fixes ParseJsonToValue redeclaration
sanjeetsuhag Apr 2, 2021
cd15d4d
Adds back code to generate GLBs for GSModels, GTModels and Vectors wh…
sanjeetsuhag Apr 3, 2021
d3e4814
Merge changes from 3d-tiles-next -> instancing branch
sanjeetsuhag Apr 22, 2021
d8a2100
Merge branch '3d-tiles-next' into instancing
sanjeetsuhag Apr 22, 2021
0ac03a5
Merge pull request #44 from CesiumGS/instancing
sanjeetsuhag Apr 22, 2021
35557c4
Update README
lilleyse Jun 16, 2021
1bade4f
Merge master
sanjeetsuhag Jul 9, 2021
ea4dba4
Merge branch 'master' into 3d-tiles-next
lilleyse Jul 12, 2021
0556b9e
Fixed clang10 compilation errors
lilleyse Jul 12, 2021
a20d929
Update README
lilleyse Jul 12, 2021
9bae38d
Add second demo
lilleyse Jul 20, 2021
c943875
Fix broken 3D Tiles Next links
lilleyse Aug 31, 2021
6b64f5c
Fixed padding not properly updating glb and json chunk byte lengths
nithinp7 Nov 1, 2021
3ed897f
json chunk length should be reference
nithinp7 Nov 1, 2021
c7b1c67
fix possible invalidated references
nithinp7 Nov 1, 2021
df2729f
Updated Catch2 to v2.13.6
Nov 10, 2021
4fbb27d
Merge branch '3d-tiles-next' of https://github.com/CesiumGS/cdb-to-3d…
Nov 10, 2021
9a7ee2c
Add ThirdParty.json
lilleyse May 6, 2022
6647a8f
Fix g++11 build
lilleyse Jul 10, 2022
c2caf2a
Merge pull request #62 from CesiumGS/glb-padding-fix
lilleyse Jul 11, 2022
1c720e8
Fix padding when combining different glTFs
lilleyse Jul 11, 2022
134f80a
Merge pull request #68 from CesiumGS/fix-padding
lilleyse Jul 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@
[submodule "extern/Catch2"]
path = extern/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "extern/libmorton"]
path = extern/libmorton
url = [email protected]:Forceflow/libmorton.git
[submodule "extern/rapidxml"]
path = extern/rapidxml
url = https://github.com/notviri/rapidxml.git
[submodule "extern/tiny-utf8"]
path = extern/tiny-utf8
url = https://github.com/DuffsDevice/tiny-utf8.git
25 changes: 20 additions & 5 deletions CDBTo3DTiles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ add_library(CDBTo3DTiles
src/CDBGeometryVectors.cpp
src/CDBElevation.cpp
src/CDBImagery.cpp
src/CDBRMTexture.cpp
src/CDBRMDescriptor.cpp
src/CDBMaterials.cpp
src/CDBModels.cpp
src/CDBAttributes.cpp
src/CDBDataset.cpp
src/CDBGeoCell.cpp
src/CDBTile.cpp
src/CDBTileset.cpp
src/CDB.cpp
src/CDBTo3DTiles.cpp)
src/CDBTo3DTiles.cpp
src/CDBTilesetBuilder.cpp)

set(PRIVATE_INCLUDE_PATHS
${PROJECT_SOURCE_DIR}/src
Expand All @@ -29,15 +33,25 @@ set(PRIVATE_THIRD_PARTY_INCLUDE_PATHS
${nlohmann_json_INCLUDE_DIRS}
${GDAL_INCLUDE_DIRS}
${tinygltf_INCLUDE_DIRS}
${LIBMORTON_INCLUDE_DIR}
${glm_INCLUDE_DIR}
${rapidxml_INCLUDE_DIR}
${tiny_utf8_INCLUDE_DIRS}
)

target_include_directories(CDBTo3DTiles
foreach(INCLUDE_DIR ${PRIVATE_THIRD_PARTY_INCLUDE_PATHS})
target_include_directories(CDBTo3DTiles
SYSTEM PUBLIC
"$<BUILD_INTERFACE:$<$<BOOL:$<TARGET_PROPERTY:CDBTo3DTiles_THIRD_PARTY_INCLUDE_PRIVATE>>:${PRIVATE_THIRD_PARTY_INCLUDE_PATHS}>>"
${INCLUDE_DIR}
)
endforeach()

target_include_directories(CDBTo3DTiles
PUBLIC
${PROJECT_SOURCE_DIR}/include
"$<BUILD_INTERFACE:$<$<BOOL:$<TARGET_PROPERTY:CDBTo3DTiles_INCLUDE_PRIVATE>>:${PRIVATE_INCLUDE_PATHS}>>")
${CMAKE_CURRENT_LIST_DIR}/../Core/include
${PROJECT_SOURCE_DIR}/include
${PRIVATE_INCLUDE_PATHS}
)

target_link_libraries(CDBTo3DTiles
PRIVATE
Expand All @@ -52,6 +66,7 @@ target_link_libraries(CDBTo3DTiles
meshoptimizer
Core
${GDAL_LIBRARIES})
link_libraries(Core)

set_property(TARGET CDBTo3DTiles
PROPERTY
Expand Down
10 changes: 8 additions & 2 deletions CDBTo3DTiles/include/CDBTo3DTiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <memory>
#include <string>
#include <vector>
#include "../src/CDBTilesetBuilder.h"

namespace CDBTo3DTiles {
class GlobalInitializer
Expand All @@ -23,8 +24,14 @@ class Converter

void combineDataset(const std::vector<std::string> &datasets);

void setUse3dTilesNext(bool use3dTilesNext);

void setExternalSchema(bool externalSchema);

void setGenerateElevationNormal(bool generateElevationNormal);

void setSubtreeLevels(int subtreeLevels);

void setElevationLODOnly(bool elevationLOD);

void setElevationDecimateError(float elevationDecimateError);
Expand All @@ -34,9 +41,8 @@ class Converter
void convert();

private:
struct Impl;
struct TilesetCollection;

std::unique_ptr<Impl> m_impl;
std::unique_ptr<CDBTilesetBuilder> m_impl;
};
} // namespace CDBTo3DTiles
28 changes: 28 additions & 0 deletions CDBTo3DTiles/include/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,32 @@ inline std::vector<std::string> splitString(const std::string &str, const std::s
results.emplace_back(str.substr(last));
return results;
}

inline uint64_t alignTo8(uint64_t v)
{
return (v + 7) & ~7u;
}

inline unsigned int countSetBitsInInteger(unsigned int integer)
{
unsigned int count = 0;
while(integer > 0)
{
if ((integer & 1) == 1)
count += 1;
integer >>= 1;
}
return count;
}

inline unsigned int countSetBitsInVectorOfInts(std::vector<uint8_t> vec)
{
unsigned int count = 0;
for(unsigned int integer : vec)
{
count += countSetBitsInInteger(integer);
}
return count;
}

} // namespace CDBTo3DTiles
71 changes: 71 additions & 0 deletions CDBTo3DTiles/src/CDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,34 @@ bool CDB::isImageryExist(const CDBTile &tile) const
return std::filesystem::exists(imagery);
}

bool CDB::isRMTextureExist(const CDBTile &tile) const
{
CDBTile rmTextureTile = CDBTile(tile.getGeoCell(),
CDBDataset::RMTexture,
1,
1,
tile.getLevel(),
tile.getUREF(),
tile.getRREF());

auto rmTexture = m_path / (rmTextureTile.getRelativePath().string() + ".tif");
return std::filesystem::exists(rmTexture);
}

bool CDB::isRMDescriptorExist(const CDBTile &tile) const
{
CDBTile rmDescriptorTile = CDBTile(tile.getGeoCell(),
CDBDataset::RMDescriptor,
1,
1,
tile.getLevel(),
tile.getUREF(),
tile.getRREF());

auto rmDescriptor = m_path / (rmDescriptorTile.getRelativePath().string() + ".xml");
return std::filesystem::exists(rmDescriptor);
}

std::optional<CDBImagery> CDB::getImagery(const CDBTile &tile) const
{
CDBTile imageryTile = CDBTile(tile.getGeoCell(),
Expand All @@ -464,6 +492,49 @@ std::optional<CDBImagery> CDB::getImagery(const CDBTile &tile) const
return CDBImagery(std::move(imageryDataset), imageryTile);
}

std::optional<CDBRMTexture> CDB::getRMTexture(const CDBTile &tile) const
{
CDBTile rmTextureTile = CDBTile(tile.getGeoCell(),
CDBDataset::RMTexture,
1,
1,
tile.getLevel(),
tile.getUREF(),
tile.getRREF());

auto rmTexturePath = m_path / (rmTextureTile.getRelativePath().string() + ".tif");
if (!std::filesystem::exists(rmTexturePath)) {
return std::nullopt;
}

auto rmTextureDataset = GDALDatasetUniquePtr(
(GDALDataset *) GDALOpen(rmTexturePath.c_str(), GDALAccess::GA_ReadOnly));

if (!rmTextureDataset) {
return std::nullopt;
}

return CDBRMTexture(std::move(rmTextureDataset), rmTextureTile);
}

CDBRMDescriptor* CDB::getRMDescriptor(const CDBTile &tile) const
{
CDBTile rmDescriptorTile = CDBTile(tile.getGeoCell(),
CDBDataset::RMDescriptor,
1,
1,
tile.getLevel(),
tile.getUREF(),
tile.getRREF());

auto rmDescriptorPath = m_path / (rmDescriptorTile.getRelativePath().string() + ".xml");
if (!std::filesystem::exists(rmDescriptorPath)) {
return nullptr;
}

return new CDBRMDescriptor(rmDescriptorPath, rmDescriptorTile);
}

void CDB::forEachDatasetTile(const CDBGeoCell &geoCell,
CDBDataset dataset,
std::function<void(const std::filesystem::path &)> process)
Expand Down
10 changes: 10 additions & 0 deletions CDBTo3DTiles/src/CDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "CDBElevation.h"
#include "CDBGeometryVectors.h"
#include "CDBImagery.h"
#include "CDBRMTexture.h"
#include "CDBRMDescriptor.h"
#include "CDBModels.h"
#include "CDBTileset.h"
#include <filesystem>
Expand Down Expand Up @@ -41,8 +43,16 @@ class CDB

bool isImageryExist(const CDBTile &tile) const;

bool isRMTextureExist(const CDBTile &tile) const;

bool isRMDescriptorExist(const CDBTile &tile) const;

std::optional<CDBImagery> getImagery(const CDBTile &tile) const;

std::optional<CDBRMTexture> getRMTexture(const CDBTile &tile) const;

CDBRMDescriptor* getRMDescriptor(const CDBTile &tile) const;

static const std::filesystem::path TILES;
static const std::filesystem::path METADATA;
static const std::filesystem::path GTModel;
Expand Down
Loading