1use crate::{open, LoadError};
3use std::{mem::ManuallyDrop, path::Path};
4#[repr(C)]
5#[derive(Debug, Clone, Copy, Default)]
6pub struct GeoKernelGlobeOptions {
7 pub struct_size: u32,
8 pub abi_version: u32,
9 pub network_enabled: i32,
10 pub basemap: i32,
11 pub terrain_enabled: i32,
12 pub atmosphere_enabled: i32,
13 pub sunlight_enabled: i32,
14 pub space_background_enabled: i32,
15 pub terrain_max_zoom: i32,
16 pub terrain_lerc: i32,
17 pub terrain_exaggeration: f64,
18}
19#[repr(C)]
20#[derive(Debug, Clone, Copy, Default)]
21pub struct GeoKernelGlobeCamera {
22 pub struct_size: u32,
23 pub abi_version: u32,
24 pub longitude: f64,
25 pub latitude: f64,
26 pub target_height_metres: f64,
27 pub distance_metres: f64,
28 pub pitch_degrees: f64,
29 pub heading_degrees: f64,
30}
31pub struct GlobeApi {
32 _library: ManuallyDrop<libloading::Library>,
33 GeoKernelGlobe_GetApiVersion: unsafe extern "C" fn() -> u32,
34 GeoKernelGlobe_DefaultOptions: unsafe extern "C" fn(*mut GeoKernelGlobeOptions) -> i32,
35 GeoKernelGlobe_DefaultCamera: unsafe extern "C" fn(*mut GeoKernelGlobeCamera) -> i32,
36 GeoKernelGlobe_Initialize: unsafe extern "C" fn() -> i32,
37 GeoKernelGlobe_ProcessEvents: unsafe extern "C" fn() -> i32,
38 GeoKernelGlobe_GetCapabilities: unsafe extern "C" fn(*mut u64) -> i32,
39 GeoKernelGlobe_Create: unsafe extern "C" fn(
40 usize,
41 *const GeoKernelGlobeOptions,
42 *const GeoKernelGlobeCamera,
43 *mut u64,
44 ) -> i32,
45 GeoKernelGlobe_Destroy: unsafe extern "C" fn(u64) -> i32,
46 GeoKernelGlobe_Resize: unsafe extern "C" fn(u64, i32, i32) -> i32,
47 GeoKernelGlobe_SetVisible: unsafe extern "C" fn(u64, i32) -> i32,
48 GeoKernelGlobe_GetNativeHandle: unsafe extern "C" fn(u64, *mut usize) -> i32,
49 GeoKernelGlobe_GetOptions: unsafe extern "C" fn(u64, *mut GeoKernelGlobeOptions) -> i32,
50 GeoKernelGlobe_SetOptions: unsafe extern "C" fn(u64, *const GeoKernelGlobeOptions) -> i32,
51 GeoKernelGlobe_SetBasemap: unsafe extern "C" fn(u64, i32) -> i32,
52 GeoKernelGlobe_ConfigureTerrain:
53 unsafe extern "C" fn(u64, *const std::ffi::c_char, i32, f64, i32) -> i32,
54 GeoKernelGlobe_GetCamera: unsafe extern "C" fn(u64, *mut GeoKernelGlobeCamera) -> i32,
55 GeoKernelGlobe_SetCamera: unsafe extern "C" fn(u64, *const GeoKernelGlobeCamera) -> i32,
56 GeoKernelGlobe_SetHomeCamera: unsafe extern "C" fn(u64, *const GeoKernelGlobeCamera) -> i32,
57 GeoKernelGlobe_ResetCamera: unsafe extern "C" fn(u64) -> i32,
58 GeoKernelGlobe_Navigate: unsafe extern "C" fn(u64, i32) -> i32,
59 GeoKernelGlobe_SetInteractionMode: unsafe extern "C" fn(u64, i32) -> i32,
60 GeoKernelGlobe_ClearInteraction: unsafe extern "C" fn(u64) -> i32,
61 GeoKernelGlobe_GetLastError: unsafe extern "C" fn(*mut std::ffi::c_char, u32, *mut u32) -> i32,
62 GeoKernelGlobe_GetBasemaps: unsafe extern "C" fn(*mut std::ffi::c_char, u32, *mut u32) -> i32,
63 GeoKernelGlobe_GetAttribution:
64 unsafe extern "C" fn(u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
65 GeoKernelGlobe_GetState: unsafe extern "C" fn(u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
66 GeoKernelGlobe_PollEvent:
67 unsafe extern "C" fn(u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
68 GeoKernelGlobe_LoadVector: unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
69 GeoKernelGlobe_SetVectorStyle:
70 unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
71 GeoKernelGlobe_ConfigureBuildings:
72 unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
73 GeoKernelGlobe_LoadModel: unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
74 GeoKernelGlobe_SetModelPlacement:
75 unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
76 GeoKernelGlobe_LoadRaster: unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
77 GeoKernelGlobe_LoadDem: unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
78 GeoKernelGlobe_GetLayers:
79 unsafe extern "C" fn(u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
80 GeoKernelGlobe_GetLayerState: unsafe extern "C" fn(
81 u64,
82 *const std::ffi::c_char,
83 *mut std::ffi::c_char,
84 u32,
85 *mut u32,
86 ) -> i32,
87 GeoKernelGlobe_GetJobState:
88 unsafe extern "C" fn(u64, u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
89 GeoKernelGlobe_CancelJob: unsafe extern "C" fn(u64, u64) -> i32,
90 GeoKernelGlobe_ForgetJob: unsafe extern "C" fn(u64, u64) -> i32,
91 GeoKernelGlobe_FocusLayer: unsafe extern "C" fn(u64, *const std::ffi::c_char) -> i32,
92 GeoKernelGlobe_RemoveLayer: unsafe extern "C" fn(u64, *const std::ffi::c_char) -> i32,
93 GeoKernelGlobe_SetLayerVisible: unsafe extern "C" fn(u64, *const std::ffi::c_char, i32) -> i32,
94 GeoKernelGlobe_SetLayerOpacity: unsafe extern "C" fn(u64, *const std::ffi::c_char, f64) -> i32,
95 GeoKernelGlobe_GetFeatureInfo: unsafe extern "C" fn(
96 u64,
97 *const std::ffi::c_char,
98 *const std::ffi::c_char,
99 *mut std::ffi::c_char,
100 u32,
101 *mut u32,
102 ) -> i32,
103 GeoKernelGlobe_SetDemStyle: unsafe extern "C" fn(u64, i32, f64, f64) -> i32,
104 GeoKernelGlobe_SampleElevation:
105 unsafe extern "C" fn(u64, f64, f64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
106 GeoKernelGlobe_GroundAt:
107 unsafe extern "C" fn(u64, f64, f64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
108 GeoKernelGlobe_IdentifyAt:
109 unsafe extern "C" fn(u64, f64, f64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
110 GeoKernelGlobe_SetMeasurementPoints: unsafe extern "C" fn(u64, *const std::ffi::c_char) -> i32,
111 GeoKernelGlobe_StartTerrainAnalysis:
112 unsafe extern "C" fn(u64, *const std::ffi::c_char, *mut u64) -> i32,
113 GeoKernelGlobe_GetMeasurement:
114 unsafe extern "C" fn(u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
115 GeoKernelGlobe_GetTerrainAnalysis:
116 unsafe extern "C" fn(u64, *mut std::ffi::c_char, u32, *mut u32) -> i32,
117 GeoKernelGlobe_ClearMeasurement: unsafe extern "C" fn(u64) -> i32,
118 GeoKernelGlobe_CancelTerrainAnalysis: unsafe extern "C" fn(u64) -> i32,
119 GeoKernelGlobe_ClearTerrainAnalysis: unsafe extern "C" fn(u64) -> i32,
120 GeoKernelGlobe_SetAnalysisOverlayVisible: unsafe extern "C" fn(u64, i32) -> i32,
121}
122impl GlobeApi {
123 pub const SYMBOLS: &'static [&'static str] = &[
124 "GeoKernelGlobe_GetApiVersion",
125 "GeoKernelGlobe_DefaultOptions",
126 "GeoKernelGlobe_DefaultCamera",
127 "GeoKernelGlobe_Initialize",
128 "GeoKernelGlobe_ProcessEvents",
129 "GeoKernelGlobe_GetCapabilities",
130 "GeoKernelGlobe_Create",
131 "GeoKernelGlobe_Destroy",
132 "GeoKernelGlobe_Resize",
133 "GeoKernelGlobe_SetVisible",
134 "GeoKernelGlobe_GetNativeHandle",
135 "GeoKernelGlobe_GetOptions",
136 "GeoKernelGlobe_SetOptions",
137 "GeoKernelGlobe_SetBasemap",
138 "GeoKernelGlobe_ConfigureTerrain",
139 "GeoKernelGlobe_GetCamera",
140 "GeoKernelGlobe_SetCamera",
141 "GeoKernelGlobe_SetHomeCamera",
142 "GeoKernelGlobe_ResetCamera",
143 "GeoKernelGlobe_Navigate",
144 "GeoKernelGlobe_SetInteractionMode",
145 "GeoKernelGlobe_ClearInteraction",
146 "GeoKernelGlobe_GetLastError",
147 "GeoKernelGlobe_GetBasemaps",
148 "GeoKernelGlobe_GetAttribution",
149 "GeoKernelGlobe_GetState",
150 "GeoKernelGlobe_PollEvent",
151 "GeoKernelGlobe_LoadVector",
152 "GeoKernelGlobe_SetVectorStyle",
153 "GeoKernelGlobe_ConfigureBuildings",
154 "GeoKernelGlobe_LoadModel",
155 "GeoKernelGlobe_SetModelPlacement",
156 "GeoKernelGlobe_LoadRaster",
157 "GeoKernelGlobe_LoadDem",
158 "GeoKernelGlobe_GetLayers",
159 "GeoKernelGlobe_GetLayerState",
160 "GeoKernelGlobe_GetJobState",
161 "GeoKernelGlobe_CancelJob",
162 "GeoKernelGlobe_ForgetJob",
163 "GeoKernelGlobe_FocusLayer",
164 "GeoKernelGlobe_RemoveLayer",
165 "GeoKernelGlobe_SetLayerVisible",
166 "GeoKernelGlobe_SetLayerOpacity",
167 "GeoKernelGlobe_GetFeatureInfo",
168 "GeoKernelGlobe_SetDemStyle",
169 "GeoKernelGlobe_SampleElevation",
170 "GeoKernelGlobe_GroundAt",
171 "GeoKernelGlobe_IdentifyAt",
172 "GeoKernelGlobe_SetMeasurementPoints",
173 "GeoKernelGlobe_StartTerrainAnalysis",
174 "GeoKernelGlobe_GetMeasurement",
175 "GeoKernelGlobe_GetTerrainAnalysis",
176 "GeoKernelGlobe_ClearMeasurement",
177 "GeoKernelGlobe_CancelTerrainAnalysis",
178 "GeoKernelGlobe_ClearTerrainAnalysis",
179 "GeoKernelGlobe_SetAnalysisOverlayVisible",
180 ];
181 pub unsafe fn load(path: &Path) -> Result<Self, LoadError> {
184 let library = open(path)?;
185 Ok(Self {
186 GeoKernelGlobe_GetApiVersion: *library.get(b"GeoKernelGlobe_GetApiVersion\0")?,
187 GeoKernelGlobe_DefaultOptions: *library.get(b"GeoKernelGlobe_DefaultOptions\0")?,
188 GeoKernelGlobe_DefaultCamera: *library.get(b"GeoKernelGlobe_DefaultCamera\0")?,
189 GeoKernelGlobe_Initialize: *library.get(b"GeoKernelGlobe_Initialize\0")?,
190 GeoKernelGlobe_ProcessEvents: *library.get(b"GeoKernelGlobe_ProcessEvents\0")?,
191 GeoKernelGlobe_GetCapabilities: *library.get(b"GeoKernelGlobe_GetCapabilities\0")?,
192 GeoKernelGlobe_Create: *library.get(b"GeoKernelGlobe_Create\0")?,
193 GeoKernelGlobe_Destroy: *library.get(b"GeoKernelGlobe_Destroy\0")?,
194 GeoKernelGlobe_Resize: *library.get(b"GeoKernelGlobe_Resize\0")?,
195 GeoKernelGlobe_SetVisible: *library.get(b"GeoKernelGlobe_SetVisible\0")?,
196 GeoKernelGlobe_GetNativeHandle: *library.get(b"GeoKernelGlobe_GetNativeHandle\0")?,
197 GeoKernelGlobe_GetOptions: *library.get(b"GeoKernelGlobe_GetOptions\0")?,
198 GeoKernelGlobe_SetOptions: *library.get(b"GeoKernelGlobe_SetOptions\0")?,
199 GeoKernelGlobe_SetBasemap: *library.get(b"GeoKernelGlobe_SetBasemap\0")?,
200 GeoKernelGlobe_ConfigureTerrain: *library.get(b"GeoKernelGlobe_ConfigureTerrain\0")?,
201 GeoKernelGlobe_GetCamera: *library.get(b"GeoKernelGlobe_GetCamera\0")?,
202 GeoKernelGlobe_SetCamera: *library.get(b"GeoKernelGlobe_SetCamera\0")?,
203 GeoKernelGlobe_SetHomeCamera: *library.get(b"GeoKernelGlobe_SetHomeCamera\0")?,
204 GeoKernelGlobe_ResetCamera: *library.get(b"GeoKernelGlobe_ResetCamera\0")?,
205 GeoKernelGlobe_Navigate: *library.get(b"GeoKernelGlobe_Navigate\0")?,
206 GeoKernelGlobe_SetInteractionMode: *library
207 .get(b"GeoKernelGlobe_SetInteractionMode\0")?,
208 GeoKernelGlobe_ClearInteraction: *library.get(b"GeoKernelGlobe_ClearInteraction\0")?,
209 GeoKernelGlobe_GetLastError: *library.get(b"GeoKernelGlobe_GetLastError\0")?,
210 GeoKernelGlobe_GetBasemaps: *library.get(b"GeoKernelGlobe_GetBasemaps\0")?,
211 GeoKernelGlobe_GetAttribution: *library.get(b"GeoKernelGlobe_GetAttribution\0")?,
212 GeoKernelGlobe_GetState: *library.get(b"GeoKernelGlobe_GetState\0")?,
213 GeoKernelGlobe_PollEvent: *library.get(b"GeoKernelGlobe_PollEvent\0")?,
214 GeoKernelGlobe_LoadVector: *library.get(b"GeoKernelGlobe_LoadVector\0")?,
215 GeoKernelGlobe_SetVectorStyle: *library.get(b"GeoKernelGlobe_SetVectorStyle\0")?,
216 GeoKernelGlobe_ConfigureBuildings: *library
217 .get(b"GeoKernelGlobe_ConfigureBuildings\0")?,
218 GeoKernelGlobe_LoadModel: *library.get(b"GeoKernelGlobe_LoadModel\0")?,
219 GeoKernelGlobe_SetModelPlacement: *library
220 .get(b"GeoKernelGlobe_SetModelPlacement\0")?,
221 GeoKernelGlobe_LoadRaster: *library.get(b"GeoKernelGlobe_LoadRaster\0")?,
222 GeoKernelGlobe_LoadDem: *library.get(b"GeoKernelGlobe_LoadDem\0")?,
223 GeoKernelGlobe_GetLayers: *library.get(b"GeoKernelGlobe_GetLayers\0")?,
224 GeoKernelGlobe_GetLayerState: *library.get(b"GeoKernelGlobe_GetLayerState\0")?,
225 GeoKernelGlobe_GetJobState: *library.get(b"GeoKernelGlobe_GetJobState\0")?,
226 GeoKernelGlobe_CancelJob: *library.get(b"GeoKernelGlobe_CancelJob\0")?,
227 GeoKernelGlobe_ForgetJob: *library.get(b"GeoKernelGlobe_ForgetJob\0")?,
228 GeoKernelGlobe_FocusLayer: *library.get(b"GeoKernelGlobe_FocusLayer\0")?,
229 GeoKernelGlobe_RemoveLayer: *library.get(b"GeoKernelGlobe_RemoveLayer\0")?,
230 GeoKernelGlobe_SetLayerVisible: *library.get(b"GeoKernelGlobe_SetLayerVisible\0")?,
231 GeoKernelGlobe_SetLayerOpacity: *library.get(b"GeoKernelGlobe_SetLayerOpacity\0")?,
232 GeoKernelGlobe_GetFeatureInfo: *library.get(b"GeoKernelGlobe_GetFeatureInfo\0")?,
233 GeoKernelGlobe_SetDemStyle: *library.get(b"GeoKernelGlobe_SetDemStyle\0")?,
234 GeoKernelGlobe_SampleElevation: *library.get(b"GeoKernelGlobe_SampleElevation\0")?,
235 GeoKernelGlobe_GroundAt: *library.get(b"GeoKernelGlobe_GroundAt\0")?,
236 GeoKernelGlobe_IdentifyAt: *library.get(b"GeoKernelGlobe_IdentifyAt\0")?,
237 GeoKernelGlobe_SetMeasurementPoints: *library
238 .get(b"GeoKernelGlobe_SetMeasurementPoints\0")?,
239 GeoKernelGlobe_StartTerrainAnalysis: *library
240 .get(b"GeoKernelGlobe_StartTerrainAnalysis\0")?,
241 GeoKernelGlobe_GetMeasurement: *library.get(b"GeoKernelGlobe_GetMeasurement\0")?,
242 GeoKernelGlobe_GetTerrainAnalysis: *library
243 .get(b"GeoKernelGlobe_GetTerrainAnalysis\0")?,
244 GeoKernelGlobe_ClearMeasurement: *library.get(b"GeoKernelGlobe_ClearMeasurement\0")?,
245 GeoKernelGlobe_CancelTerrainAnalysis: *library
246 .get(b"GeoKernelGlobe_CancelTerrainAnalysis\0")?,
247 GeoKernelGlobe_ClearTerrainAnalysis: *library
248 .get(b"GeoKernelGlobe_ClearTerrainAnalysis\0")?,
249 GeoKernelGlobe_SetAnalysisOverlayVisible: *library
250 .get(b"GeoKernelGlobe_SetAnalysisOverlayVisible\0")?,
251 _library: library,
252 })
253 }
254 pub unsafe fn GeoKernelGlobe_GetApiVersion(&self) -> u32 {
257 (self.GeoKernelGlobe_GetApiVersion)()
258 }
259 pub unsafe fn GeoKernelGlobe_DefaultOptions(&self, options: *mut GeoKernelGlobeOptions) -> i32 {
262 (self.GeoKernelGlobe_DefaultOptions)(options)
263 }
264 pub unsafe fn GeoKernelGlobe_DefaultCamera(&self, camera: *mut GeoKernelGlobeCamera) -> i32 {
267 (self.GeoKernelGlobe_DefaultCamera)(camera)
268 }
269 pub unsafe fn GeoKernelGlobe_Initialize(&self) -> i32 {
272 (self.GeoKernelGlobe_Initialize)()
273 }
274 pub unsafe fn GeoKernelGlobe_ProcessEvents(&self) -> i32 {
277 (self.GeoKernelGlobe_ProcessEvents)()
278 }
279 pub unsafe fn GeoKernelGlobe_GetCapabilities(&self, capabilities: *mut u64) -> i32 {
282 (self.GeoKernelGlobe_GetCapabilities)(capabilities)
283 }
284 pub unsafe fn GeoKernelGlobe_Create(
287 &self,
288 parent_window: usize,
289 options: *const GeoKernelGlobeOptions,
290 camera: *const GeoKernelGlobeCamera,
291 handle: *mut u64,
292 ) -> i32 {
293 (self.GeoKernelGlobe_Create)(parent_window, options, camera, handle)
294 }
295 pub unsafe fn GeoKernelGlobe_Destroy(&self, handle: u64) -> i32 {
298 (self.GeoKernelGlobe_Destroy)(handle)
299 }
300 pub unsafe fn GeoKernelGlobe_Resize(&self, handle: u64, width: i32, height: i32) -> i32 {
303 (self.GeoKernelGlobe_Resize)(handle, width, height)
304 }
305 pub unsafe fn GeoKernelGlobe_SetVisible(&self, handle: u64, visible: i32) -> i32 {
308 (self.GeoKernelGlobe_SetVisible)(handle, visible)
309 }
310 pub unsafe fn GeoKernelGlobe_GetNativeHandle(
313 &self,
314 handle: u64,
315 native_window: *mut usize,
316 ) -> i32 {
317 (self.GeoKernelGlobe_GetNativeHandle)(handle, native_window)
318 }
319 pub unsafe fn GeoKernelGlobe_GetOptions(
322 &self,
323 handle: u64,
324 options: *mut GeoKernelGlobeOptions,
325 ) -> i32 {
326 (self.GeoKernelGlobe_GetOptions)(handle, options)
327 }
328 pub unsafe fn GeoKernelGlobe_SetOptions(
331 &self,
332 handle: u64,
333 options: *const GeoKernelGlobeOptions,
334 ) -> i32 {
335 (self.GeoKernelGlobe_SetOptions)(handle, options)
336 }
337 pub unsafe fn GeoKernelGlobe_SetBasemap(&self, handle: u64, index: i32) -> i32 {
340 (self.GeoKernelGlobe_SetBasemap)(handle, index)
341 }
342 pub unsafe fn GeoKernelGlobe_ConfigureTerrain(
345 &self,
346 handle: u64,
347 url_utf8: *const std::ffi::c_char,
348 max_zoom: i32,
349 exaggeration: f64,
350 lerc: i32,
351 ) -> i32 {
352 (self.GeoKernelGlobe_ConfigureTerrain)(handle, url_utf8, max_zoom, exaggeration, lerc)
353 }
354 pub unsafe fn GeoKernelGlobe_GetCamera(
357 &self,
358 handle: u64,
359 camera: *mut GeoKernelGlobeCamera,
360 ) -> i32 {
361 (self.GeoKernelGlobe_GetCamera)(handle, camera)
362 }
363 pub unsafe fn GeoKernelGlobe_SetCamera(
366 &self,
367 handle: u64,
368 camera: *const GeoKernelGlobeCamera,
369 ) -> i32 {
370 (self.GeoKernelGlobe_SetCamera)(handle, camera)
371 }
372 pub unsafe fn GeoKernelGlobe_SetHomeCamera(
375 &self,
376 handle: u64,
377 camera: *const GeoKernelGlobeCamera,
378 ) -> i32 {
379 (self.GeoKernelGlobe_SetHomeCamera)(handle, camera)
380 }
381 pub unsafe fn GeoKernelGlobe_ResetCamera(&self, handle: u64) -> i32 {
384 (self.GeoKernelGlobe_ResetCamera)(handle)
385 }
386 pub unsafe fn GeoKernelGlobe_Navigate(&self, handle: u64, action: i32) -> i32 {
389 (self.GeoKernelGlobe_Navigate)(handle, action)
390 }
391 pub unsafe fn GeoKernelGlobe_SetInteractionMode(&self, handle: u64, mode: i32) -> i32 {
394 (self.GeoKernelGlobe_SetInteractionMode)(handle, mode)
395 }
396 pub unsafe fn GeoKernelGlobe_ClearInteraction(&self, handle: u64) -> i32 {
399 (self.GeoKernelGlobe_ClearInteraction)(handle)
400 }
401 pub unsafe fn GeoKernelGlobe_GetLastError(
404 &self,
405 buffer: *mut std::ffi::c_char,
406 capacity: u32,
407 required_bytes: *mut u32,
408 ) -> i32 {
409 (self.GeoKernelGlobe_GetLastError)(buffer, capacity, required_bytes)
410 }
411 pub unsafe fn GeoKernelGlobe_GetBasemaps(
414 &self,
415 buffer: *mut std::ffi::c_char,
416 capacity: u32,
417 required_bytes: *mut u32,
418 ) -> i32 {
419 (self.GeoKernelGlobe_GetBasemaps)(buffer, capacity, required_bytes)
420 }
421 pub unsafe fn GeoKernelGlobe_GetAttribution(
424 &self,
425 handle: u64,
426 buffer: *mut std::ffi::c_char,
427 capacity: u32,
428 required_bytes: *mut u32,
429 ) -> i32 {
430 (self.GeoKernelGlobe_GetAttribution)(handle, buffer, capacity, required_bytes)
431 }
432 pub unsafe fn GeoKernelGlobe_GetState(
435 &self,
436 handle: u64,
437 buffer: *mut std::ffi::c_char,
438 capacity: u32,
439 required_bytes: *mut u32,
440 ) -> i32 {
441 (self.GeoKernelGlobe_GetState)(handle, buffer, capacity, required_bytes)
442 }
443 pub unsafe fn GeoKernelGlobe_PollEvent(
446 &self,
447 handle: u64,
448 buffer: *mut std::ffi::c_char,
449 capacity: u32,
450 required_bytes: *mut u32,
451 ) -> i32 {
452 (self.GeoKernelGlobe_PollEvent)(handle, buffer, capacity, required_bytes)
453 }
454 pub unsafe fn GeoKernelGlobe_LoadVector(
457 &self,
458 handle: u64,
459 request_json: *const std::ffi::c_char,
460 job_id: *mut u64,
461 ) -> i32 {
462 (self.GeoKernelGlobe_LoadVector)(handle, request_json, job_id)
463 }
464 pub unsafe fn GeoKernelGlobe_SetVectorStyle(
467 &self,
468 handle: u64,
469 request_json: *const std::ffi::c_char,
470 job_id: *mut u64,
471 ) -> i32 {
472 (self.GeoKernelGlobe_SetVectorStyle)(handle, request_json, job_id)
473 }
474 pub unsafe fn GeoKernelGlobe_ConfigureBuildings(
477 &self,
478 handle: u64,
479 request_json: *const std::ffi::c_char,
480 job_id: *mut u64,
481 ) -> i32 {
482 (self.GeoKernelGlobe_ConfigureBuildings)(handle, request_json, job_id)
483 }
484 pub unsafe fn GeoKernelGlobe_LoadModel(
487 &self,
488 handle: u64,
489 request_json: *const std::ffi::c_char,
490 job_id: *mut u64,
491 ) -> i32 {
492 (self.GeoKernelGlobe_LoadModel)(handle, request_json, job_id)
493 }
494 pub unsafe fn GeoKernelGlobe_SetModelPlacement(
497 &self,
498 handle: u64,
499 request_json: *const std::ffi::c_char,
500 job_id: *mut u64,
501 ) -> i32 {
502 (self.GeoKernelGlobe_SetModelPlacement)(handle, request_json, job_id)
503 }
504 pub unsafe fn GeoKernelGlobe_LoadRaster(
507 &self,
508 handle: u64,
509 request_json: *const std::ffi::c_char,
510 job_id: *mut u64,
511 ) -> i32 {
512 (self.GeoKernelGlobe_LoadRaster)(handle, request_json, job_id)
513 }
514 pub unsafe fn GeoKernelGlobe_LoadDem(
517 &self,
518 handle: u64,
519 request_json: *const std::ffi::c_char,
520 job_id: *mut u64,
521 ) -> i32 {
522 (self.GeoKernelGlobe_LoadDem)(handle, request_json, job_id)
523 }
524 pub unsafe fn GeoKernelGlobe_GetLayers(
527 &self,
528 handle: u64,
529 buffer: *mut std::ffi::c_char,
530 capacity: u32,
531 required_bytes: *mut u32,
532 ) -> i32 {
533 (self.GeoKernelGlobe_GetLayers)(handle, buffer, capacity, required_bytes)
534 }
535 pub unsafe fn GeoKernelGlobe_GetLayerState(
538 &self,
539 handle: u64,
540 layer_id: *const std::ffi::c_char,
541 buffer: *mut std::ffi::c_char,
542 capacity: u32,
543 required_bytes: *mut u32,
544 ) -> i32 {
545 (self.GeoKernelGlobe_GetLayerState)(handle, layer_id, buffer, capacity, required_bytes)
546 }
547 pub unsafe fn GeoKernelGlobe_GetJobState(
550 &self,
551 handle: u64,
552 job_id: u64,
553 buffer: *mut std::ffi::c_char,
554 capacity: u32,
555 required_bytes: *mut u32,
556 ) -> i32 {
557 (self.GeoKernelGlobe_GetJobState)(handle, job_id, buffer, capacity, required_bytes)
558 }
559 pub unsafe fn GeoKernelGlobe_CancelJob(&self, handle: u64, job_id: u64) -> i32 {
562 (self.GeoKernelGlobe_CancelJob)(handle, job_id)
563 }
564 pub unsafe fn GeoKernelGlobe_ForgetJob(&self, handle: u64, job_id: u64) -> i32 {
567 (self.GeoKernelGlobe_ForgetJob)(handle, job_id)
568 }
569 pub unsafe fn GeoKernelGlobe_FocusLayer(
572 &self,
573 handle: u64,
574 layer_id: *const std::ffi::c_char,
575 ) -> i32 {
576 (self.GeoKernelGlobe_FocusLayer)(handle, layer_id)
577 }
578 pub unsafe fn GeoKernelGlobe_RemoveLayer(
581 &self,
582 handle: u64,
583 layer_id: *const std::ffi::c_char,
584 ) -> i32 {
585 (self.GeoKernelGlobe_RemoveLayer)(handle, layer_id)
586 }
587 pub unsafe fn GeoKernelGlobe_SetLayerVisible(
590 &self,
591 handle: u64,
592 layer_id: *const std::ffi::c_char,
593 visible: i32,
594 ) -> i32 {
595 (self.GeoKernelGlobe_SetLayerVisible)(handle, layer_id, visible)
596 }
597 pub unsafe fn GeoKernelGlobe_SetLayerOpacity(
600 &self,
601 handle: u64,
602 layer_id: *const std::ffi::c_char,
603 opacity: f64,
604 ) -> i32 {
605 (self.GeoKernelGlobe_SetLayerOpacity)(handle, layer_id, opacity)
606 }
607 pub unsafe fn GeoKernelGlobe_GetFeatureInfo(
610 &self,
611 handle: u64,
612 layer_id: *const std::ffi::c_char,
613 feature_id: *const std::ffi::c_char,
614 buffer: *mut std::ffi::c_char,
615 capacity: u32,
616 required_bytes: *mut u32,
617 ) -> i32 {
618 (self.GeoKernelGlobe_GetFeatureInfo)(
619 handle,
620 layer_id,
621 feature_id,
622 buffer,
623 capacity,
624 required_bytes,
625 )
626 }
627 pub unsafe fn GeoKernelGlobe_SetDemStyle(
630 &self,
631 handle: u64,
632 color_enabled: i32,
633 minimum: f64,
634 maximum: f64,
635 ) -> i32 {
636 (self.GeoKernelGlobe_SetDemStyle)(handle, color_enabled, minimum, maximum)
637 }
638 pub unsafe fn GeoKernelGlobe_SampleElevation(
641 &self,
642 handle: u64,
643 x: f64,
644 y: f64,
645 buffer: *mut std::ffi::c_char,
646 capacity: u32,
647 required_bytes: *mut u32,
648 ) -> i32 {
649 (self.GeoKernelGlobe_SampleElevation)(handle, x, y, buffer, capacity, required_bytes)
650 }
651 pub unsafe fn GeoKernelGlobe_GroundAt(
654 &self,
655 handle: u64,
656 x: f64,
657 y: f64,
658 buffer: *mut std::ffi::c_char,
659 capacity: u32,
660 required_bytes: *mut u32,
661 ) -> i32 {
662 (self.GeoKernelGlobe_GroundAt)(handle, x, y, buffer, capacity, required_bytes)
663 }
664 pub unsafe fn GeoKernelGlobe_IdentifyAt(
667 &self,
668 handle: u64,
669 x: f64,
670 y: f64,
671 buffer: *mut std::ffi::c_char,
672 capacity: u32,
673 required_bytes: *mut u32,
674 ) -> i32 {
675 (self.GeoKernelGlobe_IdentifyAt)(handle, x, y, buffer, capacity, required_bytes)
676 }
677 pub unsafe fn GeoKernelGlobe_SetMeasurementPoints(
680 &self,
681 handle: u64,
682 request_json: *const std::ffi::c_char,
683 ) -> i32 {
684 (self.GeoKernelGlobe_SetMeasurementPoints)(handle, request_json)
685 }
686 pub unsafe fn GeoKernelGlobe_StartTerrainAnalysis(
689 &self,
690 handle: u64,
691 request_json: *const std::ffi::c_char,
692 analysis_id: *mut u64,
693 ) -> i32 {
694 (self.GeoKernelGlobe_StartTerrainAnalysis)(handle, request_json, analysis_id)
695 }
696 pub unsafe fn GeoKernelGlobe_GetMeasurement(
699 &self,
700 handle: u64,
701 buffer: *mut std::ffi::c_char,
702 capacity: u32,
703 required_bytes: *mut u32,
704 ) -> i32 {
705 (self.GeoKernelGlobe_GetMeasurement)(handle, buffer, capacity, required_bytes)
706 }
707 pub unsafe fn GeoKernelGlobe_GetTerrainAnalysis(
710 &self,
711 handle: u64,
712 buffer: *mut std::ffi::c_char,
713 capacity: u32,
714 required_bytes: *mut u32,
715 ) -> i32 {
716 (self.GeoKernelGlobe_GetTerrainAnalysis)(handle, buffer, capacity, required_bytes)
717 }
718 pub unsafe fn GeoKernelGlobe_ClearMeasurement(&self, handle: u64) -> i32 {
721 (self.GeoKernelGlobe_ClearMeasurement)(handle)
722 }
723 pub unsafe fn GeoKernelGlobe_CancelTerrainAnalysis(&self, handle: u64) -> i32 {
726 (self.GeoKernelGlobe_CancelTerrainAnalysis)(handle)
727 }
728 pub unsafe fn GeoKernelGlobe_ClearTerrainAnalysis(&self, handle: u64) -> i32 {
731 (self.GeoKernelGlobe_ClearTerrainAnalysis)(handle)
732 }
733 pub unsafe fn GeoKernelGlobe_SetAnalysisOverlayVisible(
736 &self,
737 handle: u64,
738 visible: i32,
739 ) -> i32 {
740 (self.GeoKernelGlobe_SetAnalysisOverlayVisible)(handle, visible)
741 }
742}