viral-viewer-2 6.2.6 → 6.2.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.
Files changed (64) hide show
  1. package/dist/components/animation/viral-animation.d.ts +9 -0
  2. package/dist/components/bvh/viral-bvh.d.ts +5 -0
  3. package/dist/components/camera/viral-camera.d.ts +40 -0
  4. package/dist/components/compress/viral-compress.processor.d.ts +3 -0
  5. package/dist/components/custom-objects/index.d.ts +2 -0
  6. package/dist/components/custom-objects/viral-instanced-mesh.d.ts +31 -0
  7. package/dist/components/data-manager/viral-data-manager.d.ts +18 -0
  8. package/dist/components/event-handler/base/event-dispatcher.d.ts +9 -0
  9. package/dist/components/event-handler/keyboard/viral-keyboard.d.ts +17 -0
  10. package/dist/components/event-handler/mouse/viral-mouse.d.ts +31 -0
  11. package/dist/components/event-handler/viral-centralized-event-handler.d.ts +12 -0
  12. package/dist/components/event-handler/viral-lifecycle-event-handler.d.ts +13 -0
  13. package/dist/components/loader/viral-point-cloud.loader.d.ts +16 -0
  14. package/dist/components/loader/viral-revit.loader.d.ts +11 -0
  15. package/dist/components/loader/viral-three.loader.d.ts +11 -0
  16. package/dist/components/loader/viral.loader.d.ts +11 -0
  17. package/dist/components/material/viral-material-manager.d.ts +14 -0
  18. package/dist/components/post-processing/post-processing-renderer.d.ts +19 -0
  19. package/dist/components/renderer/viral-renderer.d.ts +11 -0
  20. package/dist/components/scene/viral-scene.d.ts +27 -0
  21. package/dist/components/stats/viral-stats.d.ts +6 -0
  22. package/dist/components/visibility-manager/viral-visibility-manager.d.ts +20 -0
  23. package/dist/components/worker/base/worker-pool.d.ts +23 -0
  24. package/dist/components/worker/base/worker-thread.d.ts +10 -0
  25. package/dist/components/worker/fetch-data.worker.d.ts +12 -0
  26. package/dist/components/worker/viral-viewer-2.worker.d.ts +17 -0
  27. package/dist/components/worker/viral-viewer-3.worker.d.ts +14 -0
  28. package/dist/components/worker/viral-viewer-4.worker.d.ts +10 -0
  29. package/dist/components/worker/viral-viewer.worker.d.ts +8 -0
  30. package/dist/components/worker-script/fetch-data-worker.script.d.ts +1 -0
  31. package/dist/components/worker-script/load-model-worker-2.script.d.ts +1 -0
  32. package/dist/components/worker-script/load-model-worker-3.script.d.ts +1 -0
  33. package/dist/components/worker-script/load-model-worker.script.d.ts +1 -0
  34. package/dist/components/worker-script/threejs.types.d.ts +1 -0
  35. package/dist/const/colors.d.ts +13 -0
  36. package/dist/const/fonts.d.ts +7 -0
  37. package/dist/gui/context-menu/viral-context-menu.d.ts +17 -0
  38. package/dist/gui/draggable-modal/viral-draggable-modal.d.ts +11 -0
  39. package/dist/gui/fonts/fonts.d.ts +2 -0
  40. package/dist/gui/navigation-cube/components/cube-camera.d.ts +15 -0
  41. package/dist/gui/navigation-cube/components/cube-renderer.d.ts +9 -0
  42. package/dist/gui/navigation-cube/components/cube-scene.d.ts +13 -0
  43. package/dist/gui/navigation-cube/components/cube.mouse.d.ts +9 -0
  44. package/dist/gui/navigation-cube/viral-navigation-cube.d.ts +16 -0
  45. package/dist/gui/spinner/viral-spinner.d.ts +10 -0
  46. package/dist/gui/tools/tools/viral-tool-ambient-occlusion.d.ts +7 -0
  47. package/dist/gui/tools/tools/viral-tool-dark-mode.d.ts +7 -0
  48. package/dist/gui/tools/tools/viral-tool-elevation.d.ts +11 -0
  49. package/dist/gui/tools/tools/viral-tool-measure.d.ts +33 -0
  50. package/dist/gui/tools/tools/viral-tool-sunlight.d.ts +7 -0
  51. package/dist/gui/tools/viral-tools.d.ts +32 -0
  52. package/dist/index.d.ts +4 -0
  53. package/dist/index.mjs +36613 -0
  54. package/dist/services/local-storage.service.d.ts +14 -0
  55. package/dist/threejs-addon/n8ao/n8ao.d.ts +303 -0
  56. package/dist/threejs-addon/n8ao/post-processing.d.ts +73558 -0
  57. package/dist/threejs-addon/stats.d.ts +21 -0
  58. package/dist/types.d.ts +120 -0
  59. package/dist/utils/html.d.ts +3 -0
  60. package/dist/utils/index.d.ts +4 -0
  61. package/dist/utils/log.d.ts +4 -0
  62. package/dist/utils/threejs.d.ts +8 -0
  63. package/dist/viral-viewer-api.d.ts +52 -0
  64. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { Clock } from "three";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ export declare class ViralAnimation {
4
+ viralViewerApi: ViralViewerApi;
5
+ clock: Clock;
6
+ constructor(viralViewerApi: ViralViewerApi);
7
+ devAnimation(): void;
8
+ animation(): void;
9
+ }
@@ -0,0 +1,5 @@
1
+ import { BufferGeometry } from "three";
2
+ export declare class ViralBVH {
3
+ constructor();
4
+ applyThreeMeshBVH(geometry: BufferGeometry): void;
5
+ }
@@ -0,0 +1,40 @@
1
+ import CameraControls from "camera-controls";
2
+ import { ViralCameraEventType, ViralViewerState } from "../../types";
3
+ import { ViralViewerApi } from "../../viral-viewer-api";
4
+ import { Vector3, Raycaster, PerspectiveCamera, Object3D } from 'three';
5
+ export declare class ViralCamera {
6
+ viralViewerApi: ViralViewerApi;
7
+ raycaster: Raycaster;
8
+ camera: PerspectiveCamera | null;
9
+ cameraControls: CameraControls | null;
10
+ targetElement: HTMLElement;
11
+ onUsing: boolean;
12
+ constructor(viralViewerApi: ViralViewerApi);
13
+ setupCamera(): void;
14
+ /**
15
+ * resize canvas by resize div
16
+ */
17
+ resizeCanvas(): void;
18
+ /**
19
+ * focuse model
20
+ * @param objectName :model name
21
+ */
22
+ focusModelByName(objectName?: string): void;
23
+ getState(): ViralViewerState | null;
24
+ restoreState(state: ViralViewerState): void;
25
+ clientToWorld(): import("three").Intersection<Object3D<import("three").Object3DEventMap>>[] | null;
26
+ worldToClient(point: Vector3): Vector3 | null;
27
+ private castRay;
28
+ updateMainCamera(): void;
29
+ private cameraWakeQueuedEvents;
30
+ private cameraSleepQueuedEvents;
31
+ /**
32
+ *
33
+ * @param type Mouse type event
34
+ * @param key key of action
35
+ * @param resolve callback
36
+ */
37
+ addEventListener(type: ViralCameraEventType, key: string, resolve: () => void): void;
38
+ removeEventListener(type: ViralCameraEventType, key: string): void;
39
+ getAllEventListener(): void;
40
+ }
@@ -0,0 +1,3 @@
1
+ export declare class ViralCompressProcessor {
2
+ pakoUnzip(buffer: ArrayBuffer): string;
3
+ }
@@ -0,0 +1,2 @@
1
+ import { ViralInstancedMesh } from "./viral-instanced-mesh";
2
+ export { ViralInstancedMesh };
@@ -0,0 +1,31 @@
1
+ import { BufferGeometry, InstancedMesh, Material, Mesh } from "three";
2
+ import { Dictionary } from "../../types";
3
+ export declare class ViralInstancedMesh extends InstancedMesh {
4
+ private _originMesh;
5
+ private _isOrigin;
6
+ overrideHoverMeshes: Mesh<BufferGeometry, Material>[];
7
+ overrideSelectMeshes: Mesh<BufferGeometry, Material>[];
8
+ _tempHoveredIndexs: number[];
9
+ hoveredIndexs: Dictionary<number, Material>;
10
+ _tempSelectedIndexs: number[];
11
+ selectedIndexs: Dictionary<number, Material>;
12
+ /**
13
+ *
14
+ * @param geometry geometry for instanced mesh
15
+ * @param materials materials for instanced mesh, can be both 1 or array
16
+ * @param count number of instance in mesh
17
+ * @param _host share the same logic with parent, when we push temp mesh into scene, we must binding original viral instanced mesh to host to recall/ reprogress later
18
+ */
19
+ constructor(geometry: BufferGeometry, materials: Material[] | Material, count: number);
20
+ hideAts(indexs: number[]): void;
21
+ hideObjects(reverseToOriginal?: boolean): void;
22
+ isolateAts(indexs: number[]): void;
23
+ isolateObjects(reverseToOriginal?: boolean): void;
24
+ hoverAts(indexs: number[], material: Material): void;
25
+ selectAts(indexs: number[], material: Material): void;
26
+ overrideObjects(reverseToOriginal?: boolean): void;
27
+ totalSelectedIndex(): number[];
28
+ reverseIndex(clearHoverIndexs?: boolean, clearSelectIndexs?: boolean): void;
29
+ reverseToOriginal(reverseHoverMeshes?: boolean, reverseSelectMeshes?: boolean): void;
30
+ getDistinctNumbers(numbers: number[]): number[];
31
+ }
@@ -0,0 +1,18 @@
1
+ import { ViralViewerApi } from "../..";
2
+ export declare class ViralDataManager {
3
+ viralViewerApi: ViralViewerApi;
4
+ elementData: {
5
+ [key: number]: any;
6
+ };
7
+ private fetchDataWorker;
8
+ constructor(viralViewerApi: ViralViewerApi);
9
+ normalFetch(url: string, byteRangeStart?: number, byteRangeEnd?: number): Promise<Response>;
10
+ /**
11
+ * worker fetch can only return json or arraybuffer value
12
+ * @param url
13
+ * @param callbackOnSuccess
14
+ * @param byteRangeStart
15
+ * @param byteRangeEnd
16
+ */
17
+ workerFetch(url: string, callbackOnSuccess?: (response: ArrayBuffer) => void, byteRangeStart?: number, byteRangeEnd?: number): void;
18
+ }
@@ -0,0 +1,9 @@
1
+ import { ViralutionEvent } from "../../../types";
2
+ type EventHandler = (...args: any[]) => void;
3
+ export declare class EventDispatcher {
4
+ private events;
5
+ on(event: ViralutionEvent, handler: EventHandler): void;
6
+ off(event: ViralutionEvent, handler: EventHandler): void;
7
+ emit(event: ViralutionEvent, ...args: any[]): void;
8
+ }
9
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ViralKeyboardEventType, ViralViewerApi } from "../../..";
2
+ export declare class ViralKeyboard {
3
+ viralViewerApi: ViralViewerApi;
4
+ constructor(viralViewerApi: ViralViewerApi);
5
+ private setupKeyPress;
6
+ private keydownQueuedEvents;
7
+ private keyupQueuedEvents;
8
+ /**
9
+ *
10
+ * @param type Mouse type event
11
+ * @param key key of action
12
+ * @param resolve callback
13
+ */
14
+ addEventListener(type: ViralKeyboardEventType, key: string, resolve: (evt: KeyboardEvent) => void): void;
15
+ removeEventListener(type: ViralKeyboardEventType, key: string): void;
16
+ getAllEventListener(): void;
17
+ }
@@ -0,0 +1,31 @@
1
+ import { Vector2 } from "three";
2
+ import { ViralViewerApi } from "../../../viral-viewer-api";
3
+ import { ViralMouseEventType } from "../../../types";
4
+ export declare class ViralMouse {
5
+ viralViewerApi: ViralViewerApi;
6
+ position: Vector2;
7
+ rawPosition: Vector2;
8
+ private mouseMoveQueuedEvents;
9
+ private mouseDownLeftQueuedEvents;
10
+ private mouseUpLeftQueuedEvents;
11
+ private mouseDownRightQueuedEvents;
12
+ private mouseUpRightQueuedEvents;
13
+ constructor(viralViewerApi: ViralViewerApi);
14
+ private setupMousePositionUpdate;
15
+ /**
16
+ *
17
+ * @param type Mouse type event
18
+ * @param key key of action
19
+ * @param resolve callback
20
+ */
21
+ addEventListener(type: ViralMouseEventType, key: string, resolve: (result: any) => void): void;
22
+ removeEventListener(type: ViralMouseEventType, key: string): void;
23
+ getAllEventListener(): void;
24
+ private hoverMeshes;
25
+ private hover;
26
+ private reverseColor;
27
+ private setupMouseDown;
28
+ private handleClick;
29
+ private setupMouseUp;
30
+ private handleMouseUp;
31
+ }
@@ -0,0 +1,12 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ export declare class ViralCentralizedEventHandler {
3
+ viralViewerApi: ViralViewerApi;
4
+ private _visibilityManager;
5
+ constructor(viralViewerApi: ViralViewerApi);
6
+ private contextMenuEventHandler;
7
+ windowHandler(): void;
8
+ hoverElementHandler(): void;
9
+ selectElementHandler(): void;
10
+ isShiftPressed: boolean;
11
+ keyboardHandler(): void;
12
+ }
@@ -0,0 +1,13 @@
1
+ import { ViewerOptions } from "../../types";
2
+ import { EventDispatcher } from "./base/event-dispatcher";
3
+ export declare class ViralLifecycleEventHandler {
4
+ private eventDispatcher;
5
+ options: ViewerOptions;
6
+ constructor(eventDispatcher: EventDispatcher, options: ViewerOptions);
7
+ private loadedScene;
8
+ private loadedMaterialManager;
9
+ private loadedRenderer;
10
+ private loadedCamera;
11
+ private loadedCube;
12
+ private loadedTools;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { Potree, PointCloudOctree } from "potree-core-viral";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ export declare class ViralPointCloudLoader {
4
+ viralViewerApi: ViralViewerApi;
5
+ potree: Potree;
6
+ pointClouds: PointCloudOctree[];
7
+ constructor(viralViewerApi: ViralViewerApi);
8
+ /**
9
+ *
10
+ * @param metadataUrl endpoint to download metadata.json
11
+ * @param urlOcbinTree endpoint to download octree.bin
12
+ * @param urlHierarchy endpoint to download hierarchy.bin
13
+ * @param pointBudget
14
+ */
15
+ load(metadataUrl: string, urlOcbinTree: string, urlHierarchy: string, pointBudget?: number, callbackOnSuccess?: (pco: PointCloudOctree) => void): void;
16
+ }
@@ -0,0 +1,11 @@
1
+ import { ViralViewerRevitProject } from "../../types";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ export declare class ViralRevitLoader {
4
+ viralViewerApi: ViralViewerApi;
5
+ constructor(viralViewerApi: ViralViewerApi);
6
+ loadRevit(model: ViralViewerRevitProject): void;
7
+ private progressStructuralGeometries;
8
+ private progressNoneStructuralGeometries;
9
+ private addCustomMesh3;
10
+ private addCustomMesh4;
11
+ }
@@ -0,0 +1,11 @@
1
+ import { ObjectLoader } from "three";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ import { GLTF, GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
4
+ export declare class ViralThreeLoader {
5
+ viralViewerApi: ViralViewerApi;
6
+ objectLoader: ObjectLoader;
7
+ gltfLoader: GLTFLoader;
8
+ constructor(viralViewerApi: ViralViewerApi);
9
+ parseObject(data: any): import("three").Object3D<import("three").Object3DEventMap>;
10
+ loadGLTF(url: string, onLoad?: (data: GLTF) => void, onProgress?: (data: ProgressEvent<EventTarget>) => void, onError?: (data: unknown) => void): void;
11
+ }
@@ -0,0 +1,11 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ import { ViralPointCloudLoader } from "./viral-point-cloud.loader";
3
+ import { ViralRevitLoader } from "./viral-revit.loader";
4
+ import { ViralThreeLoader } from "./viral-three.loader";
5
+ export declare class ViralLoader {
6
+ viralViewerApi: ViralViewerApi;
7
+ viralRevitLoader: ViralRevitLoader;
8
+ pointCloudLoader: ViralPointCloudLoader;
9
+ threeLoader: ViralThreeLoader;
10
+ constructor(viralViewerApi: ViralViewerApi);
11
+ }
@@ -0,0 +1,14 @@
1
+ import { LineBasicMaterial, Material, MeshPhongMaterial, ShaderMaterial } from "three";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ import { Dictionary } from "../../types";
4
+ export declare class ViralMaterialManager {
5
+ private viralViewerApi;
6
+ hoverMaterial: MeshPhongMaterial;
7
+ selectedMaterial: MeshPhongMaterial;
8
+ lineMaterial: LineBasicMaterial;
9
+ vertexShader: string;
10
+ fragmentShader: string;
11
+ outlineMaterial: ShaderMaterial;
12
+ materials: Dictionary<number, Material>;
13
+ constructor(viralViewerApi: ViralViewerApi);
14
+ }
@@ -0,0 +1,19 @@
1
+ import { Camera, Scene, WebGLRenderer } from "three";
2
+ import { N8AOPass } from "../../threejs-addon/n8ao/n8ao";
3
+ import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer";
4
+ import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass";
5
+ import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass";
6
+ export declare class PostProcessingRenderer {
7
+ private renderer;
8
+ composer: EffectComposer;
9
+ renderPass: any;
10
+ gammaPass: ShaderPass | null;
11
+ na8oPass: N8AOPass | null;
12
+ smaaPass: SMAAPass | null;
13
+ constructor(renderer: WebGLRenderer);
14
+ render(): void;
15
+ initRenderPass(scene: Scene, camera: Camera): void;
16
+ initGammaPass(): void;
17
+ initN8aoPass(scene: Scene, camera: Camera): void;
18
+ initSMAAPass(): void;
19
+ }
@@ -0,0 +1,11 @@
1
+ import { WebGLRenderer } from "three";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ import { PostProcessingRenderer } from "../post-processing/post-processing-renderer";
4
+ export declare class ViralRenderer {
5
+ viralViewerApi: ViralViewerApi;
6
+ renderer: WebGLRenderer;
7
+ postProcessingRenderer: PostProcessingRenderer;
8
+ constructor(viralViewerApi: ViralViewerApi);
9
+ updateSize(width: number, height: number): void;
10
+ render(): void;
11
+ }
@@ -0,0 +1,27 @@
1
+ import { Scene, Mesh, Object3D, Light, CameraHelper } from "three";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ import { TransformControls } from "three/examples/jsm/controls/TransformControls";
4
+ export declare class ViralScene {
5
+ viralViewerApi: ViralViewerApi;
6
+ scene: Scene;
7
+ objects: Object3D[];
8
+ models: Object3D[];
9
+ mainModel: Mesh;
10
+ isolateModel: Mesh;
11
+ selectables: Object3D[];
12
+ edges: Object3D[];
13
+ lights: Light[];
14
+ transformControls: TransformControls | null;
15
+ lightHelpers: CameraHelper[];
16
+ constructor(viralViewerApi: ViralViewerApi);
17
+ addObject(object: Object3D): void;
18
+ addModel(object: Object3D): void;
19
+ addEdge(object: Object3D): void;
20
+ getObjectByName(name: string): Object3D<import("three").Object3DEventMap> | undefined;
21
+ addLights(): void;
22
+ addPivotPoint(): void;
23
+ addTransformControls(): void;
24
+ addCube(): void;
25
+ addAxes(): void;
26
+ enableLightHelper(value: boolean): void;
27
+ }
@@ -0,0 +1,6 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ export declare class ViralStats {
3
+ viralViewerApi: ViralViewerApi;
4
+ stats: Stats | null;
5
+ constructor(viralViewerApi: ViralViewerApi);
6
+ }
@@ -0,0 +1,20 @@
1
+ import { Mesh } from "three";
2
+ import { ViralViewerApi } from "../../viral-viewer-api";
3
+ import { ViralInstancedMesh } from "../..";
4
+ export declare class ViralVisibilityManager {
5
+ private viralViewerApi;
6
+ constructor(viralViewerApi: ViralViewerApi);
7
+ hoverMeshes: Mesh<any, any>[];
8
+ hoverInstancedMesh: ViralInstancedMesh | null;
9
+ reverseColor(): void;
10
+ selectedMeshes: Mesh<any, any>[];
11
+ selectedInstancedMeshes: ViralInstancedMesh[];
12
+ reverseSelectedColor(): void;
13
+ isolateMeshes: Mesh<any, any>[];
14
+ isolateInstancedMeshes: ViralInstancedMesh[];
15
+ hiddenMeshes: Mesh<any, any>[];
16
+ hiddenInstancedMeshes: ViralInstancedMesh[];
17
+ showAll(): void;
18
+ hide(): void;
19
+ isolate(): void;
20
+ }
@@ -0,0 +1,23 @@
1
+ export declare class WorkerThreadPool {
2
+ private maximumNumberOfWorker;
3
+ private scriptPath;
4
+ private _workers;
5
+ private _free;
6
+ private _busy;
7
+ private _queue;
8
+ /**
9
+ *
10
+ * @param maxSize maximum number of worker
11
+ * @param scriptPath javascript path for worker execute
12
+ */
13
+ constructor(maxSize: number, scriptPath: string);
14
+ get length(): number;
15
+ get busy(): boolean;
16
+ /**
17
+ *
18
+ * @param inputData Input data send to worker
19
+ * @param resolve callback from worker
20
+ */
21
+ Enqueue<T, M>(inputData: T, resolve: (result: M) => void): void;
22
+ private _PumpQueue;
23
+ }
@@ -0,0 +1,10 @@
1
+ export declare class WorkerThread {
2
+ private _worker;
3
+ private _resolve;
4
+ _id: number;
5
+ constructor(s: string);
6
+ private _OnMessage;
7
+ get id(): number;
8
+ postMessage(data: any, resolve: (data: any) => void): void;
9
+ dispose(): void;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { WorkerThreadPool } from "./base/worker-pool";
2
+ export declare class FetchDataWorker {
3
+ workerPool: WorkerThreadPool;
4
+ constructor();
5
+ fetch(url: string, callbackOnSuccess?: (response: any) => void, byteRangeStart?: number, byteRangeEnd?: number): void;
6
+ }
7
+ export declare class FetchRequest {
8
+ url: string;
9
+ byteRangeStart?: number;
10
+ byteRangeEnd?: number;
11
+ constructor(url: string, byteRangeStart?: number, byteRangeEnd?: number);
12
+ }
@@ -0,0 +1,17 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ import { Dictionary, RenderMaterial, ViralViewerRevitNoneStructuralGeometry, ViralViewerRevitStructuralGeometry } from "../../types";
3
+ import { Mesh, MeshPhongMaterial } from "three";
4
+ import { WorkerThreadPool } from "./base/worker-pool";
5
+ export declare class ViralViewerWorker2 {
6
+ viralViewerApi: ViralViewerApi;
7
+ workerPool: WorkerThreadPool;
8
+ materials: RenderMaterial[];
9
+ mainModel: Mesh | null;
10
+ threejsMaterials: Dictionary<number, MeshPhongMaterial>;
11
+ private readonly maxPolygonPerObject;
12
+ private readonly maxPolygonForEdge;
13
+ constructor(viralViewerApi: ViralViewerApi, scriptUrl?: string);
14
+ initial(materials: RenderMaterial[]): void;
15
+ loadStructuralGeometry(model: ViralViewerRevitStructuralGeometry, callbackOnSuccess?: () => void): void;
16
+ loadNoneStructuralGeometry(model: ViralViewerRevitNoneStructuralGeometry, callbackOnSuccess?: () => void): void;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ import { RenderMaterial, ViralViewerRevitNoneStructuralGeometry, ViralViewerRevitStructuralGeometry } from "../../types";
3
+ import { Mesh } from "three";
4
+ import { WorkerThreadPool } from "./base/worker-pool";
5
+ export declare class ViralViewerWorker3 {
6
+ viralViewerApi: ViralViewerApi;
7
+ workerPool: WorkerThreadPool;
8
+ materials: RenderMaterial[];
9
+ mainModel: Mesh | null;
10
+ constructor(viralViewerApi: ViralViewerApi, scriptUrl?: string);
11
+ initial(materials: RenderMaterial[]): void;
12
+ loadStructuralGeometry(model: ViralViewerRevitStructuralGeometry, callbackOnSuccess?: () => void): void;
13
+ loadNoneStructuralGeometry(model: ViralViewerRevitNoneStructuralGeometry, callbackOnSuccess?: () => void): void;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ import { RenderMaterial, ViralutionElement } from "../../types";
3
+ import { WorkerThreadPool } from "./base/worker-pool";
4
+ export declare class ViralViewerWorker4 {
5
+ viralViewerApi: ViralViewerApi;
6
+ workerPool: WorkerThreadPool;
7
+ constructor(viralViewerApi: ViralViewerApi);
8
+ initial(materials: RenderMaterial[]): void;
9
+ loadElement(elements: ViralutionElement[], callbackOnSuccess?: () => void): void;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ import { ViralViewerRevitProject } from "../../types";
3
+ export declare class ViralViewerWorker {
4
+ viralViewerApi: ViralViewerApi;
5
+ worker: Worker;
6
+ constructor(viralViewerApi: ViralViewerApi, scriptUrl?: string);
7
+ loadModel(model: ViralViewerRevitProject, callbackOnSuccess?: () => void): void;
8
+ }
@@ -0,0 +1 @@
1
+ export declare const workerCode: any;
@@ -0,0 +1 @@
1
+ export declare const workerCode: any;
@@ -0,0 +1 @@
1
+ export function workerCode(): void;
@@ -0,0 +1 @@
1
+ export declare const workerCode: any;
@@ -0,0 +1 @@
1
+ export function workerCode(): void;
@@ -0,0 +1,13 @@
1
+ export declare const LightTheme: {
2
+ background: string;
3
+ primary: string;
4
+ secondary: string;
5
+ accent: string;
6
+ accent2: string;
7
+ };
8
+ export declare const DarkTheme: {
9
+ background: string;
10
+ primary: string;
11
+ secondary: string;
12
+ accent: string;
13
+ };
@@ -0,0 +1,7 @@
1
+ export declare class FontIndentity {
2
+ importLink: string;
3
+ fontFamily: string;
4
+ }
5
+ export declare const fonts: {
6
+ [key: string]: FontIndentity;
7
+ };
@@ -0,0 +1,17 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ export declare class ViralContextMenu {
3
+ viralViewerApi: ViralViewerApi;
4
+ private contextMenu;
5
+ private contextItems;
6
+ constructor(viralViewerApi: ViralViewerApi);
7
+ private injectContextMenu;
8
+ showContextMenu(top: number, left: number, itemKeys: number[]): void;
9
+ hideContextMenu(): void;
10
+ private initContent;
11
+ /**
12
+ *
13
+ * @param itemName
14
+ * @param resolve callback when user click
15
+ */
16
+ addContextItem(itemKey: number, itemName: string, resolve: (result: any) => void): void;
17
+ }
@@ -0,0 +1,11 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ export declare class ViralDraggableModal {
3
+ viralViewerApi: ViralViewerApi;
4
+ private rawModal;
5
+ private rawModalStyle;
6
+ isDragging: boolean;
7
+ offsetX: number;
8
+ offsetY: number;
9
+ constructor(viralViewerApi: ViralViewerApi);
10
+ inject(): void;
11
+ }
@@ -0,0 +1,2 @@
1
+ export declare const injectFonts: (fontKey: string) => void;
2
+ export declare const applyFonts: (element: HTMLElement, fontKey: string) => void;
@@ -0,0 +1,15 @@
1
+ import CameraControls from "camera-controls";
2
+ import { Vector3, PerspectiveCamera } from 'three';
3
+ import { ViralNavigationCube } from "../viral-navigation-cube";
4
+ export declare class CubeCamera {
5
+ viralNavigationCube: ViralNavigationCube;
6
+ camera: PerspectiveCamera | null;
7
+ cameraControls: CameraControls | null;
8
+ cameraControlOldPosition: Vector3;
9
+ cameraControlNewPosition: Vector3;
10
+ cameraControlHasMoved: boolean;
11
+ constructor(viralNavigationCube: ViralNavigationCube);
12
+ setupCamera(): void;
13
+ updateCubeCamera(): void;
14
+ setupHandle(): void;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { WebGLRenderer } from "three";
2
+ import { ViralNavigationCube } from "../viral-navigation-cube";
3
+ export declare class CubeRenderer {
4
+ viralNavigationCube: ViralNavigationCube;
5
+ renderer: WebGLRenderer;
6
+ constructor(viralNavigationCube: ViralNavigationCube);
7
+ setupRenderer(): void;
8
+ render(): void;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { Scene, Mesh, Object3D, MeshBasicMaterial, BufferGeometry } from 'three';
2
+ import { ViralNavigationCube } from '../viral-navigation-cube';
3
+ export declare class CubeScene {
4
+ viralNavigationCube: ViralNavigationCube;
5
+ scene: Scene;
6
+ objects: Object3D[];
7
+ cube: Mesh | null;
8
+ activePlane: Mesh<BufferGeometry, MeshBasicMaterial> | null;
9
+ constructor(viralNavigationCube: ViralNavigationCube);
10
+ addObject(object: Object3D): void;
11
+ addCube(): void;
12
+ addPlanes(): void;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { ViralNavigationCube } from "../viral-navigation-cube";
2
+ export declare class CubeMouse {
3
+ viralNavigationCube: ViralNavigationCube;
4
+ constructor(viralNavigationCube: ViralNavigationCube);
5
+ private setupMouseClick;
6
+ private handleClick;
7
+ private setupMouseMove;
8
+ private handleMove;
9
+ }
@@ -0,0 +1,16 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ import { CubeCamera } from "./components/cube-camera";
3
+ import { CubeRenderer } from "./components/cube-renderer";
4
+ import { CubeScene } from "./components/cube-scene";
5
+ import { CubeMouse } from "./components/cube.mouse";
6
+ export declare class ViralNavigationCube {
7
+ viralViewerApi: ViralViewerApi;
8
+ targetElement: HTMLElement | null;
9
+ cubeScene: CubeScene | null;
10
+ cubeRenderer: CubeRenderer | null;
11
+ cubeCamera: CubeCamera | null;
12
+ cubeMouse: CubeMouse | null;
13
+ constructor(viralViewerApi: ViralViewerApi);
14
+ private injectCubeWrapperElement;
15
+ private handleClick;
16
+ }
@@ -0,0 +1,10 @@
1
+ import { ViralViewerApi } from "../../viral-viewer-api";
2
+ export declare class ViralSpinner {
3
+ viralViewerApi: ViralViewerApi;
4
+ private spinner;
5
+ private logo;
6
+ constructor(viralViewerApi: ViralViewerApi);
7
+ private injectSpinner;
8
+ showSpinner(): void;
9
+ hideSpinner(): void;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { ViralViewerTool } from "../../../types";
2
+ import { ViralTools } from "../viral-tools";
3
+ export declare class ViralToolAmbientOcclusion {
4
+ viralTools: ViralTools;
5
+ constructor(viralTools: ViralTools);
6
+ activate(input: ViralViewerTool): void;
7
+ }