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
|
@@ -20,6 +20,14 @@ import com.margelo.nitro.reactnativecesium.*
|
|
|
20
20
|
* Represents the React Native `ViewManager` for the "CesiumView" Nitro HybridView.
|
|
21
21
|
*/
|
|
22
22
|
public class HybridCesiumViewManager: SimpleViewManager<View>() {
|
|
23
|
+
/**
|
|
24
|
+
* Represents the View and its last state snapshot (mutable)
|
|
25
|
+
*/
|
|
26
|
+
private class HybridViewHolder(
|
|
27
|
+
val hybridView: HybridCesiumView,
|
|
28
|
+
var lastState: StateWrapper? = null,
|
|
29
|
+
)
|
|
30
|
+
|
|
23
31
|
init {
|
|
24
32
|
if (RecyclableView::class.java.isAssignableFrom(HybridCesiumView::class.java)) {
|
|
25
33
|
// Enable view recycling
|
|
@@ -34,33 +42,41 @@ public class HybridCesiumViewManager: SimpleViewManager<View>() {
|
|
|
34
42
|
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
35
43
|
val hybridView = HybridCesiumView(reactContext)
|
|
36
44
|
val view = hybridView.view
|
|
37
|
-
view.setTag(associated_hybrid_view_tag, hybridView)
|
|
45
|
+
view.setTag(associated_hybrid_view_tag, HybridViewHolder(hybridView))
|
|
38
46
|
return view
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
|
|
42
|
-
val
|
|
50
|
+
val holder = getHybridViewHolder(view)
|
|
43
51
|
?: throw Error("Couldn't find view $view in local views table!")
|
|
52
|
+
val hybridView = holder.hybridView
|
|
53
|
+
val oldState = holder.lastState
|
|
54
|
+
val newState = stateWrapper
|
|
44
55
|
|
|
45
56
|
// 1. Update each prop individually
|
|
46
57
|
hybridView.beforeUpdate()
|
|
47
|
-
HybridCesiumViewStateUpdater.updateViewProps(hybridView,
|
|
58
|
+
HybridCesiumViewStateUpdater.updateViewProps(hybridView, newState, oldState)
|
|
48
59
|
hybridView.afterUpdate()
|
|
60
|
+
holder.lastState = newState
|
|
49
61
|
|
|
50
62
|
// 2. Continue in base View props
|
|
51
|
-
return super.updateState(view, props,
|
|
63
|
+
return super.updateState(view, props, newState)
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
override fun onDropViewInstance(view: View) {
|
|
55
|
-
val
|
|
56
|
-
|
|
67
|
+
val holder = getHybridViewHolder(view)
|
|
68
|
+
holder?.lastState = null
|
|
69
|
+
holder?.hybridView?.onDropView()
|
|
57
70
|
return super.onDropViewInstance(view)
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
protected override fun prepareToRecycleView(reactContext: ThemedReactContext, view: View): View? {
|
|
61
|
-
super.prepareToRecycleView(reactContext, view)
|
|
62
|
-
|
|
74
|
+
val preparedView = super.prepareToRecycleView(reactContext, view)
|
|
75
|
+
?: return null
|
|
76
|
+
val holder = getHybridViewHolder(preparedView)
|
|
63
77
|
?: return null
|
|
78
|
+
val hybridView = holder.hybridView
|
|
79
|
+
holder.lastState = null
|
|
64
80
|
|
|
65
81
|
@Suppress("USELESS_IS_CHECK")
|
|
66
82
|
if (hybridView is RecyclableView) {
|
|
@@ -74,7 +90,7 @@ public class HybridCesiumViewManager: SimpleViewManager<View>() {
|
|
|
74
90
|
}
|
|
75
91
|
}
|
|
76
92
|
|
|
77
|
-
private fun
|
|
78
|
-
return view.getTag(associated_hybrid_view_tag) as?
|
|
93
|
+
private fun getHybridViewHolder(view: View): HybridViewHolder? {
|
|
94
|
+
return view.getTag(associated_hybrid_view_tag) as? HybridViewHolder
|
|
79
95
|
}
|
|
80
96
|
}
|
|
@@ -14,10 +14,10 @@ internal class HybridCesiumViewStateUpdater {
|
|
|
14
14
|
companion object {
|
|
15
15
|
/**
|
|
16
16
|
* Updates the props for [view] through C++.
|
|
17
|
-
* The [
|
|
17
|
+
* The [newState] prop is expected to contain [view]'s props as wrapped Fabric state.
|
|
18
18
|
*/
|
|
19
19
|
@Suppress("KotlinJniMissingFunction")
|
|
20
20
|
@JvmStatic
|
|
21
|
-
external fun updateViewProps(view: HybridCesiumViewSpec,
|
|
21
|
+
external fun updateViewProps(view: HybridCesiumViewSpec, newState: StateWrapper, oldState: StateWrapper?)
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -41,6 +41,21 @@ namespace ReactNativeCesium { class HybridCesiumViewSpec_cxx; }
|
|
|
41
41
|
*/
|
|
42
42
|
namespace margelo::nitro::reactnativecesium::bridge::swift {
|
|
43
43
|
|
|
44
|
+
// pragma MARK: std::optional<std::string>
|
|
45
|
+
/**
|
|
46
|
+
* Specialized version of `std::optional<std::string>`.
|
|
47
|
+
*/
|
|
48
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
49
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
50
|
+
return std::optional<std::string>(value);
|
|
51
|
+
}
|
|
52
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
53
|
+
return optional.has_value();
|
|
54
|
+
}
|
|
55
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
56
|
+
return optional.value();
|
|
57
|
+
}
|
|
58
|
+
|
|
44
59
|
// pragma MARK: std::optional<double>
|
|
45
60
|
/**
|
|
46
61
|
* Specialized version of `std::optional<double>`.
|
|
@@ -128,6 +128,13 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
128
128
|
inline void setIonImageryAssetId(double ionImageryAssetId) noexcept override {
|
|
129
129
|
_swiftPart.setIonImageryAssetId(std::forward<decltype(ionImageryAssetId)>(ionImageryAssetId));
|
|
130
130
|
}
|
|
131
|
+
inline std::optional<std::string> getAltitudeDatum() noexcept override {
|
|
132
|
+
auto __result = _swiftPart.getAltitudeDatum();
|
|
133
|
+
return __result;
|
|
134
|
+
}
|
|
135
|
+
inline void setAltitudeDatum(const std::optional<std::string>& altitudeDatum) noexcept override {
|
|
136
|
+
_swiftPart.setAltitudeDatum(altitudeDatum);
|
|
137
|
+
}
|
|
131
138
|
inline std::optional<double> getMaximumCachedMiB() noexcept override {
|
|
132
139
|
auto __result = _swiftPart.getMaximumCachedMiB();
|
|
133
140
|
return __result;
|
|
@@ -37,6 +37,7 @@ using namespace margelo::nitro::reactnativecesium::views;
|
|
|
37
37
|
|
|
38
38
|
@implementation HybridCesiumViewComponent {
|
|
39
39
|
std::shared_ptr<HybridCesiumViewSpecSwift> _hybridView;
|
|
40
|
+
BOOL _didDropView;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
+ (void) load {
|
|
@@ -50,6 +51,7 @@ using namespace margelo::nitro::reactnativecesium::views;
|
|
|
50
51
|
|
|
51
52
|
- (instancetype) init {
|
|
52
53
|
if (self = [super init]) {
|
|
54
|
+
_props = HybridCesiumViewShadowNode::defaultSharedProps();
|
|
53
55
|
std::shared_ptr<HybridCesiumViewSpec> hybridView = ReactNativeCesium::ReactNativeCesiumAutolinking::createCesiumView();
|
|
54
56
|
_hybridView = std::dynamic_pointer_cast<HybridCesiumViewSpecSwift>(hybridView);
|
|
55
57
|
[self updateView];
|
|
@@ -69,175 +71,229 @@ using namespace margelo::nitro::reactnativecesium::views;
|
|
|
69
71
|
[self setContentView:view];
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
- (void) notifyOnDropView {
|
|
75
|
+
// A recycled component can later be invalidated. Notify only once per mount.
|
|
76
|
+
if (_didDropView) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
ReactNativeCesium::HybridCesiumViewSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
80
|
+
swiftPart.onDropView();
|
|
81
|
+
_didDropView = YES;
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
- (void) updateProps:(const std::shared_ptr<const react::Props>&)props
|
|
73
85
|
oldProps:(const std::shared_ptr<const react::Props>&)oldProps {
|
|
86
|
+
// A props update marks a newly mounted or still-active component.
|
|
87
|
+
_didDropView = NO;
|
|
88
|
+
|
|
74
89
|
// 1. Downcast props
|
|
75
|
-
const auto&
|
|
76
|
-
auto
|
|
90
|
+
const auto& newViewProps = *std::static_pointer_cast<const HybridCesiumViewProps>(props);
|
|
91
|
+
const auto* oldViewProps = static_cast<const HybridCesiumViewProps*>(oldProps.get());
|
|
77
92
|
ReactNativeCesium::HybridCesiumViewSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
78
93
|
|
|
79
|
-
// 2. Update
|
|
80
|
-
|
|
94
|
+
// 2. Update only props that differ from the previous Props snapshot.
|
|
95
|
+
const bool hasTransactionPropChanges = oldViewProps == nullptr
|
|
96
|
+
? newViewProps.hasAnyProvidedProps()
|
|
97
|
+
: !newViewProps.hasSameProps(*oldViewProps);
|
|
98
|
+
if (hasTransactionPropChanges) {
|
|
99
|
+
swiftPart.beforeUpdate();
|
|
81
100
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
101
|
+
// ionAccessToken: string
|
|
102
|
+
if (oldViewProps == nullptr
|
|
103
|
+
? newViewProps.ionAccessToken.isProvided()
|
|
104
|
+
: !newViewProps.ionAccessToken.hasSameValue(oldViewProps->ionAccessToken)) {
|
|
105
|
+
swiftPart.setIonAccessToken(newViewProps.ionAccessToken.get());
|
|
106
|
+
}
|
|
107
|
+
// ionAssetId: number
|
|
108
|
+
if (oldViewProps == nullptr
|
|
109
|
+
? newViewProps.ionAssetId.isProvided()
|
|
110
|
+
: !newViewProps.ionAssetId.hasSameValue(oldViewProps->ionAssetId)) {
|
|
111
|
+
swiftPart.setIonAssetId(newViewProps.ionAssetId.get());
|
|
112
|
+
}
|
|
113
|
+
// initialCamera: struct
|
|
114
|
+
if (oldViewProps == nullptr
|
|
115
|
+
? newViewProps.initialCamera.isProvided()
|
|
116
|
+
: !newViewProps.initialCamera.hasSameValue(oldViewProps->initialCamera)) {
|
|
117
|
+
swiftPart.setInitialCamera(newViewProps.initialCamera.get());
|
|
118
|
+
}
|
|
119
|
+
// pauseRendering: boolean
|
|
120
|
+
if (oldViewProps == nullptr
|
|
121
|
+
? newViewProps.pauseRendering.isProvided()
|
|
122
|
+
: !newViewProps.pauseRendering.hasSameValue(oldViewProps->pauseRendering)) {
|
|
123
|
+
swiftPart.setPauseRendering(newViewProps.pauseRendering.get());
|
|
124
|
+
}
|
|
125
|
+
// maximumScreenSpaceError: number
|
|
126
|
+
if (oldViewProps == nullptr
|
|
127
|
+
? newViewProps.maximumScreenSpaceError.isProvided()
|
|
128
|
+
: !newViewProps.maximumScreenSpaceError.hasSameValue(oldViewProps->maximumScreenSpaceError)) {
|
|
129
|
+
swiftPart.setMaximumScreenSpaceError(newViewProps.maximumScreenSpaceError.get());
|
|
130
|
+
}
|
|
131
|
+
// maximumSimultaneousTileLoads: number
|
|
132
|
+
if (oldViewProps == nullptr
|
|
133
|
+
? newViewProps.maximumSimultaneousTileLoads.isProvided()
|
|
134
|
+
: !newViewProps.maximumSimultaneousTileLoads.hasSameValue(oldViewProps->maximumSimultaneousTileLoads)) {
|
|
135
|
+
swiftPart.setMaximumSimultaneousTileLoads(newViewProps.maximumSimultaneousTileLoads.get());
|
|
136
|
+
}
|
|
137
|
+
// loadingDescendantLimit: number
|
|
138
|
+
if (oldViewProps == nullptr
|
|
139
|
+
? newViewProps.loadingDescendantLimit.isProvided()
|
|
140
|
+
: !newViewProps.loadingDescendantLimit.hasSameValue(oldViewProps->loadingDescendantLimit)) {
|
|
141
|
+
swiftPart.setLoadingDescendantLimit(newViewProps.loadingDescendantLimit.get());
|
|
142
|
+
}
|
|
143
|
+
// msaaSampleCount: number
|
|
144
|
+
if (oldViewProps == nullptr
|
|
145
|
+
? newViewProps.msaaSampleCount.isProvided()
|
|
146
|
+
: !newViewProps.msaaSampleCount.hasSameValue(oldViewProps->msaaSampleCount)) {
|
|
147
|
+
swiftPart.setMsaaSampleCount(newViewProps.msaaSampleCount.get());
|
|
148
|
+
}
|
|
149
|
+
// ionImageryAssetId: number
|
|
150
|
+
if (oldViewProps == nullptr
|
|
151
|
+
? newViewProps.ionImageryAssetId.isProvided()
|
|
152
|
+
: !newViewProps.ionImageryAssetId.hasSameValue(oldViewProps->ionImageryAssetId)) {
|
|
153
|
+
swiftPart.setIonImageryAssetId(newViewProps.ionImageryAssetId.get());
|
|
154
|
+
}
|
|
155
|
+
// altitudeDatum: optional
|
|
156
|
+
if (oldViewProps == nullptr
|
|
157
|
+
? newViewProps.altitudeDatum.isProvided()
|
|
158
|
+
: !newViewProps.altitudeDatum.hasSameValue(oldViewProps->altitudeDatum)) {
|
|
159
|
+
swiftPart.setAltitudeDatum(newViewProps.altitudeDatum.get());
|
|
160
|
+
}
|
|
161
|
+
// maximumCachedMiB: optional
|
|
162
|
+
if (oldViewProps == nullptr
|
|
163
|
+
? newViewProps.maximumCachedMiB.isProvided()
|
|
164
|
+
: !newViewProps.maximumCachedMiB.hasSameValue(oldViewProps->maximumCachedMiB)) {
|
|
165
|
+
swiftPart.setMaximumCachedMiB(newViewProps.maximumCachedMiB.get());
|
|
166
|
+
}
|
|
167
|
+
// preloadAncestors: optional
|
|
168
|
+
if (oldViewProps == nullptr
|
|
169
|
+
? newViewProps.preloadAncestors.isProvided()
|
|
170
|
+
: !newViewProps.preloadAncestors.hasSameValue(oldViewProps->preloadAncestors)) {
|
|
171
|
+
swiftPart.setPreloadAncestors(newViewProps.preloadAncestors.get());
|
|
172
|
+
}
|
|
173
|
+
// preloadSiblings: optional
|
|
174
|
+
if (oldViewProps == nullptr
|
|
175
|
+
? newViewProps.preloadSiblings.isProvided()
|
|
176
|
+
: !newViewProps.preloadSiblings.hasSameValue(oldViewProps->preloadSiblings)) {
|
|
177
|
+
swiftPart.setPreloadSiblings(newViewProps.preloadSiblings.get());
|
|
178
|
+
}
|
|
179
|
+
// forbidHoles: optional
|
|
180
|
+
if (oldViewProps == nullptr
|
|
181
|
+
? newViewProps.forbidHoles.isProvided()
|
|
182
|
+
: !newViewProps.forbidHoles.hasSameValue(oldViewProps->forbidHoles)) {
|
|
183
|
+
swiftPart.setForbidHoles(newViewProps.forbidHoles.get());
|
|
184
|
+
}
|
|
185
|
+
// enableWaterMask: optional
|
|
186
|
+
if (oldViewProps == nullptr
|
|
187
|
+
? newViewProps.enableWaterMask.isProvided()
|
|
188
|
+
: !newViewProps.enableWaterMask.hasSameValue(oldViewProps->enableWaterMask)) {
|
|
189
|
+
swiftPart.setEnableWaterMask(newViewProps.enableWaterMask.get());
|
|
190
|
+
}
|
|
191
|
+
// enableFogCulling: optional
|
|
192
|
+
if (oldViewProps == nullptr
|
|
193
|
+
? newViewProps.enableFogCulling.isProvided()
|
|
194
|
+
: !newViewProps.enableFogCulling.hasSameValue(oldViewProps->enableFogCulling)) {
|
|
195
|
+
swiftPart.setEnableFogCulling(newViewProps.enableFogCulling.get());
|
|
196
|
+
}
|
|
197
|
+
// enforceCulledScreenSpaceError: optional
|
|
198
|
+
if (oldViewProps == nullptr
|
|
199
|
+
? newViewProps.enforceCulledScreenSpaceError.isProvided()
|
|
200
|
+
: !newViewProps.enforceCulledScreenSpaceError.hasSameValue(oldViewProps->enforceCulledScreenSpaceError)) {
|
|
201
|
+
swiftPart.setEnforceCulledScreenSpaceError(newViewProps.enforceCulledScreenSpaceError.get());
|
|
202
|
+
}
|
|
203
|
+
// culledScreenSpaceError: optional
|
|
204
|
+
if (oldViewProps == nullptr
|
|
205
|
+
? newViewProps.culledScreenSpaceError.isProvided()
|
|
206
|
+
: !newViewProps.culledScreenSpaceError.hasSameValue(oldViewProps->culledScreenSpaceError)) {
|
|
207
|
+
swiftPart.setCulledScreenSpaceError(newViewProps.culledScreenSpaceError.get());
|
|
208
|
+
}
|
|
209
|
+
// enableLodTransitionPeriod: optional
|
|
210
|
+
if (oldViewProps == nullptr
|
|
211
|
+
? newViewProps.enableLodTransitionPeriod.isProvided()
|
|
212
|
+
: !newViewProps.enableLodTransitionPeriod.hasSameValue(oldViewProps->enableLodTransitionPeriod)) {
|
|
213
|
+
swiftPart.setEnableLodTransitionPeriod(newViewProps.enableLodTransitionPeriod.get());
|
|
214
|
+
}
|
|
215
|
+
// lodTransitionLength: optional
|
|
216
|
+
if (oldViewProps == nullptr
|
|
217
|
+
? newViewProps.lodTransitionLength.isProvided()
|
|
218
|
+
: !newViewProps.lodTransitionLength.hasSameValue(oldViewProps->lodTransitionLength)) {
|
|
219
|
+
swiftPart.setLodTransitionLength(newViewProps.lodTransitionLength.get());
|
|
220
|
+
}
|
|
221
|
+
// sqliteCacheMaxRows: optional
|
|
222
|
+
if (oldViewProps == nullptr
|
|
223
|
+
? newViewProps.sqliteCacheMaxRows.isProvided()
|
|
224
|
+
: !newViewProps.sqliteCacheMaxRows.hasSameValue(oldViewProps->sqliteCacheMaxRows)) {
|
|
225
|
+
swiftPart.setSqliteCacheMaxRows(newViewProps.sqliteCacheMaxRows.get());
|
|
226
|
+
}
|
|
227
|
+
// taskProcessorThreads: optional
|
|
228
|
+
if (oldViewProps == nullptr
|
|
229
|
+
? newViewProps.taskProcessorThreads.isProvided()
|
|
230
|
+
: !newViewProps.taskProcessorThreads.hasSameValue(oldViewProps->taskProcessorThreads)) {
|
|
231
|
+
swiftPart.setTaskProcessorThreads(newViewProps.taskProcessorThreads.get());
|
|
232
|
+
}
|
|
233
|
+
// minAltitudeAboveTerrain: optional
|
|
234
|
+
if (oldViewProps == nullptr
|
|
235
|
+
? newViewProps.minAltitudeAboveTerrain.isProvided()
|
|
236
|
+
: !newViewProps.minAltitudeAboveTerrain.hasSameValue(oldViewProps->minAltitudeAboveTerrain)) {
|
|
237
|
+
swiftPart.setMinAltitudeAboveTerrain(newViewProps.minAltitudeAboveTerrain.get());
|
|
238
|
+
}
|
|
239
|
+
// maxYawRateDegSec: optional
|
|
240
|
+
if (oldViewProps == nullptr
|
|
241
|
+
? newViewProps.maxYawRateDegSec.isProvided()
|
|
242
|
+
: !newViewProps.maxYawRateDegSec.hasSameValue(oldViewProps->maxYawRateDegSec)) {
|
|
243
|
+
swiftPart.setMaxYawRateDegSec(newViewProps.maxYawRateDegSec.get());
|
|
244
|
+
}
|
|
245
|
+
// maxPitchRateDegSec: optional
|
|
246
|
+
if (oldViewProps == nullptr
|
|
247
|
+
? newViewProps.maxPitchRateDegSec.isProvided()
|
|
248
|
+
: !newViewProps.maxPitchRateDegSec.hasSameValue(oldViewProps->maxPitchRateDegSec)) {
|
|
249
|
+
swiftPart.setMaxPitchRateDegSec(newViewProps.maxPitchRateDegSec.get());
|
|
250
|
+
}
|
|
251
|
+
// maxRollRateDegSec: optional
|
|
252
|
+
if (oldViewProps == nullptr
|
|
253
|
+
? newViewProps.maxRollRateDegSec.isProvided()
|
|
254
|
+
: !newViewProps.maxRollRateDegSec.hasSameValue(oldViewProps->maxRollRateDegSec)) {
|
|
255
|
+
swiftPart.setMaxRollRateDegSec(newViewProps.maxRollRateDegSec.get());
|
|
256
|
+
}
|
|
257
|
+
// maxClimbRateMps: optional
|
|
258
|
+
if (oldViewProps == nullptr
|
|
259
|
+
? newViewProps.maxClimbRateMps.isProvided()
|
|
260
|
+
: !newViewProps.maxClimbRateMps.hasSameValue(oldViewProps->maxClimbRateMps)) {
|
|
261
|
+
swiftPart.setMaxClimbRateMps(newViewProps.maxClimbRateMps.get());
|
|
262
|
+
}
|
|
263
|
+
// maxGroundSpeedMps: optional
|
|
264
|
+
if (oldViewProps == nullptr
|
|
265
|
+
? newViewProps.maxGroundSpeedMps.isProvided()
|
|
266
|
+
: !newViewProps.maxGroundSpeedMps.hasSameValue(oldViewProps->maxGroundSpeedMps)) {
|
|
267
|
+
swiftPart.setMaxGroundSpeedMps(newViewProps.maxGroundSpeedMps.get());
|
|
268
|
+
}
|
|
269
|
+
// onMetrics: optional
|
|
270
|
+
if (oldViewProps == nullptr
|
|
271
|
+
? newViewProps.onMetrics.isProvided()
|
|
272
|
+
: !newViewProps.onMetrics.hasSameValue(oldViewProps->onMetrics)) {
|
|
273
|
+
swiftPart.setOnMetrics(newViewProps.onMetrics.get());
|
|
274
|
+
}
|
|
275
|
+
// onActualCamera: optional
|
|
276
|
+
if (oldViewProps == nullptr
|
|
277
|
+
? newViewProps.onActualCamera.isProvided()
|
|
278
|
+
: !newViewProps.onActualCamera.hasSameValue(oldViewProps->onActualCamera)) {
|
|
279
|
+
swiftPart.setOnActualCamera(newViewProps.onActualCamera.get());
|
|
280
|
+
}
|
|
229
281
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
maybeFunc.
|
|
282
|
+
// Update hybridRef if it changed
|
|
283
|
+
if (oldViewProps == nullptr
|
|
284
|
+
? newViewProps.hybridRef.isProvided()
|
|
285
|
+
: !newViewProps.hybridRef.hasSameValue(oldViewProps->hybridRef)) {
|
|
286
|
+
// hybridRef changed - call it with new this
|
|
287
|
+
const auto& maybeFunc = newViewProps.hybridRef.get();
|
|
288
|
+
if (maybeFunc.has_value()) {
|
|
289
|
+
maybeFunc.value()(_hybridView);
|
|
290
|
+
}
|
|
236
291
|
}
|
|
237
|
-
|
|
292
|
+
|
|
293
|
+
swiftPart.afterUpdate();
|
|
238
294
|
}
|
|
239
295
|
|
|
240
|
-
//
|
|
296
|
+
// 3. Continue in base class
|
|
241
297
|
[super updateProps:props oldProps:oldProps];
|
|
242
298
|
}
|
|
243
299
|
|
|
@@ -246,6 +302,7 @@ using namespace margelo::nitro::reactnativecesium::views;
|
|
|
246
302
|
}
|
|
247
303
|
|
|
248
304
|
- (void)prepareForRecycle {
|
|
305
|
+
[self notifyOnDropView];
|
|
249
306
|
[super prepareForRecycle];
|
|
250
307
|
ReactNativeCesium::HybridCesiumViewSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
251
308
|
swiftPart.maybePrepareForRecycle();
|
|
@@ -253,8 +310,7 @@ using namespace margelo::nitro::reactnativecesium::views;
|
|
|
253
310
|
|
|
254
311
|
#ifdef ENABLE_RCT_COMPONENT_VIEW_INVALIDATE
|
|
255
312
|
- (void)invalidate {
|
|
256
|
-
|
|
257
|
-
swiftPart.onDropView();
|
|
313
|
+
[self notifyOnDropView];
|
|
258
314
|
[super invalidate];
|
|
259
315
|
}
|
|
260
316
|
#endif
|
|
@@ -19,6 +19,7 @@ public protocol HybridCesiumViewSpec_protocol: HybridObject, HybridView {
|
|
|
19
19
|
var loadingDescendantLimit: Double { get set }
|
|
20
20
|
var msaaSampleCount: Double { get set }
|
|
21
21
|
var ionImageryAssetId: Double { get set }
|
|
22
|
+
var altitudeDatum: String? { get set }
|
|
22
23
|
var maximumCachedMiB: Double? { get set }
|
|
23
24
|
var preloadAncestors: Bool? { get set }
|
|
24
25
|
var preloadSiblings: Bool? { get set }
|
|
@@ -220,6 +220,30 @@ open class HybridCesiumViewSpec_cxx {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
public final var altitudeDatum: bridge.std__optional_std__string_ {
|
|
224
|
+
@inline(__always)
|
|
225
|
+
get {
|
|
226
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
227
|
+
if let __unwrappedValue = self.__implementation.altitudeDatum {
|
|
228
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
229
|
+
} else {
|
|
230
|
+
return .init()
|
|
231
|
+
}
|
|
232
|
+
}()
|
|
233
|
+
}
|
|
234
|
+
@inline(__always)
|
|
235
|
+
set {
|
|
236
|
+
self.__implementation.altitudeDatum = { () -> String? in
|
|
237
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
238
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
239
|
+
return String(__unwrapped)
|
|
240
|
+
} else {
|
|
241
|
+
return nil
|
|
242
|
+
}
|
|
243
|
+
}()
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
223
247
|
public final var maximumCachedMiB: bridge.std__optional_double_ {
|
|
224
248
|
@inline(__always)
|
|
225
249
|
get {
|
|
@@ -32,6 +32,8 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
32
32
|
prototype.registerHybridSetter("msaaSampleCount", &HybridCesiumViewSpec::setMsaaSampleCount);
|
|
33
33
|
prototype.registerHybridGetter("ionImageryAssetId", &HybridCesiumViewSpec::getIonImageryAssetId);
|
|
34
34
|
prototype.registerHybridSetter("ionImageryAssetId", &HybridCesiumViewSpec::setIonImageryAssetId);
|
|
35
|
+
prototype.registerHybridGetter("altitudeDatum", &HybridCesiumViewSpec::getAltitudeDatum);
|
|
36
|
+
prototype.registerHybridSetter("altitudeDatum", &HybridCesiumViewSpec::setAltitudeDatum);
|
|
35
37
|
prototype.registerHybridGetter("maximumCachedMiB", &HybridCesiumViewSpec::getMaximumCachedMiB);
|
|
36
38
|
prototype.registerHybridSetter("maximumCachedMiB", &HybridCesiumViewSpec::setMaximumCachedMiB);
|
|
37
39
|
prototype.registerHybridGetter("preloadAncestors", &HybridCesiumViewSpec::getPreloadAncestors);
|
|
@@ -73,6 +73,8 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
73
73
|
virtual void setMsaaSampleCount(double msaaSampleCount) = 0;
|
|
74
74
|
virtual double getIonImageryAssetId() = 0;
|
|
75
75
|
virtual void setIonImageryAssetId(double ionImageryAssetId) = 0;
|
|
76
|
+
virtual std::optional<std::string> getAltitudeDatum() = 0;
|
|
77
|
+
virtual void setAltitudeDatum(const std::optional<std::string>& altitudeDatum) = 0;
|
|
76
78
|
virtual std::optional<double> getMaximumCachedMiB() = 0;
|
|
77
79
|
virtual void setMaximumCachedMiB(std::optional<double> maximumCachedMiB) = 0;
|
|
78
80
|
virtual std::optional<bool> getPreloadAncestors() = 0;
|