viral-viewer-2 6.7.4 → 6.7.5
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/LICENSE +7 -4
- package/README.md +0 -0
- package/dist/components/camera/viral-camera.d.ts +8 -3
- package/dist/components/compress/viral-compress.processor.d.ts +2 -1
- package/dist/components/custom-objects/viral-instanced-mesh.d.ts +6 -1
- package/dist/components/custom-objects/viral-main.model.d.ts +12 -0
- package/dist/components/custom-objects/viral-merged-mesh.d.ts +78 -8
- package/dist/components/custom-objects/viral-merged-model.d.ts +29 -2
- package/dist/components/custom-objects/viral-mesh.abstract.d.ts +3 -0
- package/dist/components/custom-objects/viral-mesh.d.ts +6 -1
- package/dist/components/custom-objects/{viral-model.d.ts → viral-seperate-model.d.ts} +5 -3
- package/dist/components/data-manager/viral-data-manager.d.ts +20 -4
- package/dist/components/event-handler/viral-centralized-event-handler.d.ts +4 -0
- package/dist/components/event-handler/viral-lifecycle-event-handler.d.ts +4 -3
- package/dist/components/handler/geometry.handler.d.ts +1 -0
- package/dist/components/loader/viral-revit.loader.d.ts +0 -1
- package/dist/components/material/viral-material-manager.d.ts +4 -6
- package/dist/components/post-processing/post-processing-renderer.d.ts +5 -0
- package/dist/components/renderer/viral-renderer.d.ts +2 -0
- package/dist/components/scene/viral-scene.d.ts +7 -5
- package/dist/components/section-box/viral-section-box.d.ts +32 -0
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +39 -0
- package/dist/components/worker/build-tree-node.worker.d.ts +12 -0
- package/dist/components/worker/load-element-standalone.worker.d.ts +7 -2
- package/dist/components/worker-script/build-tree-node.script.d.ts +1 -0
- package/dist/gui/draggable-modal/viral-draggable-modal.d.ts +1 -1
- package/dist/gui/navigation-cube/viral-navigation-cube.d.ts +0 -2
- package/dist/index.mjs +13148 -11913
- package/dist/types.d.ts +34 -2
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/threejs.d.ts +8 -1
- package/dist/viral-viewer-api.d.ts +3 -2
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
Viralution License
|
|
2
|
-
Copyright (c)
|
|
1
|
+
Viralution Viewer License
|
|
2
|
+
Copyright (c) 2025, Viralution
|
|
3
3
|
All rights reserved.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
NOTICE: NO RIGHTS GRANTED
|
|
6
|
+
|
|
7
|
+
No permission is granted to any individual, organization, or entity to use, copy, modify, sublicense, merge, publish, distribute, sell, or otherwise exploit this software in any form, in whole or in part.
|
|
6
8
|
|
|
7
9
|
THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
8
10
|
|
|
9
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
12
|
|
|
13
|
+
ANY VIOLATION OF THIS LICENSE MAY RESULT IN LEGAL ACTION.
|
package/README.md
CHANGED
|
Binary file
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import CameraControls from "camera-controls";
|
|
2
2
|
import { ViralCameraEventType, ViralViewerState } from "../../types";
|
|
3
3
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
4
|
-
import { Vector3, Raycaster, PerspectiveCamera, Object3D } from "three";
|
|
4
|
+
import { Vector3, Raycaster, PerspectiveCamera, Object3D, OrthographicCamera } from "three";
|
|
5
5
|
export declare class ViralCamera {
|
|
6
6
|
viralViewerApi: ViralViewerApi;
|
|
7
7
|
raycaster: Raycaster;
|
|
8
|
-
camera: PerspectiveCamera | null;
|
|
8
|
+
camera: PerspectiveCamera | OrthographicCamera | null;
|
|
9
|
+
private _orthoCamera;
|
|
10
|
+
private _perspectiveCamera;
|
|
11
|
+
private _frustumSize;
|
|
9
12
|
cameraControls: CameraControls | null;
|
|
10
13
|
targetElement: HTMLElement;
|
|
11
14
|
onUsing: boolean;
|
|
12
15
|
constructor(viralViewerApi: ViralViewerApi);
|
|
13
16
|
setupCamera(): void;
|
|
17
|
+
enablePerspectiveCamera(): void;
|
|
18
|
+
enableOrthographicCamera(): void;
|
|
14
19
|
/**
|
|
15
20
|
* resize canvas by resize div
|
|
16
21
|
*/
|
|
@@ -23,7 +28,7 @@ export declare class ViralCamera {
|
|
|
23
28
|
focusModelByName(objectName?: string): void;
|
|
24
29
|
getState(): ViralViewerState | null;
|
|
25
30
|
restoreState(state: ViralViewerState): void;
|
|
26
|
-
clientToWorld(): import("three").Intersection<Object3D<import("three").Object3DEventMap>>[] | null;
|
|
31
|
+
clientToWorld(items?: Object3D[]): import("three").Intersection<Object3D<import("three").Object3DEventMap>>[] | null;
|
|
27
32
|
worldToClient(point: Vector3): Vector3 | null;
|
|
28
33
|
worldToClient2(point: Vector3): Vector3 | null;
|
|
29
34
|
private castRay;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BufferGeometry, InstancedMesh, LineBasicMaterial, Material, Mesh } from "three";
|
|
2
2
|
import { Dictionary } from "../../types";
|
|
3
|
-
|
|
3
|
+
import { AbstractViralMesh } from "./viral-mesh.abstract";
|
|
4
|
+
export declare class ViralInstancedMesh extends InstancedMesh implements AbstractViralMesh {
|
|
4
5
|
private _originMesh;
|
|
5
6
|
private _isOrigin;
|
|
6
7
|
overrideHoverMeshes: Mesh<BufferGeometry, Material>[];
|
|
@@ -33,4 +34,8 @@ export declare class ViralInstancedMesh extends InstancedMesh {
|
|
|
33
34
|
private _edgeGroup;
|
|
34
35
|
enableEdge(material: LineBasicMaterial): void;
|
|
35
36
|
disableEdge(): void;
|
|
37
|
+
/**
|
|
38
|
+
* ! Disposes of the ViralMesh properly, when dispose we dont need to dispose material
|
|
39
|
+
*/
|
|
40
|
+
dispose(): void;
|
|
36
41
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dictionary, RenderMaterial, ViralutionElement } from "../..";
|
|
2
|
+
import { ViralSeperateModel } from "./viral-seperate-model";
|
|
3
|
+
/**
|
|
4
|
+
* this is a wrapper to manage whole BIM Model
|
|
5
|
+
*/
|
|
6
|
+
export declare class ViralMainModel {
|
|
7
|
+
modelId: number;
|
|
8
|
+
elements: ViralutionElement[];
|
|
9
|
+
materials: RenderMaterial[];
|
|
10
|
+
mapMaterialsToMaterialManager: Dictionary<number, number>;
|
|
11
|
+
seperateModel: ViralSeperateModel;
|
|
12
|
+
}
|
|
@@ -1,18 +1,88 @@
|
|
|
1
|
-
import { BufferGeometry, LineBasicMaterial, Material, Mesh } from "three";
|
|
1
|
+
import { BufferGeometry, Color, LineBasicMaterial, Material, Mesh, Vector3 } from "three";
|
|
2
2
|
import { BufferElement } from "../..";
|
|
3
3
|
export declare class ViralMergedMesh extends Mesh {
|
|
4
4
|
constructor(geometry?: BufferGeometry, material?: Material);
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* *for tracking and manage element visibility, for instance hide object
|
|
7
|
+
*/
|
|
8
|
+
_bufferElements: BufferElement[];
|
|
9
|
+
private _colors;
|
|
10
|
+
private _originalColor;
|
|
11
|
+
/**
|
|
12
|
+
* Stores mapping of model IDs to their element data.
|
|
13
|
+
*/
|
|
14
|
+
private _elementMap;
|
|
15
|
+
addBufferElements(bufferElements: BufferElement[], materialColor: Color): void;
|
|
16
|
+
rebuildGeometry(bufferElements: BufferElement[]): void;
|
|
17
|
+
getElements(elements: {
|
|
18
|
+
modelId: string;
|
|
19
|
+
elementId: string;
|
|
20
|
+
}[]): BufferElement[];
|
|
6
21
|
private _edgeLines;
|
|
7
22
|
enableEdge(material: LineBasicMaterial): void;
|
|
8
23
|
disableEdge(): void;
|
|
9
|
-
private
|
|
10
|
-
|
|
24
|
+
private _selectedElements;
|
|
25
|
+
select(elements: {
|
|
26
|
+
modelId: string;
|
|
27
|
+
elementId: string;
|
|
28
|
+
}[]): void;
|
|
29
|
+
private _hidingElements;
|
|
30
|
+
hide(elements?: {
|
|
31
|
+
modelId: string;
|
|
32
|
+
elementId: string;
|
|
33
|
+
}[]): void;
|
|
34
|
+
private _isolatingElements;
|
|
35
|
+
isolate(elements?: {
|
|
36
|
+
modelId: string;
|
|
37
|
+
elementId: string;
|
|
38
|
+
}[]): void;
|
|
11
39
|
reset(): void;
|
|
40
|
+
updateVisibility(bufferElements: BufferElement[]): void;
|
|
41
|
+
findElementByFaceIndex(faceIndex: number): {
|
|
42
|
+
modelId: string;
|
|
43
|
+
elementId: string;
|
|
44
|
+
} | null;
|
|
12
45
|
/**
|
|
13
|
-
*
|
|
46
|
+
*
|
|
47
|
+
* @param modelId
|
|
48
|
+
* @param elementId
|
|
49
|
+
* @param color
|
|
50
|
+
* @returns
|
|
14
51
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
52
|
+
changeColor(modelId: string, elementId: string, color: {
|
|
53
|
+
r: number;
|
|
54
|
+
g: number;
|
|
55
|
+
b: number;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Reset color of an element back to the original color
|
|
59
|
+
*/
|
|
60
|
+
resetColor(modelId: string, elementId: string): void;
|
|
61
|
+
assignUniqueFaceColors(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Assigns a random color to each element in the merged geometry.
|
|
64
|
+
*/
|
|
65
|
+
assignRandomColors(everyElementOneColor?: boolean): void;
|
|
66
|
+
/**
|
|
67
|
+
* Generates a completely random RGB color.
|
|
68
|
+
*/
|
|
69
|
+
private generateRandomColor;
|
|
70
|
+
/**
|
|
71
|
+
* Generates a unique color based on an index.
|
|
72
|
+
*/
|
|
73
|
+
private generateUniqueColor;
|
|
74
|
+
/**
|
|
75
|
+
* Converts HSL to RGB.
|
|
76
|
+
*/
|
|
77
|
+
private hslToRgb;
|
|
78
|
+
private _isGeneratedLights;
|
|
79
|
+
private _pointLight;
|
|
80
|
+
enableLights(): void;
|
|
81
|
+
disableLights(): void;
|
|
82
|
+
calculateCenter(buffer: Float32Array): Vector3 | null;
|
|
83
|
+
getFarthestDistance(centerPoint: Vector3, placePoints: Vector3[]): number;
|
|
84
|
+
/**
|
|
85
|
+
* ! Disposes of the ViralMergedMesh properly, when dispose we dont need to dispose material
|
|
86
|
+
*/
|
|
87
|
+
dispose(): void;
|
|
18
88
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LineBasicMaterial, Mesh } from "three";
|
|
1
|
+
import { Box3, LineBasicMaterial, Mesh } from "three";
|
|
2
2
|
import { ViralMergedMesh } from "./viral-merged-mesh";
|
|
3
|
+
import { BufferElement } from "../..";
|
|
3
4
|
/**
|
|
4
5
|
* this class is a wrapper, it stand for a clone of bim model (optimize version to increase performance when render)
|
|
5
6
|
* it merge geometries follow material.
|
|
@@ -7,13 +8,39 @@ import { ViralMergedMesh } from "./viral-merged-mesh";
|
|
|
7
8
|
*/
|
|
8
9
|
export declare class ViralMergedModel extends Mesh {
|
|
9
10
|
constructor();
|
|
11
|
+
get bounds(): Box3;
|
|
10
12
|
isReady: boolean;
|
|
11
13
|
setReady(value: boolean): void;
|
|
12
14
|
private _mergedMeshes;
|
|
13
15
|
addMergedMesh(mesh: ViralMergedMesh): void;
|
|
14
16
|
getMergedMeshes(): ViralMergedMesh[];
|
|
15
|
-
hide(
|
|
17
|
+
hide(elements?: {
|
|
18
|
+
modelId: string;
|
|
19
|
+
elementId: string;
|
|
20
|
+
}[]): void;
|
|
21
|
+
isolate(elements?: {
|
|
22
|
+
modelId: string;
|
|
23
|
+
elementId: string;
|
|
24
|
+
}[]): void;
|
|
25
|
+
select(elements: {
|
|
26
|
+
modelId: string;
|
|
27
|
+
elementId: string;
|
|
28
|
+
}[]): void;
|
|
29
|
+
getElements(elements: {
|
|
30
|
+
modelId: string;
|
|
31
|
+
elementId: string;
|
|
32
|
+
}[]): BufferElement[];
|
|
33
|
+
changeColor(modelId: string, elementId: string, color: {
|
|
34
|
+
r: number;
|
|
35
|
+
g: number;
|
|
36
|
+
b: number;
|
|
37
|
+
}): void;
|
|
16
38
|
reset(): void;
|
|
17
39
|
enableEdge(material: LineBasicMaterial): void;
|
|
18
40
|
disableEdge(): void;
|
|
41
|
+
/**
|
|
42
|
+
* *everytime add new model in scene this model will be regenerated again, for that reason we should dispose this model
|
|
43
|
+
* *then regenerate again
|
|
44
|
+
*/
|
|
45
|
+
dispose(): void;
|
|
19
46
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Box3, BufferGeometry, LineBasicMaterial, Material, Mesh } from "three";
|
|
2
|
-
|
|
2
|
+
import { AbstractViralMesh } from "./viral-mesh.abstract";
|
|
3
|
+
export declare class ViralMesh extends Mesh implements AbstractViralMesh {
|
|
3
4
|
constructor(geometry?: BufferGeometry, material?: Material);
|
|
4
5
|
get bounds(): Box3;
|
|
5
6
|
private _edgeLines;
|
|
6
7
|
enableEdge(material: LineBasicMaterial): void;
|
|
7
8
|
disableEdge(): void;
|
|
9
|
+
/**
|
|
10
|
+
* ! Disposes of the ViralMesh properly, when dispose we dont need to dispose material
|
|
11
|
+
*/
|
|
12
|
+
dispose(): void;
|
|
8
13
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { LineBasicMaterial, Mesh } from "three";
|
|
1
|
+
import { Box3, LineBasicMaterial, Mesh } from "three";
|
|
2
2
|
import { ViralMesh } from "./viral-mesh";
|
|
3
3
|
import { ViralInstancedMesh } from "./viral-instanced-mesh";
|
|
4
4
|
/**
|
|
5
|
-
* this class is a wrapper, it stand for a whole bim model
|
|
5
|
+
* *this class is a wrapper, it stand for a whole bim model
|
|
6
6
|
* we will manage through this class
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class ViralSeperateModel extends Mesh {
|
|
9
9
|
constructor();
|
|
10
|
+
get bounds(): Box3;
|
|
10
11
|
private _viralMeshes;
|
|
11
12
|
addViralMesh(mesh: ViralMesh): void;
|
|
12
13
|
private _viralInstancedMeshes;
|
|
13
14
|
addViralInstancedMesh(mesh: ViralInstancedMesh): void;
|
|
14
15
|
enableEdge(material: LineBasicMaterial): void;
|
|
15
16
|
disableEdge(): void;
|
|
17
|
+
dispose(): void;
|
|
16
18
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ViralViewerApi } from "../..";
|
|
1
|
+
import { DataTree, ViralViewerApi } from "../..";
|
|
2
2
|
export declare class ViralDataManager {
|
|
3
3
|
viralViewerApi: ViralViewerApi;
|
|
4
|
-
|
|
5
|
-
[key: number]: any;
|
|
6
|
-
};
|
|
4
|
+
dataTree: DataTree[];
|
|
7
5
|
private fetchDataWorker;
|
|
6
|
+
private buildTreeNodeWorker;
|
|
8
7
|
constructor(viralViewerApi: ViralViewerApi);
|
|
9
8
|
normalFetch(url: string, byteRangeStart?: number, byteRangeEnd?: number): Promise<Response>;
|
|
10
9
|
/**
|
|
@@ -15,4 +14,21 @@ export declare class ViralDataManager {
|
|
|
15
14
|
* @param byteRangeEnd
|
|
16
15
|
*/
|
|
17
16
|
workerFetch(url: string, callbackOnSuccess?: (response: ArrayBuffer) => void, byteRangeStart?: number, byteRangeEnd?: number): void;
|
|
17
|
+
addData(elementData: {
|
|
18
|
+
[key: number]: {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}): void;
|
|
24
|
+
getElementData(modelId: number, elementId: number): {
|
|
25
|
+
[key: string]: {
|
|
26
|
+
[key: string]: string;
|
|
27
|
+
};
|
|
28
|
+
} | null;
|
|
29
|
+
searchValue: string;
|
|
30
|
+
searchElementData(prefix?: string): {
|
|
31
|
+
modelId: string;
|
|
32
|
+
elementId: string;
|
|
33
|
+
}[];
|
|
18
34
|
}
|
|
@@ -16,8 +16,12 @@ export declare class ViralCentralizedEventHandler {
|
|
|
16
16
|
hoverElementHandler(): void;
|
|
17
17
|
enableHoverElement(value: boolean): void;
|
|
18
18
|
private _selectElementEnable;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated use selectElementHandler2 instead
|
|
21
|
+
*/
|
|
19
22
|
selectElementHandler(): void;
|
|
20
23
|
enableSelectElement(value: boolean): void;
|
|
24
|
+
selectElementHandler2(): void;
|
|
21
25
|
isShiftPressed: boolean;
|
|
22
26
|
keyboardHandler(): void;
|
|
23
27
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ViewerOptions } from "../../types";
|
|
2
|
-
import {
|
|
2
|
+
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
3
3
|
export declare class ViralLifecycleEventHandler {
|
|
4
|
-
private
|
|
4
|
+
private viralViewerApi;
|
|
5
5
|
options: ViewerOptions;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(viralViewerApi: ViralViewerApi, options: ViewerOptions);
|
|
7
7
|
private loadedScene;
|
|
8
8
|
private loadedMaterialManager;
|
|
9
9
|
private loadedRenderer;
|
|
10
10
|
private loadedCamera;
|
|
11
11
|
private loadedCube;
|
|
12
12
|
private loadedTools;
|
|
13
|
+
private loadedModels;
|
|
13
14
|
}
|
|
@@ -4,5 +4,6 @@ export declare class ViralGeometryHandler {
|
|
|
4
4
|
constructor(viralViewerApi: ViralViewerApi);
|
|
5
5
|
generateBuffer(indices: number[], vertices: ViralPoint[], transform?: RevitTransform | null): Float32Array;
|
|
6
6
|
mergeFloat32Arrays(buffers: Float32Array<ArrayBuffer>[]): Float32Array;
|
|
7
|
+
isGeneratingMergeModel: boolean;
|
|
7
8
|
generateMergeModel(): void;
|
|
8
9
|
}
|
|
@@ -2,7 +2,6 @@ import { RevitTransform, ViralPoint, ViralViewerRevitProject, ViralutionElement,
|
|
|
2
2
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
3
3
|
export declare class ViralRevitLoader {
|
|
4
4
|
viralViewerApi: ViralViewerApi;
|
|
5
|
-
rawData: any[];
|
|
6
5
|
elements: ViralutionElement[];
|
|
7
6
|
private _loadElementStandaloneWorker;
|
|
8
7
|
private _loadElementByMaterialWorker;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { LineBasicMaterial, Material, MeshPhongMaterial,
|
|
1
|
+
import { LineBasicMaterial, Material, MeshPhongMaterial, MeshStandardMaterial } from "three";
|
|
2
2
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
3
|
-
import { Dictionary } from "../../types";
|
|
4
3
|
export declare class ViralMaterialManager {
|
|
5
4
|
private viralViewerApi;
|
|
6
5
|
hoverMaterial: MeshPhongMaterial;
|
|
7
6
|
selectedMaterial: MeshPhongMaterial;
|
|
8
7
|
edgeMaterial: LineBasicMaterial;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
materials: Dictionary<number, Material>;
|
|
8
|
+
outlineMaterial: MeshStandardMaterial;
|
|
9
|
+
materials: Material[];
|
|
10
|
+
mergeMaterials: Material[];
|
|
13
11
|
private originalColors;
|
|
14
12
|
constructor(viralViewerApi: ViralViewerApi);
|
|
15
13
|
/**
|
|
@@ -4,6 +4,7 @@ import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass";
|
|
|
4
4
|
import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
5
5
|
import { SSAARenderPass, SSAOPass } from "three/examples/jsm/Addons";
|
|
6
6
|
import { ViralViewerApi } from "../..";
|
|
7
|
+
import { OutlinePass } from "three/examples/jsm/postprocessing/OutlinePass";
|
|
7
8
|
export declare class PostProcessingRenderer {
|
|
8
9
|
private renderer;
|
|
9
10
|
viralViewerApi: ViralViewerApi;
|
|
@@ -17,6 +18,7 @@ export declare class PostProcessingRenderer {
|
|
|
17
18
|
sobelPass: ShaderPass | null;
|
|
18
19
|
whitePass: ShaderPass | null;
|
|
19
20
|
shadowRemovalPass: ShaderPass | null;
|
|
21
|
+
outlinePass: OutlinePass | null;
|
|
20
22
|
n8aoPass: any;
|
|
21
23
|
constructor(renderer: WebGLRenderer, viralViewerApi: ViralViewerApi);
|
|
22
24
|
render(): void;
|
|
@@ -37,4 +39,7 @@ export declare class PostProcessingRenderer {
|
|
|
37
39
|
disableSobel(): void;
|
|
38
40
|
private _whiteShader;
|
|
39
41
|
initWhitePass(): void;
|
|
42
|
+
initOutlinePass(scene: Scene, camera: Camera): void;
|
|
43
|
+
enableOutline(): void;
|
|
44
|
+
disableOutline(): void;
|
|
40
45
|
}
|
|
@@ -7,6 +7,8 @@ export declare class ViralRenderer {
|
|
|
7
7
|
postProcessingRenderer: PostProcessingRenderer;
|
|
8
8
|
constructor(viralViewerApi: ViralViewerApi);
|
|
9
9
|
updateSize(width: number, height: number): void;
|
|
10
|
+
private renderTimeout;
|
|
10
11
|
render(): void;
|
|
12
|
+
private performRender;
|
|
11
13
|
screenshot(): string;
|
|
12
14
|
}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { Scene, DirectionalLight, Mesh, Object3D, Light, CameraHelper } from "three";
|
|
1
|
+
import { Scene, DirectionalLight, Mesh, Object3D, Light, CameraHelper, OrthographicCamera, PerspectiveCamera } from "three";
|
|
2
2
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
3
|
-
import { TransformControls } from "three/examples/jsm/controls/TransformControls";
|
|
4
3
|
import { ViralMergedModel } from "../custom-objects/viral-merged-model";
|
|
5
|
-
import {
|
|
4
|
+
import { ViralMainModel } from "../custom-objects/viral-main.model";
|
|
5
|
+
import { TransformControls } from "three/examples/jsm/controls/TransformControls";
|
|
6
6
|
export declare class ViralScene {
|
|
7
7
|
viralViewerApi: ViralViewerApi;
|
|
8
8
|
scene: Scene;
|
|
9
9
|
objects: Object3D[];
|
|
10
10
|
models: Object3D[];
|
|
11
|
-
|
|
11
|
+
mainModels: ViralMainModel[];
|
|
12
12
|
isolateModel: Mesh;
|
|
13
13
|
mergedModel: ViralMergedModel;
|
|
14
|
+
outlineModel: Mesh;
|
|
14
15
|
hideables: Object3D[];
|
|
15
16
|
selectables: Object3D[];
|
|
16
17
|
edges: Object3D[];
|
|
17
18
|
sunLight: DirectionalLight | null;
|
|
19
|
+
sunSphere: Mesh;
|
|
18
20
|
lights: Light[];
|
|
19
21
|
transformControls: TransformControls | null;
|
|
20
22
|
lightHelpers: CameraHelper[];
|
|
@@ -30,7 +32,7 @@ export declare class ViralScene {
|
|
|
30
32
|
getObjectByName(name: string): Object3D<import("three").Object3DEventMap> | undefined;
|
|
31
33
|
addLights(): void;
|
|
32
34
|
addPivotPoint(): void;
|
|
33
|
-
addTransformControls(): void;
|
|
35
|
+
addTransformControls(camera: PerspectiveCamera | OrthographicCamera): void;
|
|
34
36
|
addCube(): void;
|
|
35
37
|
addAxes(): void;
|
|
36
38
|
enableLightHelper(value: boolean): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Plane } from "three";
|
|
2
|
+
import { ViralViewerApi } from "../..";
|
|
3
|
+
export declare class ViralSectionBox {
|
|
4
|
+
viralViewerApi: ViralViewerApi;
|
|
5
|
+
private planeEdges;
|
|
6
|
+
constructor(viralViewerApi: ViralViewerApi);
|
|
7
|
+
private _isGenerated;
|
|
8
|
+
private createPlaneEdges;
|
|
9
|
+
private planeMaterial;
|
|
10
|
+
private _planX0;
|
|
11
|
+
private _planX1;
|
|
12
|
+
private _planY0;
|
|
13
|
+
private _planY1;
|
|
14
|
+
private _planZ0;
|
|
15
|
+
private _planZ1;
|
|
16
|
+
private _edgesX0;
|
|
17
|
+
private _edgesX1;
|
|
18
|
+
private _edgesY0;
|
|
19
|
+
private _edgesY1;
|
|
20
|
+
private _edgesZ0;
|
|
21
|
+
private _edgeX0;
|
|
22
|
+
private _edgeX1;
|
|
23
|
+
private _edgeY0;
|
|
24
|
+
private _edgeY1;
|
|
25
|
+
private _edgeZ0;
|
|
26
|
+
private edgeMaterial;
|
|
27
|
+
generateSectionBox(planes: Plane[]): void;
|
|
28
|
+
updateSectionBox(): void;
|
|
29
|
+
enable(): void;
|
|
30
|
+
disable(): void;
|
|
31
|
+
refresh(): void;
|
|
32
|
+
}
|
|
@@ -14,14 +14,33 @@ export declare class ViralVisibilityManager {
|
|
|
14
14
|
isolateInstancedMeshes: ViralInstancedMesh[];
|
|
15
15
|
hiddenMeshes: Mesh<any, any>[];
|
|
16
16
|
hiddenInstancedMeshes: ViralInstancedMesh[];
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated dont use anymore
|
|
19
|
+
*/
|
|
17
20
|
showAll(): void;
|
|
21
|
+
showAll2(): void;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated using hide2 instead
|
|
24
|
+
*/
|
|
18
25
|
hide(): void;
|
|
26
|
+
hide2(): void;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated using isolate2 instead
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
19
31
|
isolate(): void;
|
|
32
|
+
isolate2(elements?: {
|
|
33
|
+
modelId: string;
|
|
34
|
+
elementId: string;
|
|
35
|
+
}[]): void;
|
|
36
|
+
enableSun(): void;
|
|
37
|
+
disableSun(): void;
|
|
20
38
|
enableShadow(): void;
|
|
21
39
|
disableShadow(): void;
|
|
22
40
|
sunConfiguration: SunLightConfiguration;
|
|
23
41
|
private _adjustLightForMesh;
|
|
24
42
|
private _updateDirectLights;
|
|
43
|
+
private _updateLightShadowCamera;
|
|
25
44
|
enableEdge(): void;
|
|
26
45
|
disableEdge(): void;
|
|
27
46
|
enableAllWhite(): void;
|
|
@@ -33,4 +52,24 @@ export declare class ViralVisibilityManager {
|
|
|
33
52
|
private _ground;
|
|
34
53
|
enableGroundShadow(mesh?: Object3D): void;
|
|
35
54
|
disableGroundShadow(): void;
|
|
55
|
+
enableOutline(): void;
|
|
56
|
+
disableOutline(): void;
|
|
57
|
+
/**
|
|
58
|
+
* add element to outline effect
|
|
59
|
+
* @param elements
|
|
60
|
+
*/
|
|
61
|
+
addToOutline(elements?: {
|
|
62
|
+
modelId: string;
|
|
63
|
+
elementId: string;
|
|
64
|
+
}[]): void;
|
|
65
|
+
enableNight(): void;
|
|
66
|
+
disableNight(): void;
|
|
67
|
+
enableSectionBox(): void;
|
|
68
|
+
disableSectionBox(): void;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @param opacity from 0 to 1
|
|
72
|
+
*/
|
|
73
|
+
opacity: number;
|
|
74
|
+
setOpacity(opacity?: number): void;
|
|
36
75
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WorkerThreadPool } from "./base/worker-pool";
|
|
2
|
+
export declare class BuildTreeNodeWorker {
|
|
3
|
+
workerPool: WorkerThreadPool;
|
|
4
|
+
constructor();
|
|
5
|
+
buildTreeNode(elementData: {
|
|
6
|
+
[key: number]: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}[], callbackOnSuccess?: (response: any) => void): void;
|
|
12
|
+
}
|
|
@@ -5,6 +5,11 @@ export declare class LoadElementStandaloneWorker {
|
|
|
5
5
|
viralViewerApi: ViralViewerApi;
|
|
6
6
|
workerPool: WorkerThreadPool;
|
|
7
7
|
constructor(viralViewerApi: ViralViewerApi);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param materials
|
|
11
|
+
* @returns modelId
|
|
12
|
+
*/
|
|
13
|
+
initial(materials: RenderMaterial[]): number;
|
|
14
|
+
loadElement(modelId: number, elements: ViralutionElement[], callbackOnSuccess?: () => void): void;
|
|
10
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const workerCode: any;
|
|
@@ -3,7 +3,6 @@ import { CubeCamera } from "./components/cube-camera";
|
|
|
3
3
|
import { CubeRenderer } from "./components/cube-renderer";
|
|
4
4
|
import { CubeScene } from "./components/cube-scene";
|
|
5
5
|
import { CubeMouse } from "./components/cube.mouse";
|
|
6
|
-
import { ViewportGizmo } from "three-viewport-gizmo";
|
|
7
6
|
export declare class ViralNavigationCube {
|
|
8
7
|
viralViewerApi: ViralViewerApi;
|
|
9
8
|
targetElement: HTMLElement | null;
|
|
@@ -11,7 +10,6 @@ export declare class ViralNavigationCube {
|
|
|
11
10
|
cubeRenderer: CubeRenderer | null;
|
|
12
11
|
cubeCamera: CubeCamera | null;
|
|
13
12
|
cubeMouse: CubeMouse | null;
|
|
14
|
-
gizmo: ViewportGizmo | null;
|
|
15
13
|
constructor(viralViewerApi: ViralViewerApi);
|
|
16
14
|
private injectCubeWrapperElement;
|
|
17
15
|
private handleClick;
|