@thatopen/components 2.3.0-alpha.5 → 2.3.0-alpha.7
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/core/Clipper/index.d.ts +12 -2
- package/dist/core/Clipper/src/clipper-config.d.ts +33 -0
- package/dist/core/ConfigManager/index.d.ts +21 -0
- package/dist/core/ConfigManager/src/configurator.d.ts +10 -0
- package/dist/core/ConfigManager/src/index.d.ts +1 -0
- package/dist/core/Cullers/index.d.ts +2 -4
- package/dist/core/Cullers/src/culler-renderer-config.d.ts +74 -0
- package/dist/core/Cullers/src/culler-renderer.d.ts +26 -41
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +8 -14
- package/dist/core/Grids/index.d.ts +1 -5
- package/dist/core/Grids/src/index.d.ts +1 -0
- package/dist/core/Grids/src/simple-grid-config.d.ts +46 -0
- package/dist/core/Grids/src/simple-grid.d.ts +13 -24
- package/dist/core/Types/src/{config-manager.d.ts → config-types.d.ts} +8 -16
- package/dist/core/Types/src/index.d.ts +1 -1
- package/dist/core/Viewpoints/index.d.ts +3 -3
- package/dist/core/Viewpoints/src/viewpoints-config.d.ts +4 -9
- package/dist/core/Worlds/src/simple-scene-config.d.ts +4 -37
- package/dist/core/Worlds/src/simple-scene.d.ts +3 -2
- package/dist/core/index.d.ts +1 -0
- package/dist/fragments/IfcGeometryTiler/index.d.ts +3 -0
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +4 -0
- package/dist/index.cjs +29 -29
- package/dist/index.mjs +3255 -2851
- package/dist/namespace.d.ts +2979 -2921
- package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +3 -62
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
2
|
+
import { Component, Configurable, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
3
3
|
import { SimplePlane } from "./src";
|
|
4
4
|
import { Components } from "../Components";
|
|
5
|
+
import { ClipperConfig, ClipperConfigManager } from "./src/clipper-config";
|
|
5
6
|
export * from "./src";
|
|
6
7
|
/**
|
|
7
8
|
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
@@ -9,12 +10,14 @@ export * from "./src";
|
|
|
9
10
|
* @param components - the instance of {@link Components} used.
|
|
10
11
|
* E.g. {@link SimplePlane}.
|
|
11
12
|
*/
|
|
12
|
-
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
13
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable, Configurable<ClipperConfigManager, ClipperConfig> {
|
|
13
14
|
/**
|
|
14
15
|
* A unique identifier for the component.
|
|
15
16
|
* This UUID is used to register the component within the Components system.
|
|
16
17
|
*/
|
|
17
18
|
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
19
|
+
/** {@link Configurable.onSetup} */
|
|
20
|
+
readonly onSetup: Event<unknown>;
|
|
18
21
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
19
22
|
readonly onBeforeDrag: Event<void>;
|
|
20
23
|
/** Event that fires when the user stops dragging a clipping plane. */
|
|
@@ -47,6 +50,8 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
47
50
|
readonly onAfterDelete: Event<SimplePlane>;
|
|
48
51
|
/** {@link Disposable.onDisposed} */
|
|
49
52
|
readonly onDisposed: Event<string>;
|
|
53
|
+
/** {@link Configurable.isSetup} */
|
|
54
|
+
isSetup: boolean;
|
|
50
55
|
/**
|
|
51
56
|
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
52
57
|
* (up). This is desirable when clipping a building horizontally and a
|
|
@@ -69,6 +74,9 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
69
74
|
* A list of all the clipping planes created by this component.
|
|
70
75
|
*/
|
|
71
76
|
list: SimplePlane[];
|
|
77
|
+
/** {@link Configurable.config} */
|
|
78
|
+
config: ClipperConfigManager;
|
|
79
|
+
protected _defaultConfig: ClipperConfig;
|
|
72
80
|
/** The material used in all the clipping planes. */
|
|
73
81
|
private _material;
|
|
74
82
|
private _size;
|
|
@@ -119,6 +127,8 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
119
127
|
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
120
128
|
*/
|
|
121
129
|
deleteAll(types?: Set<string>): void;
|
|
130
|
+
/** {@link Configurable.setup} */
|
|
131
|
+
setup(config?: Partial<ClipperConfig>): void;
|
|
122
132
|
private deletePlane;
|
|
123
133
|
private pickPlane;
|
|
124
134
|
private getAllPlaneMeshes;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
|
|
3
|
+
import { Configurator } from "../../ConfigManager";
|
|
4
|
+
import { Clipper } from "../index";
|
|
5
|
+
type ClipperConfigType = {
|
|
6
|
+
enabled: BooleanSettingsControl;
|
|
7
|
+
visible: BooleanSettingsControl;
|
|
8
|
+
color: ColorSettingsControl;
|
|
9
|
+
opacity: NumberSettingControl;
|
|
10
|
+
size: NumberSettingControl;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Configuration interface for the {@link Clipper}.
|
|
14
|
+
*/
|
|
15
|
+
export interface ClipperConfig {
|
|
16
|
+
color: THREE.Color;
|
|
17
|
+
opacity: number;
|
|
18
|
+
size: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class ClipperConfigManager extends Configurator<Clipper, ClipperConfigType> {
|
|
21
|
+
protected _config: ClipperConfigType;
|
|
22
|
+
get enabled(): boolean;
|
|
23
|
+
set enabled(value: boolean);
|
|
24
|
+
get visible(): boolean;
|
|
25
|
+
set visible(value: boolean);
|
|
26
|
+
get color(): THREE.Color;
|
|
27
|
+
set color(value: THREE.Color);
|
|
28
|
+
get opacity(): number;
|
|
29
|
+
set opacity(value: number);
|
|
30
|
+
get size(): number;
|
|
31
|
+
set size(value: number);
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, DataSet } from "../Types";
|
|
2
|
+
import { Components } from "../Components";
|
|
3
|
+
import { Configurator } from "./src";
|
|
4
|
+
export * from "./src";
|
|
5
|
+
/**
|
|
6
|
+
* A tool to manage all the configuration from the app centrally.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ConfigManager extends Component {
|
|
9
|
+
/**
|
|
10
|
+
* The list of all configurations of this app.
|
|
11
|
+
*/
|
|
12
|
+
list: DataSet<Configurator<any, any>>;
|
|
13
|
+
/** {@link Component.enabled} */
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* A unique identifier for the component.
|
|
17
|
+
* This UUID is used to register the component within the Components system.
|
|
18
|
+
*/
|
|
19
|
+
static readonly uuid: "b8c764e0-6b24-4e77-9a32-35fa728ee5b4";
|
|
20
|
+
constructor(components: Components);
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ControlsSchema, ControlEntry } from "../../Types";
|
|
2
|
+
import { Components } from "../../Components";
|
|
3
|
+
export declare abstract class Configurator<T, U extends ControlsSchema> {
|
|
4
|
+
protected abstract _config: U;
|
|
5
|
+
protected _component: T;
|
|
6
|
+
name: string;
|
|
7
|
+
get controls(): U;
|
|
8
|
+
constructor(component: T, components: Components, name: string);
|
|
9
|
+
copyEntry(controlEntry: ControlEntry): ControlEntry;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./configurator";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { Components } from "../Components";
|
|
3
|
-
import { MeshCullerRenderer
|
|
3
|
+
import { MeshCullerRenderer } from "./src";
|
|
4
4
|
import { Component, Event, Disposable, World } from "../Types";
|
|
5
5
|
export * from "./src";
|
|
6
6
|
/**
|
|
@@ -31,11 +31,10 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
31
31
|
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
32
32
|
*
|
|
33
33
|
* @param world - The world for which to create the MeshCullerRenderer.
|
|
34
|
-
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
35
34
|
*
|
|
36
35
|
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
37
36
|
*/
|
|
38
|
-
create(world: World
|
|
37
|
+
create(world: World): MeshCullerRenderer;
|
|
39
38
|
/**
|
|
40
39
|
* Deletes the MeshCullerRenderer associated with the given world.
|
|
41
40
|
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
@@ -52,7 +51,6 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
52
51
|
*
|
|
53
52
|
* @param meshes - The meshes to update.
|
|
54
53
|
*
|
|
55
|
-
* @returns {void}
|
|
56
54
|
*/
|
|
57
55
|
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
58
56
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BooleanSettingsControl, NumberSettingControl } from "../../Types";
|
|
2
|
+
import { Configurator } from "../../ConfigManager";
|
|
3
|
+
import { CullerRenderer } from "../index";
|
|
4
|
+
type CullerRendererConfigType = {
|
|
5
|
+
enabled: BooleanSettingsControl;
|
|
6
|
+
width: NumberSettingControl;
|
|
7
|
+
height: NumberSettingControl;
|
|
8
|
+
updateInterval: NumberSettingControl;
|
|
9
|
+
autoUpdate: BooleanSettingsControl;
|
|
10
|
+
renderDebugFrame: BooleanSettingsControl;
|
|
11
|
+
threshold: NumberSettingControl;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Configuration interface for the {@link CullerRenderer}.
|
|
15
|
+
*/
|
|
16
|
+
export interface CullerRendererConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the culler renderer should make renders or not.
|
|
19
|
+
*/
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Width of the render target used for visibility checks.
|
|
23
|
+
*/
|
|
24
|
+
width: number;
|
|
25
|
+
/**
|
|
26
|
+
* Height of the render target used for visibility checks.
|
|
27
|
+
* Default value is 512.
|
|
28
|
+
*/
|
|
29
|
+
height: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the visibility check should be performed automatically.
|
|
32
|
+
* Default value is true.
|
|
33
|
+
*/
|
|
34
|
+
autoUpdate: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
37
|
+
*/
|
|
38
|
+
updateInterval: number;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to render the frame use to debug the culler behavior.
|
|
41
|
+
*/
|
|
42
|
+
renderDebugFrame: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
45
|
+
* Default value is 100.
|
|
46
|
+
*/
|
|
47
|
+
threshold: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Settings to configure the CullerRenderer.
|
|
51
|
+
*/
|
|
52
|
+
export declare class CullerRendererConfigManager extends Configurator<CullerRenderer, CullerRendererConfigType> {
|
|
53
|
+
protected _config: CullerRendererConfigType;
|
|
54
|
+
private _interval;
|
|
55
|
+
get enabled(): boolean;
|
|
56
|
+
set enabled(value: boolean);
|
|
57
|
+
get width(): number;
|
|
58
|
+
set width(value: number);
|
|
59
|
+
get height(): number;
|
|
60
|
+
set height(value: number);
|
|
61
|
+
get autoUpdate(): boolean;
|
|
62
|
+
set autoUpdate(value: boolean);
|
|
63
|
+
get updateInterval(): number;
|
|
64
|
+
set updateInterval(value: number);
|
|
65
|
+
get renderDebugFrame(): boolean;
|
|
66
|
+
set renderDebugFrame(value: boolean);
|
|
67
|
+
get threshold(): number;
|
|
68
|
+
set threshold(value: number);
|
|
69
|
+
setWidthHeight(width: number, height: number): void;
|
|
70
|
+
setAutoAndInterval(auto: boolean, interval: number): void;
|
|
71
|
+
private resetRenderTarget;
|
|
72
|
+
private resetInterval;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -1,35 +1,13 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { Components } from "../../Components";
|
|
3
|
-
import { AsyncEvent, Event, World } from "../../Types";
|
|
4
|
-
|
|
5
|
-
* Settings to configure the CullerRenderer.
|
|
6
|
-
*/
|
|
7
|
-
export interface CullerRendererSettings {
|
|
8
|
-
/**
|
|
9
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
10
|
-
* Default value is 1000.
|
|
11
|
-
*/
|
|
12
|
-
updateInterval?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Width of the render target used for visibility checks.
|
|
15
|
-
* Default value is 512.
|
|
16
|
-
*/
|
|
17
|
-
width?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Height of the render target used for visibility checks.
|
|
20
|
-
* Default value is 512.
|
|
21
|
-
*/
|
|
22
|
-
height?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Whether the visibility check should be performed automatically.
|
|
25
|
-
* Default value is true.
|
|
26
|
-
*/
|
|
27
|
-
autoUpdate?: boolean;
|
|
28
|
-
}
|
|
3
|
+
import { AsyncEvent, Configurable, Event, World } from "../../Types";
|
|
4
|
+
import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
|
|
29
5
|
/**
|
|
30
6
|
* A base renderer to determine visibility on screen.
|
|
31
7
|
*/
|
|
32
|
-
export declare class CullerRenderer {
|
|
8
|
+
export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
|
|
9
|
+
/** {@link Configurable.onSetup} */
|
|
10
|
+
readonly onSetup: Event<unknown>;
|
|
33
11
|
/** {@link Disposable.onDisposed} */
|
|
34
12
|
readonly onDisposed: Event<string>;
|
|
35
13
|
/**
|
|
@@ -47,29 +25,36 @@ export declare class CullerRenderer {
|
|
|
47
25
|
* You can bind this to the camera movement, to a certain interval, etc.
|
|
48
26
|
*/
|
|
49
27
|
needsUpdate: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
52
|
-
* for debugging purposes.
|
|
53
|
-
*/
|
|
54
|
-
renderDebugFrame: boolean;
|
|
55
28
|
/** The components instance to which this renderer belongs. */
|
|
56
29
|
components: Components;
|
|
30
|
+
/** The render target used to render the visibility scene. */
|
|
31
|
+
renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
|
|
32
|
+
/**
|
|
33
|
+
* The size of the buffer where the result of the visibility check is stored.
|
|
34
|
+
*/
|
|
35
|
+
bufferSize: number;
|
|
36
|
+
/**
|
|
37
|
+
* The buffer when the result of the visibility check is stored.
|
|
38
|
+
*/
|
|
39
|
+
buffer: Uint8Array;
|
|
40
|
+
/**
|
|
41
|
+
* Flag to indicate if the renderer shouldn't update the visibility.
|
|
42
|
+
*/
|
|
43
|
+
preventUpdate: boolean;
|
|
44
|
+
/** {@link Configurable.config} */
|
|
45
|
+
config: CullerRendererConfigManager;
|
|
46
|
+
/** {@link Configurable.isSetup} */
|
|
47
|
+
isSetup: boolean;
|
|
57
48
|
/** The world instance to which this renderer belongs. */
|
|
58
49
|
readonly world: World;
|
|
59
50
|
/** The THREE.js renderer used to make the visibility test. */
|
|
60
51
|
readonly renderer: THREE.WebGLRenderer;
|
|
61
|
-
protected
|
|
62
|
-
protected updateInterval: number;
|
|
52
|
+
protected _defaultConfig: CullerRendererConfig;
|
|
63
53
|
protected readonly worker: Worker;
|
|
64
54
|
protected readonly scene: THREE.Scene;
|
|
65
|
-
private _width;
|
|
66
|
-
private _height;
|
|
67
55
|
private _availableColor;
|
|
68
|
-
private readonly renderTarget;
|
|
69
|
-
private readonly bufferSize;
|
|
70
|
-
private readonly _buffer;
|
|
71
56
|
protected _isWorkerBusy: boolean;
|
|
72
|
-
constructor(components: Components, world: World
|
|
57
|
+
constructor(components: Components, world: World);
|
|
73
58
|
/** {@link Disposable.dispose} */
|
|
74
59
|
dispose(): void;
|
|
75
60
|
/**
|
|
@@ -79,6 +64,7 @@ export declare class CullerRenderer {
|
|
|
79
64
|
* not true.
|
|
80
65
|
*/
|
|
81
66
|
updateVisibility: (force?: boolean) => Promise<void>;
|
|
67
|
+
setup(config?: Partial<CullerRendererConfig>): void;
|
|
82
68
|
protected getAvailableColor(): {
|
|
83
69
|
r: number;
|
|
84
70
|
g: number;
|
|
@@ -87,5 +73,4 @@ export declare class CullerRenderer {
|
|
|
87
73
|
};
|
|
88
74
|
protected increaseColor(): void;
|
|
89
75
|
protected decreaseColor(): void;
|
|
90
|
-
private applySettings;
|
|
91
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { CullerRenderer
|
|
2
|
+
import { CullerRenderer } from "./culler-renderer";
|
|
3
3
|
import { Components } from "../../Components";
|
|
4
4
|
import { Event, World, Disposable } from "../../Types";
|
|
5
5
|
/**
|
|
@@ -14,42 +14,36 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
14
14
|
seen: Set<THREE.Mesh>;
|
|
15
15
|
unseen: Set<THREE.Mesh>;
|
|
16
16
|
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
19
|
-
* Default value is 100.
|
|
20
|
-
*/
|
|
21
|
-
threshold: number;
|
|
22
17
|
/**
|
|
23
18
|
* Map of color code to THREE.InstancedMesh.
|
|
24
19
|
* Used to keep track of color-coded meshes.
|
|
25
20
|
*/
|
|
26
21
|
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
27
22
|
/**
|
|
28
|
-
*
|
|
29
|
-
|
|
23
|
+
* @deprecated use config.threshold instead.
|
|
24
|
+
*/
|
|
25
|
+
get threshold(): number;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated use config.threshold instead.
|
|
30
28
|
*/
|
|
31
|
-
|
|
32
|
-
private _interval;
|
|
29
|
+
set threshold(value: number);
|
|
33
30
|
private _colorCodeMeshMap;
|
|
34
31
|
private _meshIDColorCodeMap;
|
|
35
32
|
private _currentVisibleMeshes;
|
|
36
33
|
private _recentlyHiddenMeshes;
|
|
37
|
-
private _intervalID;
|
|
38
34
|
private readonly _transparentMat;
|
|
39
|
-
constructor(components: Components, world: World
|
|
35
|
+
constructor(components: Components, world: World);
|
|
40
36
|
/** {@link Disposable.dispose} */
|
|
41
37
|
dispose(): void;
|
|
42
38
|
/**
|
|
43
39
|
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
44
40
|
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
45
|
-
* @returns {void}
|
|
46
41
|
*/
|
|
47
42
|
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
48
43
|
/**
|
|
49
44
|
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
50
45
|
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
51
46
|
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
52
|
-
* @returns {void}
|
|
53
47
|
*/
|
|
54
48
|
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
55
49
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Disposable, World, Event } from "../Types";
|
|
2
|
-
import {
|
|
2
|
+
import { SimpleGrid } from "./src";
|
|
3
3
|
import { Components } from "../Components";
|
|
4
4
|
export * from "./src";
|
|
5
5
|
/**
|
|
@@ -15,10 +15,6 @@ export declare class Grids extends Component implements Disposable {
|
|
|
15
15
|
* A map of world UUIDs to their corresponding grid instances.
|
|
16
16
|
*/
|
|
17
17
|
list: Map<string, SimpleGrid>;
|
|
18
|
-
/**
|
|
19
|
-
* The default configuration for grid creation.
|
|
20
|
-
*/
|
|
21
|
-
config: Required<GridConfig>;
|
|
22
18
|
/** {@link Disposable.onDisposed} */
|
|
23
19
|
readonly onDisposed: Event<unknown>;
|
|
24
20
|
/** {@link Component.enabled} */
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
|
|
3
|
+
import { Configurator } from "../../ConfigManager";
|
|
4
|
+
import { SimpleGrid } from "./simple-grid";
|
|
5
|
+
type SimpleGridConfigType = {
|
|
6
|
+
visible: BooleanSettingsControl;
|
|
7
|
+
color: ColorSettingsControl;
|
|
8
|
+
primarySize: NumberSettingControl;
|
|
9
|
+
secondarySize: NumberSettingControl;
|
|
10
|
+
distance: NumberSettingControl;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Configuration interface for the {@link SimpleGrid}.
|
|
14
|
+
*/
|
|
15
|
+
export interface SimpleGridConfig {
|
|
16
|
+
/**
|
|
17
|
+
* The color of the grid lines.
|
|
18
|
+
*/
|
|
19
|
+
color: THREE.Color;
|
|
20
|
+
/**
|
|
21
|
+
* The size of the primary grid lines.
|
|
22
|
+
*/
|
|
23
|
+
primarySize: number;
|
|
24
|
+
/**
|
|
25
|
+
* The size of the secondary grid lines.
|
|
26
|
+
*/
|
|
27
|
+
secondarySize: number;
|
|
28
|
+
/**
|
|
29
|
+
* The distance at which the grid lines start to fade away.
|
|
30
|
+
*/
|
|
31
|
+
distance: number;
|
|
32
|
+
}
|
|
33
|
+
export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
|
|
34
|
+
protected _config: SimpleGridConfigType;
|
|
35
|
+
get visible(): boolean;
|
|
36
|
+
set visible(value: boolean);
|
|
37
|
+
get color(): THREE.Color;
|
|
38
|
+
set color(value: THREE.Color);
|
|
39
|
+
get primarySize(): number;
|
|
40
|
+
set primarySize(value: number);
|
|
41
|
+
get secondarySize(): number;
|
|
42
|
+
set secondarySize(value: number);
|
|
43
|
+
get distance(): number;
|
|
44
|
+
set distance(value: number);
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -1,37 +1,24 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2
|
+
import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
|
|
3
3
|
import { Components } from "../../Components";
|
|
4
|
-
|
|
5
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
6
|
-
*/
|
|
7
|
-
export interface GridConfig {
|
|
8
|
-
/**
|
|
9
|
-
* The color of the grid lines.
|
|
10
|
-
*/
|
|
11
|
-
color: THREE.Color;
|
|
12
|
-
/**
|
|
13
|
-
* The size of the primary grid lines.
|
|
14
|
-
*/
|
|
15
|
-
size1: number;
|
|
16
|
-
/**
|
|
17
|
-
* The size of the secondary grid lines.
|
|
18
|
-
*/
|
|
19
|
-
size2: number;
|
|
20
|
-
/**
|
|
21
|
-
* The distance at which the grid lines start to fade away.
|
|
22
|
-
*/
|
|
23
|
-
distance: number;
|
|
24
|
-
}
|
|
4
|
+
import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
|
|
25
5
|
/**
|
|
26
6
|
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
27
7
|
*/
|
|
28
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
8
|
+
export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
|
|
29
9
|
/** {@link Disposable.onDisposed} */
|
|
30
10
|
readonly onDisposed: Event<unknown>;
|
|
11
|
+
/** {@link Configurable.onSetup} */
|
|
12
|
+
readonly onSetup: Event<unknown>;
|
|
13
|
+
/** {@link Configurable.isSetup} */
|
|
14
|
+
isSetup: boolean;
|
|
31
15
|
/** The world instance to which this Raycaster belongs. */
|
|
32
16
|
world: World;
|
|
33
17
|
/** The components instance to which this grid belongs. */
|
|
34
18
|
components: Components;
|
|
19
|
+
/** {@link Configurable.config} */
|
|
20
|
+
config: SimpleGridConfigManager;
|
|
21
|
+
protected _defaultConfig: SimpleGridConfig;
|
|
35
22
|
/** {@link Hideable.visible} */
|
|
36
23
|
get visible(): boolean;
|
|
37
24
|
/** {@link Hideable.visible} */
|
|
@@ -51,7 +38,9 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
51
38
|
/** The Three.js mesh that contains the infinite grid. */
|
|
52
39
|
readonly three: THREE.Mesh;
|
|
53
40
|
private _fade;
|
|
54
|
-
constructor(components: Components, world: World
|
|
41
|
+
constructor(components: Components, world: World);
|
|
42
|
+
/** {@link Configurable.setup} */
|
|
43
|
+
setup(config?: Partial<SimpleGridConfig>): void;
|
|
55
44
|
/** {@link Disposable.dispose} */
|
|
56
45
|
dispose(): void;
|
|
57
46
|
private setupEvents;
|
|
@@ -5,7 +5,6 @@ export interface BooleanSettingsControl {
|
|
|
5
5
|
}
|
|
6
6
|
export interface ColorSettingsControl {
|
|
7
7
|
type: "Color";
|
|
8
|
-
opacity: number;
|
|
9
8
|
value: THREE.Color;
|
|
10
9
|
}
|
|
11
10
|
export interface TextSettingsControl {
|
|
@@ -21,30 +20,23 @@ export interface NumberSettingControl {
|
|
|
21
20
|
}
|
|
22
21
|
export interface SelectSettingControl {
|
|
23
22
|
type: "Select";
|
|
23
|
+
multiple: boolean;
|
|
24
24
|
options: Set<string>;
|
|
25
25
|
value: string;
|
|
26
26
|
}
|
|
27
|
-
export interface MultiSelectSettingControl {
|
|
28
|
-
type: "MultiSelect";
|
|
29
|
-
options: Set<string>;
|
|
30
|
-
value: Set<string>;
|
|
31
|
-
}
|
|
32
27
|
export interface Vector3SettingControl {
|
|
33
|
-
type: "
|
|
28
|
+
type: "Vector3";
|
|
34
29
|
value: THREE.Vector3;
|
|
35
30
|
}
|
|
36
31
|
export interface TextSetSettingControl {
|
|
37
32
|
type: "TextSet";
|
|
38
33
|
value: Set<string>;
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
export interface NoControl {
|
|
36
|
+
type: "None";
|
|
37
|
+
value: any;
|
|
43
38
|
}
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
get controls(): any;
|
|
48
|
-
constructor(component: T);
|
|
39
|
+
export type ControlEntry = BooleanSettingsControl | ColorSettingsControl | TextSettingsControl | NumberSettingControl | SelectSettingControl | Vector3SettingControl | TextSetSettingControl | NoControl;
|
|
40
|
+
export interface ControlsSchema {
|
|
41
|
+
[name: string]: ControlEntry | ControlsSchema;
|
|
49
42
|
}
|
|
50
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
|
|
2
2
|
import { Components } from "../Components";
|
|
3
3
|
import { BCFViewpoint, Viewpoint } from "./src";
|
|
4
|
-
import {
|
|
4
|
+
import { ViewpointsConfigManager, ViewpointsConfig } from "./src/viewpoints-config";
|
|
5
5
|
export * from "./src";
|
|
6
|
-
export declare class Viewpoints extends Component implements Disposable, Configurable<
|
|
6
|
+
export declare class Viewpoints extends Component implements Disposable, Configurable<ViewpointsConfigManager, ViewpointsConfig> {
|
|
7
7
|
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
8
8
|
enabled: boolean;
|
|
9
9
|
/**
|
|
@@ -24,7 +24,7 @@ export declare class Viewpoints extends Component implements Disposable, Configu
|
|
|
24
24
|
isSetup: boolean;
|
|
25
25
|
setup(): void;
|
|
26
26
|
onSetup: Event<unknown>;
|
|
27
|
-
config:
|
|
27
|
+
config: ViewpointsConfigManager;
|
|
28
28
|
readonly onDisposed: Event<unknown>;
|
|
29
29
|
/**
|
|
30
30
|
* Disposes of the Viewpoints component and its associated resources.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BooleanSettingsControl
|
|
1
|
+
import { BooleanSettingsControl } from "../../Types";
|
|
2
2
|
import { Viewpoints } from "../index";
|
|
3
|
+
import { Configurator } from "../../ConfigManager";
|
|
3
4
|
/**
|
|
4
5
|
* Configuration interface for the Viewpoints general behavior.
|
|
5
6
|
*/
|
|
@@ -14,14 +15,8 @@ export interface ViewpointsConfig {
|
|
|
14
15
|
type ViewpointsConfigType = {
|
|
15
16
|
overwriteColors: BooleanSettingsControl;
|
|
16
17
|
};
|
|
17
|
-
export declare class
|
|
18
|
-
protected
|
|
19
|
-
overwriteColors: {
|
|
20
|
-
value: boolean;
|
|
21
|
-
opacity: number;
|
|
22
|
-
type: "Boolean";
|
|
23
|
-
};
|
|
24
|
-
};
|
|
18
|
+
export declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
|
|
19
|
+
protected _config: ViewpointsConfigType;
|
|
25
20
|
get overwriteColors(): boolean;
|
|
26
21
|
set overwriteColors(value: boolean);
|
|
27
22
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { SimpleScene } from "./simple-scene";
|
|
3
|
-
import { ColorSettingsControl,
|
|
3
|
+
import { ColorSettingsControl, NumberSettingControl, Vector3SettingControl } from "../../Types";
|
|
4
|
+
import { Configurator } from "../../ConfigManager";
|
|
4
5
|
type SimpleSceneConfigType = {
|
|
5
6
|
backgroundColor: ColorSettingsControl;
|
|
6
7
|
ambientLight: {
|
|
@@ -48,42 +49,8 @@ export interface SimpleSceneConfig {
|
|
|
48
49
|
intensity: number;
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
|
-
export declare class SimpleSceneConfigManager extends
|
|
52
|
-
protected
|
|
53
|
-
backgroundColor: {
|
|
54
|
-
value: THREE.Color;
|
|
55
|
-
opacity: number;
|
|
56
|
-
type: "Color";
|
|
57
|
-
};
|
|
58
|
-
ambientLight: {
|
|
59
|
-
color: {
|
|
60
|
-
type: "Color";
|
|
61
|
-
opacity: number;
|
|
62
|
-
value: THREE.Color;
|
|
63
|
-
};
|
|
64
|
-
intensity: {
|
|
65
|
-
type: "Number";
|
|
66
|
-
interpolable: boolean;
|
|
67
|
-
value: number;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
directionalLight: {
|
|
71
|
-
color: {
|
|
72
|
-
type: "Color";
|
|
73
|
-
opacity: number;
|
|
74
|
-
value: THREE.Color;
|
|
75
|
-
};
|
|
76
|
-
intensity: {
|
|
77
|
-
type: "Number";
|
|
78
|
-
interpolable: boolean;
|
|
79
|
-
value: number;
|
|
80
|
-
};
|
|
81
|
-
position: {
|
|
82
|
-
type: "Vector";
|
|
83
|
-
value: THREE.Vector3;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
};
|
|
52
|
+
export declare class SimpleSceneConfigManager extends Configurator<SimpleScene, SimpleSceneConfigType> {
|
|
53
|
+
protected _config: SimpleSceneConfigType;
|
|
87
54
|
ambientLight: AmbientLightConfig;
|
|
88
55
|
directionalLight: DirectionalLightConfig;
|
|
89
56
|
get backgroundColor(): THREE.Color;
|