@soonspacejs/plugin-heat-cloud 2.16.8 → 3.0.0-alpha.0
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/index.d.ts +2499 -24
- package/dist/index.esm.js +79 -78
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,2499 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { BufferGeometry } from 'three';
|
|
2
|
+
import { Color } from 'three';
|
|
3
|
+
import { Data3DTexture } from 'three';
|
|
4
|
+
import type { DataArrayTexture } from 'three';
|
|
5
|
+
import { default as default_2 } from 'soonspacejs';
|
|
6
|
+
import { IUniform } from 'three';
|
|
7
|
+
import type { Matrix3 } from 'three';
|
|
8
|
+
import { Matrix4 } from 'three';
|
|
9
|
+
import { Mesh } from 'three';
|
|
10
|
+
import { NormalBufferAttributes } from 'three';
|
|
11
|
+
import { Points } from 'three';
|
|
12
|
+
import { PointsMaterialParameters } from 'three';
|
|
13
|
+
import { RawShaderMaterial } from 'three';
|
|
14
|
+
import { ShaderLib } from 'three';
|
|
15
|
+
import { ShaderMaterial } from 'three';
|
|
16
|
+
import { ShaderMaterialParameters } from 'three';
|
|
17
|
+
import type { Side } from 'three';
|
|
18
|
+
import { Texture } from 'three';
|
|
19
|
+
import { TextureDataType } from 'three';
|
|
20
|
+
import { Vector2 } from 'three';
|
|
21
|
+
import { Vector3 } from 'three';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 轴
|
|
25
|
+
*/
|
|
26
|
+
declare enum Axis {
|
|
27
|
+
x = 0,
|
|
28
|
+
y = 1,
|
|
29
|
+
z = 2
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 轴的方法
|
|
34
|
+
*/
|
|
35
|
+
declare namespace Axis {
|
|
36
|
+
/**
|
|
37
|
+
* 将轴索引转为轴名字
|
|
38
|
+
* @param index - 索引
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
function toKey(index: Axis): AxisName;
|
|
42
|
+
/**
|
|
43
|
+
* 将轴名字转为轴索引
|
|
44
|
+
* @param name
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
function toIndex(name: AxisName): Axis;
|
|
48
|
+
/**
|
|
49
|
+
* 获取剩余的另外两个轴
|
|
50
|
+
* @remarks
|
|
51
|
+
* 获取除 axis 之外的另外两个轴,且这两轴的顺序符合叉乘得 axis 轴的顺序
|
|
52
|
+
* @param axis
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
function getCrossAxiss(axis: Axis): [
|
|
56
|
+
Axis,
|
|
57
|
+
Axis
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 轴名
|
|
63
|
+
*/
|
|
64
|
+
declare type AxisName = "x" | "y" | "z";
|
|
65
|
+
|
|
66
|
+
export declare type ColorFogPoint = ColorFogPointFeature & IVector3;
|
|
67
|
+
|
|
68
|
+
declare interface ColorFogPointFeature extends Omit<VolumeFeature, "value"> {
|
|
69
|
+
/**
|
|
70
|
+
* 颜色 RGBA
|
|
71
|
+
* @remarks
|
|
72
|
+
* 其中 RGB 取值是 0 - 255,A 的取值是 0 - 1
|
|
73
|
+
*/
|
|
74
|
+
color?: [number, number, number, number];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare class ColorFogPointsMaterial extends FogPointsMaterial<ColorFogPointsMaterialUniforms> {
|
|
78
|
+
readonly isColorFogPointsMaterial = true;
|
|
79
|
+
constructor(options?: ColorFogPointsMaterialOptions);
|
|
80
|
+
/**
|
|
81
|
+
* 雾点的颜色
|
|
82
|
+
* @remarks
|
|
83
|
+
* 当开启顶点颜色 {@link SphereFogMaterial.vertexColors} 时,此设置将无论;
|
|
84
|
+
*/
|
|
85
|
+
get color(): Color;
|
|
86
|
+
set color(value: Color);
|
|
87
|
+
get alphaMap(): Texture | null;
|
|
88
|
+
set alphaMap(value: Texture | null);
|
|
89
|
+
get uvTransform(): Matrix3;
|
|
90
|
+
set uvTransform(value: Matrix3);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 雾点材质的选项
|
|
95
|
+
*/
|
|
96
|
+
export declare interface ColorFogPointsMaterialOptions extends PointsMaterialParameters, FogPointsMaterialOptions {
|
|
97
|
+
uvTransform?: Matrix3;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 雾点材质的 uniforms
|
|
102
|
+
*/
|
|
103
|
+
export declare type ColorFogPointsMaterialUniforms = PointsUniforms & FogPointsMaterialUniforms;
|
|
104
|
+
|
|
105
|
+
export declare interface ColorFogPointsOptions extends ColorFogPointFeature {
|
|
106
|
+
points: ColorFogPoint[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 颜色梯度,颜色断点列表
|
|
111
|
+
* @remarks
|
|
112
|
+
* 颜色断点可以不按顺序排列
|
|
113
|
+
*/
|
|
114
|
+
export declare type ColorGradient = ColorStop[];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 颜色断点
|
|
118
|
+
* @remarks
|
|
119
|
+
* number 的范围是 0-1,表示断点的位置;
|
|
120
|
+
*
|
|
121
|
+
* string 表示颜色,支持 css 所支持的所有颜色格式;
|
|
122
|
+
*/
|
|
123
|
+
export declare type ColorStop = [number, string];
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* 根据热力点来计算并生成相关的3D数据
|
|
127
|
+
* @param pointInfo - 点信息
|
|
128
|
+
* @param extraInfo - 额外的信息
|
|
129
|
+
* @param intersects - 相交的点列表
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
export declare function computeHeatData3DForPoint(pointInfo: HeatParticleVolumeFeaturePointInfo, extraInfo: Data3DPointExtraInfo, intersects: HeatParticleVolumeFeaturePointInfo[]): {
|
|
133
|
+
particles: Vector3[];
|
|
134
|
+
values: number[];
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 创建颜色雾点
|
|
139
|
+
* @param options
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
export declare function createColorFogPoints(options: CreateColorFogPointsOptions): Points<BufferGeometry<NormalBufferAttributes>, ColorFogPointsMaterial>;
|
|
143
|
+
|
|
144
|
+
export declare type CreateColorFogPointsOptions = ColorFogPointsOptions & ColorFogPointsMaterialOptions;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 创建梯度 Data3DTexture
|
|
148
|
+
* @param data3D - 3D数据
|
|
149
|
+
* @param options - 选项
|
|
150
|
+
* @returns
|
|
151
|
+
*/
|
|
152
|
+
export declare function createGradientData3DTexture(data3D: IData3D, options?: CreateGradientData3DTextureOptions): GradientData3DTexture;
|
|
153
|
+
|
|
154
|
+
export declare interface CreateGradientData3DTextureOptions {
|
|
155
|
+
/**
|
|
156
|
+
* 表示为空的值
|
|
157
|
+
* @remarks
|
|
158
|
+
* 在转换时 IData3D 时,当遇到值为 undefined 或 null 的值时,就会使 voidValue 来替换;
|
|
159
|
+
*
|
|
160
|
+
* IData3D 中,可以通过 undefined 或 null 来表示空,但在将 IData3D 转为 Data3DTexture 时,所有的item都必须是数字,所以这时就需要为空约定一个数字;
|
|
161
|
+
*
|
|
162
|
+
* @defaultValue 0
|
|
163
|
+
*/
|
|
164
|
+
voidValue?: number;
|
|
165
|
+
/**
|
|
166
|
+
* 3D数据中包含的数值是否是 uint8 类型的
|
|
167
|
+
* @defaultValue false
|
|
168
|
+
*/
|
|
169
|
+
uint8?: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 创建梯度雾点
|
|
174
|
+
* @param options
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
export declare function createGradientFogPoints(options: CreateGradientFogPointsOptions): Points<BufferGeometry<NormalBufferAttributes>, GradientFogPointsMaterial>;
|
|
178
|
+
|
|
179
|
+
export declare type CreateGradientFogPointsOptions = GradientFogPointsOptions & GradientFogPointsMaterialOptions;
|
|
180
|
+
|
|
181
|
+
export declare type CreateHeatCloudOptions = HeatDataOptions & GradientOptions;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 创建热力3D数据
|
|
185
|
+
* @param options
|
|
186
|
+
* @returns
|
|
187
|
+
*/
|
|
188
|
+
export declare function createHeatData3D(options: HeatData3DOptions): {
|
|
189
|
+
data: number[];
|
|
190
|
+
size: Vector3;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export declare type CreateHeatOptions = CreatLineHeatOptions & CreateHeatCloudOptions;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 通过挤出Image来创建 ImageData3DTexture
|
|
197
|
+
* @remarks
|
|
198
|
+
* 没 z 轴挤出
|
|
199
|
+
* @param image - 图像
|
|
200
|
+
* @param depth - 挤出的深度
|
|
201
|
+
* @param options - 选项
|
|
202
|
+
* @returns
|
|
203
|
+
*/
|
|
204
|
+
export declare function createImageData3DTextureByExtrudeImage(image: CanvasImageSource, depth: number, options?: ExtrudeImageOptions | null): ImageData3DTexture;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 从梯度数据 创建梯度图像 ImageData3DTexture
|
|
208
|
+
* @param gradientData3D - 梯度数据
|
|
209
|
+
* @param options - 选项
|
|
210
|
+
* @returns
|
|
211
|
+
*/
|
|
212
|
+
export declare function createImageData3DTextureFromGradient(gradientData3D: IData3D | IImageData3, options: CreateImageData3DTextureFromGradientOptions): ImageData3DTexture;
|
|
213
|
+
|
|
214
|
+
export declare type CreateImageData3DTextureFromGradientOptions = GradientData3DToImageData3DOptions & {
|
|
215
|
+
gradient: TexImageSource | ColorGradient;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export declare type CreateImageExtrusionOptions = VolumeMaterialOptions<ImageData3DTexture> & ExtrudeImageOptions;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* 创建线性渐变 ImageData
|
|
222
|
+
* @param colorGradient
|
|
223
|
+
* @param width - 宽度
|
|
224
|
+
* @param height - 高度
|
|
225
|
+
* @returns
|
|
226
|
+
*/
|
|
227
|
+
export declare function createLinearGradientImageData(colorGradient: ColorGradient, width: number, height: number, colorSpace?: PredefinedColorSpace): ImageData;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 创建线性Data3D数据
|
|
231
|
+
* @param options
|
|
232
|
+
* @returns
|
|
233
|
+
*/
|
|
234
|
+
export declare function createLineData3D(options: LineData3DOptions): {
|
|
235
|
+
particles: Vector3[];
|
|
236
|
+
values: number[];
|
|
237
|
+
size: Vector3;
|
|
238
|
+
data: number[];
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export declare type CreatLineHeatOptions = LineDataOptions & GradientOptions;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* 将 Data2D 的坐标转成 索引
|
|
245
|
+
* @param coord - 坐标
|
|
246
|
+
* @param size - Data2D 的尺寸
|
|
247
|
+
* @returns 索引
|
|
248
|
+
*/
|
|
249
|
+
export declare function data2DCoordToIndex(coord: IVector2, size: IVector2): number;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 将 Data2D 的坐标转成 索引
|
|
253
|
+
* @param coord - 坐标
|
|
254
|
+
* @param size - Data2D 的尺寸
|
|
255
|
+
* @returns 索引
|
|
256
|
+
*/
|
|
257
|
+
export declare function data2DIndexToCoord(index: number, size: IVector2): {
|
|
258
|
+
x: number;
|
|
259
|
+
y: number;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* 将 Data3D 的坐标转成 索引
|
|
264
|
+
* @param coord - 坐标
|
|
265
|
+
* @param size - Data3D 的尺寸
|
|
266
|
+
* @returns 索引
|
|
267
|
+
*/
|
|
268
|
+
export declare function data3DCoordToIndex(coord: IVector3, size: IVector3): number;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* 将 Data3D 的坐标转成 索引
|
|
272
|
+
* @param coord - 坐标
|
|
273
|
+
* @param size - Data3D 的尺寸
|
|
274
|
+
* @returns 索引
|
|
275
|
+
*/
|
|
276
|
+
export declare function data3DIndexToCoord(index: number, size: IVector3): {
|
|
277
|
+
x: number;
|
|
278
|
+
y: number;
|
|
279
|
+
z: number;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* 计算 Data3D 点所需要的额外信息
|
|
284
|
+
*/
|
|
285
|
+
export declare type Data3DPointExtraInfo = {
|
|
286
|
+
/**
|
|
287
|
+
* 存放 Data3D 的数组
|
|
288
|
+
* @remarks
|
|
289
|
+
* 长度应该是 `size.x * size.y * size.z`
|
|
290
|
+
*/
|
|
291
|
+
data3D: number[];
|
|
292
|
+
/**
|
|
293
|
+
* Data3D的尺寸
|
|
294
|
+
*/
|
|
295
|
+
size: IVector3;
|
|
296
|
+
/**
|
|
297
|
+
* 计算标记数组
|
|
298
|
+
* @remarks
|
|
299
|
+
* 与 data3D 一样长,用于记录哪些像素已经被计算过了
|
|
300
|
+
*/
|
|
301
|
+
tags: (undefined | true)[];
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export declare interface DataAccumulateValue<D> {
|
|
305
|
+
value: D;
|
|
306
|
+
data3D: IData3D<D>;
|
|
307
|
+
index: number;
|
|
308
|
+
coord: IVector3;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* 值累积函数
|
|
313
|
+
*/
|
|
314
|
+
export declare type DataValuesAccumulate<D> = (values: DataAccumulateValue<D>[]) => D;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* 体积材质
|
|
318
|
+
*/
|
|
319
|
+
export declare class ExampleVolumeMaterial_1 extends ShaderMaterial {
|
|
320
|
+
readonly isExampleVolumeMaterial_1 = true;
|
|
321
|
+
constructor(options?: ExampleVolumeMaterial_1Options);
|
|
322
|
+
uniforms: ExampleVolumeMaterial_1Uniforms;
|
|
323
|
+
/**
|
|
324
|
+
* 三维纹理
|
|
325
|
+
*/
|
|
326
|
+
get map(): Data3DTexture | null;
|
|
327
|
+
set map(value: Data3DTexture | null);
|
|
328
|
+
/**
|
|
329
|
+
* 颜色映射纹理
|
|
330
|
+
* @remarks
|
|
331
|
+
* 会将垂直居中的那条水平像素从左到右映射到 clim 表示的限制区间,
|
|
332
|
+
* 即 clim.x 对应最左边的像素,clim.y 对应最右边的像素
|
|
333
|
+
*/
|
|
334
|
+
get gradientMap(): Texture | null;
|
|
335
|
+
protected _gradient?: null | GradientTextureOptions;
|
|
336
|
+
/**
|
|
337
|
+
* 颜色映射选项
|
|
338
|
+
*/
|
|
339
|
+
get gradient(): GradientTextureOptions | null | undefined;
|
|
340
|
+
set gradient(value: GradientTextureOptions | null | undefined);
|
|
341
|
+
/**
|
|
342
|
+
* 三维纹理的尺寸
|
|
343
|
+
* @remarks
|
|
344
|
+
* 三维纹理的尺寸 要 和 Geometry 的尺寸是一样的,不但比列一样,大小也是一样的
|
|
345
|
+
* 但 mesh 本身可以进行几何变换;
|
|
346
|
+
* Geometry 左下角的坐标要从 (0,0,0) 开始;
|
|
347
|
+
*/
|
|
348
|
+
get size(): Vector3;
|
|
349
|
+
set size(value: Vector3);
|
|
350
|
+
/**
|
|
351
|
+
* 渲染样式
|
|
352
|
+
*/
|
|
353
|
+
get style(): VolumeRenderStyle;
|
|
354
|
+
set style(value: VolumeRenderStyle);
|
|
355
|
+
/**
|
|
356
|
+
* 映射区间
|
|
357
|
+
* @remarks
|
|
358
|
+
* x 为最小值,y 为最大值
|
|
359
|
+
*/
|
|
360
|
+
get clim(): Vector2;
|
|
361
|
+
set clim(value: Vector2);
|
|
362
|
+
/**
|
|
363
|
+
* 渲染最低阈值
|
|
364
|
+
* @remarks
|
|
365
|
+
* 只对 ISO 样式有效;
|
|
366
|
+
*
|
|
367
|
+
* 当三维纹理中的值低于该值时,不会被渲染,即视为空
|
|
368
|
+
*/
|
|
369
|
+
get threshold(): number;
|
|
370
|
+
set threshold(value: number);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* 体积材质选项
|
|
375
|
+
*/
|
|
376
|
+
export declare interface ExampleVolumeMaterial_1Options {
|
|
377
|
+
/**
|
|
378
|
+
* 渲染样式
|
|
379
|
+
*/
|
|
380
|
+
style?: VolumeRenderStyle | null;
|
|
381
|
+
/**
|
|
382
|
+
* 渲染最低阈值
|
|
383
|
+
* @remarks
|
|
384
|
+
* 只对 ISO 样式有效;
|
|
385
|
+
*
|
|
386
|
+
* 当三维纹理中的值低于该值时,不会被渲染,即视为空
|
|
387
|
+
*/
|
|
388
|
+
threshold?: number | null;
|
|
389
|
+
/**
|
|
390
|
+
* 映射区间
|
|
391
|
+
* @remarks
|
|
392
|
+
* x 为最小值,y 为最大值
|
|
393
|
+
*/
|
|
394
|
+
clim?: Vector2 | null;
|
|
395
|
+
/**
|
|
396
|
+
* 三维纹理
|
|
397
|
+
*/
|
|
398
|
+
map?: Data3DTexture | null;
|
|
399
|
+
/**
|
|
400
|
+
* 颜色映射纹理
|
|
401
|
+
*/
|
|
402
|
+
gradient?: GradientTextureOptions | null;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export declare interface ExampleVolumeMaterial_1Uniforms {
|
|
406
|
+
u_size: IUniform<Vector3>;
|
|
407
|
+
u_renderstyle: IUniform<VolumeRenderStyle>;
|
|
408
|
+
u_renderthreshold: IUniform<number>;
|
|
409
|
+
u_clim: IUniform<Vector2>;
|
|
410
|
+
u_data: IUniform<null | Data3DTexture>;
|
|
411
|
+
u_cmdata: IUniform<null | Texture>;
|
|
412
|
+
|
|
413
|
+
[uniform: string]: IUniform<unknown>;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* 示例体积材质-云
|
|
418
|
+
*/
|
|
419
|
+
export declare class ExampleVolumeMaterial_Cloud extends RawShaderMaterial {
|
|
420
|
+
readonly isExampleVolumeMaterial_Cloud = true;
|
|
421
|
+
constructor(options?: ExampleVolumeMaterial_CloudOptions);
|
|
422
|
+
uniforms: ExampleVolumeMaterial_CloudUniforms;
|
|
423
|
+
/**
|
|
424
|
+
* 三维纹理
|
|
425
|
+
*/
|
|
426
|
+
get map(): GradientData3DTexture | null;
|
|
427
|
+
set map(value: GradientData3DTexture | null);
|
|
428
|
+
/**
|
|
429
|
+
* 颜色
|
|
430
|
+
*/
|
|
431
|
+
get color(): Color;
|
|
432
|
+
set color(value: Color);
|
|
433
|
+
/**
|
|
434
|
+
* 透明度
|
|
435
|
+
*/
|
|
436
|
+
get opacity(): number;
|
|
437
|
+
set opacity(value: number);
|
|
438
|
+
/**
|
|
439
|
+
* 渲染最低阈值
|
|
440
|
+
*/
|
|
441
|
+
get threshold(): number;
|
|
442
|
+
set threshold(value: number);
|
|
443
|
+
/**
|
|
444
|
+
* 范围
|
|
445
|
+
*/
|
|
446
|
+
get range(): number;
|
|
447
|
+
set range(value: number);
|
|
448
|
+
/**
|
|
449
|
+
* 体积材质渲染的采样数
|
|
450
|
+
*/
|
|
451
|
+
get steps(): number;
|
|
452
|
+
set steps(value: number);
|
|
453
|
+
/**
|
|
454
|
+
* 渲染帧次
|
|
455
|
+
*/
|
|
456
|
+
get frame(): number;
|
|
457
|
+
set frame(value: number);
|
|
458
|
+
/**
|
|
459
|
+
* 相机的位置
|
|
460
|
+
*/
|
|
461
|
+
get cameraPos(): Vector3;
|
|
462
|
+
set cameraPos(value: Vector3);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* 示例体积材质-云 的选项
|
|
467
|
+
*/
|
|
468
|
+
export declare interface ExampleVolumeMaterial_CloudOptions {
|
|
469
|
+
/**
|
|
470
|
+
* 颜色
|
|
471
|
+
*/
|
|
472
|
+
color?: Color | null;
|
|
473
|
+
/**
|
|
474
|
+
* 三维纹理
|
|
475
|
+
*/
|
|
476
|
+
map?: GradientData3DTexture | null;
|
|
477
|
+
/**
|
|
478
|
+
* 渲染最低阈值
|
|
479
|
+
*/
|
|
480
|
+
threshold?: number | null;
|
|
481
|
+
/**
|
|
482
|
+
* 透明度
|
|
483
|
+
*/
|
|
484
|
+
opacity?: number | null;
|
|
485
|
+
/**
|
|
486
|
+
* 范围
|
|
487
|
+
*/
|
|
488
|
+
range?: number | null;
|
|
489
|
+
/**
|
|
490
|
+
* 体积材质渲染的采样数
|
|
491
|
+
*/
|
|
492
|
+
steps?: number | null;
|
|
493
|
+
/**
|
|
494
|
+
* 渲染帧次
|
|
495
|
+
*/
|
|
496
|
+
frame?: number | null;
|
|
497
|
+
/**
|
|
498
|
+
* 相机的位置
|
|
499
|
+
*/
|
|
500
|
+
cameraPos?: Vector3 | null;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* 示例体积材质-云 的 uniforms
|
|
505
|
+
*/
|
|
506
|
+
export declare interface ExampleVolumeMaterial_CloudUniforms {
|
|
507
|
+
base: IUniform<Color>;
|
|
508
|
+
map: IUniform<null | GradientData3DTexture>;
|
|
509
|
+
threshold: IUniform<number>;
|
|
510
|
+
opacity: IUniform<number>;
|
|
511
|
+
range: IUniform<number>;
|
|
512
|
+
steps: IUniform<number>;
|
|
513
|
+
frame: IUniform<number>;
|
|
514
|
+
cameraPos: IUniform<Vector3>;
|
|
515
|
+
|
|
516
|
+
[uniform: string]: IUniform<unknown>;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* 示例体积材质-花边
|
|
521
|
+
*/
|
|
522
|
+
export declare class ExampleVolumeMaterial_Perlin extends RawShaderMaterial {
|
|
523
|
+
readonly isExampleVolumeMaterial_Perlin = true;
|
|
524
|
+
constructor(options?: ExampleVolumeMaterial_PerlinOptions);
|
|
525
|
+
uniforms: ExampleVolumeMaterial_PerlinUniforms;
|
|
526
|
+
/**
|
|
527
|
+
* 三维纹理
|
|
528
|
+
*/
|
|
529
|
+
get map(): GradientData3DTexture | null;
|
|
530
|
+
set map(value: GradientData3DTexture | null);
|
|
531
|
+
/**
|
|
532
|
+
* 渲染最低阈值
|
|
533
|
+
*/
|
|
534
|
+
get threshold(): number;
|
|
535
|
+
set threshold(value: number);
|
|
536
|
+
/**
|
|
537
|
+
* 体积材质渲染的采样数
|
|
538
|
+
*/
|
|
539
|
+
get steps(): number;
|
|
540
|
+
set steps(value: number);
|
|
541
|
+
/**
|
|
542
|
+
* 相机的位置
|
|
543
|
+
*/
|
|
544
|
+
get cameraPos(): Vector3;
|
|
545
|
+
set cameraPos(value: Vector3);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* 体积切片材质选项
|
|
550
|
+
*/
|
|
551
|
+
export declare interface ExampleVolumeMaterial_PerlinOptions {
|
|
552
|
+
/**
|
|
553
|
+
* 三维纹理
|
|
554
|
+
*/
|
|
555
|
+
map?: GradientData3DTexture | null;
|
|
556
|
+
/**
|
|
557
|
+
* 渲染最低阈值
|
|
558
|
+
*/
|
|
559
|
+
threshold?: number | null;
|
|
560
|
+
/**
|
|
561
|
+
* 体积材质渲染的采样数
|
|
562
|
+
*/
|
|
563
|
+
steps?: number | null;
|
|
564
|
+
/**
|
|
565
|
+
* 相机的位置
|
|
566
|
+
*/
|
|
567
|
+
cameraPos?: Vector3 | null;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* 示例体积材质-花边 的 uniforms
|
|
572
|
+
*/
|
|
573
|
+
export declare interface ExampleVolumeMaterial_PerlinUniforms {
|
|
574
|
+
map: IUniform<null | GradientData3DTexture>;
|
|
575
|
+
threshold: IUniform<number>;
|
|
576
|
+
steps: IUniform<number>;
|
|
577
|
+
cameraPos: IUniform<Vector3>;
|
|
578
|
+
|
|
579
|
+
[uniform: string]: IUniform<unknown>;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* 挤出图像
|
|
584
|
+
* @param image
|
|
585
|
+
* @param depth
|
|
586
|
+
* @param colorSpace
|
|
587
|
+
* @returns
|
|
588
|
+
*/
|
|
589
|
+
export declare function extrudeImage(image: CanvasImageSource, depth: number, options?: ExtrudeImageOptions | null): {
|
|
590
|
+
data: Uint8ClampedArray;
|
|
591
|
+
width: number;
|
|
592
|
+
height: number;
|
|
593
|
+
depth: number;
|
|
594
|
+
colorSpace: PredefinedColorSpace;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* 挤压ImageData
|
|
599
|
+
* @param imageData
|
|
600
|
+
* @param depth
|
|
601
|
+
* @param colorSpace
|
|
602
|
+
* @returns
|
|
603
|
+
*/
|
|
604
|
+
export declare function extrudeImageData(imageData: ImageData, depth: number, reverseY?: boolean | null): {
|
|
605
|
+
data: Uint8ClampedArray;
|
|
606
|
+
width: number;
|
|
607
|
+
height: number;
|
|
608
|
+
depth: number;
|
|
609
|
+
colorSpace: PredefinedColorSpace;
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* 在指定轴上挤压ImageData
|
|
614
|
+
* @param imageData
|
|
615
|
+
* @param axisName
|
|
616
|
+
* @param depth
|
|
617
|
+
* @param reverseY
|
|
618
|
+
* @returns
|
|
619
|
+
*/
|
|
620
|
+
export declare function extrudeImageDataOnAxis(imageData: ImageData, axis: Axis, depth: number, reverseY?: boolean | null): {
|
|
621
|
+
data: Uint8ClampedArray;
|
|
622
|
+
width: number;
|
|
623
|
+
height: number;
|
|
624
|
+
depth: number;
|
|
625
|
+
colorSpace: PredefinedColorSpace;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* extrudeImage 的选项
|
|
630
|
+
*/
|
|
631
|
+
export declare interface ExtrudeImageOptions {
|
|
632
|
+
reverseY?: boolean | null;
|
|
633
|
+
axis?: Axis | null;
|
|
634
|
+
colorSpace?: PredefinedColorSpace | null;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export declare class FogPointsMaterial<FogPointsUniforms extends FogPointsMaterialUniforms> extends ShaderMaterial {
|
|
638
|
+
readonly isFogPointsMaterial = true;
|
|
639
|
+
constructor(options?: FogPointsMaterialOptions, shaderMaterialParameters?: ShaderMaterialParameters | null);
|
|
640
|
+
uniforms: FogPointsUniforms;
|
|
641
|
+
/**
|
|
642
|
+
* 使用来自Texture的数据设置点的颜色
|
|
643
|
+
* @remarks
|
|
644
|
+
* 可以选择包括一个alpha通道,通常与 .transparent或.alphaTest。
|
|
645
|
+
*/
|
|
646
|
+
get map(): Texture | null;
|
|
647
|
+
set map(value: Texture | null);
|
|
648
|
+
/**
|
|
649
|
+
* 是否渲染成星星的样式
|
|
650
|
+
* @remarks
|
|
651
|
+
* 否则,将被渲染成球形
|
|
652
|
+
*/
|
|
653
|
+
get star(): boolean;
|
|
654
|
+
set star(value: boolean);
|
|
655
|
+
/**
|
|
656
|
+
* 点的大小
|
|
657
|
+
* @defaultValue 1.0
|
|
658
|
+
*/
|
|
659
|
+
get size(): number;
|
|
660
|
+
set size(value: number);
|
|
661
|
+
/**
|
|
662
|
+
* 透明度
|
|
663
|
+
* @remarks
|
|
664
|
+
* 决定整体的透明度
|
|
665
|
+
* @defaultValue 1
|
|
666
|
+
*/
|
|
667
|
+
get opacity(): number;
|
|
668
|
+
set opacity(value: number);
|
|
669
|
+
/**
|
|
670
|
+
* 实心因子
|
|
671
|
+
* @remarks
|
|
672
|
+
* 在实心范围内,雾点不会衰减
|
|
673
|
+
* @defaultValue 0
|
|
674
|
+
*/
|
|
675
|
+
get solid(): number;
|
|
676
|
+
set solid(value: number);
|
|
677
|
+
/**
|
|
678
|
+
* 雾的衰减指数
|
|
679
|
+
* @defaultValue 1
|
|
680
|
+
*/
|
|
681
|
+
get exp(): number;
|
|
682
|
+
set exp(value: number);
|
|
683
|
+
get scale(): number;
|
|
684
|
+
set scale(value: number);
|
|
685
|
+
get fogDensity(): number;
|
|
686
|
+
set fogDensity(value: number);
|
|
687
|
+
get fogNear(): number;
|
|
688
|
+
set fogNear(value: number);
|
|
689
|
+
get fogFar(): number;
|
|
690
|
+
set fogFar(value: number);
|
|
691
|
+
get fogColor(): Color;
|
|
692
|
+
set fogColor(value: Color);
|
|
693
|
+
/**
|
|
694
|
+
* 点的大小是否因相机深度而衰减
|
|
695
|
+
* @remarks
|
|
696
|
+
* 仅限透视摄像头
|
|
697
|
+
*
|
|
698
|
+
* @defaultValue true
|
|
699
|
+
*/
|
|
700
|
+
sizeAttenuation: boolean;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* 雾点材质的选项
|
|
705
|
+
*/
|
|
706
|
+
export declare interface FogPointsMaterialOptions extends Omit<PointsMaterialParameters, "color" | "uvTransform" | "alphaMap"> {
|
|
707
|
+
/**
|
|
708
|
+
* 是否渲染成星星的样式
|
|
709
|
+
* @remarks
|
|
710
|
+
* 否则,将被渲染成球形
|
|
711
|
+
*/
|
|
712
|
+
star?: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* 实心因子
|
|
715
|
+
* @remarks
|
|
716
|
+
* 在实心范围内,雾点不会衰减
|
|
717
|
+
* @defaultValue 0
|
|
718
|
+
*/
|
|
719
|
+
solid?: number;
|
|
720
|
+
/**
|
|
721
|
+
* 雾的衰减指数
|
|
722
|
+
* @defaultValue 1
|
|
723
|
+
*/
|
|
724
|
+
exp?: number;
|
|
725
|
+
/**
|
|
726
|
+
* 是否使用 geometry 中的 radius 属性
|
|
727
|
+
* @remarks
|
|
728
|
+
* 如果为 true,geometry 中需要定义 radius 属性;
|
|
729
|
+
*/
|
|
730
|
+
useRadius?: boolean;
|
|
731
|
+
/**
|
|
732
|
+
* 点的大小是否因相机深度而衰减
|
|
733
|
+
* @remarks
|
|
734
|
+
* 仅限透视摄像头
|
|
735
|
+
*
|
|
736
|
+
* @defaultValue true
|
|
737
|
+
*/
|
|
738
|
+
sizeAttenuation?: boolean;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* 雾点材质的 uniforms
|
|
743
|
+
*/
|
|
744
|
+
export declare interface FogPointsMaterialUniforms extends Omit<PointsUniforms, "diffuse" | "uvTransform" | "alphaMap"> {
|
|
745
|
+
solid: IUniform<number>;
|
|
746
|
+
exp: IUniform<number>;
|
|
747
|
+
star: IUniform<boolean>;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* 获取 Data2D 对应坐标处的Item和对应的索引
|
|
752
|
+
* @remarks
|
|
753
|
+
* 不会验证坐标是否超出 data2D 的尺寸范围
|
|
754
|
+
* @param data2D
|
|
755
|
+
* @param coord
|
|
756
|
+
* @returns
|
|
757
|
+
*/
|
|
758
|
+
export declare function getData2DItem<D>(data2D: IData2D<D>, coord: IVector2, itemSize?: number): {
|
|
759
|
+
index: number;
|
|
760
|
+
value: D[];
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* 安全地获取 Data2D 对应坐标处的Item和对应的索引
|
|
765
|
+
* @param data2D
|
|
766
|
+
* @param coord -坐标会被钳在 data2D 的尺寸范围中
|
|
767
|
+
* @returns 当坐标超出 data2D 的尺寸范围时,会返回 null
|
|
768
|
+
*/
|
|
769
|
+
export declare function getData2DItemSafe<D>(data2D: IData2D<D>, coord: IVector2, itemSize?: number): {
|
|
770
|
+
index: number;
|
|
771
|
+
value: D[];
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* 获取指定的行,即:y
|
|
776
|
+
* @param data2D
|
|
777
|
+
* @param row
|
|
778
|
+
* @param itemSize
|
|
779
|
+
* @returns
|
|
780
|
+
*/
|
|
781
|
+
export declare function getData2DRow<D>(data2D: IData2D<D>, row: number, itemSize?: number): any;
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* 获取 D苌3D 对应坐标处的值和对应的索引
|
|
785
|
+
* @remarks
|
|
786
|
+
* 不会验证坐标是否超出 data2D 的尺寸范围
|
|
787
|
+
* @param data2D
|
|
788
|
+
* @param coord
|
|
789
|
+
* @returns
|
|
790
|
+
*/
|
|
791
|
+
export declare function getData2DValue<D>(data2D: IData2D<D>, coord: IVector2): {
|
|
792
|
+
index: number;
|
|
793
|
+
value: D;
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* 安全地获取 IData2D 对应坐标处的值和对应的索引
|
|
798
|
+
* @param data2D
|
|
799
|
+
* @param coord
|
|
800
|
+
* @returns 当坐标超出 data2D 的尺寸范围时,会返回 null
|
|
801
|
+
*/
|
|
802
|
+
export declare function getData2DValueSafe<D>(data2D: IData2D<D>, coord: IVector2): {
|
|
803
|
+
index: number;
|
|
804
|
+
value: D;
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* 获取 Data3D 对应坐标处的Item和对应的索引
|
|
809
|
+
* @remarks
|
|
810
|
+
* 不会验证坐标是否超出 data3D 的尺寸范围
|
|
811
|
+
* @param data3D
|
|
812
|
+
* @param coord
|
|
813
|
+
* @returns
|
|
814
|
+
*/
|
|
815
|
+
export declare function getData3DItem<D>(data3D: IData3D<D>, coord: IVector3, itemSize?: number): {
|
|
816
|
+
index: number;
|
|
817
|
+
value: D[];
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* 安全地获取 Data3D 对应坐标处的Item和对应的索引
|
|
822
|
+
* @param data3D
|
|
823
|
+
* @param coord - 坐标会被钳在 data3D 的尺寸范围中
|
|
824
|
+
* @returns
|
|
825
|
+
*/
|
|
826
|
+
export declare function getData3DItemSafe<D>(data3D: IData3D<D>, coord: IVector3, itemSize?: number): {
|
|
827
|
+
index: number;
|
|
828
|
+
value: D[];
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* 获取 data3D 在某个轴上指定位置的切片
|
|
833
|
+
* @remarks
|
|
834
|
+
* 对于超出范围的深度,会被钳在 [0,轴长-1] 区间
|
|
835
|
+
* @param data3D
|
|
836
|
+
* @param axis
|
|
837
|
+
* @param depth
|
|
838
|
+
* @param itemSize
|
|
839
|
+
* @returns
|
|
840
|
+
*/
|
|
841
|
+
export declare function getData3DSlice<D>(data3D: IData3D<D>, axis: Axis, depth: number, itemSize?: number): IData2D<D>;
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* 获取 D苌3D 对应坐标处的值和对应的索引
|
|
845
|
+
* @remarks
|
|
846
|
+
* 不会验证坐标是否超出 data3D 的尺寸范围
|
|
847
|
+
* @param data3D
|
|
848
|
+
* @param coord
|
|
849
|
+
* @returns
|
|
850
|
+
*/
|
|
851
|
+
export declare function getData3DValue<D>(data3D: IData3D<D>, coord: IVector3): {
|
|
852
|
+
index: number;
|
|
853
|
+
value: D;
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* 安全地获取 D苌3D 对应坐标处的值和对应的索引
|
|
858
|
+
* @param data3D
|
|
859
|
+
* @param coord - 坐标会被钳在 data3D 的尺寸范围中
|
|
860
|
+
* @returns
|
|
861
|
+
*/
|
|
862
|
+
export declare function getData3DValueSafe<D>(data3D: IData3D<D>, coord: IVector3): {
|
|
863
|
+
index: number;
|
|
864
|
+
value: D;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* 值梯度函数
|
|
869
|
+
* @remarks
|
|
870
|
+
* 会通过该函数来获取在中心点及其半径范围内各点处的值
|
|
871
|
+
* @param params - 梯度参数;包含了当前点处的相关信息
|
|
872
|
+
* @returns 返回最终的值
|
|
873
|
+
*/
|
|
874
|
+
export declare type GetGradientValue = (params: GradientParams) => number;
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* 获取 ImageData 的指定位置的像素
|
|
878
|
+
* @param imageData
|
|
879
|
+
* @param row - 行索引
|
|
880
|
+
* @param col - 列索引
|
|
881
|
+
* @returns 返回有4个元素的 Uint8ClampedArray 对象,依次存放 RGBA 的值
|
|
882
|
+
*/
|
|
883
|
+
export declare function getImageDateColor(imageData: ImageData, row: number, col: number): Uint8ClampedArray;
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* 获取图像的 ImageData
|
|
887
|
+
* @remarks
|
|
888
|
+
* 对于 SVGImageElement 类型的 image,需要指定 `area.width` 和 `area.height`
|
|
889
|
+
* @param image
|
|
890
|
+
* @param options
|
|
891
|
+
* @returns
|
|
892
|
+
*/
|
|
893
|
+
export declare function getImageDateOfImage(image: CanvasImageSource, options?: GetImageDateOfImageOptions): ImageData;
|
|
894
|
+
|
|
895
|
+
export declare interface GetImageDateOfImageOptions {
|
|
896
|
+
/**
|
|
897
|
+
* 需要获取图像哪部分区域的数据
|
|
898
|
+
* @defaultValue 图像的完整区域
|
|
899
|
+
*/
|
|
900
|
+
area?: {
|
|
901
|
+
x: number;
|
|
902
|
+
y: number;
|
|
903
|
+
width: number;
|
|
904
|
+
height: number;
|
|
905
|
+
} | null;
|
|
906
|
+
/**
|
|
907
|
+
* ImageDate 的宽度
|
|
908
|
+
* @remarks
|
|
909
|
+
* 如果与 area 的宽度不一样,则会对图像进行缩放处理
|
|
910
|
+
*/
|
|
911
|
+
width?: number | null;
|
|
912
|
+
/**
|
|
913
|
+
* ImageDate 的高度
|
|
914
|
+
* @remarks
|
|
915
|
+
* 如果与 area 的高度不一样,则会对图像进行缩放处理
|
|
916
|
+
*/
|
|
917
|
+
height?: number | null;
|
|
918
|
+
colorSpace?: PredefinedColorSpace | null;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* 获取 ImageData 的指定行
|
|
923
|
+
* @param imageData
|
|
924
|
+
* @param row - 行索引
|
|
925
|
+
* @returns 返回 Uint8ClampedArray 类型的对象
|
|
926
|
+
*/
|
|
927
|
+
export declare function getImageDateRow(imageData: ImageData, row: number): Uint8ClampedArray;
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* 轴线值梯度函数
|
|
931
|
+
* @remarks
|
|
932
|
+
* 会通过该函数来获取从轴线的起始点到终点之间轴线上各点处的值
|
|
933
|
+
* @param params - 梯度参数;包含了当前点处的相关信息
|
|
934
|
+
* @returns 返回最终的值
|
|
935
|
+
*/
|
|
936
|
+
export declare type GetLineGradientValue = (params: LineGradientParams) => number;
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* 获取 ImageSource 资源的固有尺寸
|
|
940
|
+
* @remarks
|
|
941
|
+
* 不是显示的尺寸,而是资源本身的固有尺寸
|
|
942
|
+
* @param image
|
|
943
|
+
* @returns
|
|
944
|
+
*/
|
|
945
|
+
export declare function getNaturalSizeOfImageSource(image: TexImageSource): {
|
|
946
|
+
width: number;
|
|
947
|
+
height: number;
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* 梯度 Data3D 选项
|
|
952
|
+
*/
|
|
953
|
+
export declare interface GradientData3DOptions {
|
|
954
|
+
/**
|
|
955
|
+
* 数值的映射区间
|
|
956
|
+
* @remarks
|
|
957
|
+
* x 为最小值,y 为最大值
|
|
958
|
+
*
|
|
959
|
+
* @defaultValue {x:0,y:100}
|
|
960
|
+
*/
|
|
961
|
+
range?: IVector2 | null;
|
|
962
|
+
/**
|
|
963
|
+
* 是否丢弃超出映射范围的数值
|
|
964
|
+
* @remarks
|
|
965
|
+
* 当数值超出映射区间 {@link GradientData3DOptions.range} 时,是否丢弃;
|
|
966
|
+
*
|
|
967
|
+
* 包含左右边界值
|
|
968
|
+
* @defaultValue true
|
|
969
|
+
*/
|
|
970
|
+
discardOut?: boolean | null;
|
|
971
|
+
/**
|
|
972
|
+
* 空值的范围
|
|
973
|
+
* @remarks
|
|
974
|
+
* 当数值在此范围中时,会被认为是空的值,渲染时会被丢弃
|
|
975
|
+
*
|
|
976
|
+
* 包含左右边界值
|
|
977
|
+
*
|
|
978
|
+
* @defaultValue {x:-100,y:-1}
|
|
979
|
+
*/
|
|
980
|
+
voidRange?: IVector2 | null;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* 3D数据纹理
|
|
985
|
+
* @remarks
|
|
986
|
+
* 专门用于 {@link ./GradientVolumeMaterial#GradientVolumeMaterial} 的纹理对象
|
|
987
|
+
* 提供了一些与 {@link ./GradientVolumeMaterial#GradientVolumeMaterial} 约定的设置 和 一些便利方法
|
|
988
|
+
*/
|
|
989
|
+
export declare class GradientData3DTexture extends Data3DTexture {
|
|
990
|
+
readonly isGradientData3DTexture = true;
|
|
991
|
+
constructor(data: BufferSource, width: number, height: number, depth: number, type?: TextureDataType);
|
|
992
|
+
/**
|
|
993
|
+
* 获取3D数据的切片
|
|
994
|
+
* @remarks
|
|
995
|
+
* 切片就是指定轴的指定位置的垂直截面
|
|
996
|
+
* @param axis - 轴
|
|
997
|
+
* @param depth - 在轴上的坐标值
|
|
998
|
+
* @returns
|
|
999
|
+
*/
|
|
1000
|
+
getData3DSlice(axis: Axis, depth: number): IData2D<number>;
|
|
1001
|
+
/**
|
|
1002
|
+
* 获取3D数据中指定坐标处的数据项目
|
|
1003
|
+
* @remarks
|
|
1004
|
+
* 在 ImageData3DTexture 中,与 {@link ImageData3DTexture.getColor} 返回的值一样;
|
|
1005
|
+
* @param coord
|
|
1006
|
+
* @returns
|
|
1007
|
+
*/
|
|
1008
|
+
getItem(coord: IVector3): number[];
|
|
1009
|
+
/**
|
|
1010
|
+
* 获取3D数据中指定坐标处的值
|
|
1011
|
+
* @param coord - 坐标
|
|
1012
|
+
* @returns
|
|
1013
|
+
*/
|
|
1014
|
+
getValue(coord: IVector3): number;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* 梯度 Data3D 转 ImageData3D
|
|
1019
|
+
* @param data3D
|
|
1020
|
+
* @param gradient
|
|
1021
|
+
* @param options
|
|
1022
|
+
* @returns
|
|
1023
|
+
*/
|
|
1024
|
+
export declare function gradientData3DToImageData3D(data3D: IData3D, gradient: ImageData, options: GradientData3DToImageData3DOptions): {
|
|
1025
|
+
data: number[];
|
|
1026
|
+
size: IVector3;
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* 梯度 Data3D 转 ImageData3D 的选项
|
|
1031
|
+
*/
|
|
1032
|
+
export declare interface GradientData3DToImageData3DOptions extends GradientData3DOptions {
|
|
1033
|
+
voidColor?: [number, number, number, number];
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export declare type GradientFogPoint = VolumeFeature & IVector3;
|
|
1037
|
+
|
|
1038
|
+
export declare interface GradientFogPointsGeometryOptions extends VolumeFeature {
|
|
1039
|
+
points: GradientFogPoint[];
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* 梯度雾点材质
|
|
1044
|
+
* @remarks
|
|
1045
|
+
* 需要 geoometry 有以下属性
|
|
1046
|
+
* - value : 每个顶点都有一个数字类型的值 value
|
|
1047
|
+
* - radius : 仅当 useRadius 为 true 时必须;每个顶点都有一个数字类型的半径
|
|
1048
|
+
*
|
|
1049
|
+
* 材质的 map 属性存储的是梯度图像,用于映射 value 的;
|
|
1050
|
+
*/
|
|
1051
|
+
export declare class GradientFogPointsMaterial extends FogPointsMaterial<GradientFogPointsMaterialUniforms> {
|
|
1052
|
+
readonly isColorFogPointsMaterial = true;
|
|
1053
|
+
constructor(options?: GradientFogPointsMaterialOptions);
|
|
1054
|
+
/**
|
|
1055
|
+
* 数值的映射区间
|
|
1056
|
+
* @remarks
|
|
1057
|
+
* x 为最小值,y 为最大值
|
|
1058
|
+
*
|
|
1059
|
+
* @defaultValue {x:0,y:100}
|
|
1060
|
+
*/
|
|
1061
|
+
get range(): Vector2;
|
|
1062
|
+
set range(value: Vector2);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* 梯度雾点材质的选项
|
|
1067
|
+
*/
|
|
1068
|
+
export declare interface GradientFogPointsMaterialOptions extends PointsMaterialParameters, FogPointsMaterialOptions {
|
|
1069
|
+
/**
|
|
1070
|
+
* 数值的映射区间
|
|
1071
|
+
* @remarks
|
|
1072
|
+
* x 为最小值,y 为最大值
|
|
1073
|
+
*
|
|
1074
|
+
* @defaultValue {x:0,y:100}
|
|
1075
|
+
*/
|
|
1076
|
+
range?: IVector2 | null;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* 梯度雾点材质的 uniforms
|
|
1081
|
+
*/
|
|
1082
|
+
export declare interface GradientFogPointsMaterialUniforms extends PointsUniforms, FogPointsMaterialUniforms {
|
|
1083
|
+
range: IUniform<Vector2>;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
export declare interface GradientFogPointsOptions extends GradientFogPointsGeometryOptions {
|
|
1087
|
+
/**
|
|
1088
|
+
* 数值的梯度映射纹理
|
|
1089
|
+
*/
|
|
1090
|
+
gradient?: GradientTextureOptions | null;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
export declare type GradientOptions = GradientOptionsOptimizeOptions & CreateGradientData3DTextureOptions & GradientVolumeMaterialOptions;
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* 优化选项
|
|
1097
|
+
*/
|
|
1098
|
+
export declare interface GradientOptionsOptimizeOptions {
|
|
1099
|
+
/**
|
|
1100
|
+
* 指定优化后的梯度选项的所能达到的最大尺寸
|
|
1101
|
+
* @remarks
|
|
1102
|
+
* 会对原来的梯度选项进行等比缩放以达到该尺寸;
|
|
1103
|
+
*
|
|
1104
|
+
* 如果同时指定 maxSize 和 {@link GradientOptionsOptimizeOptions.scale} ,则优先使用 {@link GradientOptionsOptimizeOptions.scale}
|
|
1105
|
+
* @defaultValue 100
|
|
1106
|
+
*/
|
|
1107
|
+
maxSize?: number;
|
|
1108
|
+
/**
|
|
1109
|
+
* 缩放系数
|
|
1110
|
+
* @remarks
|
|
1111
|
+
* 对原梯度选项进行缩放;
|
|
1112
|
+
*
|
|
1113
|
+
* 优先级高于 {@link GradientOptionsOptimizeOptions.maxSize}
|
|
1114
|
+
*/
|
|
1115
|
+
scale?: number;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* 梯度函数的参数
|
|
1120
|
+
*/
|
|
1121
|
+
export declare interface GradientParams {
|
|
1122
|
+
/**
|
|
1123
|
+
* 梯度的变化比率
|
|
1124
|
+
* @remarks
|
|
1125
|
+
* 一般是当前点与其所属中心点的距离和中心点半径的比率
|
|
1126
|
+
*/
|
|
1127
|
+
ratio: number;
|
|
1128
|
+
/**
|
|
1129
|
+
* 当前中心点的半径
|
|
1130
|
+
*/
|
|
1131
|
+
radius: number;
|
|
1132
|
+
/**
|
|
1133
|
+
* 当前中心点空心比率
|
|
1134
|
+
*/
|
|
1135
|
+
hollow: number;
|
|
1136
|
+
/**
|
|
1137
|
+
* 根据空间比率计算的空心半径
|
|
1138
|
+
*/
|
|
1139
|
+
hollowRadius: number;
|
|
1140
|
+
/**
|
|
1141
|
+
* 当前点与其所属中心点的距离
|
|
1142
|
+
*/
|
|
1143
|
+
distance: number;
|
|
1144
|
+
/**
|
|
1145
|
+
* 值
|
|
1146
|
+
*/
|
|
1147
|
+
value: number;
|
|
1148
|
+
/**
|
|
1149
|
+
* 值的范围
|
|
1150
|
+
*/
|
|
1151
|
+
clim: IVector2;
|
|
1152
|
+
/**
|
|
1153
|
+
* 当前点的坐标
|
|
1154
|
+
*/
|
|
1155
|
+
point: Vector3;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
declare type GradientTextureOptions = Texture | TexImageSource | string | ColorGradient;
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* 梯度体积材质
|
|
1162
|
+
*/
|
|
1163
|
+
export declare class GradientVolumeMaterial extends VolumeMaterial<GradientData3DTexture, GradientVolumeMaterialUniforms> {
|
|
1164
|
+
readonly isGradientVolumeMaterial = true;
|
|
1165
|
+
constructor(options?: GradientVolumeMaterialOptions);
|
|
1166
|
+
/**
|
|
1167
|
+
* 数值的梯度映射纹理
|
|
1168
|
+
*/
|
|
1169
|
+
get gradient(): Texture | null;
|
|
1170
|
+
set gradient(value: Texture | null);
|
|
1171
|
+
/**
|
|
1172
|
+
* 数值的映射区间
|
|
1173
|
+
* @remarks
|
|
1174
|
+
* x 为最小值,y 为最大值
|
|
1175
|
+
*
|
|
1176
|
+
* @defaultValue {x:0,y:100}
|
|
1177
|
+
*/
|
|
1178
|
+
get range(): Vector2;
|
|
1179
|
+
set range(value: Vector2);
|
|
1180
|
+
/**
|
|
1181
|
+
* 是否丢弃超出映射范围的数值
|
|
1182
|
+
* @remarks
|
|
1183
|
+
* 当数值超出映射区间 {@link GradientVolumeMaterial.range} 时,是否丢弃;
|
|
1184
|
+
*
|
|
1185
|
+
* 包含左右边界值
|
|
1186
|
+
* @defaultValue true
|
|
1187
|
+
*/
|
|
1188
|
+
get discardOut(): boolean;
|
|
1189
|
+
set discardOut(value: boolean);
|
|
1190
|
+
/**
|
|
1191
|
+
* 空值的范围
|
|
1192
|
+
* @remarks
|
|
1193
|
+
* 当数值在此范围中时,会被认为是空的值,渲染时会被丢弃
|
|
1194
|
+
*
|
|
1195
|
+
* 包含左右边界值
|
|
1196
|
+
*
|
|
1197
|
+
* @defaultValue {x:-100,y:-1}
|
|
1198
|
+
*/
|
|
1199
|
+
get voidRange(): Vector2;
|
|
1200
|
+
set voidRange(value: Vector2);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* 梯度体积材质选项
|
|
1205
|
+
*/
|
|
1206
|
+
export declare interface GradientVolumeMaterialOptions extends VolumeMaterialOptions<GradientData3DTexture>, GradientData3DOptions {
|
|
1207
|
+
/**
|
|
1208
|
+
* 数值的梯度映射纹理
|
|
1209
|
+
*/
|
|
1210
|
+
gradient?: GradientTextureOptions | null;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* GradientVolumeMaterial 的 uniforms 类型
|
|
1215
|
+
*/
|
|
1216
|
+
export declare interface GradientVolumeMaterialUniforms extends VolumeMaterialUniforms<GradientData3DTexture> {
|
|
1217
|
+
gradient: IUniform<null | Texture>;
|
|
1218
|
+
range: IUniform<Vector2>;
|
|
1219
|
+
discardOut: IUniform<boolean>;
|
|
1220
|
+
voidRange: IUniform<Vector2>;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* 热力值及其相关信息
|
|
1225
|
+
*/
|
|
1226
|
+
export declare type HeatAccumulateValue = Required<Omit<SphereParticleVolumeFeature, "valueGradient">> & GradientParams;
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* 创建热力3D数据的选项
|
|
1230
|
+
*/
|
|
1231
|
+
export declare interface HeatData3DOptions extends HeatParticleVolumeFeature {
|
|
1232
|
+
/**
|
|
1233
|
+
* 热力点列表
|
|
1234
|
+
*/
|
|
1235
|
+
points: HeatParticleVolumeFeaturePoint[];
|
|
1236
|
+
/**
|
|
1237
|
+
* Data3D 的尺寸
|
|
1238
|
+
* @defaultValue 从原点到 points 的AABB包围盒最大点的空间尺寸
|
|
1239
|
+
*/
|
|
1240
|
+
size?: IVector3 | null;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
export declare type HeatDataOptions = Omit<HeatData3DOptions, 'points'>;
|
|
1244
|
+
|
|
1245
|
+
declare class HeatMapPlugin {
|
|
1246
|
+
readonly ssp: default_2;
|
|
1247
|
+
constructor(ssp: default_2);
|
|
1248
|
+
defaultColorGradient: ColorGradient;
|
|
1249
|
+
defaultGradientVolumeMaterialOptions: GradientVolumeMaterialOptions;
|
|
1250
|
+
protected _createTexture(points: HeatData3DOptions['points'], options: CreateHeatOptions, isLine?: boolean): any;
|
|
1251
|
+
/**
|
|
1252
|
+
* 创建热力云
|
|
1253
|
+
* return material
|
|
1254
|
+
*/
|
|
1255
|
+
createHeatCloud(points: HeatParticleVolumeFeaturePoint[], options?: CreateHeatCloudOptions): any;
|
|
1256
|
+
createLineHeat(points: ParticleVolumeFeaturePoint[], options: CreatLineHeatOptions): any;
|
|
1257
|
+
createImageExtrusion(imageUrl: string, options?: CreateImageExtrusionOptions & {
|
|
1258
|
+
depth?: number;
|
|
1259
|
+
}): Promise<any>;
|
|
1260
|
+
createSliceMesh(material: VolumeMaterial, options?: SliceMaterialOptions & CreateImageData3DTextureFromGradientOptions): any;
|
|
1261
|
+
createImageSlice(material: VolumeMaterial, options?: CreateImageData3DTextureFromGradientOptions): any;
|
|
1262
|
+
}
|
|
1263
|
+
export { HeatMapPlugin }
|
|
1264
|
+
export default HeatMapPlugin;
|
|
1265
|
+
|
|
1266
|
+
/**
|
|
1267
|
+
* 热力粒子体积特性
|
|
1268
|
+
*/
|
|
1269
|
+
export declare interface HeatParticleVolumeFeature extends SphereParticleVolumeFeature {
|
|
1270
|
+
/**
|
|
1271
|
+
* 值累积函数
|
|
1272
|
+
* @remarks
|
|
1273
|
+
* 当某一个点处理多个热力球区域内时,需要考虑多个热力球在该点的累积效果,通过该函数来获取最终的累积结果
|
|
1274
|
+
* @defaultValue valuesAccumulate_Default
|
|
1275
|
+
*/
|
|
1276
|
+
valuesAccumulate?: HeatValuesAccumulate;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* 热力点
|
|
1281
|
+
*/
|
|
1282
|
+
export declare type HeatParticleVolumeFeaturePoint = HeatParticleVolumeFeature & IVector3;
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* 热力点信息
|
|
1286
|
+
*/
|
|
1287
|
+
export declare type HeatParticleVolumeFeaturePointInfo = Required<HeatParticleVolumeFeaturePoint>;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* 热力向量信息
|
|
1291
|
+
*/
|
|
1292
|
+
export declare type HeatParticleVolumeFeatureVectorInfo = Required<HeatParticleVolumeFeature> & Vector3;
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* 热力值累积函数
|
|
1296
|
+
* @remarks
|
|
1297
|
+
* 当某一个点处理多个热力球区域内时,需要考虑多个热力球在该点的累积效果,通过该函数来获取最终的累积结果
|
|
1298
|
+
* @param values - 值的信息列表
|
|
1299
|
+
* @param clim - 默认的映射区间
|
|
1300
|
+
* @returns 累积后的最终值
|
|
1301
|
+
*/
|
|
1302
|
+
export declare type HeatValuesAccumulate = (values: HeatAccumulateValue[], clim: IVector2) => number;
|
|
1303
|
+
|
|
1304
|
+
/**
|
|
1305
|
+
* 默认的空心比率梯度函数
|
|
1306
|
+
* @param param0
|
|
1307
|
+
* @returns
|
|
1308
|
+
*/
|
|
1309
|
+
export declare function hollowGradient_Default({ startHollow, addedHollow, ratio }: LineGradientParams): number;
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Data2D 类型
|
|
1313
|
+
*/
|
|
1314
|
+
export declare interface IData2D<D = number> {
|
|
1315
|
+
data: ArrayLike<D>;
|
|
1316
|
+
size: IVector2;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* Data3D 类型
|
|
1321
|
+
*/
|
|
1322
|
+
export declare interface IData3D<D = number> {
|
|
1323
|
+
data: ArrayLike<D>;
|
|
1324
|
+
size: IVector3;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* IImageData2 的类型
|
|
1329
|
+
*/
|
|
1330
|
+
export declare interface IImageData2 {
|
|
1331
|
+
data: ArrayBufferView;
|
|
1332
|
+
height: number;
|
|
1333
|
+
width: number;
|
|
1334
|
+
colorSpace?: PredefinedColorSpace;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* IImageData3 类型的数据
|
|
1339
|
+
* @remarks
|
|
1340
|
+
* 比 IImageData2 多了个深度
|
|
1341
|
+
*/
|
|
1342
|
+
export declare interface IImageData3 extends IImageData2 {
|
|
1343
|
+
depth: number;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
/**
|
|
1347
|
+
* 获取3D图像切片的工具
|
|
1348
|
+
* @remarks
|
|
1349
|
+
* 提供了用于呈现切片的 canvas 元素;
|
|
1350
|
+
* 生成切片图像的url;
|
|
1351
|
+
* 获取指定坐标的颜色等等;
|
|
1352
|
+
*/
|
|
1353
|
+
export declare class ImageData3DSlice {
|
|
1354
|
+
readonly isImageData3DSlice = true;
|
|
1355
|
+
constructor(image3D: IImageData3);
|
|
1356
|
+
/**
|
|
1357
|
+
* 3D图像数据
|
|
1358
|
+
*/
|
|
1359
|
+
get image3D(): IImageData3;
|
|
1360
|
+
set image3D(value: IImageData3);
|
|
1361
|
+
protected _image3D: IImageData3;
|
|
1362
|
+
/**
|
|
1363
|
+
* 呈现切片的 canvas 元素
|
|
1364
|
+
* @remarks
|
|
1365
|
+
* 当 {@link ImageData3DSlice.axis} 或 {@link ImageData3DSlice.depth} 变更时,它会自动更新切片
|
|
1366
|
+
*/
|
|
1367
|
+
get canvas(): HTMLCanvasElement;
|
|
1368
|
+
protected _canvas?: HTMLCanvasElement | null;
|
|
1369
|
+
/**
|
|
1370
|
+
* canvas 的 2d 上下文对象
|
|
1371
|
+
*/
|
|
1372
|
+
get context(): CanvasRenderingContext2D;
|
|
1373
|
+
protected _context?: CanvasRenderingContext2D;
|
|
1374
|
+
/**
|
|
1375
|
+
* 轴
|
|
1376
|
+
* @remarks
|
|
1377
|
+
* 会沿该轴的垂直截面生成切片
|
|
1378
|
+
*
|
|
1379
|
+
* @defaultValue Axis.z
|
|
1380
|
+
*/
|
|
1381
|
+
get axis(): Axis;
|
|
1382
|
+
set axis(value: Axis);
|
|
1383
|
+
protected _axis: Axis;
|
|
1384
|
+
/**
|
|
1385
|
+
* 轴上的坐标值
|
|
1386
|
+
* @remarks
|
|
1387
|
+
* 会在轴的该位置处获取切片
|
|
1388
|
+
* @defaultValue 0
|
|
1389
|
+
*/
|
|
1390
|
+
get depth(): number;
|
|
1391
|
+
set depth(value: number);
|
|
1392
|
+
protected _depth: number;
|
|
1393
|
+
/**
|
|
1394
|
+
* 切片的尺寸
|
|
1395
|
+
* @remarks
|
|
1396
|
+
* 不同轴上的切片的尺寸一般不一样
|
|
1397
|
+
*/
|
|
1398
|
+
get sliceSize(): IVector2;
|
|
1399
|
+
protected _sliceSize?: IVector2 | null;
|
|
1400
|
+
/**
|
|
1401
|
+
* 获取切片数据
|
|
1402
|
+
* @remarks
|
|
1403
|
+
* 总是获取当前轴和深度处的切片
|
|
1404
|
+
*/
|
|
1405
|
+
get slice(): ImageData;
|
|
1406
|
+
protected _slice?: ImageData | null;
|
|
1407
|
+
/**
|
|
1408
|
+
* 获取切片数据
|
|
1409
|
+
* @remarks
|
|
1410
|
+
* 可以指定轴和深度;该方法不会更新 {@link ImageData3DSlice.axis} 和 {@link ImageData3DSlice.depth} 属性
|
|
1411
|
+
* @param axis - 轴
|
|
1412
|
+
* @param depth - 深度
|
|
1413
|
+
* @returns
|
|
1414
|
+
*/
|
|
1415
|
+
getSlice(axis: Axis, depth: number): ImageData;
|
|
1416
|
+
/**
|
|
1417
|
+
* 获取切片图像的 url
|
|
1418
|
+
* @returns
|
|
1419
|
+
*/
|
|
1420
|
+
getDataURL(): string;
|
|
1421
|
+
/**
|
|
1422
|
+
* 获取切片上指定坐标处的颜色
|
|
1423
|
+
* @param coord - 坐标
|
|
1424
|
+
* @returns
|
|
1425
|
+
*/
|
|
1426
|
+
getColor(coord: IVector2): Uint8ClampedArray;
|
|
1427
|
+
/**
|
|
1428
|
+
* 更新切片尺寸相关的信息
|
|
1429
|
+
*/
|
|
1430
|
+
updateSize(): void;
|
|
1431
|
+
/**
|
|
1432
|
+
* 更新切片相关的信息
|
|
1433
|
+
*/
|
|
1434
|
+
updateSlice(): void;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* 3D图像纹理
|
|
1439
|
+
* @remarks
|
|
1440
|
+
* 专门用于 {@link ./ImageVolumeMaterial#ImageVolumeMaterial} 的纹理对象
|
|
1441
|
+
* 提供了一些与 {@link ./ImageVolumeMaterial#ImageVolumeMaterial} 约定的设置 和 一些便利方法
|
|
1442
|
+
*/
|
|
1443
|
+
export declare class ImageData3DTexture extends Data3DTexture {
|
|
1444
|
+
readonly isImageData3DTexture = true;
|
|
1445
|
+
constructor(data: BufferSource, width: number, height: number, depth: number);
|
|
1446
|
+
/**
|
|
1447
|
+
* 获取3D数据的切片
|
|
1448
|
+
* @remarks
|
|
1449
|
+
* 切片就是指定轴的指定位置的垂直截面
|
|
1450
|
+
* @param axis - 轴
|
|
1451
|
+
* @param depth - 在轴上的坐标值
|
|
1452
|
+
* @returns
|
|
1453
|
+
*/
|
|
1454
|
+
getData3DSlice(axis: Axis, depth: number): IData2D<number>;
|
|
1455
|
+
/**
|
|
1456
|
+
* 获取3D数据中指定坐标处的数据项目
|
|
1457
|
+
* @remarks
|
|
1458
|
+
* 在 ImageData3DTexture 中,与 {@link ImageData3DTexture.getColor} 返回的值一样;
|
|
1459
|
+
* @param coord
|
|
1460
|
+
* @returns
|
|
1461
|
+
*/
|
|
1462
|
+
getItem(coord: IVector3): number[];
|
|
1463
|
+
/**
|
|
1464
|
+
* 获取3D图像中指定坐标处的颜色
|
|
1465
|
+
* @param coord - 坐标
|
|
1466
|
+
* @returns
|
|
1467
|
+
*/
|
|
1468
|
+
getColor(coord: IVector3): number[];
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* 获取3D图像切片的工具
|
|
1473
|
+
* @remarks
|
|
1474
|
+
* 提供了用于呈现切片的 canvas 元素;
|
|
1475
|
+
* 生成切片图像的url;
|
|
1476
|
+
* 获取指定坐标的颜色等等;
|
|
1477
|
+
*/
|
|
1478
|
+
export declare class ImageData3DTextureSlice extends ImageData3DSlice {
|
|
1479
|
+
readonly isImageData3DTextureSlice = true;
|
|
1480
|
+
constructor(texture: IImageData3 | Texture3D);
|
|
1481
|
+
/**
|
|
1482
|
+
* 设置材质或 IImageData3 类数据
|
|
1483
|
+
*/
|
|
1484
|
+
set texture(texture: IImageData3 | Texture3D);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* imageData转Canvas
|
|
1489
|
+
* @param imageData
|
|
1490
|
+
* @returns
|
|
1491
|
+
*/
|
|
1492
|
+
export declare function imageDataToCanvas(imageData: ImageData): HTMLCanvasElement;
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* 将 imageData 转成 url
|
|
1496
|
+
* @param imageData
|
|
1497
|
+
* @returns
|
|
1498
|
+
*/
|
|
1499
|
+
export declare function imageDataToUrl(imageData: ImageData): string;
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* 图像体积材质
|
|
1503
|
+
* @remarks
|
|
1504
|
+
* 用于渲染3D图像的材质
|
|
1505
|
+
*/
|
|
1506
|
+
export declare class ImageVolumeMaterial extends VolumeMaterial<ImageData3DTexture> {
|
|
1507
|
+
readonly isImageVolumeMaterial = true;
|
|
1508
|
+
constructor(options?: VolumeMaterialOptions<ImageData3DTexture>);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* 判断是否是 IImageData2 类型的数据
|
|
1513
|
+
* @remarks
|
|
1514
|
+
* IImageData3 类型的数据也会被验证通过
|
|
1515
|
+
* @param target
|
|
1516
|
+
* @returns
|
|
1517
|
+
*/
|
|
1518
|
+
export declare function isIImageData2(target: any): target is IImageData2;
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* 判断是否是 IImageData3 类型的数据
|
|
1522
|
+
* @param target
|
|
1523
|
+
* @returns
|
|
1524
|
+
*/
|
|
1525
|
+
export declare function isIImageData3(target: any): target is IImageData3;
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* 坐标是否超出尺寸范围
|
|
1529
|
+
* @param coord
|
|
1530
|
+
* @param size
|
|
1531
|
+
* @returns
|
|
1532
|
+
*/
|
|
1533
|
+
export declare function isOutOfSize<Ivec extends IVector>(coord: Ivec, size: Ivec): boolean;
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* 向量
|
|
1537
|
+
*/
|
|
1538
|
+
declare type IVector = IVector2 | IVector3 | IVector4;
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* 二维向量
|
|
1542
|
+
*/
|
|
1543
|
+
declare interface IVector2 {
|
|
1544
|
+
x: number;
|
|
1545
|
+
y: number;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* 三维向量
|
|
1550
|
+
*/
|
|
1551
|
+
declare interface IVector3 extends IVector2 {
|
|
1552
|
+
z: number;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* 四维向量
|
|
1557
|
+
*/
|
|
1558
|
+
declare interface IVector4 extends IVector3 {
|
|
1559
|
+
w: number;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* 创建线性3D数据的选项
|
|
1564
|
+
*/
|
|
1565
|
+
export declare interface LineData3DOptions extends SphereParticleVolumeFeature {
|
|
1566
|
+
/**
|
|
1567
|
+
* 体积粒子列表
|
|
1568
|
+
*/
|
|
1569
|
+
points: ParticleVolumeFeaturePoint[];
|
|
1570
|
+
/**
|
|
1571
|
+
* Data3D 的尺寸
|
|
1572
|
+
* @defaultValue 从原点到 points 的AABB包围盒最大点的空间尺寸
|
|
1573
|
+
*/
|
|
1574
|
+
size?: IVector3 | null;
|
|
1575
|
+
/**
|
|
1576
|
+
* 半径梯度函数
|
|
1577
|
+
* @defaultValue radiusGradient_Default
|
|
1578
|
+
*/
|
|
1579
|
+
radiusGradient?: GetLineGradientValue;
|
|
1580
|
+
/**
|
|
1581
|
+
* 空心比梯度函数
|
|
1582
|
+
* @defaultValue hollowGradient_Default
|
|
1583
|
+
*/
|
|
1584
|
+
hollowGradient?: GetLineGradientValue;
|
|
1585
|
+
/**
|
|
1586
|
+
* 轴线值梯度函数
|
|
1587
|
+
* @defaultValue lineValueGradient_Default
|
|
1588
|
+
*/
|
|
1589
|
+
lineValueGradient?: GetLineGradientValue;
|
|
1590
|
+
/**
|
|
1591
|
+
* 值累积函数
|
|
1592
|
+
* @defaultValue numberValuesAccumulate_Default
|
|
1593
|
+
*/
|
|
1594
|
+
valuesAccumulate?: NumberValuesAccumulate;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
export declare type LineDataOptions = Omit<LineData3DOptions, 'points'>;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* 轴线梯度函数的参数
|
|
1601
|
+
*/
|
|
1602
|
+
export declare interface LineGradientParams {
|
|
1603
|
+
/**
|
|
1604
|
+
* 梯度的变化比率
|
|
1605
|
+
* @remarks
|
|
1606
|
+
* 一般是当前轴线位置到轴线开始处距离 与 轴线的长度的比率
|
|
1607
|
+
*/
|
|
1608
|
+
ratio: number;
|
|
1609
|
+
/**
|
|
1610
|
+
* 轴线的长度
|
|
1611
|
+
*/
|
|
1612
|
+
length: number;
|
|
1613
|
+
/**
|
|
1614
|
+
* 当前点的坐标
|
|
1615
|
+
*/
|
|
1616
|
+
point: Vector3;
|
|
1617
|
+
/**
|
|
1618
|
+
* 轴线起始点处的半径
|
|
1619
|
+
*/
|
|
1620
|
+
startRadius: number;
|
|
1621
|
+
/**
|
|
1622
|
+
* 轴线终点处的半径
|
|
1623
|
+
*/
|
|
1624
|
+
endRadius: number;
|
|
1625
|
+
/**
|
|
1626
|
+
* 轴线终点处的半径相对起始点处的半径的增加量;即 `endRadius - startRadius`
|
|
1627
|
+
*/
|
|
1628
|
+
addedRadius: number;
|
|
1629
|
+
/**
|
|
1630
|
+
* 选项中默认的半径
|
|
1631
|
+
*/
|
|
1632
|
+
defaultRadius: number;
|
|
1633
|
+
/**
|
|
1634
|
+
* 当前中心点的半径
|
|
1635
|
+
* @remarks
|
|
1636
|
+
* 注意:在 `radiusGradient` 中,该值就是 `defaultRadius`;
|
|
1637
|
+
*/
|
|
1638
|
+
radius: number;
|
|
1639
|
+
/**
|
|
1640
|
+
* 轴线起始点处的值
|
|
1641
|
+
*/
|
|
1642
|
+
startValue: number;
|
|
1643
|
+
/**
|
|
1644
|
+
* 轴线终点处的值
|
|
1645
|
+
*/
|
|
1646
|
+
endValue: number;
|
|
1647
|
+
/**
|
|
1648
|
+
* 轴线终点处的值相对起始点处的值的增加量;即 `endValue - startValue`
|
|
1649
|
+
*/
|
|
1650
|
+
addedValue: number;
|
|
1651
|
+
/**
|
|
1652
|
+
* 选项中默认的值
|
|
1653
|
+
*/
|
|
1654
|
+
defaultValue: number;
|
|
1655
|
+
/**
|
|
1656
|
+
* 轴线起始点处的空心比率
|
|
1657
|
+
*/
|
|
1658
|
+
startHollow: number;
|
|
1659
|
+
/**
|
|
1660
|
+
* 轴线终点处的空心比率
|
|
1661
|
+
*/
|
|
1662
|
+
endHollow: number;
|
|
1663
|
+
/**
|
|
1664
|
+
* 轴线终点处的空心比率相对起始点处的空心比率的增加量;即 `endHollow - startHollow`
|
|
1665
|
+
*/
|
|
1666
|
+
addedHollow: number;
|
|
1667
|
+
/**
|
|
1668
|
+
* 选项中默认的空心比率
|
|
1669
|
+
*/
|
|
1670
|
+
defaultHollow: number;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* 默认的轴线值梯度函数
|
|
1675
|
+
* @param param0
|
|
1676
|
+
* @returns
|
|
1677
|
+
*/
|
|
1678
|
+
export declare function lineValueGradient_Default({ startValue, addedValue, ratio }: LineGradientParams): number;
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* 将几何体的原点移动包围盒的最小点处
|
|
1682
|
+
* @param geometry
|
|
1683
|
+
*/
|
|
1684
|
+
export declare function makeOriginOnBoundingBoxMinOfGeometry(geometry: BufferGeometry): BufferGeometry<NormalBufferAttributes>;
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* 将多 Data3D 合并成一个
|
|
1688
|
+
* @param data3Ds
|
|
1689
|
+
* @param valuesAccumulate
|
|
1690
|
+
* @param options
|
|
1691
|
+
* @returns
|
|
1692
|
+
*/
|
|
1693
|
+
export declare function mergeData3Ds<D>(data3Ds: IData3D<D>[], options: MergeData3DsOptions<D>): {
|
|
1694
|
+
data: D[];
|
|
1695
|
+
size: {
|
|
1696
|
+
x: number;
|
|
1697
|
+
y: number;
|
|
1698
|
+
z: number;
|
|
1699
|
+
};
|
|
1700
|
+
};
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* 合并选项
|
|
1704
|
+
*/
|
|
1705
|
+
export declare interface MergeData3DsOptions<D> {
|
|
1706
|
+
valuesAccumulate: DataValuesAccumulate<D>;
|
|
1707
|
+
verifyVoid?: VerifyVoidValue<D>;
|
|
1708
|
+
voidValue: D;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* 数值累积函数
|
|
1713
|
+
* @remarks
|
|
1714
|
+
* 当某一个点处理多个区域数据内时,需要考虑多个数据区域在该点的累积效果,通过该函数来获取最终的累积结果
|
|
1715
|
+
* @param values - 值的列表
|
|
1716
|
+
* @param clim - 默认的映射区间
|
|
1717
|
+
* @returns 累积后的最终值
|
|
1718
|
+
*/
|
|
1719
|
+
export declare type NumberValuesAccumulate = (values: number[], clim: IVector2) => number;
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* 默认的数值累积函数
|
|
1723
|
+
* @param values
|
|
1724
|
+
* @param clim
|
|
1725
|
+
* @returns
|
|
1726
|
+
*/
|
|
1727
|
+
export declare function numberValuesAccumulate_Default(values: number[], clim: IVector2): number;
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* 对梯度选项进行优化
|
|
1731
|
+
* @param gradientOptions
|
|
1732
|
+
* @param options
|
|
1733
|
+
* @returns
|
|
1734
|
+
*/
|
|
1735
|
+
export declare function optimizeGradientOptions<Opts extends TransferableGradientOptions>(gradientOptions: Opts, options?: GradientOptionsOptimizeOptions | null): {
|
|
1736
|
+
options: Opts;
|
|
1737
|
+
position: Vector3;
|
|
1738
|
+
scale: number;
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* 粒子体积特征
|
|
1743
|
+
*/
|
|
1744
|
+
export declare interface ParticleVolumeFeature extends VolumeFeature {
|
|
1745
|
+
/**
|
|
1746
|
+
* 空心因子
|
|
1747
|
+
*
|
|
1748
|
+
* @defaultValue 0
|
|
1749
|
+
*/
|
|
1750
|
+
hollow?: number;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
export declare type ParticleVolumeFeaturePoint = ParticleVolumeFeature & IVector3;
|
|
1754
|
+
|
|
1755
|
+
export declare type ParticleVolumeFeaturePointInfo = Required<ParticleVolumeFeaturePoint>;
|
|
1756
|
+
|
|
1757
|
+
export declare type ParticleVolumeFeatureVectorInfo = Required<ParticleVolumeFeature> & Vector3;
|
|
1758
|
+
|
|
1759
|
+
export declare type PointsUniforms = typeof ShaderLib.points.uniforms;
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* 默认的半径梯度函数
|
|
1763
|
+
* @param param0
|
|
1764
|
+
* @returns
|
|
1765
|
+
*/
|
|
1766
|
+
export declare function radiusGradient_Default({ startRadius, addedRadius, ratio }: LineGradientParams): number;
|
|
1767
|
+
|
|
1768
|
+
/**
|
|
1769
|
+
* 将 imageData 沿 Y 轴反转
|
|
1770
|
+
* @param imageData
|
|
1771
|
+
* @returns
|
|
1772
|
+
*/
|
|
1773
|
+
export declare function reverseImageDateY(imageData: ImageData): ImageData;
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* 切片材质
|
|
1777
|
+
* @remarks
|
|
1778
|
+
* 用于呈现3D图像的在指定轴上指定位置处的截面
|
|
1779
|
+
*/
|
|
1780
|
+
export declare class SliceMaterial extends ShaderMaterial {
|
|
1781
|
+
readonly isSliceMaterial = true;
|
|
1782
|
+
constructor(options?: SliceMaterialOptions);
|
|
1783
|
+
uniforms: SliceMaterialUniforms;
|
|
1784
|
+
/**
|
|
1785
|
+
* 三维的纹理
|
|
1786
|
+
*/
|
|
1787
|
+
get map(): Texture3D | null;
|
|
1788
|
+
set map(value: Texture3D | null);
|
|
1789
|
+
/**
|
|
1790
|
+
* 透明度
|
|
1791
|
+
* @remarks
|
|
1792
|
+
* 决定整体的透明度
|
|
1793
|
+
* @defaultValue 1
|
|
1794
|
+
*/
|
|
1795
|
+
get opacity(): number;
|
|
1796
|
+
set opacity(value: number);
|
|
1797
|
+
/**
|
|
1798
|
+
* 轴
|
|
1799
|
+
* @remarks
|
|
1800
|
+
* 切片就是垂直于该轴的截面
|
|
1801
|
+
*
|
|
1802
|
+
* @defaultValue Axis.z
|
|
1803
|
+
*/
|
|
1804
|
+
get axis(): Axis;
|
|
1805
|
+
set axis(value: Axis);
|
|
1806
|
+
/**
|
|
1807
|
+
* 轴上的坐标值
|
|
1808
|
+
* @remarks
|
|
1809
|
+
* 会在轴的该位置处获取切片
|
|
1810
|
+
* @defaultValue 0
|
|
1811
|
+
*/
|
|
1812
|
+
get depth(): number;
|
|
1813
|
+
set depth(value: number);
|
|
1814
|
+
/**
|
|
1815
|
+
* 切片的尺寸
|
|
1816
|
+
* @remarks
|
|
1817
|
+
* 不同轴上的切片的尺寸一般不一样
|
|
1818
|
+
*/
|
|
1819
|
+
get sliceSize(): Vector2;
|
|
1820
|
+
protected _sliceSize?: Vector2 | null;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* 切片材质的选项
|
|
1825
|
+
*/
|
|
1826
|
+
export declare interface SliceMaterialOptions extends Omit<ShaderMaterialParameters, "opacity"> {
|
|
1827
|
+
/**
|
|
1828
|
+
* 三维的纹理
|
|
1829
|
+
*/
|
|
1830
|
+
map?: Texture3D | null;
|
|
1831
|
+
/**
|
|
1832
|
+
* 透明度
|
|
1833
|
+
* @remarks
|
|
1834
|
+
* 决定整体的透明度
|
|
1835
|
+
* @defaultValue 1
|
|
1836
|
+
*/
|
|
1837
|
+
opacity?: number | null;
|
|
1838
|
+
/**
|
|
1839
|
+
* 轴
|
|
1840
|
+
* @remarks
|
|
1841
|
+
* 切片就是垂直于该轴的截面
|
|
1842
|
+
*
|
|
1843
|
+
* @defaultValue Axis.z
|
|
1844
|
+
*/
|
|
1845
|
+
axis?: Axis | null;
|
|
1846
|
+
/**
|
|
1847
|
+
* 轴上的坐标值
|
|
1848
|
+
* @remarks
|
|
1849
|
+
* 会在轴的该位置处获取切片
|
|
1850
|
+
* @defaultValue 0
|
|
1851
|
+
*/
|
|
1852
|
+
depth?: number | null;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* 切片材质的 uniforms
|
|
1857
|
+
*/
|
|
1858
|
+
export declare interface SliceMaterialUniforms {
|
|
1859
|
+
map: IUniform<Texture3D | null>;
|
|
1860
|
+
opacity: IUniform<number>;
|
|
1861
|
+
axis: IUniform<Axis>;
|
|
1862
|
+
depth: IUniform<number>;
|
|
1863
|
+
|
|
1864
|
+
[uniform: string]: IUniform<unknown>;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* 呈现3D图像切片的Mesh
|
|
1869
|
+
* @remarks
|
|
1870
|
+
* 专用于 {@link ./SliceMaterial#SliceMaterial}
|
|
1871
|
+
*
|
|
1872
|
+
* 虽然 {@link ./SliceMaterial#SliceMaterial} 也可以用于普通的 Mesh;但如果使用 SliceMesh ,则可以减少很多切片材质 和 geometry 同步操作;
|
|
1873
|
+
*/
|
|
1874
|
+
export declare class SliceMesh extends Mesh {
|
|
1875
|
+
readonly isSliceMesh = true;
|
|
1876
|
+
constructor(options: SliceMaterialOptions);
|
|
1877
|
+
protected _geometry: BufferGeometry;
|
|
1878
|
+
material: SliceMaterial;
|
|
1879
|
+
protected _material: SliceMaterial;
|
|
1880
|
+
/**
|
|
1881
|
+
* 是否自动更新几何体
|
|
1882
|
+
* @remarks
|
|
1883
|
+
* 当启动该选项后,在 SliceMesh 监测到切片尺寸相关的变更时,会自动更新 geometry 的尺寸,以适应切片的尺寸
|
|
1884
|
+
* @defaultValue true
|
|
1885
|
+
*/
|
|
1886
|
+
autoUpdateGeometry: boolean;
|
|
1887
|
+
/**
|
|
1888
|
+
* 更新几何体
|
|
1889
|
+
*/
|
|
1890
|
+
updateGeometry(): false | undefined;
|
|
1891
|
+
/**
|
|
1892
|
+
* 三维的纹理
|
|
1893
|
+
*/
|
|
1894
|
+
get map(): Texture3D | null;
|
|
1895
|
+
set map(value: Texture3D | null);
|
|
1896
|
+
/**
|
|
1897
|
+
* 轴
|
|
1898
|
+
* @remarks
|
|
1899
|
+
* 切片就是垂直于该轴的截面
|
|
1900
|
+
*
|
|
1901
|
+
* @defaultValue Axis.z
|
|
1902
|
+
*/
|
|
1903
|
+
get axis(): Axis;
|
|
1904
|
+
set axis(value: Axis);
|
|
1905
|
+
/**
|
|
1906
|
+
* 轴上的坐标值
|
|
1907
|
+
* @remarks
|
|
1908
|
+
* 会在轴的该位置处获取切片
|
|
1909
|
+
* @defaultValue 0
|
|
1910
|
+
*/
|
|
1911
|
+
get depth(): number;
|
|
1912
|
+
set depth(value: number);
|
|
1913
|
+
/**
|
|
1914
|
+
* 切片的尺寸
|
|
1915
|
+
* @remarks
|
|
1916
|
+
* 不同轴上的切片的尺寸一般不一样
|
|
1917
|
+
*/
|
|
1918
|
+
get sliceSize(): Vector2;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* 体积雾材质
|
|
1923
|
+
*/
|
|
1924
|
+
export declare class SphereFogMaterial extends ShaderMaterial {
|
|
1925
|
+
readonly isSphereFogMaterial = true;
|
|
1926
|
+
constructor(options?: SphereFogMaterialOptions);
|
|
1927
|
+
uniforms: SphereFogMaterialUniforms;
|
|
1928
|
+
/**
|
|
1929
|
+
* Mesh三角形的渲染面
|
|
1930
|
+
* @remarks
|
|
1931
|
+
* 可设置为前面、后面、或者两面都渲染
|
|
1932
|
+
* 如果只渲染前面,进入体积材质内部,体积材质就会消失
|
|
1933
|
+
* 如果只渲染后面,体积初遮挡,就会消失
|
|
1934
|
+
* 如果两面都渲染,则会隐藏看到容器的面
|
|
1935
|
+
*/
|
|
1936
|
+
get side(): Side;
|
|
1937
|
+
set side(value: Side);
|
|
1938
|
+
protected _side: Side;
|
|
1939
|
+
/**
|
|
1940
|
+
* 球形雾的颜色
|
|
1941
|
+
* @remarks
|
|
1942
|
+
* 当开启顶点颜色 {@link SphereFogMaterial.vertexColors} 时,此设置将无论;
|
|
1943
|
+
*/
|
|
1944
|
+
get color(): Color;
|
|
1945
|
+
set color(value: Color);
|
|
1946
|
+
/**
|
|
1947
|
+
* 透明度
|
|
1948
|
+
* @remarks
|
|
1949
|
+
* 决定整体的透明度
|
|
1950
|
+
* @defaultValue 1
|
|
1951
|
+
*/
|
|
1952
|
+
get opacity(): number;
|
|
1953
|
+
set opacity(value: number);
|
|
1954
|
+
/**
|
|
1955
|
+
* 实心因子
|
|
1956
|
+
* @remarks
|
|
1957
|
+
* 在实心范围内,球形雾不会衰减
|
|
1958
|
+
* @defaultValue 0
|
|
1959
|
+
*/
|
|
1960
|
+
get solid(): number;
|
|
1961
|
+
set solid(value: number);
|
|
1962
|
+
/**
|
|
1963
|
+
* 雾的衰减指数
|
|
1964
|
+
* @defaultValue 1
|
|
1965
|
+
*/
|
|
1966
|
+
get exp(): number;
|
|
1967
|
+
set exp(value: number);
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
/**
|
|
1971
|
+
* 球形雾材质选项
|
|
1972
|
+
*/
|
|
1973
|
+
export declare interface SphereFogMaterialOptions {
|
|
1974
|
+
/**
|
|
1975
|
+
* 球形雾的颜色
|
|
1976
|
+
* @remarks
|
|
1977
|
+
* 当开启顶点颜色 {@link SphereFogMaterial.vertexColors} 时,此设置将无论;
|
|
1978
|
+
*/
|
|
1979
|
+
color?: Color | null;
|
|
1980
|
+
/**
|
|
1981
|
+
* 实心因子
|
|
1982
|
+
* @remarks
|
|
1983
|
+
* 在实心范围内,球形雾不会衰减
|
|
1984
|
+
* @defaultValue 0
|
|
1985
|
+
*/
|
|
1986
|
+
solid?: number | null;
|
|
1987
|
+
/**
|
|
1988
|
+
* 雾的衰减指数
|
|
1989
|
+
* @defaultValue 1
|
|
1990
|
+
*/
|
|
1991
|
+
exp?: number | null;
|
|
1992
|
+
/**
|
|
1993
|
+
* 透明度
|
|
1994
|
+
* @remarks
|
|
1995
|
+
* 决定整体的透明度
|
|
1996
|
+
* @defaultValue 1
|
|
1997
|
+
*/
|
|
1998
|
+
opacity?: number | null;
|
|
1999
|
+
/**
|
|
2000
|
+
* Mesh三角形的渲染面
|
|
2001
|
+
* @remarks
|
|
2002
|
+
* 可设置为前面、后面、或者两面都渲染
|
|
2003
|
+
* 如果只渲染前面,进入体积材质内部,体积材质就会消失
|
|
2004
|
+
* 如果只渲染后面,体积初遮挡,就会消失
|
|
2005
|
+
* 如果两面都渲染,则会隐藏看到容器的面
|
|
2006
|
+
*/
|
|
2007
|
+
side?: Side | undefined;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* 球形雾的 uniforms
|
|
2012
|
+
*/
|
|
2013
|
+
export declare interface SphereFogMaterialUniforms {
|
|
2014
|
+
color: IUniform<Color>;
|
|
2015
|
+
solid: IUniform<number>;
|
|
2016
|
+
exp: IUniform<number>;
|
|
2017
|
+
opacity: IUniform<number>;
|
|
2018
|
+
isDoubleSide: IUniform<boolean>;
|
|
2019
|
+
|
|
2020
|
+
[uniform: string]: IUniform<unknown>;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
export declare interface SphereParticleVolumeFeature extends ParticleVolumeFeature {
|
|
2024
|
+
/**
|
|
2025
|
+
* 映射区间
|
|
2026
|
+
* @remarks
|
|
2027
|
+
* x 为最小值,y 为最大值
|
|
2028
|
+
*
|
|
2029
|
+
* @defaultValue {x:0,y:100}
|
|
2030
|
+
*/
|
|
2031
|
+
clim?: IVector2;
|
|
2032
|
+
/**
|
|
2033
|
+
* 值梯度函数
|
|
2034
|
+
*/
|
|
2035
|
+
valueGradient?: GetGradientValue;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
/**
|
|
2039
|
+
* 3D的纹理
|
|
2040
|
+
* @remarks
|
|
2041
|
+
* 包含三维数据的纹理
|
|
2042
|
+
*/
|
|
2043
|
+
declare type Texture3D = Data3DTexture | DataArrayTexture;
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* 梯度特性
|
|
2047
|
+
*/
|
|
2048
|
+
export declare interface TransferableGradientFeature {
|
|
2049
|
+
/**
|
|
2050
|
+
* 半径
|
|
2051
|
+
*
|
|
2052
|
+
* @defaultValue 10
|
|
2053
|
+
*/
|
|
2054
|
+
radius?: number | null;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* 可变换的梯度选项
|
|
2059
|
+
*/
|
|
2060
|
+
export declare interface TransferableGradientOptions extends TransferableGradientFeature {
|
|
2061
|
+
/**
|
|
2062
|
+
* 热力点列表
|
|
2063
|
+
*/
|
|
2064
|
+
points?: (TransferableGradientFeature & IVector3)[] | null;
|
|
2065
|
+
/**
|
|
2066
|
+
* Data3D 的尺寸
|
|
2067
|
+
*/
|
|
2068
|
+
size?: IVector3 | null;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* 对梯度选项应用矩阵变换
|
|
2073
|
+
* @param options
|
|
2074
|
+
* @param matrix
|
|
2075
|
+
* @returns
|
|
2076
|
+
*/
|
|
2077
|
+
export declare function transformGradientOptions<Opts extends TransferableGradientOptions>(options: Opts, matrix: Matrix4): Opts;
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* 对梯度选项进行平移后再缩放
|
|
2081
|
+
* @param options
|
|
2082
|
+
* @param translate
|
|
2083
|
+
* @param scale
|
|
2084
|
+
* @returns
|
|
2085
|
+
*/
|
|
2086
|
+
export declare function translateScaleGradientOptions<Opts extends TransferableGradientOptions>(options: Opts, translate: Vector3, scale?: number): Opts;
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* 默认的值梯度函数
|
|
2090
|
+
*/
|
|
2091
|
+
export declare function valueGradient_Default({ ratio, value }: GradientParams): number;
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* 默认的值累积函数
|
|
2095
|
+
* @param values
|
|
2096
|
+
* @param clim
|
|
2097
|
+
* @returns
|
|
2098
|
+
*/
|
|
2099
|
+
export declare function valuesAccumulate_Default(values: HeatAccumulateValue[], clim: IVector2): number;
|
|
2100
|
+
|
|
2101
|
+
/**
|
|
2102
|
+
* 空值验证函数
|
|
2103
|
+
*/
|
|
2104
|
+
export declare type VerifyVoidValue<D> = (value: D, data3D: IData3D<D>, index: number) => boolean | null | undefined;
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* 体积特征
|
|
2108
|
+
*/
|
|
2109
|
+
export declare interface VolumeFeature {
|
|
2110
|
+
/**
|
|
2111
|
+
* 半径
|
|
2112
|
+
*
|
|
2113
|
+
* @defaultValue 10
|
|
2114
|
+
*/
|
|
2115
|
+
radius?: number;
|
|
2116
|
+
/**
|
|
2117
|
+
* 值
|
|
2118
|
+
*
|
|
2119
|
+
* @defaultValue 100
|
|
2120
|
+
*/
|
|
2121
|
+
value?: number;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
/**
|
|
2125
|
+
* 体积材质填充模式
|
|
2126
|
+
*/
|
|
2127
|
+
export declare enum VolumeFit {
|
|
2128
|
+
/**
|
|
2129
|
+
* 填充
|
|
2130
|
+
* @remarks
|
|
2131
|
+
* 材质会充满容器
|
|
2132
|
+
*/
|
|
2133
|
+
Fill = 0,
|
|
2134
|
+
/**
|
|
2135
|
+
* 对齐
|
|
2136
|
+
* @remarks
|
|
2137
|
+
* 材质会从容器的最小点开始绘制,但不会充满容器
|
|
2138
|
+
*/
|
|
2139
|
+
Align = 1,
|
|
2140
|
+
/**
|
|
2141
|
+
* 原始
|
|
2142
|
+
* @remarks
|
|
2143
|
+
* 材质会从容器空间中的坐标原点开始绘制,也不会充满容器
|
|
2144
|
+
*/
|
|
2145
|
+
Raw = 2
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* 体积材质
|
|
2150
|
+
*/
|
|
2151
|
+
export declare abstract class VolumeMaterial<Data3M extends Data3DTexture = Data3DTexture, VolumeUniforms extends VolumeMaterialUniforms<Data3M> = VolumeMaterialUniforms<Data3M>> extends ShaderMaterial {
|
|
2152
|
+
readonly isVolumeMaterial = true;
|
|
2153
|
+
constructor(options?: VolumeMaterialOptions<Data3M>);
|
|
2154
|
+
/**
|
|
2155
|
+
* uniforms
|
|
2156
|
+
*/
|
|
2157
|
+
uniforms: VolumeUniforms;
|
|
2158
|
+
/**
|
|
2159
|
+
* 三维的纹理
|
|
2160
|
+
*/
|
|
2161
|
+
get map(): Data3M | null;
|
|
2162
|
+
set map(value: Data3M | null);
|
|
2163
|
+
/**
|
|
2164
|
+
* 渲染体积材质的容器的最小点
|
|
2165
|
+
* @remarks
|
|
2166
|
+
* 容器的最小点和最大点一般是被设置成 geometry 的AABB包围盒;但也可以不是
|
|
2167
|
+
* 总之,体积材质的渲染依托于 geometry 的形状,它不会超出 geometry 的尺寸;
|
|
2168
|
+
* 但可以控制容器的最小点和最大点来控制体积材质的渲染尺寸;
|
|
2169
|
+
*/
|
|
2170
|
+
get containerMin(): Vector3;
|
|
2171
|
+
set containerMin(value: Vector3);
|
|
2172
|
+
/**
|
|
2173
|
+
* 渲染体积材质的容器的最大点
|
|
2174
|
+
* @remarks
|
|
2175
|
+
* 容器的最小点和最大点一般是被设置成 geometry 的AABB包围盒;但也可以不是
|
|
2176
|
+
* 总之,体积材质的渲染依托于 geometry 的形状,它不会超出 geometry 的尺寸;
|
|
2177
|
+
* 但可以控制容器的最小点和最大点来控制体积材质的渲染尺寸;
|
|
2178
|
+
*/
|
|
2179
|
+
get containerMax(): Vector3;
|
|
2180
|
+
set containerMax(value: Vector3);
|
|
2181
|
+
/**
|
|
2182
|
+
* 渲染体积材质容器的尺寸
|
|
2183
|
+
* @remarks
|
|
2184
|
+
* 每次调用都会重新计算
|
|
2185
|
+
*/
|
|
2186
|
+
get containerSize(): Vector3;
|
|
2187
|
+
/**
|
|
2188
|
+
* 体积材质在容器内的填充模式
|
|
2189
|
+
* @defaultValue VolumeFit.Fill
|
|
2190
|
+
*/
|
|
2191
|
+
get fit(): VolumeFit;
|
|
2192
|
+
set fit(value: VolumeFit);
|
|
2193
|
+
/**
|
|
2194
|
+
* 获取当前填模式下对 map 的应用的平移
|
|
2195
|
+
* @returns
|
|
2196
|
+
*/
|
|
2197
|
+
getFitTranslate(): Vector3;
|
|
2198
|
+
/**
|
|
2199
|
+
* 获取当前填模式下对 map 的应用的缩放
|
|
2200
|
+
* @returns
|
|
2201
|
+
*/
|
|
2202
|
+
getFitScale(): Vector3;
|
|
2203
|
+
/**
|
|
2204
|
+
* 获取当前填模式下对 map 的应用的变换矩阵
|
|
2205
|
+
* @returns
|
|
2206
|
+
*/
|
|
2207
|
+
getFitMatrix(): Matrix4;
|
|
2208
|
+
/**
|
|
2209
|
+
* 获取当前填模式下对 map 的应用的变换矩阵的逆矩阵
|
|
2210
|
+
* @returns
|
|
2211
|
+
*/
|
|
2212
|
+
getFitMatrixInvert(): Matrix4;
|
|
2213
|
+
/**
|
|
2214
|
+
* Mesh三角形的渲染面
|
|
2215
|
+
* @remarks
|
|
2216
|
+
* 可设置为前面、后面、或者两面都渲染
|
|
2217
|
+
* 如果只渲染前面,进入体积材质内部,体积材质就会消失
|
|
2218
|
+
* 如果只渲染后面,体积初遮挡,就会消失
|
|
2219
|
+
* 如果两面都渲染,则会隐藏看到容器的面
|
|
2220
|
+
*/
|
|
2221
|
+
get side(): Side;
|
|
2222
|
+
set side(value: Side);
|
|
2223
|
+
protected _side: Side;
|
|
2224
|
+
/**
|
|
2225
|
+
* 透明度
|
|
2226
|
+
* @remarks
|
|
2227
|
+
* 决定整体的透明度
|
|
2228
|
+
*/
|
|
2229
|
+
get opacity(): number;
|
|
2230
|
+
set opacity(value: number);
|
|
2231
|
+
/**
|
|
2232
|
+
* 有效透明度的取值范围
|
|
2233
|
+
* @remarks
|
|
2234
|
+
* 如果最终颜色的透明度小于或等于 alphaRange.x ,则被认为是完全透明
|
|
2235
|
+
* 如果最终颜色的透明度在于或等于 alphaRange.y ,则被认为是完全不透明
|
|
2236
|
+
* 取值范围应当在 0 - 1
|
|
2237
|
+
* @defaultValue {x:0,y:0.95}
|
|
2238
|
+
*/
|
|
2239
|
+
get alphaRange(): Vector2;
|
|
2240
|
+
set alphaRange(value: Vector2);
|
|
2241
|
+
/**
|
|
2242
|
+
* 是否开启雾化的效果
|
|
2243
|
+
* @remarks
|
|
2244
|
+
* 开启后的渲染效果会更像雾
|
|
2245
|
+
* @defaultValue true
|
|
2246
|
+
*/
|
|
2247
|
+
get atomize(): boolean;
|
|
2248
|
+
set atomize(value: boolean);
|
|
2249
|
+
/**
|
|
2250
|
+
* 体积材质渲染的采样数
|
|
2251
|
+
* @remarks
|
|
2252
|
+
* 采样数越高,占用的GPU资源就越大;所以该数据设置的适宜最好;
|
|
2253
|
+
* @defaultValue 100
|
|
2254
|
+
*/
|
|
2255
|
+
get steps(): number;
|
|
2256
|
+
set steps(value: number);
|
|
2257
|
+
/**
|
|
2258
|
+
* 颜色累积系数
|
|
2259
|
+
* @remarks
|
|
2260
|
+
* 它是对体积材质进行积分时使用的系数;只在开启雾化效果{@link VolumeMaterial.atomize}时才有效;
|
|
2261
|
+
* 值越小,最终呈现出的效果就越雾化;
|
|
2262
|
+
* @defaultValue 1
|
|
2263
|
+
*/
|
|
2264
|
+
get accFactor(): number;
|
|
2265
|
+
set accFactor(value: number);
|
|
2266
|
+
/**
|
|
2267
|
+
* 将材质空间下的坐标转为 map 空间下的坐标
|
|
2268
|
+
* @param coord - 材质空间下的坐标
|
|
2269
|
+
* @returns
|
|
2270
|
+
*/
|
|
2271
|
+
toMapPosition(coord: IVector3): Vector3;
|
|
2272
|
+
/**
|
|
2273
|
+
* 将材质空间下的深度转为 map 空间下的深度
|
|
2274
|
+
* @param axis - map坐标系下的坐标轴
|
|
2275
|
+
* @param depth - 材质空间下的深度
|
|
2276
|
+
* @returns
|
|
2277
|
+
*/
|
|
2278
|
+
toMapDepth(axis: Axis, depth: number): number;
|
|
2279
|
+
/**
|
|
2280
|
+
* 获取3D数据的切片
|
|
2281
|
+
* @remarks
|
|
2282
|
+
* 切片就是指定轴的指定位置的垂直截面
|
|
2283
|
+
* @param axis - map坐标系下的坐标轴
|
|
2284
|
+
* @param depth - 材质空间下,在轴方向的坐标值
|
|
2285
|
+
* @returns
|
|
2286
|
+
*/
|
|
2287
|
+
getData3DSlice(axis: Axis, depth: number): IData2D<number> | null;
|
|
2288
|
+
/**
|
|
2289
|
+
* 获取3D数据中指定坐标处的数据项目
|
|
2290
|
+
* @param coord
|
|
2291
|
+
* @returns
|
|
2292
|
+
*/
|
|
2293
|
+
getItem(coord: IVector3): number[] | null;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
/**
|
|
2297
|
+
* 体积材质的选项
|
|
2298
|
+
*/
|
|
2299
|
+
export declare interface VolumeMaterialOptions<Data3M extends Data3DTexture = Data3DTexture> extends Omit<ShaderMaterialParameters, "map" | "opacity"> {
|
|
2300
|
+
/**
|
|
2301
|
+
* 三维的纹理
|
|
2302
|
+
*/
|
|
2303
|
+
map?: Data3M | null;
|
|
2304
|
+
/**
|
|
2305
|
+
* 渲染体积材质的容器的最小点
|
|
2306
|
+
* @remarks
|
|
2307
|
+
* 容器的最小点和最大点一般是被设置成 geometry 的AABB包围盒;但也可以不是
|
|
2308
|
+
* 总之,体积材质的渲染依托于 geometry 的形状,它不会超出 geometry 的尺寸;
|
|
2309
|
+
* 但可以控制容器的最小点和最大点来控制体积材质的渲染尺寸;
|
|
2310
|
+
* @defaultValue {x:0,y:0,z:0}
|
|
2311
|
+
*/
|
|
2312
|
+
containerMin?: IVector3 | null;
|
|
2313
|
+
/**
|
|
2314
|
+
* 渲染体积材质的容器的最大点
|
|
2315
|
+
* @remarks
|
|
2316
|
+
* 容器的最小点和最大点一般是被设置成 geometry 的AABB包围盒;但也可以不是
|
|
2317
|
+
* 总之,体积材质的渲染依托于 geometry 的形状,它不会超出 geometry 的尺寸;
|
|
2318
|
+
* 但可以控制容器的最小点和最大点来控制体积材质的渲染尺寸;
|
|
2319
|
+
* @defaultValue map尺寸中的最大点
|
|
2320
|
+
*/
|
|
2321
|
+
containerMax?: IVector3 | null;
|
|
2322
|
+
/**
|
|
2323
|
+
* 体积材质在容器内的填充模式
|
|
2324
|
+
* @defaultValue VolumeFit.Fill
|
|
2325
|
+
*/
|
|
2326
|
+
fit?: VolumeFit | null;
|
|
2327
|
+
/**
|
|
2328
|
+
* Mesh三角形的渲染面
|
|
2329
|
+
* @remarks
|
|
2330
|
+
* 可设置为前面、后面、或者两面都渲染
|
|
2331
|
+
* 如果只渲染前面,进入体积材质内部,体积材质就会消失
|
|
2332
|
+
* 如果只渲染后面,体积初遮挡,就会消失
|
|
2333
|
+
* 如果两面都渲染,则会隐藏看到容器的面
|
|
2334
|
+
*/
|
|
2335
|
+
side?: Side | undefined;
|
|
2336
|
+
/**
|
|
2337
|
+
* 透明度
|
|
2338
|
+
* @remarks
|
|
2339
|
+
* 决定整体的透明度
|
|
2340
|
+
* @defaultValue 1
|
|
2341
|
+
*/
|
|
2342
|
+
opacity?: number | null;
|
|
2343
|
+
/**
|
|
2344
|
+
* 有效透明度的取值范围
|
|
2345
|
+
* @remarks
|
|
2346
|
+
* 如果最终颜色的透明度小于或等于 alphaRange.x ,则被认为是完全透明
|
|
2347
|
+
* 如果最终颜色的透明度在于或等于 alphaRange.y ,则被认为是完全不透明
|
|
2348
|
+
* 取值范围应当在 0 - 1
|
|
2349
|
+
* @defaultValue {x:0,y:0.95}
|
|
2350
|
+
*/
|
|
2351
|
+
alphaRange?: IVector2 | null;
|
|
2352
|
+
/**
|
|
2353
|
+
* 是否开启雾化的效果
|
|
2354
|
+
* @remarks
|
|
2355
|
+
* 开启后的渲染效果会更像雾
|
|
2356
|
+
* @defaultValue true
|
|
2357
|
+
*/
|
|
2358
|
+
atomize?: boolean | null;
|
|
2359
|
+
/**
|
|
2360
|
+
* 体积材质渲染的采样数
|
|
2361
|
+
* @remarks
|
|
2362
|
+
* 采样数越高,占用的GPU资源就越大;所以该数据设置的适宜最好;
|
|
2363
|
+
* @defaultValue 100
|
|
2364
|
+
*/
|
|
2365
|
+
steps?: number | null;
|
|
2366
|
+
/**
|
|
2367
|
+
* 颜色累积系数
|
|
2368
|
+
* @remarks
|
|
2369
|
+
* 它是对体积材质进行积分时使用的系数;只在开启雾化效果{@link VolumeMaterial.atomize}时才有效;
|
|
2370
|
+
* 值越小,最终呈现出的效果就越雾化;
|
|
2371
|
+
* @defaultValue 1
|
|
2372
|
+
*/
|
|
2373
|
+
accFactor?: number | null;
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* 体积材质的 Uniforms 类型
|
|
2378
|
+
*/
|
|
2379
|
+
export declare interface VolumeMaterialUniforms<Data3M extends Texture3D = Data3DTexture> {
|
|
2380
|
+
map: IUniform<Data3M | null>;
|
|
2381
|
+
containerMin: IUniform<Vector3>;
|
|
2382
|
+
containerMax: IUniform<Vector3>;
|
|
2383
|
+
fit: IUniform<VolumeFit>;
|
|
2384
|
+
opacity: IUniform<number>;
|
|
2385
|
+
alphaRange: IUniform<Vector2>;
|
|
2386
|
+
atomize: IUniform<boolean>;
|
|
2387
|
+
steps: IUniform<number>;
|
|
2388
|
+
accFactor: IUniform<number>;
|
|
2389
|
+
isDoubleSide: IUniform<boolean>;
|
|
2390
|
+
|
|
2391
|
+
[uniform: string]: IUniform<unknown>;
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* 体积Mesh
|
|
2396
|
+
* @remarks
|
|
2397
|
+
* 专用用于体积材质;
|
|
2398
|
+
*
|
|
2399
|
+
* 体积材质也可以用于普通的 Mesh;但如果使用 VolumeMesh ,则可以减少很多体积材质 和 geometry 同步操作;
|
|
2400
|
+
*/
|
|
2401
|
+
export declare class VolumeMesh extends Mesh {
|
|
2402
|
+
readonly isVolumeMesh = true;
|
|
2403
|
+
constructor(material: VolumeMaterial);
|
|
2404
|
+
protected _geometry: BufferGeometry;
|
|
2405
|
+
/**
|
|
2406
|
+
* 是否自动更新材质
|
|
2407
|
+
* @remarks
|
|
2408
|
+
* 当启动该选项后,在 VolumeMesh 监测到 geometry 变更时,会自动更新体积材质的相关选项,以适应新的 geometry
|
|
2409
|
+
* @defaultValue true
|
|
2410
|
+
*/
|
|
2411
|
+
autoUpdateMaterial: boolean;
|
|
2412
|
+
material: VolumeMaterial;
|
|
2413
|
+
protected _material: VolumeMaterial;
|
|
2414
|
+
/**
|
|
2415
|
+
* 是否自动更新几何体
|
|
2416
|
+
* @remarks
|
|
2417
|
+
* 当启动该选项后,在 VolumeMesh 监测到 material 变更时,会自动更新 geometry 的相关选项,以适应新的 体积材质
|
|
2418
|
+
* @defaultValue true
|
|
2419
|
+
*/
|
|
2420
|
+
autoUpdateGeometry: boolean;
|
|
2421
|
+
/**
|
|
2422
|
+
* 更新材质
|
|
2423
|
+
* @remarks
|
|
2424
|
+
* 更新体积材质的相关选项以使其匹配 geometry
|
|
2425
|
+
*/
|
|
2426
|
+
updateMaterial(): false | undefined;
|
|
2427
|
+
/**
|
|
2428
|
+
* 更新几何体
|
|
2429
|
+
* @remarks
|
|
2430
|
+
* 更新 geometry 的相关选项以使其匹配体积材质
|
|
2431
|
+
*/
|
|
2432
|
+
updateGeometry(): false | undefined;
|
|
2433
|
+
/**
|
|
2434
|
+
* 自动规范化
|
|
2435
|
+
* @remarks
|
|
2436
|
+
* 开启该选项,设置新的 geometry 时,对 geometry 自动执行规范化操作
|
|
2437
|
+
*/
|
|
2438
|
+
autoNormalize: boolean;
|
|
2439
|
+
/**
|
|
2440
|
+
* 规范化
|
|
2441
|
+
* @remarks
|
|
2442
|
+
* 将 geometry 的原点移动到包围盒的最小点处
|
|
2443
|
+
*/
|
|
2444
|
+
normalize(): void;
|
|
2445
|
+
/**
|
|
2446
|
+
* 将材质空间下的坐标转为 map 空间下的坐标
|
|
2447
|
+
* @param coord - 材质空间下的坐标
|
|
2448
|
+
* @returns
|
|
2449
|
+
*/
|
|
2450
|
+
toMapPosition(coord: IVector3): Vector3;
|
|
2451
|
+
/**
|
|
2452
|
+
* 将世界坐标系下的深度转为 material 空间下的深度
|
|
2453
|
+
* @param axis - 材质空间下的坐标轴
|
|
2454
|
+
* @param depth - 深度
|
|
2455
|
+
* @returns
|
|
2456
|
+
*/
|
|
2457
|
+
toMaterialDepth(axis: Axis, depth: number): number;
|
|
2458
|
+
/**
|
|
2459
|
+
* 将世界坐标系下的深度转为 map 空间下的深度
|
|
2460
|
+
* @param axis - map空间下的坐标轴
|
|
2461
|
+
* @param depth - 深度
|
|
2462
|
+
* @returns
|
|
2463
|
+
*/
|
|
2464
|
+
toMapDepth(axis: Axis, depth: number): number;
|
|
2465
|
+
/**
|
|
2466
|
+
* 获取3D数据的切片
|
|
2467
|
+
* @remarks
|
|
2468
|
+
* 切片就是指定轴的指定位置的垂直截面;
|
|
2469
|
+
* 轴和深度都是局部坐标系下的
|
|
2470
|
+
* @param axis - map空间下的坐标轴
|
|
2471
|
+
* @param depth - 世界空间下在轴方向上的坐标值
|
|
2472
|
+
* @returns
|
|
2473
|
+
*/
|
|
2474
|
+
getData3DSlice(axis: Axis, depth: number): IData2D<number> | null;
|
|
2475
|
+
/**
|
|
2476
|
+
* 获取3D数据中指定坐标处的数据项目
|
|
2477
|
+
* @param coord - 世界坐标系下的坐标
|
|
2478
|
+
* @returns
|
|
2479
|
+
*/
|
|
2480
|
+
getItem(coord: IVector3): number[] | null;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* 体积渲染样式
|
|
2485
|
+
*/
|
|
2486
|
+
export declare enum VolumeRenderStyle {
|
|
2487
|
+
/**
|
|
2488
|
+
* 密度投影
|
|
2489
|
+
* @remarks
|
|
2490
|
+
* 会显示出几何体的外面
|
|
2491
|
+
*/
|
|
2492
|
+
MIP = 0,
|
|
2493
|
+
/**
|
|
2494
|
+
* 标准的样式
|
|
2495
|
+
*/
|
|
2496
|
+
ISO = 1
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
export { }
|