@inweb/viewer-visualize 27.10.0 → 27.11.0

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 (88) hide show
  1. package/dist/viewer-visualize.js +572 -235
  2. package/dist/viewer-visualize.js.map +1 -1
  3. package/dist/viewer-visualize.min.js +1 -1
  4. package/dist/viewer-visualize.module.js +457 -235
  5. package/dist/viewer-visualize.module.js.map +1 -1
  6. package/lib/Viewer/Commands/ClearSelected.d.ts +1 -1
  7. package/lib/Viewer/Commands/Deselect.d.ts +2 -0
  8. package/lib/Viewer/Commands/Explode.d.ts +1 -1
  9. package/lib/Viewer/Commands/GetHidden.d.ts +2 -0
  10. package/lib/Viewer/Commands/GetIsolated.d.ts +2 -0
  11. package/lib/Viewer/Commands/GetSelected.d.ts +2 -2
  12. package/lib/Viewer/Commands/GetSelected2.d.ts +1 -1
  13. package/lib/Viewer/Commands/Hide.d.ts +2 -0
  14. package/lib/Viewer/Commands/HideAll.d.ts +2 -0
  15. package/lib/Viewer/Commands/HideSelected.d.ts +1 -1
  16. package/lib/Viewer/Commands/Isolate.d.ts +2 -0
  17. package/lib/Viewer/Commands/IsolateSelected.d.ts +1 -1
  18. package/lib/Viewer/Commands/RegenerateAll.d.ts +1 -1
  19. package/lib/Viewer/Commands/ResetView.d.ts +1 -1
  20. package/lib/Viewer/Commands/Select.d.ts +2 -0
  21. package/lib/Viewer/Commands/SelectModel.d.ts +1 -1
  22. package/lib/Viewer/Commands/SetSelected.d.ts +2 -2
  23. package/lib/Viewer/Commands/SetSelected2.d.ts +2 -2
  24. package/lib/Viewer/Commands/Show.d.ts +2 -0
  25. package/lib/Viewer/Commands/ShowAll.d.ts +1 -1
  26. package/lib/Viewer/Commands/ToHandles.d.ts +2 -0
  27. package/lib/Viewer/Commands/ToHandles2.d.ts +2 -0
  28. package/lib/Viewer/Commands/ToggleSelection.d.ts +2 -0
  29. package/lib/Viewer/Commands/ZoomExtents.d.ts +2 -0
  30. package/lib/Viewer/Commands/ZoomTo.d.ts +2 -0
  31. package/lib/Viewer/Commands/ZoomToSelected.d.ts +1 -1
  32. package/lib/Viewer/Components/index.d.ts +1 -1
  33. package/lib/Viewer/Draggers/index.d.ts +2 -2
  34. package/lib/Viewer/Loaders/VSFCloudLoader.d.ts +2 -2
  35. package/lib/Viewer/Loaders/VSFXCloudLoader.d.ts +2 -2
  36. package/lib/Viewer/Loaders/VSFXCloudPartialLoader.d.ts +2 -2
  37. package/lib/Viewer/Loaders/VSFXCloudStreamingLoader.d.ts +2 -2
  38. package/lib/Viewer/Loaders/index.d.ts +4 -2
  39. package/lib/Viewer/Models/ModelImpl.d.ts +14 -0
  40. package/lib/Viewer/Models/ModelImpl.types.d.ts +6 -1
  41. package/lib/Viewer/Viewer.d.ts +18 -3
  42. package/package.json +5 -5
  43. package/src/Viewer/Commands/ClearSelected.ts +4 -8
  44. package/src/Viewer/Commands/Deselect.ts +35 -0
  45. package/src/Viewer/Commands/Explode.ts +4 -6
  46. package/src/Viewer/Commands/GetHidden.ts +30 -0
  47. package/src/Viewer/Commands/GetIsolated.ts +30 -0
  48. package/src/Viewer/Commands/GetModels.ts +2 -3
  49. package/src/Viewer/Commands/GetSelected.ts +5 -30
  50. package/src/Viewer/Commands/GetSelected2.ts +5 -7
  51. package/src/Viewer/Commands/Hide.ts +35 -0
  52. package/src/Viewer/Commands/HideAll.ts +32 -0
  53. package/src/Viewer/Commands/HideSelected.ts +2 -11
  54. package/src/Viewer/Commands/Isolate.ts +41 -0
  55. package/src/Viewer/Commands/IsolateSelected.ts +2 -8
  56. package/src/Viewer/Commands/RegenerateAll.ts +2 -3
  57. package/src/Viewer/Commands/ResetView.ts +2 -4
  58. package/src/Viewer/Commands/Select.ts +36 -0
  59. package/src/Viewer/Commands/SelectModel.ts +11 -14
  60. package/src/Viewer/Commands/SetSelected.ts +8 -19
  61. package/src/Viewer/Commands/SetSelected2.ts +6 -14
  62. package/src/Viewer/Commands/Show.ts +34 -0
  63. package/src/Viewer/Commands/ShowAll.ts +3 -6
  64. package/src/Viewer/Commands/ToHandles.ts +35 -0
  65. package/src/Viewer/Commands/ToHandles2.ts +36 -0
  66. package/src/Viewer/Commands/ToggleSelection.ts +40 -0
  67. package/src/Viewer/Commands/{ZoomToExtents.ts → ZoomExtents.ts} +2 -8
  68. package/src/Viewer/Commands/{ZoomToObjects.ts → ZoomTo.ts} +8 -13
  69. package/src/Viewer/Commands/ZoomToSelected.ts +3 -11
  70. package/src/Viewer/Commands/index.ts +29 -8
  71. package/src/Viewer/Components/index.ts +1 -1
  72. package/src/Viewer/Draggers/Actions/OrbitAction.ts +21 -14
  73. package/src/Viewer/Draggers/Common/OdBaseDragger.ts +32 -32
  74. package/src/Viewer/Draggers/OdZoomWheelDragger.ts +2 -2
  75. package/src/Viewer/Draggers/OrbitAroundBuildingDragger.ts +14 -10
  76. package/src/Viewer/Draggers/index.ts +2 -2
  77. package/src/Viewer/Loaders/VSFCloudLoader.ts +5 -4
  78. package/src/Viewer/Loaders/VSFFileLoader.ts +2 -1
  79. package/src/Viewer/Loaders/VSFXCloudLoader.ts +5 -4
  80. package/src/Viewer/Loaders/VSFXCloudPartialLoader.ts +5 -4
  81. package/src/Viewer/Loaders/VSFXCloudStreamingLoader.ts +5 -4
  82. package/src/Viewer/Loaders/VSFXFileLoader.ts +2 -1
  83. package/src/Viewer/Loaders/index.ts +4 -2
  84. package/src/Viewer/Models/ModelImpl.ts +149 -2
  85. package/src/Viewer/Models/ModelImpl.types.ts +9 -1
  86. package/src/Viewer/Viewer.ts +120 -18
  87. package/lib/Viewer/Commands/ZoomToExtents.d.ts +0 -2
  88. package/lib/Viewer/Commands/ZoomToObjects.d.ts +0 -2
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function clearSelected(viewer: Viewer): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function deselect(viewer: Viewer, handles?: string | string[]): void;
@@ -1,3 +1,3 @@
1
1
  import { Viewer } from "../Viewer";
