react-native-cesium 1.2.18 → 1.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/android/CMakeLists.txt +1 -0
- package/android/build.gradle +1 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/cpp/CesiumBridgeAndroid.cpp +44 -18
- package/android/src/main/cpp/CesiumBridgeAndroid.h +9 -0
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/CesiumBridgeJNI.kt +3 -0
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/HybridCesiumView.kt +9 -0
- package/cpp/engine/CameraIntegrator.cpp +82 -47
- package/cpp/engine/CameraIntegrator.hpp +27 -8
- package/cpp/engine/CesiumEngine.cpp +183 -312
- package/cpp/engine/CesiumEngine.hpp +41 -28
- package/cpp/engine/EngineTunables.hpp +6 -5
- package/cpp/engine/GeoidConverter.cpp +32 -11
- package/cpp/engine/GeoidConverter.hpp +41 -0
- package/cpp/engine/GltfToMesh.cpp +14 -5
- package/cpp/engine/ResourcePreparer.cpp +3 -3
- package/cpp/engine/ResourcePreparer.hpp +1 -1
- package/cpp/engine/TerrainFloor.hpp +70 -0
- package/cpp/engine/TerrainHeight.hpp +113 -0
- package/cpp/engine/test/CameraIntegratorTest.cpp +264 -0
- package/cpp/engine/test/GeoidConverterTest.cpp +77 -0
- package/cpp/engine/test/build_and_run.sh +20 -6
- package/ios/CesiumBridge.h +5 -0
- package/ios/CesiumBridge.mm +61 -32
- package/ios/HybridCesiumView.swift +11 -0
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts +34 -9
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JCameraState.hpp +1 -1
- package/nitrogen/generated/android/c++/JCesiumMetrics.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JQuaternion.hpp +1 -1
- package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.cpp +182 -131
- package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.hpp +6 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CameraState.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CesiumMetrics.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Func_void_CameraState.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Func_void_CesiumMetrics.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/HybridCesiumViewSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Quaternion.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/views/HybridCesiumViewManager.kt +26 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/views/HybridCesiumViewStateUpdater.kt +2 -2
- package/nitrogen/generated/ios/ReactNativeCesium-Swift-Cxx-Bridge.hpp +15 -0
- package/nitrogen/generated/ios/c++/HybridCesiumViewSpecSwift.hpp +7 -0
- package/nitrogen/generated/ios/c++/views/HybridCesiumViewComponent.mm +217 -161
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec_cxx.swift +24 -0
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.cpp +36 -335
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.hpp +110 -77
- package/nitrogen/generated/shared/json/CesiumViewConfig.json +1 -0
- package/package.json +12 -12
- package/scripts/cesium/config.mjs +1 -1
- package/scripts/cesium/vcpkg-triplets/arm64-ios-simulator.cmake +3 -0
- package/scripts/cesium/vcpkg-triplets/arm64-ios.cmake +4 -0
- package/src/specs/cesium-view.nitro.ts +34 -9
|
@@ -7,325 +7,50 @@
|
|
|
7
7
|
|
|
8
8
|
#include "HybridCesiumViewComponent.hpp"
|
|
9
9
|
|
|
10
|
-
#include <
|
|
11
|
-
#include <
|
|
12
|
-
#include <utility>
|
|
13
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
16
|
-
#include <react/renderer/core/RawValue.h>
|
|
17
|
-
#include <react/renderer/core/ShadowNode.h>
|
|
18
|
-
#include <react/renderer/core/ComponentDescriptor.h>
|
|
19
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
10
|
+
#include <NitroModules/NitroHash.hpp>
|
|
11
|
+
#include <NitroModules/ReactProp.hpp>
|
|
20
12
|
|
|
21
13
|
namespace margelo::nitro::reactnativecesium::views {
|
|
22
14
|
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
23
17
|
extern const char HybridCesiumViewComponentName[] = "CesiumView";
|
|
24
18
|
|
|
25
19
|
HybridCesiumViewProps::HybridCesiumViewProps(const react::PropsParserContext& context,
|
|
26
20
|
const HybridCesiumViewProps& sourceProps,
|
|
27
21
|
const react::RawProps& rawProps):
|
|
28
22
|
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
29
|
-
ionAccessToken(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
const react::RawValue* rawValue = rawProps.at("pauseRendering", nullptr, nullptr);
|
|
62
|
-
if (rawValue == nullptr) return sourceProps.pauseRendering;
|
|
63
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
64
|
-
return CachedProp<bool>::fromRawValue(*runtime, value, sourceProps.pauseRendering);
|
|
65
|
-
} catch (const std::exception& exc) {
|
|
66
|
-
throw std::runtime_error(std::string("CesiumView.pauseRendering: ") + exc.what());
|
|
67
|
-
}
|
|
68
|
-
}()),
|
|
69
|
-
maximumScreenSpaceError([&]() -> CachedProp<double> {
|
|
70
|
-
try {
|
|
71
|
-
const react::RawValue* rawValue = rawProps.at("maximumScreenSpaceError", nullptr, nullptr);
|
|
72
|
-
if (rawValue == nullptr) return sourceProps.maximumScreenSpaceError;
|
|
73
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
74
|
-
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.maximumScreenSpaceError);
|
|
75
|
-
} catch (const std::exception& exc) {
|
|
76
|
-
throw std::runtime_error(std::string("CesiumView.maximumScreenSpaceError: ") + exc.what());
|
|
77
|
-
}
|
|
78
|
-
}()),
|
|
79
|
-
maximumSimultaneousTileLoads([&]() -> CachedProp<double> {
|
|
80
|
-
try {
|
|
81
|
-
const react::RawValue* rawValue = rawProps.at("maximumSimultaneousTileLoads", nullptr, nullptr);
|
|
82
|
-
if (rawValue == nullptr) return sourceProps.maximumSimultaneousTileLoads;
|
|
83
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
84
|
-
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.maximumSimultaneousTileLoads);
|
|
85
|
-
} catch (const std::exception& exc) {
|
|
86
|
-
throw std::runtime_error(std::string("CesiumView.maximumSimultaneousTileLoads: ") + exc.what());
|
|
87
|
-
}
|
|
88
|
-
}()),
|
|
89
|
-
loadingDescendantLimit([&]() -> CachedProp<double> {
|
|
90
|
-
try {
|
|
91
|
-
const react::RawValue* rawValue = rawProps.at("loadingDescendantLimit", nullptr, nullptr);
|
|
92
|
-
if (rawValue == nullptr) return sourceProps.loadingDescendantLimit;
|
|
93
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
94
|
-
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.loadingDescendantLimit);
|
|
95
|
-
} catch (const std::exception& exc) {
|
|
96
|
-
throw std::runtime_error(std::string("CesiumView.loadingDescendantLimit: ") + exc.what());
|
|
97
|
-
}
|
|
98
|
-
}()),
|
|
99
|
-
msaaSampleCount([&]() -> CachedProp<double> {
|
|
100
|
-
try {
|
|
101
|
-
const react::RawValue* rawValue = rawProps.at("msaaSampleCount", nullptr, nullptr);
|
|
102
|
-
if (rawValue == nullptr) return sourceProps.msaaSampleCount;
|
|
103
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
104
|
-
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.msaaSampleCount);
|
|
105
|
-
} catch (const std::exception& exc) {
|
|
106
|
-
throw std::runtime_error(std::string("CesiumView.msaaSampleCount: ") + exc.what());
|
|
107
|
-
}
|
|
108
|
-
}()),
|
|
109
|
-
ionImageryAssetId([&]() -> CachedProp<double> {
|
|
110
|
-
try {
|
|
111
|
-
const react::RawValue* rawValue = rawProps.at("ionImageryAssetId", nullptr, nullptr);
|
|
112
|
-
if (rawValue == nullptr) return sourceProps.ionImageryAssetId;
|
|
113
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
114
|
-
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.ionImageryAssetId);
|
|
115
|
-
} catch (const std::exception& exc) {
|
|
116
|
-
throw std::runtime_error(std::string("CesiumView.ionImageryAssetId: ") + exc.what());
|
|
117
|
-
}
|
|
118
|
-
}()),
|
|
119
|
-
maximumCachedMiB([&]() -> CachedProp<std::optional<double>> {
|
|
120
|
-
try {
|
|
121
|
-
const react::RawValue* rawValue = rawProps.at("maximumCachedMiB", nullptr, nullptr);
|
|
122
|
-
if (rawValue == nullptr) return sourceProps.maximumCachedMiB;
|
|
123
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
124
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maximumCachedMiB);
|
|
125
|
-
} catch (const std::exception& exc) {
|
|
126
|
-
throw std::runtime_error(std::string("CesiumView.maximumCachedMiB: ") + exc.what());
|
|
127
|
-
}
|
|
128
|
-
}()),
|
|
129
|
-
preloadAncestors([&]() -> CachedProp<std::optional<bool>> {
|
|
130
|
-
try {
|
|
131
|
-
const react::RawValue* rawValue = rawProps.at("preloadAncestors", nullptr, nullptr);
|
|
132
|
-
if (rawValue == nullptr) return sourceProps.preloadAncestors;
|
|
133
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
134
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.preloadAncestors);
|
|
135
|
-
} catch (const std::exception& exc) {
|
|
136
|
-
throw std::runtime_error(std::string("CesiumView.preloadAncestors: ") + exc.what());
|
|
137
|
-
}
|
|
138
|
-
}()),
|
|
139
|
-
preloadSiblings([&]() -> CachedProp<std::optional<bool>> {
|
|
140
|
-
try {
|
|
141
|
-
const react::RawValue* rawValue = rawProps.at("preloadSiblings", nullptr, nullptr);
|
|
142
|
-
if (rawValue == nullptr) return sourceProps.preloadSiblings;
|
|
143
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
144
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.preloadSiblings);
|
|
145
|
-
} catch (const std::exception& exc) {
|
|
146
|
-
throw std::runtime_error(std::string("CesiumView.preloadSiblings: ") + exc.what());
|
|
147
|
-
}
|
|
148
|
-
}()),
|
|
149
|
-
forbidHoles([&]() -> CachedProp<std::optional<bool>> {
|
|
150
|
-
try {
|
|
151
|
-
const react::RawValue* rawValue = rawProps.at("forbidHoles", nullptr, nullptr);
|
|
152
|
-
if (rawValue == nullptr) return sourceProps.forbidHoles;
|
|
153
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
154
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.forbidHoles);
|
|
155
|
-
} catch (const std::exception& exc) {
|
|
156
|
-
throw std::runtime_error(std::string("CesiumView.forbidHoles: ") + exc.what());
|
|
157
|
-
}
|
|
158
|
-
}()),
|
|
159
|
-
enableWaterMask([&]() -> CachedProp<std::optional<bool>> {
|
|
160
|
-
try {
|
|
161
|
-
const react::RawValue* rawValue = rawProps.at("enableWaterMask", nullptr, nullptr);
|
|
162
|
-
if (rawValue == nullptr) return sourceProps.enableWaterMask;
|
|
163
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
164
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.enableWaterMask);
|
|
165
|
-
} catch (const std::exception& exc) {
|
|
166
|
-
throw std::runtime_error(std::string("CesiumView.enableWaterMask: ") + exc.what());
|
|
167
|
-
}
|
|
168
|
-
}()),
|
|
169
|
-
enableFogCulling([&]() -> CachedProp<std::optional<bool>> {
|
|
170
|
-
try {
|
|
171
|
-
const react::RawValue* rawValue = rawProps.at("enableFogCulling", nullptr, nullptr);
|
|
172
|
-
if (rawValue == nullptr) return sourceProps.enableFogCulling;
|
|
173
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
174
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.enableFogCulling);
|
|
175
|
-
} catch (const std::exception& exc) {
|
|
176
|
-
throw std::runtime_error(std::string("CesiumView.enableFogCulling: ") + exc.what());
|
|
177
|
-
}
|
|
178
|
-
}()),
|
|
179
|
-
enforceCulledScreenSpaceError([&]() -> CachedProp<std::optional<bool>> {
|
|
180
|
-
try {
|
|
181
|
-
const react::RawValue* rawValue = rawProps.at("enforceCulledScreenSpaceError", nullptr, nullptr);
|
|
182
|
-
if (rawValue == nullptr) return sourceProps.enforceCulledScreenSpaceError;
|
|
183
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
184
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.enforceCulledScreenSpaceError);
|
|
185
|
-
} catch (const std::exception& exc) {
|
|
186
|
-
throw std::runtime_error(std::string("CesiumView.enforceCulledScreenSpaceError: ") + exc.what());
|
|
187
|
-
}
|
|
188
|
-
}()),
|
|
189
|
-
culledScreenSpaceError([&]() -> CachedProp<std::optional<double>> {
|
|
190
|
-
try {
|
|
191
|
-
const react::RawValue* rawValue = rawProps.at("culledScreenSpaceError", nullptr, nullptr);
|
|
192
|
-
if (rawValue == nullptr) return sourceProps.culledScreenSpaceError;
|
|
193
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
194
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.culledScreenSpaceError);
|
|
195
|
-
} catch (const std::exception& exc) {
|
|
196
|
-
throw std::runtime_error(std::string("CesiumView.culledScreenSpaceError: ") + exc.what());
|
|
197
|
-
}
|
|
198
|
-
}()),
|
|
199
|
-
enableLodTransitionPeriod([&]() -> CachedProp<std::optional<bool>> {
|
|
200
|
-
try {
|
|
201
|
-
const react::RawValue* rawValue = rawProps.at("enableLodTransitionPeriod", nullptr, nullptr);
|
|
202
|
-
if (rawValue == nullptr) return sourceProps.enableLodTransitionPeriod;
|
|
203
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
204
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.enableLodTransitionPeriod);
|
|
205
|
-
} catch (const std::exception& exc) {
|
|
206
|
-
throw std::runtime_error(std::string("CesiumView.enableLodTransitionPeriod: ") + exc.what());
|
|
207
|
-
}
|
|
208
|
-
}()),
|
|
209
|
-
lodTransitionLength([&]() -> CachedProp<std::optional<double>> {
|
|
210
|
-
try {
|
|
211
|
-
const react::RawValue* rawValue = rawProps.at("lodTransitionLength", nullptr, nullptr);
|
|
212
|
-
if (rawValue == nullptr) return sourceProps.lodTransitionLength;
|
|
213
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
214
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.lodTransitionLength);
|
|
215
|
-
} catch (const std::exception& exc) {
|
|
216
|
-
throw std::runtime_error(std::string("CesiumView.lodTransitionLength: ") + exc.what());
|
|
217
|
-
}
|
|
218
|
-
}()),
|
|
219
|
-
sqliteCacheMaxRows([&]() -> CachedProp<std::optional<double>> {
|
|
220
|
-
try {
|
|
221
|
-
const react::RawValue* rawValue = rawProps.at("sqliteCacheMaxRows", nullptr, nullptr);
|
|
222
|
-
if (rawValue == nullptr) return sourceProps.sqliteCacheMaxRows;
|
|
223
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
224
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.sqliteCacheMaxRows);
|
|
225
|
-
} catch (const std::exception& exc) {
|
|
226
|
-
throw std::runtime_error(std::string("CesiumView.sqliteCacheMaxRows: ") + exc.what());
|
|
227
|
-
}
|
|
228
|
-
}()),
|
|
229
|
-
taskProcessorThreads([&]() -> CachedProp<std::optional<double>> {
|
|
230
|
-
try {
|
|
231
|
-
const react::RawValue* rawValue = rawProps.at("taskProcessorThreads", nullptr, nullptr);
|
|
232
|
-
if (rawValue == nullptr) return sourceProps.taskProcessorThreads;
|
|
233
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
234
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.taskProcessorThreads);
|
|
235
|
-
} catch (const std::exception& exc) {
|
|
236
|
-
throw std::runtime_error(std::string("CesiumView.taskProcessorThreads: ") + exc.what());
|
|
237
|
-
}
|
|
238
|
-
}()),
|
|
239
|
-
minAltitudeAboveTerrain([&]() -> CachedProp<std::optional<double>> {
|
|
240
|
-
try {
|
|
241
|
-
const react::RawValue* rawValue = rawProps.at("minAltitudeAboveTerrain", nullptr, nullptr);
|
|
242
|
-
if (rawValue == nullptr) return sourceProps.minAltitudeAboveTerrain;
|
|
243
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
244
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.minAltitudeAboveTerrain);
|
|
245
|
-
} catch (const std::exception& exc) {
|
|
246
|
-
throw std::runtime_error(std::string("CesiumView.minAltitudeAboveTerrain: ") + exc.what());
|
|
247
|
-
}
|
|
248
|
-
}()),
|
|
249
|
-
maxYawRateDegSec([&]() -> CachedProp<std::optional<double>> {
|
|
250
|
-
try {
|
|
251
|
-
const react::RawValue* rawValue = rawProps.at("maxYawRateDegSec", nullptr, nullptr);
|
|
252
|
-
if (rawValue == nullptr) return sourceProps.maxYawRateDegSec;
|
|
253
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
254
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxYawRateDegSec);
|
|
255
|
-
} catch (const std::exception& exc) {
|
|
256
|
-
throw std::runtime_error(std::string("CesiumView.maxYawRateDegSec: ") + exc.what());
|
|
257
|
-
}
|
|
258
|
-
}()),
|
|
259
|
-
maxPitchRateDegSec([&]() -> CachedProp<std::optional<double>> {
|
|
260
|
-
try {
|
|
261
|
-
const react::RawValue* rawValue = rawProps.at("maxPitchRateDegSec", nullptr, nullptr);
|
|
262
|
-
if (rawValue == nullptr) return sourceProps.maxPitchRateDegSec;
|
|
263
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
264
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxPitchRateDegSec);
|
|
265
|
-
} catch (const std::exception& exc) {
|
|
266
|
-
throw std::runtime_error(std::string("CesiumView.maxPitchRateDegSec: ") + exc.what());
|
|
267
|
-
}
|
|
268
|
-
}()),
|
|
269
|
-
maxRollRateDegSec([&]() -> CachedProp<std::optional<double>> {
|
|
270
|
-
try {
|
|
271
|
-
const react::RawValue* rawValue = rawProps.at("maxRollRateDegSec", nullptr, nullptr);
|
|
272
|
-
if (rawValue == nullptr) return sourceProps.maxRollRateDegSec;
|
|
273
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
274
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxRollRateDegSec);
|
|
275
|
-
} catch (const std::exception& exc) {
|
|
276
|
-
throw std::runtime_error(std::string("CesiumView.maxRollRateDegSec: ") + exc.what());
|
|
277
|
-
}
|
|
278
|
-
}()),
|
|
279
|
-
maxClimbRateMps([&]() -> CachedProp<std::optional<double>> {
|
|
280
|
-
try {
|
|
281
|
-
const react::RawValue* rawValue = rawProps.at("maxClimbRateMps", nullptr, nullptr);
|
|
282
|
-
if (rawValue == nullptr) return sourceProps.maxClimbRateMps;
|
|
283
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
284
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxClimbRateMps);
|
|
285
|
-
} catch (const std::exception& exc) {
|
|
286
|
-
throw std::runtime_error(std::string("CesiumView.maxClimbRateMps: ") + exc.what());
|
|
287
|
-
}
|
|
288
|
-
}()),
|
|
289
|
-
maxGroundSpeedMps([&]() -> CachedProp<std::optional<double>> {
|
|
290
|
-
try {
|
|
291
|
-
const react::RawValue* rawValue = rawProps.at("maxGroundSpeedMps", nullptr, nullptr);
|
|
292
|
-
if (rawValue == nullptr) return sourceProps.maxGroundSpeedMps;
|
|
293
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
294
|
-
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxGroundSpeedMps);
|
|
295
|
-
} catch (const std::exception& exc) {
|
|
296
|
-
throw std::runtime_error(std::string("CesiumView.maxGroundSpeedMps: ") + exc.what());
|
|
297
|
-
}
|
|
298
|
-
}()),
|
|
299
|
-
onMetrics([&]() -> CachedProp<std::optional<std::function<void(const CesiumMetrics& /* metrics */)>>> {
|
|
300
|
-
try {
|
|
301
|
-
const react::RawValue* rawValue = rawProps.at("onMetrics", nullptr, nullptr);
|
|
302
|
-
if (rawValue == nullptr) return sourceProps.onMetrics;
|
|
303
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
304
|
-
return CachedProp<std::optional<std::function<void(const CesiumMetrics& /* metrics */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onMetrics);
|
|
305
|
-
} catch (const std::exception& exc) {
|
|
306
|
-
throw std::runtime_error(std::string("CesiumView.onMetrics: ") + exc.what());
|
|
307
|
-
}
|
|
308
|
-
}()),
|
|
309
|
-
onActualCamera([&]() -> CachedProp<std::optional<std::function<void(const CameraState& /* camera */)>>> {
|
|
310
|
-
try {
|
|
311
|
-
const react::RawValue* rawValue = rawProps.at("onActualCamera", nullptr, nullptr);
|
|
312
|
-
if (rawValue == nullptr) return sourceProps.onActualCamera;
|
|
313
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
314
|
-
return CachedProp<std::optional<std::function<void(const CameraState& /* camera */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onActualCamera);
|
|
315
|
-
} catch (const std::exception& exc) {
|
|
316
|
-
throw std::runtime_error(std::string("CesiumView.onActualCamera: ") + exc.what());
|
|
317
|
-
}
|
|
318
|
-
}()),
|
|
319
|
-
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridCesiumViewSpec>& /* ref */)>>> {
|
|
320
|
-
try {
|
|
321
|
-
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
322
|
-
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
323
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
324
|
-
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridCesiumViewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.hybridRef);
|
|
325
|
-
} catch (const std::exception& exc) {
|
|
326
|
-
throw std::runtime_error(std::string("CesiumView.hybridRef: ") + exc.what());
|
|
327
|
-
}
|
|
328
|
-
}()) { }
|
|
23
|
+
ionAccessToken(nitro::ReactProp<std::string>::fromRawValue("CesiumView", "ionAccessToken", rawProps, sourceProps.ionAccessToken)),
|
|
24
|
+
ionAssetId(nitro::ReactProp<double>::fromRawValue("CesiumView", "ionAssetId", rawProps, sourceProps.ionAssetId)),
|
|
25
|
+
initialCamera(nitro::ReactProp<CameraState>::fromRawValue("CesiumView", "initialCamera", rawProps, sourceProps.initialCamera)),
|
|
26
|
+
pauseRendering(nitro::ReactProp<bool>::fromRawValue("CesiumView", "pauseRendering", rawProps, sourceProps.pauseRendering)),
|
|
27
|
+
maximumScreenSpaceError(nitro::ReactProp<double>::fromRawValue("CesiumView", "maximumScreenSpaceError", rawProps, sourceProps.maximumScreenSpaceError)),
|
|
28
|
+
maximumSimultaneousTileLoads(nitro::ReactProp<double>::fromRawValue("CesiumView", "maximumSimultaneousTileLoads", rawProps, sourceProps.maximumSimultaneousTileLoads)),
|
|
29
|
+
loadingDescendantLimit(nitro::ReactProp<double>::fromRawValue("CesiumView", "loadingDescendantLimit", rawProps, sourceProps.loadingDescendantLimit)),
|
|
30
|
+
msaaSampleCount(nitro::ReactProp<double>::fromRawValue("CesiumView", "msaaSampleCount", rawProps, sourceProps.msaaSampleCount)),
|
|
31
|
+
ionImageryAssetId(nitro::ReactProp<double>::fromRawValue("CesiumView", "ionImageryAssetId", rawProps, sourceProps.ionImageryAssetId)),
|
|
32
|
+
altitudeDatum(nitro::ReactProp<std::optional<std::string>>::fromRawValue("CesiumView", "altitudeDatum", rawProps, sourceProps.altitudeDatum)),
|
|
33
|
+
maximumCachedMiB(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "maximumCachedMiB", rawProps, sourceProps.maximumCachedMiB)),
|
|
34
|
+
preloadAncestors(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "preloadAncestors", rawProps, sourceProps.preloadAncestors)),
|
|
35
|
+
preloadSiblings(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "preloadSiblings", rawProps, sourceProps.preloadSiblings)),
|
|
36
|
+
forbidHoles(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "forbidHoles", rawProps, sourceProps.forbidHoles)),
|
|
37
|
+
enableWaterMask(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "enableWaterMask", rawProps, sourceProps.enableWaterMask)),
|
|
38
|
+
enableFogCulling(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "enableFogCulling", rawProps, sourceProps.enableFogCulling)),
|
|
39
|
+
enforceCulledScreenSpaceError(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "enforceCulledScreenSpaceError", rawProps, sourceProps.enforceCulledScreenSpaceError)),
|
|
40
|
+
culledScreenSpaceError(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "culledScreenSpaceError", rawProps, sourceProps.culledScreenSpaceError)),
|
|
41
|
+
enableLodTransitionPeriod(nitro::ReactProp<std::optional<bool>>::fromRawValue("CesiumView", "enableLodTransitionPeriod", rawProps, sourceProps.enableLodTransitionPeriod)),
|
|
42
|
+
lodTransitionLength(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "lodTransitionLength", rawProps, sourceProps.lodTransitionLength)),
|
|
43
|
+
sqliteCacheMaxRows(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "sqliteCacheMaxRows", rawProps, sourceProps.sqliteCacheMaxRows)),
|
|
44
|
+
taskProcessorThreads(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "taskProcessorThreads", rawProps, sourceProps.taskProcessorThreads)),
|
|
45
|
+
minAltitudeAboveTerrain(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "minAltitudeAboveTerrain", rawProps, sourceProps.minAltitudeAboveTerrain)),
|
|
46
|
+
maxYawRateDegSec(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "maxYawRateDegSec", rawProps, sourceProps.maxYawRateDegSec)),
|
|
47
|
+
maxPitchRateDegSec(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "maxPitchRateDegSec", rawProps, sourceProps.maxPitchRateDegSec)),
|
|
48
|
+
maxRollRateDegSec(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "maxRollRateDegSec", rawProps, sourceProps.maxRollRateDegSec)),
|
|
49
|
+
maxClimbRateMps(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "maxClimbRateMps", rawProps, sourceProps.maxClimbRateMps)),
|
|
50
|
+
maxGroundSpeedMps(nitro::ReactProp<std::optional<double>>::fromRawValue("CesiumView", "maxGroundSpeedMps", rawProps, sourceProps.maxGroundSpeedMps)),
|
|
51
|
+
onMetrics(nitro::ReactProp<std::optional<std::function<void(const CesiumMetrics& /* metrics */)>>>::fromRawValue("CesiumView", "onMetrics", rawProps, sourceProps.onMetrics)),
|
|
52
|
+
onActualCamera(nitro::ReactProp<std::optional<std::function<void(const CameraState& /* camera */)>>>::fromRawValue("CesiumView", "onActualCamera", rawProps, sourceProps.onActualCamera)),
|
|
53
|
+
hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridCesiumViewSpec>& /* ref */)>>>::fromRawValue("CesiumView", "hybridRef", rawProps, sourceProps.hybridRef)) { }
|
|
329
54
|
|
|
330
55
|
bool HybridCesiumViewProps::filterObjectKeys(const std::string& propName) {
|
|
331
56
|
switch (hashString(propName)) {
|
|
@@ -338,6 +63,7 @@ namespace margelo::nitro::reactnativecesium::views {
|
|
|
338
63
|
case hashString("loadingDescendantLimit"): return true;
|
|
339
64
|
case hashString("msaaSampleCount"): return true;
|
|
340
65
|
case hashString("ionImageryAssetId"): return true;
|
|
66
|
+
case hashString("altitudeDatum"): return true;
|
|
341
67
|
case hashString("maximumCachedMiB"): return true;
|
|
342
68
|
case hashString("preloadAncestors"): return true;
|
|
343
69
|
case hashString("preloadSiblings"): return true;
|
|
@@ -363,29 +89,4 @@ namespace margelo::nitro::reactnativecesium::views {
|
|
|
363
89
|
}
|
|
364
90
|
}
|
|
365
91
|
|
|
366
|
-
HybridCesiumViewComponentDescriptor::HybridCesiumViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
367
|
-
: ConcreteComponentDescriptor(parameters,
|
|
368
|
-
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
369
|
-
|
|
370
|
-
std::shared_ptr<const react::Props> HybridCesiumViewComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
371
|
-
const std::shared_ptr<const react::Props>& props,
|
|
372
|
-
react::RawProps rawProps) const {
|
|
373
|
-
// 1. Prepare raw props parser
|
|
374
|
-
rawProps.parse(rawPropsParser_);
|
|
375
|
-
// 2. Copy props with Nitro's cached copy constructor
|
|
376
|
-
return HybridCesiumViewShadowNode::Props(context, /* & */ rawProps, props);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
#ifdef ANDROID
|
|
380
|
-
void HybridCesiumViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
381
|
-
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
382
|
-
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
383
|
-
auto& concreteShadowNode = static_cast<HybridCesiumViewShadowNode&>(shadowNode);
|
|
384
|
-
const std::shared_ptr<const HybridCesiumViewProps>& constProps = concreteShadowNode.getConcreteSharedProps();
|
|
385
|
-
const std::shared_ptr<HybridCesiumViewProps>& props = std::const_pointer_cast<HybridCesiumViewProps>(constProps);
|
|
386
|
-
HybridCesiumViewState state{props};
|
|
387
|
-
concreteShadowNode.setStateData(std::move(state));
|
|
388
|
-
}
|
|
389
|
-
#endif
|
|
390
|
-
|
|
391
92
|
} // namespace margelo::nitro::reactnativecesium::views
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <
|
|
11
|
-
#include <NitroModules/
|
|
12
|
-
#include <NitroModules/
|
|
13
|
-
#include <NitroModules/CachedProp.hpp>
|
|
14
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
10
|
+
#include <NitroModules/ReactProp.hpp>
|
|
11
|
+
#include <NitroModules/ViewComponentDescriptor.hpp>
|
|
12
|
+
#include <NitroModules/ViewPropsHolderState.hpp>
|
|
16
13
|
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
14
|
#include <react/renderer/components/view/ViewProps.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/core/RawProps.h>
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
18
19
|
|
|
19
20
|
#include <string>
|
|
20
21
|
#include "CameraState.hpp"
|
|
@@ -44,36 +45,107 @@ namespace margelo::nitro::reactnativecesium::views {
|
|
|
44
45
|
const react::RawProps& rawProps);
|
|
45
46
|
|
|
46
47
|
public:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
nitro::ReactProp<std::string> ionAccessToken;
|
|
49
|
+
nitro::ReactProp<double> ionAssetId;
|
|
50
|
+
nitro::ReactProp<CameraState> initialCamera;
|
|
51
|
+
nitro::ReactProp<bool> pauseRendering;
|
|
52
|
+
nitro::ReactProp<double> maximumScreenSpaceError;
|
|
53
|
+
nitro::ReactProp<double> maximumSimultaneousTileLoads;
|
|
54
|
+
nitro::ReactProp<double> loadingDescendantLimit;
|
|
55
|
+
nitro::ReactProp<double> msaaSampleCount;
|
|
56
|
+
nitro::ReactProp<double> ionImageryAssetId;
|
|
57
|
+
nitro::ReactProp<std::optional<std::string>> altitudeDatum;
|
|
58
|
+
nitro::ReactProp<std::optional<double>> maximumCachedMiB;
|
|
59
|
+
nitro::ReactProp<std::optional<bool>> preloadAncestors;
|
|
60
|
+
nitro::ReactProp<std::optional<bool>> preloadSiblings;
|
|
61
|
+
nitro::ReactProp<std::optional<bool>> forbidHoles;
|
|
62
|
+
nitro::ReactProp<std::optional<bool>> enableWaterMask;
|
|
63
|
+
nitro::ReactProp<std::optional<bool>> enableFogCulling;
|
|
64
|
+
nitro::ReactProp<std::optional<bool>> enforceCulledScreenSpaceError;
|
|
65
|
+
nitro::ReactProp<std::optional<double>> culledScreenSpaceError;
|
|
66
|
+
nitro::ReactProp<std::optional<bool>> enableLodTransitionPeriod;
|
|
67
|
+
nitro::ReactProp<std::optional<double>> lodTransitionLength;
|
|
68
|
+
nitro::ReactProp<std::optional<double>> sqliteCacheMaxRows;
|
|
69
|
+
nitro::ReactProp<std::optional<double>> taskProcessorThreads;
|
|
70
|
+
nitro::ReactProp<std::optional<double>> minAltitudeAboveTerrain;
|
|
71
|
+
nitro::ReactProp<std::optional<double>> maxYawRateDegSec;
|
|
72
|
+
nitro::ReactProp<std::optional<double>> maxPitchRateDegSec;
|
|
73
|
+
nitro::ReactProp<std::optional<double>> maxRollRateDegSec;
|
|
74
|
+
nitro::ReactProp<std::optional<double>> maxClimbRateMps;
|
|
75
|
+
nitro::ReactProp<std::optional<double>> maxGroundSpeedMps;
|
|
76
|
+
nitro::ReactProp<std::optional<std::function<void(const CesiumMetrics& /* metrics */)>>> onMetrics;
|
|
77
|
+
nitro::ReactProp<std::optional<std::function<void(const CameraState& /* camera */)>>> onActualCamera;
|
|
78
|
+
nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridCesiumViewSpec>& /* ref */)>>> hybridRef;
|
|
79
|
+
|
|
80
|
+
[[nodiscard]]
|
|
81
|
+
bool hasSameProps(const HybridCesiumViewProps& other) const noexcept {
|
|
82
|
+
return ionAccessToken.hasSameValue(other.ionAccessToken) &&
|
|
83
|
+
ionAssetId.hasSameValue(other.ionAssetId) &&
|
|
84
|
+
initialCamera.hasSameValue(other.initialCamera) &&
|
|
85
|
+
pauseRendering.hasSameValue(other.pauseRendering) &&
|
|
86
|
+
maximumScreenSpaceError.hasSameValue(other.maximumScreenSpaceError) &&
|
|
87
|
+
maximumSimultaneousTileLoads.hasSameValue(other.maximumSimultaneousTileLoads) &&
|
|
88
|
+
loadingDescendantLimit.hasSameValue(other.loadingDescendantLimit) &&
|
|
89
|
+
msaaSampleCount.hasSameValue(other.msaaSampleCount) &&
|
|
90
|
+
ionImageryAssetId.hasSameValue(other.ionImageryAssetId) &&
|
|
91
|
+
altitudeDatum.hasSameValue(other.altitudeDatum) &&
|
|
92
|
+
maximumCachedMiB.hasSameValue(other.maximumCachedMiB) &&
|
|
93
|
+
preloadAncestors.hasSameValue(other.preloadAncestors) &&
|
|
94
|
+
preloadSiblings.hasSameValue(other.preloadSiblings) &&
|
|
95
|
+
forbidHoles.hasSameValue(other.forbidHoles) &&
|
|
96
|
+
enableWaterMask.hasSameValue(other.enableWaterMask) &&
|
|
97
|
+
enableFogCulling.hasSameValue(other.enableFogCulling) &&
|
|
98
|
+
enforceCulledScreenSpaceError.hasSameValue(other.enforceCulledScreenSpaceError) &&
|
|
99
|
+
culledScreenSpaceError.hasSameValue(other.culledScreenSpaceError) &&
|
|
100
|
+
enableLodTransitionPeriod.hasSameValue(other.enableLodTransitionPeriod) &&
|
|
101
|
+
lodTransitionLength.hasSameValue(other.lodTransitionLength) &&
|
|
102
|
+
sqliteCacheMaxRows.hasSameValue(other.sqliteCacheMaxRows) &&
|
|
103
|
+
taskProcessorThreads.hasSameValue(other.taskProcessorThreads) &&
|
|
104
|
+
minAltitudeAboveTerrain.hasSameValue(other.minAltitudeAboveTerrain) &&
|
|
105
|
+
maxYawRateDegSec.hasSameValue(other.maxYawRateDegSec) &&
|
|
106
|
+
maxPitchRateDegSec.hasSameValue(other.maxPitchRateDegSec) &&
|
|
107
|
+
maxRollRateDegSec.hasSameValue(other.maxRollRateDegSec) &&
|
|
108
|
+
maxClimbRateMps.hasSameValue(other.maxClimbRateMps) &&
|
|
109
|
+
maxGroundSpeedMps.hasSameValue(other.maxGroundSpeedMps) &&
|
|
110
|
+
onMetrics.hasSameValue(other.onMetrics) &&
|
|
111
|
+
onActualCamera.hasSameValue(other.onActualCamera) &&
|
|
112
|
+
hybridRef.hasSameValue(other.hybridRef);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[[nodiscard]]
|
|
116
|
+
bool hasAnyProvidedProps() const noexcept {
|
|
117
|
+
return ionAccessToken.isProvided() ||
|
|
118
|
+
ionAssetId.isProvided() ||
|
|
119
|
+
initialCamera.isProvided() ||
|
|
120
|
+
pauseRendering.isProvided() ||
|
|
121
|
+
maximumScreenSpaceError.isProvided() ||
|
|
122
|
+
maximumSimultaneousTileLoads.isProvided() ||
|
|
123
|
+
loadingDescendantLimit.isProvided() ||
|
|
124
|
+
msaaSampleCount.isProvided() ||
|
|
125
|
+
ionImageryAssetId.isProvided() ||
|
|
126
|
+
altitudeDatum.isProvided() ||
|
|
127
|
+
maximumCachedMiB.isProvided() ||
|
|
128
|
+
preloadAncestors.isProvided() ||
|
|
129
|
+
preloadSiblings.isProvided() ||
|
|
130
|
+
forbidHoles.isProvided() ||
|
|
131
|
+
enableWaterMask.isProvided() ||
|
|
132
|
+
enableFogCulling.isProvided() ||
|
|
133
|
+
enforceCulledScreenSpaceError.isProvided() ||
|
|
134
|
+
culledScreenSpaceError.isProvided() ||
|
|
135
|
+
enableLodTransitionPeriod.isProvided() ||
|
|
136
|
+
lodTransitionLength.isProvided() ||
|
|
137
|
+
sqliteCacheMaxRows.isProvided() ||
|
|
138
|
+
taskProcessorThreads.isProvided() ||
|
|
139
|
+
minAltitudeAboveTerrain.isProvided() ||
|
|
140
|
+
maxYawRateDegSec.isProvided() ||
|
|
141
|
+
maxPitchRateDegSec.isProvided() ||
|
|
142
|
+
maxRollRateDegSec.isProvided() ||
|
|
143
|
+
maxClimbRateMps.isProvided() ||
|
|
144
|
+
maxGroundSpeedMps.isProvided() ||
|
|
145
|
+
onMetrics.isProvided() ||
|
|
146
|
+
onActualCamera.isProvided() ||
|
|
147
|
+
hybridRef.isProvided();
|
|
148
|
+
}
|
|
77
149
|
|
|
78
150
|
private:
|
|
79
151
|
static bool filterObjectKeys(const std::string& propName);
|
|
@@ -82,32 +154,7 @@ namespace margelo::nitro::reactnativecesium::views {
|
|
|
82
154
|
/**
|
|
83
155
|
* State for the "CesiumView" View.
|
|
84
156
|
*/
|
|
85
|
-
|
|
86
|
-
public:
|
|
87
|
-
HybridCesiumViewState() = default;
|
|
88
|
-
explicit HybridCesiumViewState(const std::shared_ptr<HybridCesiumViewProps>& props):
|
|
89
|
-
_props(props) {}
|
|
90
|
-
|
|
91
|
-
public:
|
|
92
|
-
[[nodiscard]]
|
|
93
|
-
const std::shared_ptr<HybridCesiumViewProps>& getProps() const {
|
|
94
|
-
return _props;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public:
|
|
98
|
-
#ifdef ANDROID
|
|
99
|
-
HybridCesiumViewState(const HybridCesiumViewState& /* previousState */, folly::dynamic /* data */) {}
|
|
100
|
-
folly::dynamic getDynamic() const {
|
|
101
|
-
throw std::runtime_error("HybridCesiumViewState does not support folly!");
|
|
102
|
-
}
|
|
103
|
-
react::MapBuffer getMapBuffer() const {
|
|
104
|
-
throw std::runtime_error("HybridCesiumViewState does not support MapBuffer!");
|
|
105
|
-
};
|
|
106
|
-
#endif
|
|
107
|
-
|
|
108
|
-
private:
|
|
109
|
-
std::shared_ptr<HybridCesiumViewProps> _props;
|
|
110
|
-
};
|
|
157
|
+
using HybridCesiumViewState = nitro::ViewPropsHolderState<HybridCesiumViewProps>;
|
|
111
158
|
|
|
112
159
|
/**
|
|
113
160
|
* The Shadow Node for the "CesiumView" View.
|
|
@@ -120,21 +167,7 @@ namespace margelo::nitro::reactnativecesium::views {
|
|
|
120
167
|
/**
|
|
121
168
|
* The Component Descriptor for the "CesiumView" View.
|
|
122
169
|
*/
|
|
123
|
-
|
|
124
|
-
public:
|
|
125
|
-
explicit HybridCesiumViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
126
|
-
|
|
127
|
-
public:
|
|
128
|
-
/**
|
|
129
|
-
* A faster path for cloning props - reuses the caching logic from `HybridCesiumViewProps`.
|
|
130
|
-
*/
|
|
131
|
-
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
132
|
-
const std::shared_ptr<const react::Props>& props,
|
|
133
|
-
react::RawProps rawProps) const override;
|
|
134
|
-
#ifdef ANDROID
|
|
135
|
-
void adopt(react::ShadowNode& shadowNode) const override;
|
|
136
|
-
#endif
|
|
137
|
-
};
|
|
170
|
+
using HybridCesiumViewComponentDescriptor = nitro::ViewComponentDescriptor<HybridCesiumViewShadowNode>;
|
|
138
171
|
|
|
139
172
|
/* The actual view for "CesiumView" needs to be implemented in platform-specific code. */
|
|
140
173
|
|