Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Commit 1f6576b

Browse files
Surface API TeamKai DietrichmnonnenmachermorishuzNicolasNeubauer
committed
Geoidal high land; A tiny, mountainous mesh; triangulated
Co-authored-by: Kai Dietrich <[email protected]> Co-authored-by: Martin Nonnenmacher <[email protected]> Co-authored-by: Mauritius Seeger <[email protected]> Co-authored-by: Nicolas Neubauer <[email protected]> Co-authored-by: Seeger, Mauritius <[email protected]> Co-authored-by: Tymofii Baga <[email protected]> Co-authored-by: Vova Bilonenko <[email protected]> Co-authored-by: Yaogang Lian <[email protected]>
0 parents  commit 1f6576b

File tree

117 files changed

+47676
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+47676
-0
lines changed

.clang-format

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
DisableFormat: false
3+
ColumnLimit: 98 #78+5*IndentWidth
4+
IndentWidth: 4
5+
TabWidth: 4
6+
UseTab: Never
7+
8+
AccessModifierOffset: -2
9+
10+
AlignAfterOpenBracket: Align
11+
AlignConsecutiveAssignments: false
12+
AlignConsecutiveDeclarations: false
13+
AlignEscapedNewlines: DontAlign
14+
AlignOperands: false
15+
AlignTrailingComments: false
16+
17+
AllowAllParametersOfDeclarationOnNextLine: true
18+
19+
AllowShortBlocksOnASingleLine: false
20+
AllowShortCaseLabelsOnASingleLine: true
21+
AllowShortFunctionsOnASingleLine: Inline
22+
AllowShortIfStatementsOnASingleLine: true
23+
AllowShortLoopsOnASingleLine: false
24+
25+
AlwaysBreakAfterReturnType: None
26+
AlwaysBreakBeforeMultilineStrings: true
27+
AlwaysBreakTemplateDeclarations: true
28+
BinPackArguments: false
29+
BinPackParameters: false
30+
31+
BreakBeforeBraces: Custom
32+
BraceWrapping:
33+
AfterClass: true
34+
AfterControlStatement: true
35+
AfterEnum: true
36+
AfterFunction: true
37+
AfterNamespace: false
38+
AfterObjCDeclaration: true
39+
AfterStruct: true
40+
AfterUnion: true
41+
BeforeCatch: true
42+
BeforeElse: true
43+
IndentBraces: false
44+
45+
BreakBeforeBinaryOperators: None
46+
BreakBeforeInheritanceComma: false
47+
BreakBeforeTernaryOperators: true
48+
49+
BreakConstructorInitializersBeforeComma: true
50+
BreakConstructorInitializers: AfterColon
51+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
52+
ConstructorInitializerIndentWidth: 4
53+
BreakStringLiterals: false
54+
55+
CompactNamespaces: false
56+
ContinuationIndentWidth: 4
57+
DerivePointerAlignment: false
58+
ExperimentalAutoDetectBinPacking: false
59+
FixNamespaceComments: true
60+
61+
IndentCaseLabels: true
62+
IndentWrappedFunctionNames: false
63+
IndentPPDirectives: AfterHash
64+
KeepEmptyLinesAtTheStartOfBlocks: true
65+
MacroBlockBegin: ''
66+
MacroBlockEnd: ''
67+
MaxEmptyLinesToKeep: 1
68+
NamespaceIndentation: None
69+
PenaltyBreakAssignment: 2
70+
PenaltyBreakBeforeFirstCallParameter: 19
71+
PenaltyBreakComment: 300
72+
PenaltyBreakFirstLessLess: 120
73+
PenaltyBreakString: 1000
74+
PenaltyExcessCharacter: 500
75+
PenaltyReturnTypeOnItsOwnLine: 1000
76+
PointerAlignment: Left
77+
ReflowComments: false
78+
SortIncludes: false
79+
80+
SpaceAfterCStyleCast: false
81+
SpaceAfterTemplateKeyword: false
82+
SpaceBeforeAssignmentOperators: true
83+
SpaceBeforeParens: Never
84+
SpaceInEmptyParentheses: false
85+
SpacesBeforeTrailingComments: 1
86+
SpacesInAngles: false
87+
SpacesInContainerLiterals: false
88+
SpacesInCStyleCastParentheses: false
89+
SpacesInParentheses: false
90+
SpacesInSquareBrackets: false
91+
92+
---
93+
Language: Cpp
94+
Standard: Cpp11
95+
Cpp11BracedListStyle: true
96+
...

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Dockerfile
2+
build-docker.sh
3+
README.md
4+
3rdparty/

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.DS_Store
2+
build*/
3+
.kdev4/
4+
*.kdev4
5+
.vscode
6+
3rdparty/
7+
scripts/benchmarkcsv2pdf/tin_terrain_benchmarks.csv.pdf
8+

