vim-web 0.3.42 → 0.3.43
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/types/core-viewers/ultra/index.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/socketClient.d.ts +10 -3
- package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +2 -3
- package/dist/types/core-viewers/webgl/loader/materials/ghostMaterial.d.ts +16 -0
- package/dist/types/core-viewers/webgl/loader/materials/simpleMaterial.d.ts +10 -5
- package/dist/types/core-viewers/webgl/loader/materials/viewerMaterials.d.ts +9 -8
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +2 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +2 -1
- package/dist/types/core-viewers/webgl/loader/progressive/instancedMesh.d.ts +3 -1
- package/dist/types/core-viewers/webgl/loader/scene.d.ts +3 -2
- package/dist/types/core-viewers/webgl/viewer/environment/environment.d.ts +0 -6
- package/dist/types/core-viewers/webgl/viewer/rendering/renderScene.d.ts +8 -4
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +5 -9
- package/dist/types/core-viewers/webgl/viewer/selection.d.ts +1 -0
- package/dist/types/core-viewers/webgl/viewer/settings/viewerSettings.d.ts +4 -39
- package/dist/types/react-viewers/helpers/inputs.d.ts +1 -2
- package/dist/types/react-viewers/helpers/isolation.d.ts +91 -50
- package/dist/types/react-viewers/settings/settings.d.ts +3 -2
- package/dist/vim-web.iife.js +355 -556
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +361 -562
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/core-viewers/webgl/images.d.ts +0 -4
- package/dist/types/core-viewers/webgl/loader/materials/isolationMaterial.d.ts +0 -12
- package/dist/types/core-viewers/webgl/viewer/environment/groundPlane.d.ts +0 -25
|
@@ -5,5 +5,5 @@ export * from './viewer/vim';
|
|
|
5
5
|
export * from './utils/math3d';
|
|
6
6
|
export * from './viewer/color';
|
|
7
7
|
export type { ILoadRequest, VimRequestErrorType } from './viewer/loadRequest';
|
|
8
|
-
export type { ClientState } from './viewer/socketClient';
|
|
8
|
+
export type { ClientState, ConnectionSettings } from './viewer/socketClient';
|
|
9
9
|
export type { VimSource } from './viewer/rpcSafeClient';
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as Protocol from './protocol';
|
|
2
2
|
import { Marshal } from './marshal';
|
|
3
3
|
import { ILogger } from './logger';
|
|
4
|
+
export declare const DEFAULT_LOCAL_ULTRA_SERVER_URL = "ws://localhost:8123";
|
|
5
|
+
export type ConnectionSettings = {
|
|
6
|
+
url?: string;
|
|
7
|
+
retries?: number;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
retryDelay?: number;
|
|
10
|
+
};
|
|
4
11
|
export type ClientState = ClientStateConnecting | ClientStateConnected | ClientStateDisconnected | ClientStateValidating | ClientError;
|
|
5
12
|
export type ClientError = ClientStateCompatibilityError | ClientStateConnectionError | ClientStreamError;
|
|
6
13
|
export type ClientStateConnecting = {
|
|
@@ -61,6 +68,8 @@ export declare class SocketClient {
|
|
|
61
68
|
onVideoFrame: (msg: Protocol.VideoFrameMessage) => void;
|
|
62
69
|
private _state;
|
|
63
70
|
private _onStatusUpdate;
|
|
71
|
+
private _connectPromise;
|
|
72
|
+
private _connectionSettings;
|
|
64
73
|
/**
|
|
65
74
|
* Event that is triggered when the connection status updates.
|
|
66
75
|
* @returns An event dispatcher for connection status updates.
|
|
@@ -76,8 +85,6 @@ export declare class SocketClient {
|
|
|
76
85
|
* @param state - The new connection state.
|
|
77
86
|
*/
|
|
78
87
|
private updateState;
|
|
79
|
-
private _connectPromise;
|
|
80
|
-
private _connectingUrl;
|
|
81
88
|
/**
|
|
82
89
|
* Gets the URL to which the messenger is currently connecting or connected.
|
|
83
90
|
* @returns The WebSocket URL as a string, or undefined if not set.
|
|
@@ -94,7 +101,7 @@ export declare class SocketClient {
|
|
|
94
101
|
* @param url - The WebSocket URL to connect to.
|
|
95
102
|
* @returns A promise that resolves when the connection is established.
|
|
96
103
|
*/
|
|
97
|
-
connect(
|
|
104
|
+
connect(settings: ConnectionSettings): Promise<boolean>;
|
|
98
105
|
/**
|
|
99
106
|
* Disconnects from the current WebSocket server.
|
|
100
107
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IInputs } from './inputs/inputs';
|
|
2
|
-
import { ClientState } from './socketClient';
|
|
2
|
+
import { ClientState, ConnectionSettings } from './socketClient';
|
|
3
3
|
import { IDecoder } from './decoder';
|
|
4
4
|
import { Vim } from './vim';
|
|
5
5
|
import { ILoadRequest } from './loadRequest';
|
|
@@ -11,7 +11,6 @@ import { RpcSafeClient, VimSource } from './rpcSafeClient';
|
|
|
11
11
|
import { ISimpleEvent } from 'ste-simple-events';
|
|
12
12
|
import { IReadonlyVimCollection } from './vimCollection';
|
|
13
13
|
import { IRenderer } from './renderer';
|
|
14
|
-
export declare const DEFAULT_LOCAL_ULTRA_SERVER_URL = "ws://localhost:8123";
|
|
15
14
|
export declare const INVALID_HANDLE = 4294967295;
|
|
16
15
|
/**
|
|
17
16
|
* The main Viewer class responsible for managing VIM files,
|
|
@@ -97,7 +96,7 @@ export declare class Viewer {
|
|
|
97
96
|
* @param url - The server URL to connect to. Defaults to 'ws://localhost:8123'.
|
|
98
97
|
* @returns A promise that resolves when the connection is established.
|
|
99
98
|
*/
|
|
100
|
-
connect(
|
|
99
|
+
connect(settings?: ConnectionSettings): Promise<boolean>;
|
|
101
100
|
/**
|
|
102
101
|
* Disconnects from the current VIM Ultra server.
|
|
103
102
|
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vim-loader/materials
|
|
3
|
+
* This module provides materials for rendering specific visualization modes in VIM.
|
|
4
|
+
*/
|
|
5
|
+
import * as THREE from 'three';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a material for the ghost effect in isolation mode.
|
|
8
|
+
*
|
|
9
|
+
* - **Non-visible items**: Rendered as transparent objects using a customizable fill color.
|
|
10
|
+
* - **Visible items**: Completely excluded from rendering.
|
|
11
|
+
* - Designed for use with instanced or merged meshes.
|
|
12
|
+
* - Includes clipping plane support, vertex colors, and transparency.
|
|
13
|
+
*
|
|
14
|
+
* @returns {THREE.ShaderMaterial} A custom shader material for the ghost effect.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createGhostMaterial(): THREE.ShaderMaterial;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module vim-loader/materials
|
|
3
|
+
* This module provides custom materials for visualizing and isolating objects in VIM.
|
|
3
4
|
*/
|
|
4
5
|
import * as THREE from 'three';
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Creates a material for isolation mode.
|
|
8
|
+
*
|
|
9
|
+
* - **Non-visible items**: Completely excluded from rendering by pushing them out of view.
|
|
10
|
+
* - **Visible items**: Rendered with flat shading and basic pseudo-lighting.
|
|
11
|
+
* - **Object coloring**: Supports both instance-based and vertex-based coloring for visible objects.
|
|
12
|
+
*
|
|
13
|
+
* This material is optimized for both instanced and merged meshes, with support for clipping planes.
|
|
14
|
+
*
|
|
15
|
+
* @returns {THREE.ShaderMaterial} A custom shader material for isolation mode.
|
|
11
16
|
*/
|
|
12
17
|
export declare function createSimpleMaterial(): THREE.ShaderMaterial;
|
|
@@ -7,6 +7,7 @@ import { OutlineMaterial } from './outlineMaterial';
|
|
|
7
7
|
import { ViewerSettings } from '../../viewer/settings/viewerSettings';
|
|
8
8
|
import { MergeMaterial } from './mergeMaterial';
|
|
9
9
|
import { SkyboxMaterial } from './skyboxMaterial';
|
|
10
|
+
export type ModelMaterial = THREE.Material | THREE.Material[] | undefined;
|
|
10
11
|
/**
|
|
11
12
|
* Defines the materials to be used by the vim loader and allows for material injection.
|
|
12
13
|
*/
|
|
@@ -33,7 +34,7 @@ export declare class ViewerMaterials {
|
|
|
33
34
|
/**
|
|
34
35
|
* Material used to show traces of hidden objects.
|
|
35
36
|
*/
|
|
36
|
-
readonly
|
|
37
|
+
readonly ghost: THREE.Material;
|
|
37
38
|
/**
|
|
38
39
|
* Material used to filter out what is not selected for selection outline effect.
|
|
39
40
|
*/
|
|
@@ -57,7 +58,7 @@ export declare class ViewerMaterials {
|
|
|
57
58
|
private _focusIntensity;
|
|
58
59
|
private _focusColor;
|
|
59
60
|
private _onUpdate;
|
|
60
|
-
constructor(opaque?: StandardMaterial, transparent?: StandardMaterial, simple?: THREE.Material, wireframe?: THREE.LineBasicMaterial,
|
|
61
|
+
constructor(opaque?: StandardMaterial, transparent?: StandardMaterial, simple?: THREE.Material, wireframe?: THREE.LineBasicMaterial, ghost?: THREE.Material, mask?: THREE.ShaderMaterial, outline?: OutlineMaterial, merge?: MergeMaterial, skyBox?: SkyboxMaterial);
|
|
61
62
|
/**
|
|
62
63
|
* Updates material settings based on the provided configuration.
|
|
63
64
|
* @param {ViewerSettings} settings - The settings to apply to the materials.
|
|
@@ -73,15 +74,15 @@ export declare class ViewerMaterials {
|
|
|
73
74
|
get modelColor(): THREE.Color;
|
|
74
75
|
set modelColor(color: THREE.Color);
|
|
75
76
|
/**
|
|
76
|
-
* Determines the opacity of the
|
|
77
|
+
* Determines the opacity of the ghost material.
|
|
77
78
|
*/
|
|
78
|
-
get
|
|
79
|
-
set
|
|
79
|
+
get ghostOpacity(): number;
|
|
80
|
+
set ghostOpacity(opacity: number);
|
|
80
81
|
/**
|
|
81
|
-
* Determines the color of the
|
|
82
|
+
* Determines the color of the ghost material.
|
|
82
83
|
*/
|
|
83
|
-
get
|
|
84
|
-
set
|
|
84
|
+
get ghostColor(): THREE.Color;
|
|
85
|
+
set ghostColor(color: THREE.Color);
|
|
85
86
|
/**
|
|
86
87
|
* Determines the color intensity of the highlight effect on mouse hover.
|
|
87
88
|
*/
|
|
@@ -5,6 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { InsertableSubmesh } from './progressive/insertableSubmesh';
|
|
6
6
|
import { Vim } from './vim';
|
|
7
7
|
import { InstancedSubmesh } from './progressive/instancedSubmesh';
|
|
8
|
+
import { ModelMaterial } from './materials/viewerMaterials';
|
|
8
9
|
/**
|
|
9
10
|
* Wrapper around THREE.Mesh
|
|
10
11
|
* Keeps track of what VIM instances are part of this mesh.
|
|
@@ -53,7 +54,7 @@ export declare class Mesh {
|
|
|
53
54
|
/**
|
|
54
55
|
* Overrides mesh material, set to undefine to restore initial material.
|
|
55
56
|
*/
|
|
56
|
-
setMaterial(value:
|
|
57
|
+
setMaterial(value: ModelMaterial): void;
|
|
57
58
|
/**
|
|
58
59
|
* Returns submesh for given index.
|
|
59
60
|
*/
|
|
@@ -7,6 +7,7 @@ import { InsertableGeometry } from './insertableGeometry';
|
|
|
7
7
|
import { InsertableSubmesh } from './insertableSubmesh';
|
|
8
8
|
import { G3dMeshOffsets } from './g3dOffsets';
|
|
9
9
|
import { Vim } from '../vim';
|
|
10
|
+
import { ModelMaterial } from '../materials/viewerMaterials';
|
|
10
11
|
export declare class InsertableMesh {
|
|
11
12
|
offsets: G3dMeshOffsets;
|
|
12
13
|
mesh: THREE.Mesh;
|
|
@@ -55,5 +56,5 @@ export declare class InsertableMesh {
|
|
|
55
56
|
/**
|
|
56
57
|
* Overrides mesh material, set to undefine to restore initial material.
|
|
57
58
|
*/
|
|
58
|
-
setMaterial(value:
|
|
59
|
+
setMaterial(value: ModelMaterial): void;
|
|
59
60
|
}
|
|
@@ -5,6 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { Vim } from '../vim';
|
|
6
6
|
import { InstancedSubmesh } from './instancedSubmesh';
|
|
7
7
|
import { G3d, G3dMesh } from 'vim-format';
|
|
8
|
+
import { ModelMaterial } from '../materials/viewerMaterials';
|
|
8
9
|
export declare class InstancedMesh {
|
|
9
10
|
g3dMesh: G3dMesh | G3d;
|
|
10
11
|
vim: Vim;
|
|
@@ -15,6 +16,7 @@ export declare class InstancedMesh {
|
|
|
15
16
|
boxes: THREE.Box3[];
|
|
16
17
|
ignoreSceneMaterial: boolean;
|
|
17
18
|
private _material;
|
|
19
|
+
readonly size: number;
|
|
18
20
|
constructor(g3d: G3dMesh | G3d, mesh: THREE.InstancedMesh, instances: Array<number>);
|
|
19
21
|
get merged(): boolean;
|
|
20
22
|
/**
|
|
@@ -25,7 +27,7 @@ export declare class InstancedMesh {
|
|
|
25
27
|
* Returns all submeshes for given index.
|
|
26
28
|
*/
|
|
27
29
|
getSubmeshes(): InstancedSubmesh[];
|
|
28
|
-
setMaterial(value:
|
|
30
|
+
setMaterial(value: ModelMaterial): void;
|
|
29
31
|
private computeBoundingBoxes;
|
|
30
32
|
private importBoundingBoxes;
|
|
31
33
|
computeBoundingBox(boxes: THREE.Box3[]): THREE.Box3;
|
|
@@ -6,6 +6,7 @@ import { Mesh, Submesh } from './mesh';
|
|
|
6
6
|
import { Vim } from './vim';
|
|
7
7
|
import { InsertableMesh } from './progressive/insertableMesh';
|
|
8
8
|
import { InstancedMesh } from './progressive/instancedMesh';
|
|
9
|
+
import { ModelMaterial } from './materials/viewerMaterials';
|
|
9
10
|
/**
|
|
10
11
|
* Interface for a renderer object, providing methods to add and remove objects from a scene, update bounding boxes, and notify scene updates.
|
|
11
12
|
*/
|
|
@@ -76,11 +77,11 @@ export declare class Scene {
|
|
|
76
77
|
/**
|
|
77
78
|
* Gets the current material override or undefined if none.
|
|
78
79
|
*/
|
|
79
|
-
get material():
|
|
80
|
+
get material(): ModelMaterial;
|
|
80
81
|
/**
|
|
81
82
|
* Sets and apply a material override to the scene, set to undefined to remove override.
|
|
82
83
|
*/
|
|
83
|
-
set material(value:
|
|
84
|
+
set material(value: ModelMaterial);
|
|
84
85
|
/**
|
|
85
86
|
* Unloads and disposes all meshes and leaves the scene ready to add new ones.
|
|
86
87
|
*/
|
|
@@ -5,7 +5,6 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { ViewerSettings } from '../settings/viewerSettings';
|
|
6
6
|
import { ICamera } from '../camera/camera';
|
|
7
7
|
import { ViewerMaterials } from '../../loader/materials/viewerMaterials';
|
|
8
|
-
import { GroundPlane } from './groundPlane';
|
|
9
8
|
import { Skybox } from './skybox';
|
|
10
9
|
import { Renderer } from '../rendering/renderer';
|
|
11
10
|
import { CameraLight } from './cameraLight';
|
|
@@ -23,10 +22,6 @@ export declare class Environment {
|
|
|
23
22
|
* The array of directional lights in the scene.
|
|
24
23
|
*/
|
|
25
24
|
readonly sunLights: ReadonlyArray<CameraLight>;
|
|
26
|
-
/**
|
|
27
|
-
* The ground plane under the model in the scene.
|
|
28
|
-
*/
|
|
29
|
-
readonly groundPlane: GroundPlane;
|
|
30
25
|
readonly skybox: Skybox;
|
|
31
26
|
constructor(camera: ICamera, renderer: Renderer, viewerMaterials: ViewerMaterials, settings: ViewerSettings);
|
|
32
27
|
/**
|
|
@@ -36,7 +31,6 @@ export declare class Environment {
|
|
|
36
31
|
private createSkyLight;
|
|
37
32
|
private createSunLights;
|
|
38
33
|
private addObjectsToRenderer;
|
|
39
|
-
private setupRendererListeners;
|
|
40
34
|
/**
|
|
41
35
|
* Dispose of all resources.
|
|
42
36
|
*/
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { Scene } from '../../loader/scene';
|
|
6
|
+
import { ModelMaterial } from '../../loader/materials/viewerMaterials';
|
|
7
|
+
import { InstancedMesh } from '../../loader/progressive/instancedMesh';
|
|
6
8
|
/**
|
|
7
9
|
* Wrapper around the THREE scene that tracks bounding box and other information.
|
|
8
10
|
*/
|
|
9
11
|
export declare class RenderScene {
|
|
10
12
|
scene: THREE.Scene;
|
|
11
13
|
boxUpdated: boolean;
|
|
14
|
+
smallGhostThreshold: number | undefined;
|
|
12
15
|
private _vimScenes;
|
|
13
16
|
private _boundingBox;
|
|
14
17
|
private _memory;
|
|
15
18
|
private _2dCount;
|
|
16
|
-
private
|
|
17
|
-
get
|
|
19
|
+
private _modelMaterial;
|
|
20
|
+
get meshes(): (import("../..").InsertableMesh | import("../../loader/mesh").Mesh | InstancedMesh)[];
|
|
18
21
|
constructor();
|
|
19
22
|
get estimatedMemory(): number;
|
|
20
23
|
has2dObjects(): boolean;
|
|
@@ -45,8 +48,9 @@ export declare class RenderScene {
|
|
|
45
48
|
* Removes all rendered objects
|
|
46
49
|
*/
|
|
47
50
|
clear(): void;
|
|
48
|
-
get
|
|
49
|
-
set
|
|
51
|
+
get modelMaterial(): ModelMaterial;
|
|
52
|
+
set modelMaterial(material: ModelMaterial);
|
|
53
|
+
private updateInstanceMeshVisibility;
|
|
50
54
|
private addScene;
|
|
51
55
|
updateBox(box: THREE.Box3 | undefined): void;
|
|
52
56
|
private removeScene;
|
|
@@ -5,7 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { IRenderer, Scene } from '../../loader/scene';
|
|
6
6
|
import { Viewport } from '../viewport';
|
|
7
7
|
import { RenderScene } from './renderScene';
|
|
8
|
-
import { ViewerMaterials } from '../../loader/materials/viewerMaterials';
|
|
8
|
+
import { ModelMaterial, ViewerMaterials } from '../../loader/materials/viewerMaterials';
|
|
9
9
|
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
10
10
|
import { Camera } from '../camera/camera';
|
|
11
11
|
import { RenderingSection } from './renderingSection';
|
|
@@ -36,7 +36,6 @@ export declare class Renderer implements IRenderer {
|
|
|
36
36
|
private _composer;
|
|
37
37
|
private _materials;
|
|
38
38
|
private _renderText;
|
|
39
|
-
private _skipAntialias;
|
|
40
39
|
private _needsUpdate;
|
|
41
40
|
private _onSceneUpdate;
|
|
42
41
|
private _onBoxUpdated;
|
|
@@ -52,13 +51,6 @@ export declare class Renderer implements IRenderer {
|
|
|
52
51
|
*/
|
|
53
52
|
get needsUpdate(): boolean;
|
|
54
53
|
set needsUpdate(value: boolean);
|
|
55
|
-
/**
|
|
56
|
-
* Indicates whether the next render should skip antialiasing.
|
|
57
|
-
* Useful for expensive operations such as the section box.
|
|
58
|
-
* Can only be set to true. Cleared on each render.
|
|
59
|
-
*/
|
|
60
|
-
get skipAntialias(): boolean;
|
|
61
|
-
set skipAntialias(value: boolean);
|
|
62
54
|
constructor(scene: RenderScene, viewport: Viewport, materials: ViewerMaterials, camera: Camera, settings: ViewerSettings);
|
|
63
55
|
/**
|
|
64
56
|
* Removes all objects from rendering and disposes the WebGL context.
|
|
@@ -69,6 +61,8 @@ export declare class Renderer implements IRenderer {
|
|
|
69
61
|
*/
|
|
70
62
|
get background(): THREE.Color | THREE.Texture;
|
|
71
63
|
set background(color: THREE.Color | THREE.Texture);
|
|
64
|
+
get modelMaterial(): ModelMaterial;
|
|
65
|
+
set modelMaterial(material: ModelMaterial);
|
|
72
66
|
/**
|
|
73
67
|
* Signal dispatched at the end of each frame if the scene was updated, such as visibility changes.
|
|
74
68
|
*/
|
|
@@ -82,6 +76,8 @@ export declare class Renderer implements IRenderer {
|
|
|
82
76
|
*/
|
|
83
77
|
get textEnabled(): boolean;
|
|
84
78
|
set textEnabled(value: boolean);
|
|
79
|
+
get smallGhostThreshold(): number;
|
|
80
|
+
set smallGhostThreshold(value: number);
|
|
85
81
|
/**
|
|
86
82
|
* Returns the bounding box encompassing all rendered objects.
|
|
87
83
|
* @param target - Box in which to copy the result. A new instance is created if undefined.
|
|
@@ -51,6 +51,7 @@ export declare class Selection {
|
|
|
51
51
|
* or `null`, `undefined`, or an empty array to clear the selection.
|
|
52
52
|
*/
|
|
53
53
|
select(object: SelectableObject | SelectableObject[] | undefined): void;
|
|
54
|
+
any(): boolean;
|
|
54
55
|
/**
|
|
55
56
|
* Returns true if the given object is currently selected.
|
|
56
57
|
* @param {IObject} object The object to check for selection.
|
|
@@ -165,41 +165,6 @@ export type ViewerSettings = {
|
|
|
165
165
|
*/
|
|
166
166
|
sharpness: number;
|
|
167
167
|
};
|
|
168
|
-
/**
|
|
169
|
-
* Ground plane under the scene options.
|
|
170
|
-
*/
|
|
171
|
-
groundPlane: {
|
|
172
|
-
/**
|
|
173
|
-
* Enables/Disables plane under scene
|
|
174
|
-
* Default: true
|
|
175
|
-
*/
|
|
176
|
-
visible: boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Controls how the texture will be retrieved using the texture field.
|
|
179
|
-
* Default: base64
|
|
180
|
-
*/
|
|
181
|
-
encoding: TextureEncoding;
|
|
182
|
-
/**
|
|
183
|
-
* Local or remote texture url for plane
|
|
184
|
-
* Default: Vim halo ground provided with the viewer.
|
|
185
|
-
*/
|
|
186
|
-
texture: string;
|
|
187
|
-
/**
|
|
188
|
-
* Opacity of the plane
|
|
189
|
-
* Default: 1
|
|
190
|
-
*/
|
|
191
|
-
opacity: number;
|
|
192
|
-
/**
|
|
193
|
-
* Color of the plane
|
|
194
|
-
* Default: THREE.Color(0xff, 0xff, 0xff)
|
|
195
|
-
*/
|
|
196
|
-
color: THREE.Color;
|
|
197
|
-
/**
|
|
198
|
-
* Size of the ground plane relative to the model
|
|
199
|
-
* Default: 5
|
|
200
|
-
*/
|
|
201
|
-
size: number;
|
|
202
|
-
};
|
|
203
168
|
/**
|
|
204
169
|
* Object highlight on click options
|
|
205
170
|
*/
|
|
@@ -226,16 +191,16 @@ export type ViewerSettings = {
|
|
|
226
191
|
opacity: number;
|
|
227
192
|
};
|
|
228
193
|
/**
|
|
229
|
-
*
|
|
194
|
+
* Ghost material options
|
|
230
195
|
*/
|
|
231
|
-
|
|
196
|
+
ghost: {
|
|
232
197
|
/**
|
|
233
|
-
*
|
|
198
|
+
* Ghost material color
|
|
234
199
|
* Default: rgb(78, 82, 92)
|
|
235
200
|
*/
|
|
236
201
|
color: THREE.Color;
|
|
237
202
|
/**
|
|
238
|
-
*
|
|
203
|
+
* Ghost material opacity
|
|
239
204
|
* Default: 0.08
|
|
240
205
|
*/
|
|
241
206
|
opacity: number;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
5
5
|
import { SideState } from '../sidePanel/sideState';
|
|
6
|
-
import { Isolation } from './isolation';
|
|
7
6
|
import { ComponentCamera } from './camera';
|
|
7
|
+
import { Isolation } from './isolation';
|
|
8
8
|
/**
|
|
9
9
|
* Custom viewer input scheme for the vim component
|
|
10
10
|
*/
|
|
@@ -14,7 +14,6 @@ export declare class ComponentInputs implements VIM.InputScheme {
|
|
|
14
14
|
private _default;
|
|
15
15
|
private _isolation;
|
|
16
16
|
private _sideState;
|
|
17
|
-
private _help;
|
|
18
17
|
constructor(viewer: VIM.Viewer, camera: ComponentCamera, isolation: Isolation, sideState: SideState);
|
|
19
18
|
private _getSelection;
|
|
20
19
|
onMainAction(hit: VIM.InputAction): void;
|
|
@@ -1,87 +1,128 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module viw-webgl-react
|
|
3
|
-
*/
|
|
4
1
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
5
2
|
import { ComponentSettings } from '../settings/settings';
|
|
6
3
|
import { ComponentCamera } from './camera';
|
|
4
|
+
import { ISimpleEvent } from 'ste-simple-events';
|
|
7
5
|
/**
|
|
8
|
-
* Manages the isolation mechanic in the
|
|
6
|
+
* Manages the isolation mechanic in the VIM component.
|
|
7
|
+
*
|
|
8
|
+
* **Isolation** determines which objects are visible (isolated) and which are
|
|
9
|
+
* hidden or displayed as ghosted. This class applies materials, updates object
|
|
10
|
+
* visibility, and ensures the camera view is adjusted when isolation changes.
|
|
9
11
|
*/
|
|
10
12
|
export declare class Isolation {
|
|
11
13
|
private _viewer;
|
|
12
14
|
private _settings;
|
|
13
15
|
private _isolation;
|
|
14
|
-
private _lastIsolation;
|
|
15
16
|
private _camera;
|
|
16
|
-
private _references;
|
|
17
17
|
private _onChanged;
|
|
18
|
-
/** Signal dispatched when the isolation set changes. */
|
|
19
|
-
get onChanged(): import("ste-simple-events").ISimpleEvent<string>;
|
|
20
|
-
constructor(viewer: VIM.Viewer, camera: ComponentCamera, settings: ComponentSettings);
|
|
21
|
-
/**
|
|
22
|
-
* Applies relevant settings to isolation.
|
|
23
|
-
* @param settings The settings to be applied to isolation.
|
|
24
|
-
*/
|
|
25
|
-
applySettings(settings: ComponentSettings): void;
|
|
26
18
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
19
|
+
* An event that is dispatched whenever the isolation set changes.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* This can be used by other parts of the application to react to isolation
|
|
23
|
+
* updates (for example, updating UI or triggering additional viewport actions).
|
|
24
|
+
*
|
|
25
|
+
* @returns {ISimpleEvent<string>} Event interface for subscribing to isolation changes.
|
|
30
26
|
*/
|
|
31
|
-
|
|
27
|
+
get onChanged(): ISimpleEvent<string>;
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
29
|
+
* Constructs an IsolationManager.
|
|
30
|
+
*
|
|
31
|
+
* @param viewer - The VIM Viewer responsible for managing the 3D scene and objects.
|
|
32
|
+
* @param camera - A component that handles camera control and framing.
|
|
33
|
+
* @param settings - The settings that control isolation and material usage.
|
|
36
34
|
*/
|
|
37
|
-
|
|
35
|
+
constructor(viewer: VIM.Viewer, camera: ComponentCamera, settings: ComponentSettings);
|
|
38
36
|
/**
|
|
39
|
-
*
|
|
37
|
+
* Applies relevant settings to the isolation behavior.
|
|
38
|
+
*
|
|
39
|
+
* @param settings - The new settings to apply.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* This updates the internal reference to settings and immediately sets
|
|
43
|
+
* the material based on whether isolation is currently active.
|
|
40
44
|
*/
|
|
41
|
-
|
|
45
|
+
applySettings(settings: ComponentSettings): void;
|
|
42
46
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
47
|
+
* Checks if isolation is currently active (i.e., any objects are isolated).
|
|
48
|
+
*
|
|
49
|
+
* @returns True if isolation is active; otherwise, false.
|
|
45
50
|
*/
|
|
46
|
-
|
|
51
|
+
isActive(): boolean;
|
|
47
52
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
53
|
+
* Retrieves the current array of isolated objects.
|
|
54
|
+
*
|
|
55
|
+
* @returns An array of isolated objects, or undefined if isolation is not active.
|
|
50
56
|
*/
|
|
51
|
-
current(): VIM.Object3D[];
|
|
57
|
+
current(): VIM.Object3D[] | undefined;
|
|
52
58
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @param
|
|
56
|
-
* @
|
|
59
|
+
* Sets the specified objects as isolated, hiding or ghosting the rest.
|
|
60
|
+
*
|
|
61
|
+
* @param objects - The objects to isolate.
|
|
62
|
+
* @param source - A label or identifier indicating the source of this action (e.g., "user").
|
|
57
63
|
*/
|
|
58
|
-
isolate(objects: VIM.Object3D[], source: string):
|
|
64
|
+
isolate(objects: VIM.Object3D[], source: string): void;
|
|
59
65
|
/**
|
|
60
|
-
* Toggles
|
|
61
|
-
*
|
|
66
|
+
* Toggles isolation by using the current selection.
|
|
67
|
+
*
|
|
68
|
+
* @param source - A label or identifier for the isolation action.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* This method replaces the current isolation set with whatever objects are
|
|
72
|
+
* currently selected. If selection is empty, it effectively clears isolation.
|
|
62
73
|
*/
|
|
63
|
-
|
|
74
|
+
toggle(source: string): void;
|
|
64
75
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @param
|
|
76
|
+
* Hides the specified objects from the isolation set.
|
|
77
|
+
*
|
|
78
|
+
* @param objects - The objects to hide.
|
|
79
|
+
* @param source - A label or identifier for the isolation action.
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* If there is no active isolation set (i.e., all objects are visible),
|
|
83
|
+
* the method first treats all objects in the scene as isolated,
|
|
84
|
+
* and then removes the specified objects. This ensures the specified
|
|
85
|
+
* objects become hidden.
|
|
68
86
|
*/
|
|
69
87
|
hide(objects: VIM.Object3D[], source: string): void;
|
|
70
88
|
/**
|
|
71
|
-
* Adds the
|
|
72
|
-
*
|
|
73
|
-
* @param
|
|
89
|
+
* Adds the specified objects to the current isolation set (making them visible).
|
|
90
|
+
*
|
|
91
|
+
* @param objects - The objects to show.
|
|
92
|
+
* @param source - A label or identifier for the isolation action.
|
|
74
93
|
*/
|
|
75
94
|
show(objects: VIM.Object3D[], source: string): void;
|
|
76
95
|
/**
|
|
77
|
-
* Clears the current isolation.
|
|
78
|
-
*
|
|
96
|
+
* Clears the current isolation set, making all objects visible.
|
|
97
|
+
*
|
|
98
|
+
* @param source - A label or identifier for the isolation action.
|
|
79
99
|
*/
|
|
80
100
|
clear(source: string): void;
|
|
81
101
|
/**
|
|
82
|
-
*
|
|
102
|
+
* Constructs the correct material (or array of materials) based on the given settings.
|
|
103
|
+
*
|
|
104
|
+
* @param settings - The current component settings, including isolation rules.
|
|
105
|
+
* @param isolate - Whether or not isolation is active.
|
|
106
|
+
* @returns The material(s) to assign to the renderer, or undefined if default materials should be used.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* - If isolation is active and `useGhostMaterial` is true, an array containing
|
|
110
|
+
* the simple and ghost materials is returned.
|
|
111
|
+
* - If fast materials are enabled, the simple material is returned.
|
|
112
|
+
* - Otherwise, defaults to undefined, allowing the system to pick a standard material.
|
|
113
|
+
*/
|
|
114
|
+
private getMaterial;
|
|
115
|
+
/**
|
|
116
|
+
* Applies the current isolation state: sets visibility for objects, updates materials,
|
|
117
|
+
* and dispatches the changed event.
|
|
118
|
+
*
|
|
119
|
+
* @param source - A label or identifier for the isolation action.
|
|
120
|
+
*/
|
|
121
|
+
private _apply;
|
|
122
|
+
/**
|
|
123
|
+
* Gathers all objects from all loaded VIM instances.
|
|
124
|
+
*
|
|
125
|
+
* @returns An array of all objects within the loaded VIM scenes.
|
|
83
126
|
*/
|
|
84
|
-
private
|
|
85
|
-
getMaterial(settings: ComponentSettings, isolate: boolean): import("three").Material;
|
|
86
|
-
private _isolate;
|
|
127
|
+
private getAllObjects;
|
|
87
128
|
}
|
|
@@ -32,12 +32,13 @@ export declare function isFalse(value: UserBoolean | boolean): value is false |
|
|
|
32
32
|
* @interface ComponentSettings
|
|
33
33
|
*/
|
|
34
34
|
export type ComponentSettings = {
|
|
35
|
-
|
|
35
|
+
materials: {
|
|
36
36
|
useFastMaterial: boolean;
|
|
37
|
+
useGhostMaterial: boolean;
|
|
38
|
+
smallGhostThreshold: number;
|
|
37
39
|
};
|
|
38
40
|
isolation: {
|
|
39
41
|
enable: boolean;
|
|
40
|
-
useIsolationMaterial: boolean;
|
|
41
42
|
};
|
|
42
43
|
capacity: {
|
|
43
44
|
canFollowUrl: boolean;
|