@juun-roh/cesium-utils 0.4.2 → 0.4.4
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/dist/collection/index.js +1 -1
- package/dist/dev/index.cjs +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/highlight/index.js +1 -1
- package/dist/index.d.cts +1312 -6
- package/dist/index.d.ts +1312 -6
- package/dist/index.js +1 -1
- package/dist/terrain/dev/index.cjs +1 -0
- package/dist/terrain/dev/index.js +1 -0
- package/dist/terrain/index.js +1 -1
- package/dist/viewer/index.js +1 -1
- package/package.json +89 -44
- package/dist/chunk-6I6OKECI.js +0 -0
- package/dist/chunk-PSCNWZUR.js +0 -1
- package/dist/chunk-WTOAUTEK.js +0 -1
- package/dist/chunk-XHMLNB5Q.js +0 -1
- package/dist/chunk-Z2COOTT4.js +0 -1
- package/dist/collection/index.d.cts +0 -553
- package/dist/collection/index.d.ts +0 -553
- package/dist/dev/index.d.cts +0 -222
- package/dist/dev/index.d.ts +0 -222
- package/dist/experimental/index.d.cts +0 -105
- package/dist/experimental/index.d.ts +0 -105
- package/dist/highlight/index.d.cts +0 -245
- package/dist/highlight/index.d.ts +0 -245
- package/dist/hybrid-terrain-provider-Th8n2hZ1.d.cts +0 -180
- package/dist/hybrid-terrain-provider-Th8n2hZ1.d.ts +0 -180
- package/dist/terrain/index.d.cts +0 -8
- package/dist/terrain/index.d.ts +0 -8
- package/dist/viewer/index.d.cts +0 -19
- package/dist/viewer/index.d.ts +0 -19
package/dist/dev/index.d.cts
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { Viewer, Color, Rectangle } from 'cesium';
|
|
2
|
-
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-Th8n2hZ1.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Utility for managing deprecation warnings in the cesium-utils library.
|
|
6
|
-
* Provides runtime warnings to help developers identify deprecated API usage.
|
|
7
|
-
*/
|
|
8
|
-
declare namespace Deprecate {
|
|
9
|
-
/**
|
|
10
|
-
* Configuration options for deprecation warnings.
|
|
11
|
-
*/
|
|
12
|
-
interface Options {
|
|
13
|
-
/**
|
|
14
|
-
* Whether to show the warning only once per deprecation message.
|
|
15
|
-
* @default true
|
|
16
|
-
*/
|
|
17
|
-
once?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Custom prefix for the warning message.
|
|
20
|
-
* @default "[DEPRECATED]"
|
|
21
|
-
*/
|
|
22
|
-
prefix?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Whether to include a stack trace in the warning.
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
includeStack?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Version when the feature will be removed.
|
|
30
|
-
*/
|
|
31
|
-
removeInVersion?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Displays a deprecation warning message.
|
|
35
|
-
*
|
|
36
|
-
* @param message - The deprecation message to display
|
|
37
|
-
* @param options - Configuration options for the warning
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* // Basic usage
|
|
42
|
-
* deprecationWarning("oldFunction() is deprecated. Use newFunction() instead.");
|
|
43
|
-
*
|
|
44
|
-
* // With removal version
|
|
45
|
-
* deprecationWarning("TerrainArea is deprecated.", {
|
|
46
|
-
* removeInVersion: "v0.3.0"
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* // Allow multiple warnings
|
|
50
|
-
* deprecationWarning("Repeated warning", { once: false });
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
function warn(message: string, options?: Options): void;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a deprecation wrapper function that shows a warning when called.
|
|
56
|
-
*
|
|
57
|
-
* @param fn - The function to wrap
|
|
58
|
-
* @param message - The deprecation message
|
|
59
|
-
* @param options - Configuration options for the warning
|
|
60
|
-
* @returns A wrapped function that shows a deprecation warning when called
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* const oldFunction = deprecate(
|
|
65
|
-
* () => console.log("old implementation"),
|
|
66
|
-
* "oldFunction() is deprecated. Use newFunction() instead."
|
|
67
|
-
* );
|
|
68
|
-
*
|
|
69
|
-
* oldFunction(); // Shows warning and executes function
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
function deprecate<T extends (...args: any[]) => any>(fn: T, message: string, options?: Options): T;
|
|
73
|
-
/**
|
|
74
|
-
* Clears all shown warning messages.
|
|
75
|
-
* Useful for testing or when you want to reset the warning state.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* clearDeprecationWarnings();
|
|
80
|
-
* deprecationWarning("This will show again");
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
function clear(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Gets the count of unique deprecation warnings that have been shown.
|
|
86
|
-
*
|
|
87
|
-
* @returns The number of unique deprecation warnings shown
|
|
88
|
-
*/
|
|
89
|
-
function getWarningCount(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Checks if a specific deprecation warning has been shown.
|
|
92
|
-
*
|
|
93
|
-
* @param message - The deprecation message to check
|
|
94
|
-
* @returns True if the warning has been shown, false otherwise
|
|
95
|
-
*/
|
|
96
|
-
function hasShown(message: string): boolean;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @class
|
|
101
|
-
* Utility class for visualizing terrain provider boundaries and debugging terrain loading.
|
|
102
|
-
*/
|
|
103
|
-
declare class TerrainVisualizer {
|
|
104
|
-
private _viewer;
|
|
105
|
-
private _terrainProvider;
|
|
106
|
-
private _visible;
|
|
107
|
-
private _tileCoordinatesLayer;
|
|
108
|
-
private _hybridImageryLayer;
|
|
109
|
-
private _colors;
|
|
110
|
-
/**
|
|
111
|
-
* Creates a new `TerrainVisualizer`.
|
|
112
|
-
* @param viewer The Cesium viewer instance
|
|
113
|
-
* @param options {@link TerrainVisualizer.ConstructorOptions}
|
|
114
|
-
*/
|
|
115
|
-
constructor(viewer: Viewer, options: TerrainVisualizer.ConstructorOptions);
|
|
116
|
-
/**
|
|
117
|
-
* Sets the terrain provider to visualize.
|
|
118
|
-
* @param terrainProvider The terrain provider to visualize.
|
|
119
|
-
*/
|
|
120
|
-
setTerrainProvider(terrainProvider: HybridTerrainProvider): void;
|
|
121
|
-
/**
|
|
122
|
-
* Updates all active visualizations.
|
|
123
|
-
*/
|
|
124
|
-
update(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Clears all visualizations.
|
|
127
|
-
*/
|
|
128
|
-
clear(): void;
|
|
129
|
-
/**
|
|
130
|
-
* Shows terrain visualization using HybridImageryProvider.
|
|
131
|
-
* Optionally adds tile coordinate grid overlay.
|
|
132
|
-
* @param options Visualization options
|
|
133
|
-
*/
|
|
134
|
-
show(options?: {
|
|
135
|
-
/** Show tile coordinate labels. Default: true */
|
|
136
|
-
showTileCoordinates?: boolean;
|
|
137
|
-
/** Transparency level (0-1). Default: 0.5 */
|
|
138
|
-
alpha?: number;
|
|
139
|
-
}): void;
|
|
140
|
-
private _ensureTileCoordinatesLayer;
|
|
141
|
-
/**
|
|
142
|
-
* Hides the terrain visualization.
|
|
143
|
-
*/
|
|
144
|
-
hide(): void;
|
|
145
|
-
/**
|
|
146
|
-
* Sets the colors used for visualization.
|
|
147
|
-
* @param colors Map of role names to colors
|
|
148
|
-
*/
|
|
149
|
-
setColors(colors: Record<string, Color>): void;
|
|
150
|
-
/**
|
|
151
|
-
* Shows terrain regions using HybridImageryProvider (performant, global coverage).
|
|
152
|
-
* This replaces the entity-based approach with an imagery layer.
|
|
153
|
-
* @param alpha Transparency level (0-1), default 0.5
|
|
154
|
-
*/
|
|
155
|
-
showImageryOverlay(alpha?: number): void;
|
|
156
|
-
/**
|
|
157
|
-
* Hides the imagery overlay.
|
|
158
|
-
*/
|
|
159
|
-
hideImageryOverlay(): void;
|
|
160
|
-
/**
|
|
161
|
-
* Shows tile coordinate grid overlay.
|
|
162
|
-
*/
|
|
163
|
-
showTileCoordinates(): void;
|
|
164
|
-
/**
|
|
165
|
-
* Hides tile coordinate grid overlay.
|
|
166
|
-
*/
|
|
167
|
-
hideTileCoordinates(): void;
|
|
168
|
-
/**
|
|
169
|
-
* Sets the transparency of the imagery overlay.
|
|
170
|
-
* @param alpha Transparency level (0-1), where 0 is fully transparent and 1 is fully opaque
|
|
171
|
-
*/
|
|
172
|
-
setAlpha(alpha: number): void;
|
|
173
|
-
/**
|
|
174
|
-
* Flies the camera to focus on a rectangle.
|
|
175
|
-
* @param rectangle The rectangle to focus on.
|
|
176
|
-
* @param options {@link Viewer.flyTo}
|
|
177
|
-
*/
|
|
178
|
-
flyTo(rectangle: Rectangle, options?: {
|
|
179
|
-
duration?: number;
|
|
180
|
-
}): void;
|
|
181
|
-
/** Whether tile coordinates are currently visible. */
|
|
182
|
-
get tileCoordinatesVisible(): boolean;
|
|
183
|
-
/** Whether the grid is currently visible. */
|
|
184
|
-
get visible(): boolean;
|
|
185
|
-
/** The viewer used in the visualizer */
|
|
186
|
-
get viewer(): Viewer;
|
|
187
|
-
/** The colors used in the visualizer */
|
|
188
|
-
get colors(): Map<string, Color>;
|
|
189
|
-
/** The hybrid terrain instance used in the visualizer */
|
|
190
|
-
get terrainProvider(): HybridTerrainProvider;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* @namespace
|
|
194
|
-
* Contains types, utility functions, and constants for terrain visualization.
|
|
195
|
-
*/
|
|
196
|
-
declare namespace TerrainVisualizer {
|
|
197
|
-
/** Initialization options for `TerrainVisualizer` constructor. */
|
|
198
|
-
interface ConstructorOptions {
|
|
199
|
-
/** Colors to use for different visualization elements */
|
|
200
|
-
colors?: Record<string, Color>;
|
|
201
|
-
/** Whether to show tile grid initially. */
|
|
202
|
-
tile?: boolean;
|
|
203
|
-
/** Initial zoom level to use for visualizations. */
|
|
204
|
-
activeLevel?: number;
|
|
205
|
-
/** Terrain provider to visualize. */
|
|
206
|
-
terrainProvider: HybridTerrainProvider;
|
|
207
|
-
}
|
|
208
|
-
/** Options for {@link TerrainVisualizer.visualize} */
|
|
209
|
-
interface Options {
|
|
210
|
-
color?: Color;
|
|
211
|
-
show?: boolean;
|
|
212
|
-
maxTilesToShow?: number;
|
|
213
|
-
levels?: number[];
|
|
214
|
-
tag?: string;
|
|
215
|
-
alpha?: number;
|
|
216
|
-
tileAlpha?: number;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
declare const deprecate: typeof Deprecate.deprecate;
|
|
221
|
-
|
|
222
|
-
export { Deprecate, TerrainVisualizer, deprecate };
|
package/dist/dev/index.d.ts
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { Viewer, Color, Rectangle } from 'cesium';
|
|
2
|
-
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-Th8n2hZ1.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Utility for managing deprecation warnings in the cesium-utils library.
|
|
6
|
-
* Provides runtime warnings to help developers identify deprecated API usage.
|
|
7
|
-
*/
|
|
8
|
-
declare namespace Deprecate {
|
|
9
|
-
/**
|
|
10
|
-
* Configuration options for deprecation warnings.
|
|
11
|
-
*/
|
|
12
|
-
interface Options {
|
|
13
|
-
/**
|
|
14
|
-
* Whether to show the warning only once per deprecation message.
|
|
15
|
-
* @default true
|
|
16
|
-
*/
|
|
17
|
-
once?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Custom prefix for the warning message.
|
|
20
|
-
* @default "[DEPRECATED]"
|
|
21
|
-
*/
|
|
22
|
-
prefix?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Whether to include a stack trace in the warning.
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
includeStack?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Version when the feature will be removed.
|
|
30
|
-
*/
|
|
31
|
-
removeInVersion?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Displays a deprecation warning message.
|
|
35
|
-
*
|
|
36
|
-
* @param message - The deprecation message to display
|
|
37
|
-
* @param options - Configuration options for the warning
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* // Basic usage
|
|
42
|
-
* deprecationWarning("oldFunction() is deprecated. Use newFunction() instead.");
|
|
43
|
-
*
|
|
44
|
-
* // With removal version
|
|
45
|
-
* deprecationWarning("TerrainArea is deprecated.", {
|
|
46
|
-
* removeInVersion: "v0.3.0"
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* // Allow multiple warnings
|
|
50
|
-
* deprecationWarning("Repeated warning", { once: false });
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
function warn(message: string, options?: Options): void;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a deprecation wrapper function that shows a warning when called.
|
|
56
|
-
*
|
|
57
|
-
* @param fn - The function to wrap
|
|
58
|
-
* @param message - The deprecation message
|
|
59
|
-
* @param options - Configuration options for the warning
|
|
60
|
-
* @returns A wrapped function that shows a deprecation warning when called
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* const oldFunction = deprecate(
|
|
65
|
-
* () => console.log("old implementation"),
|
|
66
|
-
* "oldFunction() is deprecated. Use newFunction() instead."
|
|
67
|
-
* );
|
|
68
|
-
*
|
|
69
|
-
* oldFunction(); // Shows warning and executes function
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
function deprecate<T extends (...args: any[]) => any>(fn: T, message: string, options?: Options): T;
|
|
73
|
-
/**
|
|
74
|
-
* Clears all shown warning messages.
|
|
75
|
-
* Useful for testing or when you want to reset the warning state.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* clearDeprecationWarnings();
|
|
80
|
-
* deprecationWarning("This will show again");
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
function clear(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Gets the count of unique deprecation warnings that have been shown.
|
|
86
|
-
*
|
|
87
|
-
* @returns The number of unique deprecation warnings shown
|
|
88
|
-
*/
|
|
89
|
-
function getWarningCount(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Checks if a specific deprecation warning has been shown.
|
|
92
|
-
*
|
|
93
|
-
* @param message - The deprecation message to check
|
|
94
|
-
* @returns True if the warning has been shown, false otherwise
|
|
95
|
-
*/
|
|
96
|
-
function hasShown(message: string): boolean;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @class
|
|
101
|
-
* Utility class for visualizing terrain provider boundaries and debugging terrain loading.
|
|
102
|
-
*/
|
|
103
|
-
declare class TerrainVisualizer {
|
|
104
|
-
private _viewer;
|
|
105
|
-
private _terrainProvider;
|
|
106
|
-
private _visible;
|
|
107
|
-
private _tileCoordinatesLayer;
|
|
108
|
-
private _hybridImageryLayer;
|
|
109
|
-
private _colors;
|
|
110
|
-
/**
|
|
111
|
-
* Creates a new `TerrainVisualizer`.
|
|
112
|
-
* @param viewer The Cesium viewer instance
|
|
113
|
-
* @param options {@link TerrainVisualizer.ConstructorOptions}
|
|
114
|
-
*/
|
|
115
|
-
constructor(viewer: Viewer, options: TerrainVisualizer.ConstructorOptions);
|
|
116
|
-
/**
|
|
117
|
-
* Sets the terrain provider to visualize.
|
|
118
|
-
* @param terrainProvider The terrain provider to visualize.
|
|
119
|
-
*/
|
|
120
|
-
setTerrainProvider(terrainProvider: HybridTerrainProvider): void;
|
|
121
|
-
/**
|
|
122
|
-
* Updates all active visualizations.
|
|
123
|
-
*/
|
|
124
|
-
update(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Clears all visualizations.
|
|
127
|
-
*/
|
|
128
|
-
clear(): void;
|
|
129
|
-
/**
|
|
130
|
-
* Shows terrain visualization using HybridImageryProvider.
|
|
131
|
-
* Optionally adds tile coordinate grid overlay.
|
|
132
|
-
* @param options Visualization options
|
|
133
|
-
*/
|
|
134
|
-
show(options?: {
|
|
135
|
-
/** Show tile coordinate labels. Default: true */
|
|
136
|
-
showTileCoordinates?: boolean;
|
|
137
|
-
/** Transparency level (0-1). Default: 0.5 */
|
|
138
|
-
alpha?: number;
|
|
139
|
-
}): void;
|
|
140
|
-
private _ensureTileCoordinatesLayer;
|
|
141
|
-
/**
|
|
142
|
-
* Hides the terrain visualization.
|
|
143
|
-
*/
|
|
144
|
-
hide(): void;
|
|
145
|
-
/**
|
|
146
|
-
* Sets the colors used for visualization.
|
|
147
|
-
* @param colors Map of role names to colors
|
|
148
|
-
*/
|
|
149
|
-
setColors(colors: Record<string, Color>): void;
|
|
150
|
-
/**
|
|
151
|
-
* Shows terrain regions using HybridImageryProvider (performant, global coverage).
|
|
152
|
-
* This replaces the entity-based approach with an imagery layer.
|
|
153
|
-
* @param alpha Transparency level (0-1), default 0.5
|
|
154
|
-
*/
|
|
155
|
-
showImageryOverlay(alpha?: number): void;
|
|
156
|
-
/**
|
|
157
|
-
* Hides the imagery overlay.
|
|
158
|
-
*/
|
|
159
|
-
hideImageryOverlay(): void;
|
|
160
|
-
/**
|
|
161
|
-
* Shows tile coordinate grid overlay.
|
|
162
|
-
*/
|
|
163
|
-
showTileCoordinates(): void;
|
|
164
|
-
/**
|
|
165
|
-
* Hides tile coordinate grid overlay.
|
|
166
|
-
*/
|
|
167
|
-
hideTileCoordinates(): void;
|
|
168
|
-
/**
|
|
169
|
-
* Sets the transparency of the imagery overlay.
|
|
170
|
-
* @param alpha Transparency level (0-1), where 0 is fully transparent and 1 is fully opaque
|
|
171
|
-
*/
|
|
172
|
-
setAlpha(alpha: number): void;
|
|
173
|
-
/**
|
|
174
|
-
* Flies the camera to focus on a rectangle.
|
|
175
|
-
* @param rectangle The rectangle to focus on.
|
|
176
|
-
* @param options {@link Viewer.flyTo}
|
|
177
|
-
*/
|
|
178
|
-
flyTo(rectangle: Rectangle, options?: {
|
|
179
|
-
duration?: number;
|
|
180
|
-
}): void;
|
|
181
|
-
/** Whether tile coordinates are currently visible. */
|
|
182
|
-
get tileCoordinatesVisible(): boolean;
|
|
183
|
-
/** Whether the grid is currently visible. */
|
|
184
|
-
get visible(): boolean;
|
|
185
|
-
/** The viewer used in the visualizer */
|
|
186
|
-
get viewer(): Viewer;
|
|
187
|
-
/** The colors used in the visualizer */
|
|
188
|
-
get colors(): Map<string, Color>;
|
|
189
|
-
/** The hybrid terrain instance used in the visualizer */
|
|
190
|
-
get terrainProvider(): HybridTerrainProvider;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* @namespace
|
|
194
|
-
* Contains types, utility functions, and constants for terrain visualization.
|
|
195
|
-
*/
|
|
196
|
-
declare namespace TerrainVisualizer {
|
|
197
|
-
/** Initialization options for `TerrainVisualizer` constructor. */
|
|
198
|
-
interface ConstructorOptions {
|
|
199
|
-
/** Colors to use for different visualization elements */
|
|
200
|
-
colors?: Record<string, Color>;
|
|
201
|
-
/** Whether to show tile grid initially. */
|
|
202
|
-
tile?: boolean;
|
|
203
|
-
/** Initial zoom level to use for visualizations. */
|
|
204
|
-
activeLevel?: number;
|
|
205
|
-
/** Terrain provider to visualize. */
|
|
206
|
-
terrainProvider: HybridTerrainProvider;
|
|
207
|
-
}
|
|
208
|
-
/** Options for {@link TerrainVisualizer.visualize} */
|
|
209
|
-
interface Options {
|
|
210
|
-
color?: Color;
|
|
211
|
-
show?: boolean;
|
|
212
|
-
maxTilesToShow?: number;
|
|
213
|
-
levels?: number[];
|
|
214
|
-
tag?: string;
|
|
215
|
-
alpha?: number;
|
|
216
|
-
tileAlpha?: number;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
declare const deprecate: typeof Deprecate.deprecate;
|
|
221
|
-
|
|
222
|
-
export { Deprecate, TerrainVisualizer, deprecate };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Viewer, Cartesian3, JulianDate, Color, Entity } from 'cesium';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @since Cesium 1.132.0
|
|
5
|
-
* @experimental
|
|
6
|
-
* Point sunlight analysis utility for shadow calculations.
|
|
7
|
-
*
|
|
8
|
-
* ⚠️ **Warning**: This is an experimental feature that uses Cesium's internal APIs.
|
|
9
|
-
* The API may change or break in future versions of Cesium or cesium-utils.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const sunlight = new Sunlight(viewer);
|
|
14
|
-
* sunlight.analyze(point, JulianDate.now());
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
declare class Sunlight {
|
|
18
|
-
private _uniformState;
|
|
19
|
-
private _viewer;
|
|
20
|
-
private _analyzing;
|
|
21
|
-
private _pointEntityId?;
|
|
22
|
-
private _objectsToExclude;
|
|
23
|
-
private _polylines;
|
|
24
|
-
private _points;
|
|
25
|
-
constructor(viewer: Viewer);
|
|
26
|
-
/** The sun position in 3D world coordinates at the current scene time. */
|
|
27
|
-
get sunPositionWC(): Cartesian3;
|
|
28
|
-
/** A normalized vector to the sun in 3D world coordinates at the current scene time. */
|
|
29
|
-
get sunDirectionWC(): Cartesian3;
|
|
30
|
-
/** Whether sunlight analysis is currently in progress. */
|
|
31
|
-
get isAnalyzing(): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Gets virtual position and direction of the sun to reduce calculation overhead.
|
|
34
|
-
*
|
|
35
|
-
* @param from target point to start from
|
|
36
|
-
* @param radius virtual distance between target point and the sun. Defaults to 10000 (10km)
|
|
37
|
-
*/
|
|
38
|
-
virtualSun(from: Cartesian3, radius?: number): {
|
|
39
|
-
position: Cartesian3;
|
|
40
|
-
direction: Cartesian3;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Analyze the sunlight acceptance from a given point at a given time.
|
|
44
|
-
* @param from target point to analyze
|
|
45
|
-
* @param at time to analyze
|
|
46
|
-
* @param options {@link Sunlight.AnalyzeOptions}
|
|
47
|
-
*/
|
|
48
|
-
analyze(from: Cartesian3, at: JulianDate, options?: Sunlight.AnalyzeOptions): Promise<Sunlight.AnalysisResult>;
|
|
49
|
-
/**
|
|
50
|
-
* Analyze the sunlight acceptance from a given point at a given time range.
|
|
51
|
-
* @param from target point to analyze
|
|
52
|
-
* @param range time range to analyze
|
|
53
|
-
* @param options {@link Sunlight.AnalyzeOptions}
|
|
54
|
-
*/
|
|
55
|
-
analyze(from: Cartesian3, range: Sunlight.TimeRange, options?: Sunlight.AnalyzeOptions): Promise<Sunlight.AnalysisResult[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Remove all instances created for debug purpose
|
|
58
|
-
*/
|
|
59
|
-
clear(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Create an ellipsoid entity for ray collision detection to complement cesium's native click event accuracy
|
|
62
|
-
* @param at where to create the entity
|
|
63
|
-
* @param show whether to show point entity
|
|
64
|
-
* @param errorBoundary size of the point entity for error tolerance
|
|
65
|
-
*/
|
|
66
|
-
setTargetPoint(at: Cartesian3, show?: boolean, errorBoundary?: number, color?: Color): Entity;
|
|
67
|
-
private _analyzeSingleTime;
|
|
68
|
-
private _analyzeTimeRange;
|
|
69
|
-
/**
|
|
70
|
-
* @returns A promise tht resolves to an object containing the object and position of the first intersection.
|
|
71
|
-
* @see https://github.com/CesiumGS/cesium/blob/1.136/packages/engine/Source/Scene/Scene.js#L4868
|
|
72
|
-
*/
|
|
73
|
-
private _pick;
|
|
74
|
-
private _getExcludedObjects;
|
|
75
|
-
}
|
|
76
|
-
declare namespace Sunlight {
|
|
77
|
-
const DETECTION_ELLIPSOID_ID = "sunlight-detection-ellipsoid";
|
|
78
|
-
/** for time-range analysis */
|
|
79
|
-
interface TimeRange {
|
|
80
|
-
/** When to start analysis */
|
|
81
|
-
start: JulianDate;
|
|
82
|
-
/** When to end analysis */
|
|
83
|
-
end: JulianDate;
|
|
84
|
-
/** Step interval (seconds) inside the range */
|
|
85
|
-
step: number;
|
|
86
|
-
}
|
|
87
|
-
interface AnalyzeOptions {
|
|
88
|
-
/** List of objects to exclude from ray pick */
|
|
89
|
-
objectsToExclude?: any[];
|
|
90
|
-
/** size of the point entity for error tolerance */
|
|
91
|
-
errorBoundary?: number;
|
|
92
|
-
/** Whether to show sunlight paths */
|
|
93
|
-
debugShowRays?: boolean;
|
|
94
|
-
/** Whether to show points */
|
|
95
|
-
debugShowPoints?: boolean;
|
|
96
|
-
}
|
|
97
|
-
interface AnalysisResult {
|
|
98
|
-
/** ISO time string */
|
|
99
|
-
timestamp: string;
|
|
100
|
-
/** Whether the sunlight has reached */
|
|
101
|
-
result: boolean | any;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export { Sunlight };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Viewer, Cartesian3, JulianDate, Color, Entity } from 'cesium';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @since Cesium 1.132.0
|
|
5
|
-
* @experimental
|
|
6
|
-
* Point sunlight analysis utility for shadow calculations.
|
|
7
|
-
*
|
|
8
|
-
* ⚠️ **Warning**: This is an experimental feature that uses Cesium's internal APIs.
|
|
9
|
-
* The API may change or break in future versions of Cesium or cesium-utils.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const sunlight = new Sunlight(viewer);
|
|
14
|
-
* sunlight.analyze(point, JulianDate.now());
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
declare class Sunlight {
|
|
18
|
-
private _uniformState;
|
|
19
|
-
private _viewer;
|
|
20
|
-
private _analyzing;
|
|
21
|
-
private _pointEntityId?;
|
|
22
|
-
private _objectsToExclude;
|
|
23
|
-
private _polylines;
|
|
24
|
-
private _points;
|
|
25
|
-
constructor(viewer: Viewer);
|
|
26
|
-
/** The sun position in 3D world coordinates at the current scene time. */
|
|
27
|
-
get sunPositionWC(): Cartesian3;
|
|
28
|
-
/** A normalized vector to the sun in 3D world coordinates at the current scene time. */
|
|
29
|
-
get sunDirectionWC(): Cartesian3;
|
|
30
|
-
/** Whether sunlight analysis is currently in progress. */
|
|
31
|
-
get isAnalyzing(): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Gets virtual position and direction of the sun to reduce calculation overhead.
|
|
34
|
-
*
|
|
35
|
-
* @param from target point to start from
|
|
36
|
-
* @param radius virtual distance between target point and the sun. Defaults to 10000 (10km)
|
|
37
|
-
*/
|
|
38
|
-
virtualSun(from: Cartesian3, radius?: number): {
|
|
39
|
-
position: Cartesian3;
|
|
40
|
-
direction: Cartesian3;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Analyze the sunlight acceptance from a given point at a given time.
|
|
44
|
-
* @param from target point to analyze
|
|
45
|
-
* @param at time to analyze
|
|
46
|
-
* @param options {@link Sunlight.AnalyzeOptions}
|
|
47
|
-
*/
|
|
48
|
-
analyze(from: Cartesian3, at: JulianDate, options?: Sunlight.AnalyzeOptions): Promise<Sunlight.AnalysisResult>;
|
|
49
|
-
/**
|
|
50
|
-
* Analyze the sunlight acceptance from a given point at a given time range.
|
|
51
|
-
* @param from target point to analyze
|
|
52
|
-
* @param range time range to analyze
|
|
53
|
-
* @param options {@link Sunlight.AnalyzeOptions}
|
|
54
|
-
*/
|
|
55
|
-
analyze(from: Cartesian3, range: Sunlight.TimeRange, options?: Sunlight.AnalyzeOptions): Promise<Sunlight.AnalysisResult[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Remove all instances created for debug purpose
|
|
58
|
-
*/
|
|
59
|
-
clear(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Create an ellipsoid entity for ray collision detection to complement cesium's native click event accuracy
|
|
62
|
-
* @param at where to create the entity
|
|
63
|
-
* @param show whether to show point entity
|
|
64
|
-
* @param errorBoundary size of the point entity for error tolerance
|
|
65
|
-
*/
|
|
66
|
-
setTargetPoint(at: Cartesian3, show?: boolean, errorBoundary?: number, color?: Color): Entity;
|
|
67
|
-
private _analyzeSingleTime;
|
|
68
|
-
private _analyzeTimeRange;
|
|
69
|
-
/**
|
|
70
|
-
* @returns A promise tht resolves to an object containing the object and position of the first intersection.
|
|
71
|
-
* @see https://github.com/CesiumGS/cesium/blob/1.136/packages/engine/Source/Scene/Scene.js#L4868
|
|
72
|
-
*/
|
|
73
|
-
private _pick;
|
|
74
|
-
private _getExcludedObjects;
|
|
75
|
-
}
|
|
76
|
-
declare namespace Sunlight {
|
|
77
|
-
const DETECTION_ELLIPSOID_ID = "sunlight-detection-ellipsoid";
|
|
78
|
-
/** for time-range analysis */
|
|
79
|
-
interface TimeRange {
|
|
80
|
-
/** When to start analysis */
|
|
81
|
-
start: JulianDate;
|
|
82
|
-
/** When to end analysis */
|
|
83
|
-
end: JulianDate;
|
|
84
|
-
/** Step interval (seconds) inside the range */
|
|
85
|
-
step: number;
|
|
86
|
-
}
|
|
87
|
-
interface AnalyzeOptions {
|
|
88
|
-
/** List of objects to exclude from ray pick */
|
|
89
|
-
objectsToExclude?: any[];
|
|
90
|
-
/** size of the point entity for error tolerance */
|
|
91
|
-
errorBoundary?: number;
|
|
92
|
-
/** Whether to show sunlight paths */
|
|
93
|
-
debugShowRays?: boolean;
|
|
94
|
-
/** Whether to show points */
|
|
95
|
-
debugShowPoints?: boolean;
|
|
96
|
-
}
|
|
97
|
-
interface AnalysisResult {
|
|
98
|
-
/** ISO time string */
|
|
99
|
-
timestamp: string;
|
|
100
|
-
/** Whether the sunlight has reached */
|
|
101
|
-
result: boolean | any;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export { Sunlight };
|