2
- export declare function explode(viewer: Viewer, index?: number): void;
2
+ export declare function explode(viewer: Viewer, scale?: number): void;
3
3
  export declare function collect(viewer: Viewer): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function getHidden(viewer: Viewer, multimodel?: boolean): string[];
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function getIsolated(viewer: Viewer, multimodel?: boolean): string[];
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
2
- export declare function getSelected(viewer: Viewer): string[];
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function getSelected(viewer: Viewer, multimodel?: boolean): string[];
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function getSelected2(viewer: Viewer): string[];
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function hide(viewer: Viewer, handles: string | string[]): void;
@@ -0,0 +1,2 @@
1
+ import { Viewer } from "../Viewer";
2
+ export declare function hideAll(viewer: Viewer): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function hideSelected(viewer: Viewer): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function isolate(viewer: Viewer, handles: string | string[]): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function isolateSelected(viewer: Viewer): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function regenerateAll(viewer: Viewer): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function resetView(viewer: Viewer): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function select(viewer: Viewer, handles?: string | string[]): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function selectModel(viewer: Viewer, handle: string): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
2
- export declare function setSelected(viewer: Viewer, handles2?: string[]): void;
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function setSelected(viewer: Viewer, handles?: string | string[]): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
2
- export declare function setSelected2(viewer: Viewer, handles2?: string[]): void;
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function setSelected2(viewer: Viewer, handles2?: string | string[]): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function show(viewer: Viewer, handles: string | string[]): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function showAll(viewer: Viewer): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function toHandles(viewer: Viewer, handles2: string | string[]): string[];
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function toHandles2(viewer: Viewer, handles: string | string[]): string[];
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function toggleSelection(viewer: Viewer, handles?: string | string[]): void;
@@ -0,0 +1,2 @@
1
+ import { Viewer } from "../Viewer";
2
+ export declare function zoomExtents(viewer: Viewer): void;
@@ -0,0 +1,2 @@
1
+ import type { Viewer } from "../Viewer";
2
+ export declare function zoomTo(viewer: Viewer, handles?: string | string[]): void;
@@ -1,2 +1,2 @@
1
- import { Viewer } from "../Viewer";
1
+ import type { Viewer } from "../Viewer";
2
2
  export declare function zoomToSelected(viewer: Viewer): void;
