viral-viewer-2 6.2.7 → 6.2.9
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 +5 -52
- package/dist/components/camera/viral-camera.d.ts +1 -1
- package/dist/components/custom-objects/viral-instanced-mesh.d.ts +1 -1
- package/dist/components/custom-objects/viral-mesh.d.ts +9 -0
- package/dist/components/event-handler/viral-centralized-event-handler.d.ts +2 -0
- package/dist/components/loader/viral-revit.loader.d.ts +13 -1
- package/dist/components/scene/viral-scene.d.ts +1 -0
- package/dist/components/worker/load-element-by-material-v2.worker.d.ts +11 -0
- package/dist/components/worker/load-element-by-material.worker.d.ts +11 -0
- package/dist/components/worker/{viral-viewer-4.worker.d.ts → load-element-standalone.worker.d.ts} +1 -1
- package/dist/components/worker-script/load-element-by-material.script.d.ts +3 -0
- package/dist/components/worker-script/material-aproach/load-element-by-material-instanced-mesh.script.d.ts +1 -0
- package/dist/components/worker-script/material-aproach/load-element-by-material-mesh.script.d.ts +3 -0
- package/dist/const/colors.d.ts +1 -0
- package/dist/const/icons.d.ts +7 -0
- package/dist/gui/context-menu/viral-context-menu.d.ts +1 -1
- package/dist/gui/draggable-modal/viral-draggable-modal.d.ts +10 -0
- package/dist/gui/tools/tools/viral-tool-export-scene.d.ts +7 -0
- package/dist/index.mjs +20132 -15592
- package/dist/types.d.ts +26 -1
- package/dist/viral-viewer-api.d.ts +2 -4
- package/package.json +2 -3
- /package/dist/components/worker-script/{load-model-worker-3.script.d.ts → load-element-standalone.script.d.ts} +0 -0
package/LICENSE
CHANGED
|
@@ -1,57 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Viral
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
23
|
-
============
|
|
24
|
-
== VIRAL ==
|
|
25
|
-
============
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Copyright (c) 2023, Viral
|
|
1
|
+
Viralution License
|
|
2
|
+
Copyright (c) 2023, Viralution
|
|
29
3
|
All rights reserved.
|
|
30
4
|
|
|
31
|
-
|
|
32
|
-
modification, are permitted provided that the following conditions are met:
|
|
33
|
-
|
|
34
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
35
|
-
list of conditions and the following disclaimer.
|
|
36
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
37
|
-
this list of conditions and the following disclaimer in the documentation
|
|
38
|
-
and/or other materials provided with the distribution.
|
|
39
|
-
|
|
40
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
41
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
42
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
43
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
44
|
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
45
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
46
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
47
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
48
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
49
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
50
|
-
|
|
51
|
-
The views and conclusions contained in the software and documentation are those
|
|
52
|
-
of the authors and should not be interpreted as representing official policies,
|
|
53
|
-
either expressed or implied, of the FreeBSD Project.
|
|
5
|
+
Permission is hereby denied to any party to copy, modify, sublicense, merge, publish, distribute, and/or sell this software.
|
|
54
6
|
|
|
7
|
+
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.
|
|
55
8
|
|
|
56
|
-
|
|
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.
|
|
57
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
4
|
+
import { Vector3, Raycaster, PerspectiveCamera, Object3D } from "three";
|
|
5
5
|
export declare class ViralCamera {
|
|
6
6
|
viralViewerApi: ViralViewerApi;
|
|
7
7
|
raycaster: Raycaster;
|
|
@@ -26,6 +26,6 @@ export declare class ViralInstancedMesh extends InstancedMesh {
|
|
|
26
26
|
overrideObjects(reverseToOriginal?: boolean): void;
|
|
27
27
|
totalSelectedIndex(): number[];
|
|
28
28
|
reverseIndex(clearHoverIndexs?: boolean, clearSelectIndexs?: boolean): void;
|
|
29
|
-
reverseToOriginal(reverseHoverMeshes?: boolean, reverseSelectMeshes?: boolean): void;
|
|
29
|
+
reverseToOriginal(reverseHoverMeshes?: boolean, reverseSelectMeshes?: boolean, reverseInstanceData?: boolean): void;
|
|
30
30
|
getDistinctNumbers(numbers: number[]): number[];
|
|
31
31
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BufferGeometry, Material, Mesh } from "three";
|
|
2
|
+
export declare class ViralMesh extends Mesh {
|
|
3
|
+
elementData: {
|
|
4
|
+
[key: string]: number[];
|
|
5
|
+
};
|
|
6
|
+
materialName: string;
|
|
7
|
+
constructor(geometry?: BufferGeometry, material?: Material);
|
|
8
|
+
addElement(uniqueId: string, buffer: Float32Array): void;
|
|
9
|
+
}
|
|
@@ -3,7 +3,9 @@ export declare class ViralCentralizedEventHandler {
|
|
|
3
3
|
viralViewerApi: ViralViewerApi;
|
|
4
4
|
private _visibilityManager;
|
|
5
5
|
constructor(viralViewerApi: ViralViewerApi);
|
|
6
|
+
private elementProperties;
|
|
6
7
|
private contextMenuEventHandler;
|
|
8
|
+
cameraHandler(): void;
|
|
7
9
|
windowHandler(): void;
|
|
8
10
|
hoverElementHandler(): void;
|
|
9
11
|
selectElementHandler(): void;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { ViralViewerRevitProject } from "../../types";
|
|
1
|
+
import { RevitTransform, ViralPoint, ViralViewerRevitProject, ViralutionFragmentModel } from "../../types";
|
|
2
2
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
3
3
|
export declare class ViralRevitLoader {
|
|
4
4
|
viralViewerApi: ViralViewerApi;
|
|
5
|
+
private _loadElementStandaloneWorker;
|
|
6
|
+
private _loadElementByMaterialWorker;
|
|
7
|
+
private _loadElementByMaterialV2Worker;
|
|
5
8
|
constructor(viralViewerApi: ViralViewerApi);
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated This function is deprecated. Use the loadRevit2 instead.
|
|
11
|
+
*/
|
|
6
12
|
loadRevit(model: ViralViewerRevitProject): void;
|
|
7
13
|
private progressStructuralGeometries;
|
|
8
14
|
private progressNoneStructuralGeometries;
|
|
9
15
|
private addCustomMesh3;
|
|
10
16
|
private addCustomMesh4;
|
|
17
|
+
loadRevitGroupByMaterial(model: ViralutionFragmentModel): void;
|
|
18
|
+
getVerticePoints(indices: number[], vertices: ViralPoint[], instances?: RevitTransform[]): number[];
|
|
19
|
+
loadStandalone(trackingUrl: string, dataUrl: string, informationUrl: string): Promise<void>;
|
|
20
|
+
getMaterials(dataUrl: string, byteRangeStart: number, byteRangeEnd: number): Promise<any>;
|
|
21
|
+
getElements(dataUrl: string, chunk: number[][], callbackOnSuccess?: (model: any) => void): Promise<void>;
|
|
22
|
+
loadByMaterial(trackingUrl: string, dataUrl: string, informationUrl: string): Promise<void>;
|
|
11
23
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
|
+
import { Fragment, RenderMaterial } from "../../types";
|
|
3
|
+
import { WorkerThreadPool } from "./base/worker-pool";
|
|
4
|
+
export declare class LoadElementByMaterialV2Worker {
|
|
5
|
+
viralViewerApi: ViralViewerApi;
|
|
6
|
+
meshWorkerPool: WorkerThreadPool;
|
|
7
|
+
instancedMeshWorkerPool: WorkerThreadPool;
|
|
8
|
+
constructor(viralViewerApi: ViralViewerApi);
|
|
9
|
+
initial(materials: RenderMaterial[]): void;
|
|
10
|
+
loadElement(fragment: Fragment, callbackOnSuccess?: () => void): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
|
+
import { RenderMaterial, ViralutionElement } from "../../types";
|
|
3
|
+
import { WorkerThreadPool } from "./base/worker-pool";
|
|
4
|
+
export declare class LoadElementByMaterialWorker {
|
|
5
|
+
viralViewerApi: ViralViewerApi;
|
|
6
|
+
workerPool: WorkerThreadPool;
|
|
7
|
+
private _meshesByMaterial;
|
|
8
|
+
constructor(viralViewerApi: ViralViewerApi);
|
|
9
|
+
initial(materials: RenderMaterial[]): void;
|
|
10
|
+
loadElement(elements: ViralutionElement[], callbackOnSuccess?: () => void): void;
|
|
11
|
+
}
|
package/dist/components/worker/{viral-viewer-4.worker.d.ts → load-element-standalone.worker.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
2
|
import { RenderMaterial, ViralutionElement } from "../../types";
|
|
3
3
|
import { WorkerThreadPool } from "./base/worker-pool";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class LoadElementStandaloneWorker {
|
|
5
5
|
viralViewerApi: ViralViewerApi;
|
|
6
6
|
workerPool: WorkerThreadPool;
|
|
7
7
|
constructor(viralViewerApi: ViralViewerApi);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function workerCode(): void;
|
package/dist/const/colors.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Icons: {
|
|
2
|
+
showAll: (size?: number, color?: string) => string;
|
|
3
|
+
isolate: (size?: number, color?: string) => string;
|
|
4
|
+
hide: (size?: number, color?: string) => string;
|
|
5
|
+
focus: (size?: number, color?: string) => string;
|
|
6
|
+
properties: (size?: number, color?: string) => string;
|
|
7
|
+
};
|
|
@@ -13,5 +13,5 @@ export declare class ViralContextMenu {
|
|
|
13
13
|
* @param itemName
|
|
14
14
|
* @param resolve callback when user click
|
|
15
15
|
*/
|
|
16
|
-
addContextItem(itemKey: number, itemName: string, resolve: (result: any) => void): void;
|
|
16
|
+
addContextItem(itemKey: number, itemName: string, itemIcon: string, resolve: (result: any) => void): void;
|
|
17
17
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
2
|
export declare class ViralDraggableModal {
|
|
3
3
|
viralViewerApi: ViralViewerApi;
|
|
4
|
+
private modal;
|
|
5
|
+
private modalTitle;
|
|
6
|
+
private modalBody;
|
|
7
|
+
private modalBodyLeft;
|
|
8
|
+
private modalBodyRight;
|
|
9
|
+
properties: any;
|
|
4
10
|
private rawModal;
|
|
5
11
|
private rawModalStyle;
|
|
6
12
|
isDragging: boolean;
|
|
@@ -8,4 +14,8 @@ export declare class ViralDraggableModal {
|
|
|
8
14
|
offsetY: number;
|
|
9
15
|
constructor(viralViewerApi: ViralViewerApi);
|
|
10
16
|
inject(): void;
|
|
17
|
+
show(): void;
|
|
18
|
+
hide(): void;
|
|
19
|
+
updatePosition(clientX: number, clientY: number): void;
|
|
20
|
+
updateModalContent(uniqueId: number): void;
|
|
11
21
|
}
|