CMakeLists.txt

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
project(tin-terrain)
4+
5+
option(TNTN_TEST "include test targets in the buildsystem" OFF)
6+
option(TNTN_DOWNLOAD_DEPS "download dependencies during cmake configure" ON)
7+
#option(TNTN_USE_ADDONS "" OFF)
8+
9+
set(CMAKE_CXX_STANDARD 14)
10+
11+
12+
# get the current working branch
13+
execute_process(
14+
COMMAND git describe --all --dirty
15+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
16+
OUTPUT_VARIABLE TNTN_GIT_DESCRIPTION
17+
OUTPUT_STRIP_TRAILING_WHITESPACE
18+
)
19+
20+
# last commit hash
21+
execute_process(
22+
COMMAND git log -1 --format=%H
23+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
24+
OUTPUT_VARIABLE TNTN_GIT_COMMIT_HASH
25+
OUTPUT_STRIP_TRAILING_WHITESPACE
26+
)
27+
string(TIMESTAMP TNTN_TIMESTAMP "%Y%m%dT%H%MZ" UTC)
28+
29+
30+
find_package(GDAL REQUIRED)
31+
if(NOT GDAL_FOUND)
32+
message(FATAL_ERROR "GDAL not found, cannot proceed")
33+
endif()
34+
if(NOT GDAL_CONFIG)
35+
message(FATAL_ERROR "gdal-config command not found (not in PATH?), cannot proceed")
36+
endif()
37+
38+
execute_process(
39+
COMMAND ${GDAL_CONFIG} --version
40+
OUTPUT_VARIABLE SYSTEM_GDAL_VERSION
41+
)
42+
43+
if(SYSTEM_GDAL_VERSION VERSION_LESS "2.3")
44+
message(FATAL_ERROR "GDAL version \"${SYSTEM_GDAL_VERSION}\" is too old, at least 2.3 is required")
45+
endif()
46+
47+
# Boost
48+
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
49+
set(Boost_USE_STATIC_LIBS ON)
50+
find_package(Boost REQUIRED COMPONENTS
51+
program_options
52+
filesystem
53+
system
54+
)
55+
56+
include("download-deps.cmake")
57+
find_path(TNTN_LIBGLM_SOURCE_DIR NAMES "glm/glm.hpp" HINTS "${CMAKE_SOURCE_DIR}/3rdparty/glm-0.9.9.0/")
58+
find_path(TNTN_LIBFMT_SOURCE_DIR NAMES "include/fmt/format.h" HINTS "${CMAKE_SOURCE_DIR}/3rdparty/fmt-5.1.0/")
59+
find_path(TNTN_CATCH2_SOURCE_DIR NAMES "catch.hpp" HINTS "${CMAKE_SOURCE_DIR}/3rdparty/Catch2-2.3.0/")
60+
61+
if(NOT TNTN_LIBGLM_SOURCE_DIR)
62+
message(SEND_ERROR "GLM math library source dir not found, please download and set TNTN_LIBGLM_SOURCE_DIR")
63+
endif()
64+
if(NOT TNTN_LIBFMT_SOURCE_DIR)
65+
message(SEND_ERROR "libfmt string formatting library source dir not found, please download and set TNTN_LIBFMT_SOURCE_DIR")
66+
endif()
67+
68+
add_subdirectory("${TNTN_LIBFMT_SOURCE_DIR}")
69+
70+
71+
set(TNTN_SOURCE_FILES
72+
73+
src/dem2tintiles_workflow.cpp
74+
include/tntn/dem2tintiles_workflow.h
75+
76+
src/TileMaker.cpp
77+
include/tntn/TileMaker.h
78+
79+
src/MercatorProjection.cpp
80+
include/tntn/MercatorProjection.h
81+
82+
include/tntn/MeshMode.h
83+
include/tntn/Mesh.h
84+
src/Mesh.cpp
85+
86+
include/tntn/QuadEdge.h
87+
src/QuadEdge.cpp
88+
89+
include/tntn/DelaunayMesh.h
90+
src/DelaunayMesh.cpp
91+
92+
include/tntn/DelaunayTriangle.h
93+
src/DelaunayTriangle.cpp
94+
95+
include/tntn/TerraMesh.h
96+
src/TerraMesh.cpp
97+
98+
include/tntn/TerraUtils.h
99+
src/TerraUtils.cpp
100+
101+
include/tntn/terra_meshing.h
102+
src/terra_meshing.cpp
103+
104+
include/tntn/zemlya_meshing.h
105+
src/zemlya_meshing.cpp
106+
107+
include/tntn/MeshIO.h
108+
src/MeshIO.cpp
109+
110+
include/tntn/geometrix.h
111+
src/geometrix.cpp
112+
113+
include/tntn/SurfacePoints.h
114+
src/SurfacePoints.cpp
115+
116+
include/tntn/ZoomRange.h
117+
118+
include/tntn/util.h
119+
src/util.cpp
120+
121+
include/tntn/logging.h
122+
src/logging.cpp
123+
124+
include/tntn/OFFReader.h
125+
src/OFFReader.cpp
126+
127+
include/tntn/Raster.h
128+
129+
include/tntn/RasterIO.h
130+
src/RasterIO.cpp
131+
132+
include/tntn/Mesh2Raster.h
133+
src/Mesh2Raster.cpp
134+
135+
include/tntn/SuperTriangle.h
136+
src/SuperTriangle.cpp
137+
138+
include/tntn/raster_tools.h
139+
src/raster_tools.cpp
140+
141+
include/tntn/FileFormat.h
142+
143+
include/tntn/tntn_assert.h
144+
145+
include/tntn/File.h
146+
src/File.cpp
147+
148+
include/tntn/QuantizedMeshIO.h
149+
src/QuantizedMeshIO.cpp
150+
151+
include/tntn/MeshWriter.h
152+
src/MeshWriter.cpp
153+
154+
include/tntn/ObjPool.h
155+
156+
include/tntn/benchmark_workflow.h
157+
src/benchmark_workflow.cpp
158+
159+
include/tntn/simple_meshing.h
160+
src/simple_meshing.cpp
161+
162+
include/tntn/Points2Mesh.h
163+
src/Points2Mesh.cpp
164+
165+
include/tntn/endianness.h
166+
include/tntn/BinaryIO.h
167+
src/BinaryIO.cpp
168+
169+
include/tntn/version_info.h
170+
src/version_info.cpp.in
171+
"${CMAKE_CURRENT_BINARY_DIR}/version_info.cpp"
172+
173+
include/tntn/RasterOverviews.h
174+
src/RasterOverviews.cpp
175+
176+
include/tntn/gdal_init.h
177+
src/gdal_init.cpp
178+
179+
include/delaunator_cpp/Delaunator.h
180+
src/Delaunator.cpp
181+
182+
include/tntn/println.h
183+
src/println.cpp
184+
)
185+
186+
if(TNTN_USE_ADDONS)
187+
list(APPEND TNTN_SOURCE_FILES
188+
include/tntn/Raster2Mesh.h
189+
src/Raster2Mesh.cpp
190+
include/tntn/ZemlyaMesh.h
191+
src/ZemlyaMesh.cpp
192+
)
193+
endif()
194+
195+
configure_file(src/version_info.cpp.in version_info.cpp)
196+
197+
198+
add_library(tntn STATIC
199+
${TNTN_SOURCE_FILES}
200+
)
201+
202+
target_compile_definitions(tntn PUBLIC $<$<CONFIG:Debug>:TNTN_DEBUG>)
203+
204+
target_compile_definitions(tntn PUBLIC GLM_FORCE_SWIZZLE GLM_ENABLE_EXPERIMENTAL)
205+
206+
if(TNTN_DOWNLOAD_ADDONS)
207+
target_compile_definitions(tntn PUBLIC TNTN_USE_ADDONS=1)
208+
endif()
209+
210+
target_include_directories(tntn
211+
PUBLIC
212+
${TNTN_LIBGLM_SOURCE_DIR}
213+
${CMAKE_CURRENT_SOURCE_DIR}/include/
214+
${Boost_INCLUDE_DIRS}
215+
216+
PRIVATE
217+
${GDAL_INCLUDE_DIR}
218+
)
219+
if(TNTN_USE_ADDONS)
220+
target_include_directories(tntn
221+
PUBLIC
222+
3rdparty/addons/include/
223+
)
224+
endif()
225+
226+
target_link_libraries(tntn
227+
PUBLIC
228+
${Boost_LIBRARIES}
229+
fmt
230+
231+
PRIVATE
232+
${GDAL_LIBRARY}
233+
)
234+
235+
add_executable(tin-terrain
236+
src/cmd.cpp
237+
)
238+
target_include_directories(tin-terrain
239+
PRIVATE
240+
${Boost_INCLUDE_DIRS}
241+
)
242+
target_link_libraries(tin-terrain
243+
PRIVATE
244+
${Boost_LIBRARIES}
245+
tntn
246+
)
247+
248+
if(TNTN_TEST)
249+
add_subdirectory(test)
250+
endif()

0 commit comments

Comments
 (0)