@@ -30,7 +30,7 @@ import { IComponentsRegistry } from "@inweb/viewer-core";
30
30
  * }
31
31
  *
32
32
  * onGeometryEnd = (event: MouseEvent) => {
33
- * this.viewer.executeCommand("zoomToExtents");
33
+ * this.viewer.zoomExtents();
34
34
  * };
35
35
  *
36
36
  * }
@@ -21,11 +21,11 @@ import { IDraggersRegistry } from "@inweb/viewer-core";
21
21
  *
22
22
  * constructor(viewer: Viewer) {
23
23
  * this.viewer = viewer;
24
- * this.viewer.addEventListener("pointermove", this.onPointerMove);
24
+ * this.viewer.canvas.addEventListener("pointermove", this.onPointerMove);
25
25
  * }
26
26
  *
27
27
  * override dispose() {
28
- * this.viewer.removeEventListener("pointermove", this.onPointerMove);
28
+ * this.viewer.canvas.removeEventListener("pointermove", this.onPointerMove);
29
29
  * }
30
30
  *
31
31
  * onPointerMove = (event: PointerEvent) => {
@@ -1,8 +1,8 @@
1
- import { Loader } from "@inweb/viewer-core";
1
+ import { Loader, LoadParams } from "@inweb/viewer-core";
2
2
  import { Viewer } from "../Viewer";
3
3
  export declare class VSFCloudLoader extends Loader {
4
4
  viewer: Viewer;
5
5
  constructor(viewer: Viewer);
6
6
  isSupport(file: any, format?: string): boolean;
7
- load(model: any, format?: string): Promise<this>;
7
+ load(model: any, format?: string, params?: LoadParams): Promise<this>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { Loader } from "@inweb/viewer-core";
1
+ import { Loader, LoadParams } from "@inweb/viewer-core";
2
2
  import { Viewer } from "../Viewer";
3
3
  export declare class VSFXCloudLoader extends Loader {
4
4
  viewer: Viewer;
5
5
  constructor(viewer: Viewer);
6
6
  isSupport(file: any): boolean;
7
- load(model: any): Promise<this>;
7
+ load(model: any, format?: string, params?: LoadParams): Promise<this>;
8
8
  }
@@ -1,10 +1,10 @@
1
- import { Loader } from "@inweb/viewer-core";
1
+ import { Loader, LoadParams } from "@inweb/viewer-core";
2
2
  import { Viewer } from "../Viewer";
3
3
  export declare class VSFXCloudPartialLoader extends Loader {
4
4
  viewer: Viewer;
5
5
  abortControllerForRequestMap: Map<number, AbortController>;
6
6
  constructor(viewer: Viewer);
7
7
  isSupport(file: any): boolean;
8
- load(model: any): Promise<this>;
8
+ load(model: any, format?: string, params?: LoadParams): Promise<this>;
9
9
  cancel(): void;
10
10
  }
@@ -1,8 +1,8 @@
1
- import { Loader } from "@inweb/viewer-core";
1
+ import { Loader, LoadParams } from "@inweb/viewer-core";
2
2
  import { Viewer } from "../Viewer";
3
3
  export declare class VSFXCloudStreamingLoader extends Loader {
4
4
  viewer: Viewer;
5
5
  constructor(viewer: Viewer);
6
6
  isSupport(file: any): boolean;
7
- load(model: any): Promise<this>;
7
+ load(model: any, format?: string, params?: LoadParams): Promise<this>;
8
8
  }
@@ -47,10 +47,12 @@ import { ILoadersRegistry } from "@inweb/viewer-core";
47
47
  * // load VSFX data from file (custom loading logic)
48
48
  * const data = await fetch(file).then((result) => result.arrayBuffer());
49
49
  *
50
- * const modelImpl = new ModelImpl();
50
+ * this.viewer.visViewer().parseVsfx(new Uint8Array(data));
51
+ *
52
+ * const modelImpl = new ModelImpl(this.viewer.visualizeJs);
51
53
  * modelImpl.id = params.modelId;
54
+ * modelImpl.initialize();
52
55
  *
53
- * this.viewer.visViewer().parseVsfx(new Uint8Array(data));
54
56
  * this.viewer.models.push(modelImpl);
55
57
  *
56
58
  * this.viewer.syncOptions();
@@ -1,5 +1,19 @@
1
1
  import { IModelImpl } from "./ModelImpl.types";
2
2
  export declare class ModelImpl implements IModelImpl {
3
3
  id: string;
4
+ visualizeJs: any;
5
+ constructor(visualizeJs: any);
4
6
  dispose(): void;
7
+ initialize(): void;
8
+ getHandlesByEntityIterator(iterator: any): string[];
9
+ getHandlesBySelectionSet(selectionSet: any): string[];
10
+ getSelectionSetByHandles(handles: string[]): any;
11
+ hide(handles: string[]): this;
12
+ hideAll(): this;
13
+ isolate(handles: string[]): this;
14
+ show(handles: string[]): this;
15
+ showAll(): this;
16
+ highlight(handles: string[]): this;
17
+ unhighlight(handles: string[]): this;
18
+ explode(scale: 0, coeff?: number): this;
5
19
  }
@@ -2,4 +2,9 @@ import { IModel } from "@inweb/viewer-core";
2
2
  /**
3
3
  * Basic model implementation.
4
4
  */
5
- export type IModelImpl = IModel;
5
+ export interface IModelImpl extends IModel {
6
+ initialize(): void;
7
+ getHandlesByEntityIterator(iterator: any): string[];
8
+ getHandlesBySelectionSet(selectionSet: any): string[];
9
+ getSelectionSetByHandles(handles: string[]): any;
10
+ }
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter2 } from "@inweb/eventemitter2";
2
2
  import { Assembly, Client, File, Model } from "@inweb/client";
3
- import { CanvasEventMap, FileSource, IComponent, IDragger, IInfo, ILoader, IOptions, IViewer, IViewpoint, OptionsEventMap, ViewerEventMap } from "@inweb/viewer-core";
3
+ import { CanvasEventMap, FileSource, IComponent, IDragger, IInfo, ILoader, IOptions, IViewer, IViewpoint, OptionsEventMap, Selector, ViewerEventMap, VisibilityManager } from "@inweb/viewer-core";
4
4
  import { IMarkup, IWorldTransform } from "@inweb/markup";
5
5
  import { IModelImpl } from "./Models/ModelImpl.types";
6
6
  import { MarkupType } from "./Markup/MarkupFactory";
@@ -21,6 +21,9 @@ export declare class Viewer extends EventEmitter2<ViewerEventMap & CanvasEventMa
21
21
  private _visualizeTimestamp;
22
22
  private _viewer;
23
23
  private _crossOrigin;
24
+ selector: Selector;
25
+ visibilityManager: VisibilityManager;
26
+ explodeScale: number;
24
27
  private _activeDragger;
25
28
  private _components;
26
29
  private _renderNeeded;
@@ -219,14 +222,26 @@ export declare class Viewer extends EventEmitter2<ViewerEventMap & CanvasEventMa
219
222
  syncOverlay(): void;
220
223
  clearOverlay(): void;
221
224
  clearSlices(): void;
222
- getSelected(): string[];
223
- setSelected(handles?: string[]): void;
225
+ getSelected(multimodel?: boolean): string[];
224
226
  getSelected2(): string[];
227
+ setSelected(handles?: string[]): void;
225
228
  setSelected2(handles?: string[]): void;
229
+ select(handles: string | string[]): void;
230
+ deselect(handles: string | string[]): void;
231
+ toggleSelection(handles: string | string[]): void;
226
232
  clearSelected(): void;
233
+ getHidden(multimodel?: boolean): string[];
234
+ getIsolated(multimodel?: boolean): string[];
235
+ hide(handle: string | string[]): void;
236
+ hideAll(): void;
227
237
  hideSelected(): void;
238
+ isolate(handle: string | string[]): void;
228
239
  isolateSelected(): void;
240
+ show(handle: string | string[]): void;
229
241
  showAll(): void;
242
+ zoomExtents(): void;
243
+ zoomTo(handles: string | string[]): void;
244
+ zoomToSelected(): void;
230
245
  explode(index?: number): void;
231
246
  collect(): void;
232
247
  activeDragger(): IDragger | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/viewer-visualize",
3
- "version": "27.10.0",
3
+ "version": "27.11.0",
4
4
  "description": "JavaScript library for rendering CAD and BIM files in a browser using VisualizeJS",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -29,10 +29,10 @@
29
29
  "docs": "typedoc"
30
30
  },
31
31
  "dependencies": {
32
- "@inweb/client": "~27.10.0",
33
- "@inweb/eventemitter2": "~27.10.0",
34
- "@inweb/markup": "~27.10.0",
35
- "@inweb/viewer-core": "~27.10.0"
32
+ "@inweb/client": "~27.11.0",
33
+ "@inweb/eventemitter2": "~27.11.0",
34
+ "@inweb/markup": "~27.11.0",
35
+ "@inweb/viewer-core": "~27.11.0"
36
36
  },
37
37
  "visualizeJS": "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/master/Visualize.js"
38
38
  }
@@ -21,16 +21,12 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { Viewer } from "../Viewer";
24
+ import type { Viewer } from "../Viewer";
25
25
 
26
26
  export function clearSelected(viewer: Viewer): void {
27
- if (!viewer.visualizeJs) return;
28
-
29
- const visViewer = viewer.visViewer();
30
- visViewer.unselect();
27
+ viewer.selector.clearSelected();
31
28
 
29
+ viewer.emitEvent({ type: "select" });
30
+ viewer.emitEvent({ type: "select2" }); // @deprecated
32
31
  viewer.update();
33
-
34
- viewer.emitEvent({ type: "select", handles: [] });
35
- viewer.emitEvent({ type: "select2", handles: [] });
36
32
  }
@@ -0,0 +1,35 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2026, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import type { Viewer } from "../Viewer";
25
+ import { toHandles } from "./ToHandles";
26
+
27
+ export function deselect(viewer: Viewer, handles: string | string[] = []): void {
28
+ handles = toHandles(viewer, handles);
29
+
30
+ viewer.selector.deselect(handles);
31
+
32
+ viewer.emitEvent({ type: "select" });
33
+ viewer.emitEvent({ type: "select2" }); // @deprecated
34
+ viewer.update();
35
+ }
@@ -23,14 +23,12 @@
23
23
 
24
24
  import { Viewer } from "../Viewer";
25
25
 
26
- export function explode(viewer: Viewer, index = 0): void {
27
- if (!viewer.visualizeJs) return;
28
-
29
- const visViewer = viewer.visViewer();
30
- visViewer.explode(index);
26
+ export function explode(viewer: Viewer, scale = 0): void {
27
+ viewer.models.forEach((model) => model.explode(scale));
28
+ viewer.explodeScale = scale;
31
29
 
32
30
  viewer.update();
33
- viewer.emitEvent({ type: "explode", data: index });
31
+ viewer.emitEvent({ type: "explode", data: scale });
34
32
  }
35
33
 
36
34
  export function collect(viewer: Viewer) {
@@ -0,0 +1,30 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2026, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import type { Viewer } from "../Viewer";
25
+ import { toHandles2 } from "./ToHandles2";
26
+
27
+ export function getHidden(viewer: Viewer, multimodel = false): string[] {
28
+ const handles = Array.from(viewer.visibilityManager.hidden);
29
+ return multimodel ? toHandles2(viewer, handles) : handles;
30
+ }
@@ -0,0 +1,30 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2026, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import type { Viewer } from "../Viewer";
25
+ import { toHandles2 } from "./ToHandles2";
26
+
27
+ export function getIsolated(viewer: Viewer, multimodel = false): string[] {
28
+ const handles = Array.from(viewer.visibilityManager.isolated);
29
+ return multimodel ? toHandles2(viewer, handles) : handles;
30
+ }
@@ -24,15 +24,14 @@
24
24
  import { Viewer } from "../Viewer";
25
25
 
26
26
  export function getModels(viewer: Viewer): string[] {
27
- if (!viewer.visualizeJs) return [];
28
-
29
27
  const visViewer = viewer.visViewer();
30
28
 
31
29
  const handles: string[] = [];
32
30
  const modelItr = visViewer.getModelIterator();
33
- for (; !modelItr.done(); modelItr.step()) {
31
+ while (!modelItr.done()) {
34
32
  const modelPtr = modelItr.getModel();
35
33
  if (modelPtr.getName()[0] !== "$") handles.push(modelPtr.getDatabaseHandle());
34
+ modelItr.step();
36
35
  }
37
36
  modelItr.delete();
38
37
 
@@ -21,35 +21,10 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { Viewer } from "../Viewer";
24
+ import type { Viewer } from "../Viewer";
25
+ import { toHandles2 } from "./ToHandles2";
25
26
 
26
- export function getSelected(viewer: Viewer): string[] {
27
- if (!viewer.visualizeJs) return [];
28
-
29
- const visViewer = viewer.visViewer();
30
-
31
- const handles: string[] = [];
32
- const selectionSet = visViewer.getSelected();
33
- if (!selectionSet.isNull() && selectionSet.numItems() !== 0) {
34
- const itr = selectionSet.getIterator();
35
- for (; !itr.done(); itr.step()) {
36
- const entityId = itr.getEntity();
37
-
38
- const entityPtr =
39
- entityId.getType() === 1
40
- ? entityId.openObject()
41
- : entityId.getType() === 2
42
- ? entityId.openObjectAsInsert()
43
- : null;
44
-
45
- if (entityPtr) {
46
- const handle = entityPtr.getNativeDatabaseHandle();
47
- if (handle !== "-1") handles.push(handle);
48
- entityPtr.delete();
49
- }
50
- }
51
- itr.delete();
52
- }
53
-
54
- return handles;
27
+ export function getSelected(viewer: Viewer, multimodel = false): string[] {
28
+ const handles = Array.from(viewer.selector.selected);
29
+ return multimodel ? toHandles2(viewer, handles) : handles;
55
30
  }
@@ -21,13 +21,11 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { Viewer } from "../Viewer";
24
+ import type { Viewer } from "../Viewer";
25
25
 
26
26
  export function getSelected2(viewer: Viewer): string[] {
27
- const handles = viewer.executeCommand("getSelected");
28
-
29
- const model = viewer.models[0];
30
- const handles2 = handles.map((handle) => `${model.id}:${handle}`);
31
-
32
- return handles2;
27
+ console.warn(
28
+ "getSelected2 command has been deprecated since 27.11 and will be removed in a future release, use getSelected instead"
29
+ );
30
+ return viewer.executeCommand("getSelected", true);
33
31
  }
@@ -0,0 +1,35 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2026, Open Design Alliance ("the Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import type { Viewer } from "../Viewer";
25
+ import { toHandles } from "./ToHandles";
26
+
27
+ export function hide(viewer: Viewer, handles: string | string[]): void {
28
+ handles = toHandles(viewer, handles);
29
+
30
+ viewer.deselect(handles);
31
+ viewer.visibilityManager.hide(handles);
32
+
33
+ viewer.emitEvent({ type: "hide" });
34
+ viewer.update();
35
+ }
@@ -0,0 +1,32 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2026, Open Design Alliance ("the Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import { Viewer } from "../Viewer";
25
+
26
+ export function hideAll(viewer: Viewer): void {
27
+ viewer.clearSelected();
28
+ viewer.visibilityManager.hideAll();
29
+
30
+ viewer.emitEvent({ type: "hideall" });
31
+ viewer.update();
32
+ }