@inweb/viewer-core 25.8.16 → 25.8.19

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.
@@ -169,9 +169,9 @@
169
169
  }
170
170
  }
171
171
  /**
172
- * Reset options to default
172
+ * Resets options to default values.
173
173
  *
174
- * @param fields - Name of fields to be reset
174
+ * @param fields - Name of fields to be reset. Specify `undefined` to reset all.
175
175
  */
176
176
  resetToDefaults(fields) {
177
177
  if (fields !== undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"viewer-core.js","sources":["../src/commands/Commands.ts","../src/options/IOptions.ts","../src/options/Options.ts","../src/viewer/CanvasEvents.ts","../src/viewer/IDragger.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IViewer } from \"../viewer/IViewer\";\nimport { ICommand, ICommandHandler, ICommandDescription, ICommandsMap, ICommands } from \"./ICommands\";\n\nclass Commands implements ICommands {\n private readonly _commands = new Map<string, ICommand>();\n\n registerCommand(id: string, handler: ICommandHandler, description?: ICommandDescription, thisArg?: any): void {\n this._commands.set(id, { id, handler, thisArg, description });\n }\n\n registerCommandAlias(id: string, alias: string): void {\n this.registerCommand(alias, (viewer: IViewer, ...args) => this.executeCommand(id, viewer, ...args));\n }\n\n getCommand(id: string): ICommand | undefined {\n return this._commands.get(id);\n }\n\n getCommands(): ICommandsMap {\n const map = new Map<string, ICommand>();\n this._commands.forEach((value, key) => map.set(key, value));\n return map;\n }\n\n executeCommand(id: string, viewer: IViewer, ...args: any[]): any {\n const command = this._commands.get(id);\n if (!command) {\n if (viewer) {\n const isDraggerCommand = viewer.draggers.includes(id);\n if (isDraggerCommand) return viewer.setActiveDragger(id);\n }\n\n console.warn(`Command '${id}' not found`);\n return undefined;\n }\n\n const { handler, thisArg } = command;\n const result = handler.apply(thisArg, [viewer, ...args]);\n\n viewer?.emit({ type: \"command\", data: id, args });\n\n return result;\n }\n}\n\nconst _commands = new Map<string, Commands>();\n\nfunction commands(viewerType = \"\"): ICommands {\n let result = _commands.get(viewerType);\n if (!result) {\n result = new Commands();\n _commands.set(viewerType, result);\n }\n return result;\n}\n\ncommands(\"\").registerCommand(\"noop\", () => {});\ncommands(\"VisualizeJS\").registerCommand(\"noop\", () => {});\ncommands(\"ThreeJS\").registerCommand(\"noop\", () => {});\n\nexport { commands };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport interface RGB {\n red: number;\n green: number;\n blue: number;\n}\n\n/**\n * Viewer parameters.\n */\nexport interface IOptions {\n /**\n * Show WCS\n *\n * @defaultValue true\n */\n showWCS?: boolean;\n\n /**\n * Enable camera animation\n *\n * @defaultValue true\n */\n cameraAnimation?: boolean;\n\n /**\n * Enable antialiasing use FXAA\n *\n * @defaultValue true\n */\n antialiasing?: boolean;\n\n /**\n * Enable ground shadows\n *\n * @defaultValue false\n */\n groundShadow?: boolean;\n\n /**\n * Enable shadows\n *\n * @defaultValue false\n */\n shadows?: boolean;\n\n /**\n * Camera speed on X axis\n *\n * @defaultValue 4\n */\n cameraAxisXSpeed?: number;\n\n /**\n * Camera speed on Y axis\n *\n * @defaultValue 1\n */\n cameraAxisYSpeed?: number;\n\n /**\n * Ambient occlusion\n *\n * @defaultValue false\n */\n ambientOcclusion?: boolean;\n\n /**\n * Enable streaming of drawings from the server\n *\n * If streaming is disabled, the file/assembly will be loaded in one go. If streaming is\n * enabled, partial download mode may be enabled as well.\n *\n * @defaultValue true\n */\n enableStreamingMode?: boolean;\n\n /**\n * Enable partial load mode to be able open large drawing. Only used if streaming is enabled.\n * If partial mode is enabled, then scene graph will be disabled.\n *\n * @defaultValue false\n */\n enablePartialMode?: boolean;\n\n /**\n * The size of the memory buffer that the Viewer can use for graphics data\n *\n * @defaultValue 3294967296\n */\n memoryLimit?: number;\n\n /**\n * Cutting plane fill color\n *\n * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }\n */\n cuttingPlaneFillColor?: RGB;\n\n /**\n * Outline edges color in RGB format.\n */\n edgesColor?: { r: number; g: number; b: number };\n\n /**\n * Faces color in the RGB format.\n */\n facesColor?: { r: number; g: number; b: number };\n\n /**\n * Show or hide edges.\n */\n edgesVisibility?: boolean;\n\n /**\n * Show edges over drawing.\n */\n edgesOverlap?: boolean;\n\n /**\n * Show faces over drawing.\n */\n facesOverlap?: boolean;\n\n /**\n * Faces transparency value from 0 to 255.\n */\n facesTransparancy?: number;\n\n /**\n * Enable custom highlight settings.\n */\n enableCustomHighlight?: boolean;\n\n /**\n * Enable or disable scene graph, it increases perfomance improvement, but consumes memory.\n * Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode\n * will be disabled\n */\n sceneGraph: boolean;\n\n /**\n * Edge display models. No edges is usefull for less memory consumption: `false` - no edges\n * are displayed, `true` - display isolines.\n */\n edgeModel: boolean;\n\n /**\n * Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,\n * moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.\n */\n reverseZoomWheel: boolean;\n\n /**\n * Enable mouse wheel zooming.\n */\n enableZoomWheel: boolean;\n\n /**\n * Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since\n * gestures contains touch zoom.\n */\n enableGestures: boolean;\n\n /**\n * Default file geometry data type. Can be one of:\n *\n * - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.\n * - `gltf` - `glTF`, for opening a file in `Three.js` viewer.\n */\n geometryType?: string;\n}\n\nexport function defaultOptions(): IOptions {\n return {\n showWCS: true,\n cameraAnimation: true,\n antialiasing: true,\n groundShadow: false,\n shadows: false,\n cameraAxisXSpeed: 4,\n cameraAxisYSpeed: 1,\n ambientOcclusion: false,\n enableStreamingMode: true,\n enablePartialMode: false,\n memoryLimit: 3294967296,\n cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },\n edgesColor: { r: 0xff, g: 0x98, b: 0x00 },\n facesColor: { r: 0xff, g: 0x98, b: 0x00 },\n edgesVisibility: true,\n edgesOverlap: true,\n facesOverlap: false,\n facesTransparancy: 200,\n enableCustomHighlight: true,\n sceneGraph: false,\n edgeModel: true,\n reverseZoomWheel: false,\n enableZoomWheel: true,\n enableGestures: true,\n geometryType: \"vsfx\",\n };\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { EventEmitter2 } from \"@inweb/eventemitter2\";\nimport { IOptions, RGB, defaultOptions } from \"./IOptions\";\n\nexport class Options implements IOptions {\n protected _emitter?: EventEmitter2;\n protected _data: IOptions;\n\n constructor(emitter?: EventEmitter2) {\n this._emitter = emitter;\n this._data = defaultOptions();\n this.loadFromStorage();\n }\n\n static defaults(): IOptions {\n return defaultOptions();\n }\n\n notifierChangeEvent(): void {\n console.warn(\n \"Options.notifierChangeEvent() has been deprecated since 25.3 and will be removed in a future release, use Options.change() instead.\"\n );\n this.change();\n }\n\n change(): void {\n if (this._emitter !== undefined) {\n this.saveToStorage();\n this._emitter.emit({ type: \"optionschange\", data: this });\n }\n }\n\n saveToStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n localStorage.setItem(\"od-client-settings\", JSON.stringify(this.data));\n } catch (error) {\n console.error(\"Cannot save client settings.\", error);\n }\n }\n\n loadFromStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n const item = localStorage.getItem(\"od-client-settings\");\n if (item) {\n const data = JSON.parse(item);\n this.data = { ...data };\n }\n } catch (error) {\n console.error(\"Cannot load client settings.\", error);\n }\n }\n\n /**\n * Reset options to default\n *\n * @param fields - Name of fields to be reset\n */\n resetToDefaults(fields?: string[]): void {\n if (fields !== undefined) {\n const defaults = Options.defaults();\n const resetData = fields.reduce((acc, field) => {\n acc[field] = defaults[field];\n return acc;\n }, {});\n\n this.data = { ...this.data, ...resetData };\n } else {\n this.data = { ...this.data, ...Options.defaults() };\n }\n }\n\n get data(): IOptions {\n return this._data;\n }\n\n set data(value: IOptions) {\n const enablePartialMode = value.enableStreamingMode ? value.enablePartialMode : false;\n const sceneGraph = enablePartialMode ? false : value.sceneGraph;\n this._data = { ...Options.defaults(), ...this._data, ...value, enablePartialMode, sceneGraph };\n this.change();\n }\n\n get showWCS(): boolean {\n return this._data.showWCS;\n }\n\n set showWCS(value: boolean) {\n this._data.showWCS = value;\n this.change();\n }\n\n get cameraAnimation(): boolean {\n return this._data.cameraAnimation;\n }\n\n set cameraAnimation(value: boolean) {\n this._data.cameraAnimation = value;\n this.change();\n }\n\n get antialiasing(): boolean {\n return this._data.antialiasing;\n }\n\n set antialiasing(value: boolean) {\n this._data.antialiasing = value;\n this.change();\n }\n\n get groundShadow(): boolean {\n return this._data.groundShadow;\n }\n\n set groundShadow(value: boolean) {\n this._data.groundShadow = value;\n this.change();\n }\n\n get shadows(): boolean {\n return this._data.shadows;\n }\n\n set shadows(value: boolean) {\n this._data.shadows = value;\n this.change();\n }\n\n get cameraAxisXSpeed(): number {\n return this._data.cameraAxisXSpeed;\n }\n\n set cameraAxisXSpeed(value: number) {\n this._data.cameraAxisXSpeed = value;\n this.change();\n }\n\n get cameraAxisYSpeed(): number {\n return this._data.cameraAxisYSpeed;\n }\n\n set cameraAxisYSpeed(value: number) {\n this.cameraAxisYSpeed = value;\n this.change();\n }\n\n get ambientOcclusion(): boolean {\n return this._data.ambientOcclusion;\n }\n\n set ambientOcclusion(value: boolean) {\n this._data.ambientOcclusion = value;\n this.change();\n }\n\n get enableStreamingMode(): boolean {\n return this._data.enableStreamingMode;\n }\n\n set enableStreamingMode(value: boolean) {\n this._data.enableStreamingMode = value;\n if (!value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get enablePartialMode(): boolean {\n return this._data.enablePartialMode;\n }\n\n set enablePartialMode(value: boolean) {\n this._data.enablePartialMode = value;\n if (value) {\n this._data.enableStreamingMode = true;\n this._data.sceneGraph = false;\n }\n this.change();\n }\n\n get memoryLimit(): number {\n return this._data.memoryLimit;\n }\n\n set memoryLimit(value: number) {\n this._data.memoryLimit = value;\n this.change();\n }\n\n get cuttingPlaneFillColor(): RGB {\n return this._data.cuttingPlaneFillColor;\n }\n\n set cuttingPlaneFillColor(value: RGB) {\n this._data.cuttingPlaneFillColor = value;\n this.change();\n }\n\n get edgesColor() {\n return this._data.edgesColor;\n }\n\n set edgesColor(value) {\n this._data.edgesColor = value;\n this.change();\n }\n\n get facesColor() {\n return this._data.facesColor;\n }\n\n set facesColor(value) {\n this._data.facesColor = value;\n this.change();\n }\n\n get edgesVisibility() {\n return this._data.edgesVisibility;\n }\n\n set edgesVisibility(value) {\n this._data.edgesVisibility = value;\n this.change();\n }\n\n get edgesOverlap() {\n return this._data.edgesOverlap;\n }\n\n set edgesOverlap(value) {\n this._data.edgesOverlap = value;\n this.change();\n }\n\n get facesOverlap() {\n return this._data.facesOverlap;\n }\n\n set facesOverlap(value) {\n this._data.facesOverlap = value;\n this.change();\n }\n\n get facesTransparancy() {\n return this._data.facesTransparancy;\n }\n\n set facesTransparancy(value) {\n this._data.facesTransparancy = value;\n this.change();\n }\n\n get enableCustomHighlight() {\n return this._data.enableCustomHighlight;\n }\n\n set enableCustomHighlight(value) {\n this._data.enableCustomHighlight = value;\n this.change();\n }\n\n get sceneGraph() {\n return this._data.sceneGraph;\n }\n\n set sceneGraph(value) {\n this._data.sceneGraph = value;\n if (value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get edgeModel() {\n return Boolean(this._data.edgeModel);\n }\n\n set edgeModel(value) {\n this._data.edgeModel = Boolean(value);\n this.change();\n }\n\n get reverseZoomWheel() {\n return this._data.reverseZoomWheel;\n }\n\n set reverseZoomWheel(value: boolean) {\n this._data.reverseZoomWheel = !!value;\n this.change();\n }\n\n get enableZoomWheel() {\n return this._data.enableZoomWheel;\n }\n\n set enableZoomWheel(value: boolean) {\n this._data.enableZoomWheel = !!value;\n this.change();\n }\n\n get enableGestures() {\n return this._data.enableGestures;\n }\n\n set enableGestures(value: boolean) {\n this._data.enableGestures = !!value;\n this.change();\n }\n\n get geometryType() {\n return this._data.geometryType;\n }\n\n set geometryType(value: string) {\n this._data.geometryType = value;\n this.change();\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport const CanvasEvents = [\n \"click\",\n \"contextmenu\",\n \"dblclick\",\n \"mousedown\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseup\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerup\",\n \"touchcancel\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n];\n\nexport const CANVAS_EVENTS = CanvasEvents;\n\n/**\n * Canvas Events.\n *\n * @event\n */\nexport interface CanvasEventMap {\n /**\n * Event that fires on mouse click.\n */\n click: MouseEvent;\n\n /**\n * Event that fires when the user attempts to open a context menu.\n */\n contextmenu: PointerEvent;\n\n /**\n * Event that fires on mouse double click.\n */\n dblclick: MouseEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n mousedown: MouseEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n mouseleave: MouseEvent;\n\n /**\n * Event that fires on mouse move.\n */\n mousemove: MouseEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n mouseup: MouseEvent;\n\n /**\n * Event is fired when the browser determines that there are unlikely to be any more pointer events.\n */\n pointercancel: PointerEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n pointerdown: PointerEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n pointerleave: PointerEvent;\n\n /**\n * Event that fires on mouse move.\n */\n pointermove: PointerEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n pointerup: PointerEvent;\n\n /**\n * Event that fires touch is canceled.\n */\n touchcancel: TouchEvent;\n\n /**\n * Event that fires touch is ended.\n */\n touchend: TouchEvent;\n\n /**\n * Event that fires touch is moving.\n */\n touchmove: TouchEvent;\n\n /**\n * Event that fires when touch is started.\n */\n touchstart: TouchEvent;\n\n /**\n * Event that fires when mouse wheel is moving.\n */\n wheel: MouseEvent;\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport type { IViewer } from \"./IViewer\";\n\nexport interface IDragger {\n name: string;\n initialize(): void;\n dispose(): void;\n updatePreview(): void;\n}\n\nexport class Dragger implements IDragger {\n name = \"\";\n\n constructor(viewer: IViewer) {}\n\n initialize(): void {}\n\n dispose(): void {}\n\n updatePreview(): void {}\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;I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AAG;QAC1B,OAAO;QACP,aAAa;QACb,UAAU;QACV,WAAW;QACX,YAAY;QACZ,WAAW;QACX,SAAS;QACT,eAAe;QACf,aAAa;QACb,cAAc;QACd,aAAa;QACb,WAAW;QACX,aAAa;QACb,UAAU;QACV,WAAW;QACX,YAAY;QACZ,OAAO;MACP;AAEK,UAAM,aAAa,GAAG;;IC3C7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;UAWa,OAAO,CAAA;IAGlB,IAAA,WAAA,CAAY,MAAe,EAAA;YAF3B,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;SAEqB;IAE/B,IAAA,UAAU,MAAW;IAErB,IAAA,OAAO,MAAW;IAElB,IAAA,aAAa,MAAW;IACzB;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"viewer-core.js","sources":["../src/commands/Commands.ts","../src/options/IOptions.ts","../src/options/Options.ts","../src/viewer/CanvasEvents.ts","../src/viewer/IDragger.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IViewer } from \"../viewer/IViewer\";\nimport { ICommand, ICommandHandler, ICommandDescription, ICommandsMap, ICommands } from \"./ICommands\";\n\nclass Commands implements ICommands {\n private readonly _commands = new Map<string, ICommand>();\n\n registerCommand(id: string, handler: ICommandHandler, description?: ICommandDescription, thisArg?: any): void {\n this._commands.set(id, { id, handler, thisArg, description });\n }\n\n registerCommandAlias(id: string, alias: string): void {\n this.registerCommand(alias, (viewer: IViewer, ...args) => this.executeCommand(id, viewer, ...args));\n }\n\n getCommand(id: string): ICommand | undefined {\n return this._commands.get(id);\n }\n\n getCommands(): ICommandsMap {\n const map = new Map<string, ICommand>();\n this._commands.forEach((value, key) => map.set(key, value));\n return map;\n }\n\n executeCommand(id: string, viewer: IViewer, ...args: any[]): any {\n const command = this._commands.get(id);\n if (!command) {\n if (viewer) {\n const isDraggerCommand = viewer.draggers.includes(id);\n if (isDraggerCommand) return viewer.setActiveDragger(id);\n }\n\n console.warn(`Command '${id}' not found`);\n return undefined;\n }\n\n const { handler, thisArg } = command;\n const result = handler.apply(thisArg, [viewer, ...args]);\n\n viewer?.emit({ type: \"command\", data: id, args });\n\n return result;\n }\n}\n\nconst _commands = new Map<string, Commands>();\n\nfunction commands(viewerType = \"\"): ICommands {\n let result = _commands.get(viewerType);\n if (!result) {\n result = new Commands();\n _commands.set(viewerType, result);\n }\n return result;\n}\n\ncommands(\"\").registerCommand(\"noop\", () => {});\ncommands(\"VisualizeJS\").registerCommand(\"noop\", () => {});\ncommands(\"ThreeJS\").registerCommand(\"noop\", () => {});\n\nexport { commands };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport interface RGB {\n red: number;\n green: number;\n blue: number;\n}\n\n/**\n * Viewer options interface.\n */\nexport interface IOptions {\n /**\n * Show the world coordinate system axes in the bottom-left corner of the viewer.\n *\n * @defaultValue true\n */\n showWCS?: boolean;\n\n /**\n * Enable camera animation.\n *\n * @defaultValue true\n */\n cameraAnimation?: boolean;\n\n /**\n * Enable anti-aliasing using FXAA.\n *\n * @defaultValue true\n */\n antialiasing?: boolean;\n\n /**\n * Show ground shadows below the model.\n *\n * @defaultValue false\n */\n groundShadow?: boolean;\n\n /**\n * Enable ambient shadows.\n *\n * @defaultValue false\n */\n shadows?: boolean;\n\n /**\n * Camera speed on X axis.\n *\n * @defaultValue 4\n */\n cameraAxisXSpeed?: number;\n\n /**\n * Camera speed on Y axis.\n *\n * @defaultValue 1\n */\n cameraAxisYSpeed?: number;\n\n /**\n * Enable ambient occlusion.\n *\n * @defaultValue false\n */\n ambientOcclusion?: boolean;\n\n /**\n * Enable streaming of drawings from the server.\n *\n * If streaming is disabled, the file/assembly will be loaded in one go. The viewer will only\n * update once the loading is complete, which may take a while.\n *\n * If streaming is enabled, {@link enablePartialMode | partial download} mode may be enabled as well.\n *\n * @defaultValue true\n */\n enableStreamingMode?: boolean;\n\n /**\n * Enable partial load mode to be able open large drawing.\n *\n * In partial loading mode, the viewer keeps only visible objects in memory and loads other\n * objects when the zoom or viewpoint changes.\n *\n * Only used if {@link enableStreamingMode | streaming} is enabled. If partial mode is\n * enabled, then {@link sceneGraph | scene graph} will be disabled.\n *\n * @defaultValue false\n */\n enablePartialMode?: boolean;\n\n /**\n * The size of the memory buffer for graphics data, in bytes.\n *\n * @defaultValue 3294967296\n */\n memoryLimit?: number;\n\n /**\n * Cutting planes fill color.\n *\n * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }\n */\n cuttingPlaneFillColor?: RGB;\n\n /**\n * Edges highlight color.\n */\n edgesColor?: { r: number; g: number; b: number };\n\n /**\n * Faces highlight color.\n */\n facesColor?: { r: number; g: number; b: number };\n\n /**\n * Show highlighted edges.\n */\n edgesVisibility?: boolean;\n\n /**\n * Show highlighted edges over drawing.\n */\n edgesOverlap?: boolean;\n\n /**\n * Show highlighted faces over drawing.\n */\n facesOverlap?: boolean;\n\n /**\n * Highlighted faces transparency value, from 0 to 255.\n */\n facesTransparancy?: number;\n\n /**\n * Enable custom highlight settings.\n */\n enableCustomHighlight?: boolean;\n\n /**\n * Enable scene graph.\n *\n * Scene graph increases perfomance improvement, but consumes memory. Large drawings can take\n * up a lot of memory. If scene graph is enabled, then\n * {@link enablePartialMode | partial load mode} will be disabled.\n */\n sceneGraph: boolean;\n\n /**\n * Show the edges of the model:\n *\n * - `false` - No model edges are displayed. Usefull for less memory consumption.\n * - `true` - Display isolines.\n */\n edgeModel: boolean;\n\n /**\n * Reverse the mouse wheel direction for zooming:\n *\n * - `false` - Moving the wheel up zooms in, moving down zooms out.\n * - `true` - Moving the wheel up zooms out, moving down zooms in.\n */\n reverseZoomWheel: boolean;\n\n /**\n * Enable mouse wheel zooming.\n */\n enableZoomWheel: boolean;\n\n /**\n * Enable touch gestures.\n *\n * This option will be ignored when {@link enableZoomWheel | mouse wheel zooming} is disabled,\n * since gestures contains touch zoom.\n */\n enableGestures: boolean;\n\n /**\n * Deprecated since `25.8`.\n */\n geometryType?: string;\n\n /**\n * Resets options to default values.\n *\n * @param fields - Name of fields to be reset.\n */\n resetToDefaults?: (fields?: string[]) => void;\n}\n\nexport function defaultOptions(): IOptions {\n return {\n showWCS: true,\n cameraAnimation: true,\n antialiasing: true,\n groundShadow: false,\n shadows: false,\n cameraAxisXSpeed: 4,\n cameraAxisYSpeed: 1,\n ambientOcclusion: false,\n enableStreamingMode: true,\n enablePartialMode: false,\n memoryLimit: 3294967296,\n cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },\n edgesColor: { r: 0xff, g: 0x98, b: 0x00 },\n facesColor: { r: 0xff, g: 0x98, b: 0x00 },\n edgesVisibility: true,\n edgesOverlap: true,\n facesOverlap: false,\n facesTransparancy: 200,\n enableCustomHighlight: true,\n sceneGraph: false,\n edgeModel: true,\n reverseZoomWheel: false,\n enableZoomWheel: true,\n enableGestures: true,\n geometryType: \"vsfx\",\n };\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { EventEmitter2 } from \"@inweb/eventemitter2\";\nimport { IOptions, RGB, defaultOptions } from \"./IOptions\";\n\nexport class Options implements IOptions {\n protected _emitter?: EventEmitter2;\n protected _data: IOptions;\n\n constructor(emitter?: EventEmitter2) {\n this._emitter = emitter;\n this._data = defaultOptions();\n this.loadFromStorage();\n }\n\n static defaults(): IOptions {\n return defaultOptions();\n }\n\n notifierChangeEvent(): void {\n console.warn(\n \"Options.notifierChangeEvent() has been deprecated since 25.3 and will be removed in a future release, use Options.change() instead.\"\n );\n this.change();\n }\n\n change(): void {\n if (this._emitter !== undefined) {\n this.saveToStorage();\n this._emitter.emit({ type: \"optionschange\", data: this });\n }\n }\n\n saveToStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n localStorage.setItem(\"od-client-settings\", JSON.stringify(this.data));\n } catch (error) {\n console.error(\"Cannot save client settings.\", error);\n }\n }\n\n loadFromStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n const item = localStorage.getItem(\"od-client-settings\");\n if (item) {\n const data = JSON.parse(item);\n this.data = { ...data };\n }\n } catch (error) {\n console.error(\"Cannot load client settings.\", error);\n }\n }\n\n /**\n * Resets options to default values.\n *\n * @param fields - Name of fields to be reset. Specify `undefined` to reset all.\n */\n resetToDefaults(fields?: string[]): void {\n if (fields !== undefined) {\n const defaults = Options.defaults();\n const resetData = fields.reduce((acc, field) => {\n acc[field] = defaults[field];\n return acc;\n }, {});\n this.data = { ...this.data, ...resetData };\n } else {\n this.data = { ...this.data, ...Options.defaults() };\n }\n }\n\n get data(): IOptions {\n return this._data;\n }\n\n set data(value: IOptions) {\n const enablePartialMode = value.enableStreamingMode ? value.enablePartialMode : false;\n const sceneGraph = enablePartialMode ? false : value.sceneGraph;\n this._data = { ...Options.defaults(), ...this._data, ...value, enablePartialMode, sceneGraph };\n this.change();\n }\n\n get showWCS(): boolean {\n return this._data.showWCS;\n }\n\n set showWCS(value: boolean) {\n this._data.showWCS = value;\n this.change();\n }\n\n get cameraAnimation(): boolean {\n return this._data.cameraAnimation;\n }\n\n set cameraAnimation(value: boolean) {\n this._data.cameraAnimation = value;\n this.change();\n }\n\n get antialiasing(): boolean {\n return this._data.antialiasing;\n }\n\n set antialiasing(value: boolean) {\n this._data.antialiasing = value;\n this.change();\n }\n\n get groundShadow(): boolean {\n return this._data.groundShadow;\n }\n\n set groundShadow(value: boolean) {\n this._data.groundShadow = value;\n this.change();\n }\n\n get shadows(): boolean {\n return this._data.shadows;\n }\n\n set shadows(value: boolean) {\n this._data.shadows = value;\n this.change();\n }\n\n get cameraAxisXSpeed(): number {\n return this._data.cameraAxisXSpeed;\n }\n\n set cameraAxisXSpeed(value: number) {\n this._data.cameraAxisXSpeed = value;\n this.change();\n }\n\n get cameraAxisYSpeed(): number {\n return this._data.cameraAxisYSpeed;\n }\n\n set cameraAxisYSpeed(value: number) {\n this.cameraAxisYSpeed = value;\n this.change();\n }\n\n get ambientOcclusion(): boolean {\n return this._data.ambientOcclusion;\n }\n\n set ambientOcclusion(value: boolean) {\n this._data.ambientOcclusion = value;\n this.change();\n }\n\n get enableStreamingMode(): boolean {\n return this._data.enableStreamingMode;\n }\n\n set enableStreamingMode(value: boolean) {\n this._data.enableStreamingMode = value;\n if (!value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get enablePartialMode(): boolean {\n return this._data.enablePartialMode;\n }\n\n set enablePartialMode(value: boolean) {\n this._data.enablePartialMode = value;\n if (value) {\n this._data.enableStreamingMode = true;\n this._data.sceneGraph = false;\n }\n this.change();\n }\n\n get memoryLimit(): number {\n return this._data.memoryLimit;\n }\n\n set memoryLimit(value: number) {\n this._data.memoryLimit = value;\n this.change();\n }\n\n get cuttingPlaneFillColor(): RGB {\n return this._data.cuttingPlaneFillColor;\n }\n\n set cuttingPlaneFillColor(value: RGB) {\n this._data.cuttingPlaneFillColor = value;\n this.change();\n }\n\n get edgesColor() {\n return this._data.edgesColor;\n }\n\n set edgesColor(value) {\n this._data.edgesColor = value;\n this.change();\n }\n\n get facesColor() {\n return this._data.facesColor;\n }\n\n set facesColor(value) {\n this._data.facesColor = value;\n this.change();\n }\n\n get edgesVisibility() {\n return this._data.edgesVisibility;\n }\n\n set edgesVisibility(value) {\n this._data.edgesVisibility = value;\n this.change();\n }\n\n get edgesOverlap() {\n return this._data.edgesOverlap;\n }\n\n set edgesOverlap(value) {\n this._data.edgesOverlap = value;\n this.change();\n }\n\n get facesOverlap() {\n return this._data.facesOverlap;\n }\n\n set facesOverlap(value) {\n this._data.facesOverlap = value;\n this.change();\n }\n\n get facesTransparancy() {\n return this._data.facesTransparancy;\n }\n\n set facesTransparancy(value) {\n this._data.facesTransparancy = value;\n this.change();\n }\n\n get enableCustomHighlight() {\n return this._data.enableCustomHighlight;\n }\n\n set enableCustomHighlight(value) {\n this._data.enableCustomHighlight = value;\n this.change();\n }\n\n get sceneGraph() {\n return this._data.sceneGraph;\n }\n\n set sceneGraph(value) {\n this._data.sceneGraph = value;\n if (value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get edgeModel() {\n return Boolean(this._data.edgeModel);\n }\n\n set edgeModel(value) {\n this._data.edgeModel = Boolean(value);\n this.change();\n }\n\n get reverseZoomWheel() {\n return this._data.reverseZoomWheel;\n }\n\n set reverseZoomWheel(value: boolean) {\n this._data.reverseZoomWheel = !!value;\n this.change();\n }\n\n get enableZoomWheel() {\n return this._data.enableZoomWheel;\n }\n\n set enableZoomWheel(value: boolean) {\n this._data.enableZoomWheel = !!value;\n this.change();\n }\n\n get enableGestures() {\n return this._data.enableGestures;\n }\n\n set enableGestures(value: boolean) {\n this._data.enableGestures = !!value;\n this.change();\n }\n\n get geometryType() {\n return this._data.geometryType;\n }\n\n set geometryType(value: string) {\n this._data.geometryType = value;\n this.change();\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport const CanvasEvents = [\n \"click\",\n \"contextmenu\",\n \"dblclick\",\n \"mousedown\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseup\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerup\",\n \"touchcancel\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n];\n\nexport const CANVAS_EVENTS = CanvasEvents;\n\n/**\n * Canvas Events.\n *\n * @event\n */\nexport interface CanvasEventMap {\n /**\n * Event that fires on mouse click.\n */\n click: MouseEvent;\n\n /**\n * Event that fires when the user attempts to open a context menu.\n */\n contextmenu: PointerEvent;\n\n /**\n * Event that fires on mouse double click.\n */\n dblclick: MouseEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n mousedown: MouseEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n mouseleave: MouseEvent;\n\n /**\n * Event that fires on mouse move.\n */\n mousemove: MouseEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n mouseup: MouseEvent;\n\n /**\n * Event is fired when the browser determines that there are unlikely to be any more pointer events.\n */\n pointercancel: PointerEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n pointerdown: PointerEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n pointerleave: PointerEvent;\n\n /**\n * Event that fires on mouse move.\n */\n pointermove: PointerEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n pointerup: PointerEvent;\n\n /**\n * Event that fires touch is canceled.\n */\n touchcancel: TouchEvent;\n\n /**\n * Event that fires touch is ended.\n */\n touchend: TouchEvent;\n\n /**\n * Event that fires touch is moving.\n */\n touchmove: TouchEvent;\n\n /**\n * Event that fires when touch is started.\n */\n touchstart: TouchEvent;\n\n /**\n * Event that fires when mouse wheel is moving.\n */\n wheel: MouseEvent;\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport type { IViewer } from \"./IViewer\";\n\nexport interface IDragger {\n name: string;\n initialize(): void;\n dispose(): void;\n updatePreview(): void;\n}\n\nexport class Dragger implements IDragger {\n name = \"\";\n\n constructor(viewer: IViewer) {}\n\n initialize(): void {}\n\n dispose(): void {}\n\n updatePreview(): void {}\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAKA,MAAM,QAAQ,CAAA;IAAd,IAAA,WAAA,GAAA;IACmB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;SAuC1D;IArCC,IAAA,eAAe,CAAC,EAAU,EAAE,OAAwB,EAAE,WAAiC,EAAE,OAAa,EAAA;IACpG,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;SAC/D;QAED,oBAAoB,CAAC,EAAU,EAAE,KAAa,EAAA;YAC5C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,MAAe,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;SACrG;IAED,IAAA,UAAU,CAAC,EAAU,EAAA;YACnB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SAC/B;QAED,WAAW,GAAA;IACT,QAAA,MAAM,GAAG,GAAG,IAAI,G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AAC,KAAc,EAAA;YAC/B,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;YACpC,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;IAED,IAAA,IAAI,YAAY,GAAA;IACd,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;SAChC;QAED,IAAI,YAAY,CAAC,KAAa,EAAA;IAC5B,QAAA,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC;YAChC,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;IACF;;IC/UD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AAEa,UAAA,YAAY,GAAG;QAC1B,OAAO;QACP,aAAa;QACb,UAAU;QACV,WAAW;QACX,YAAY;QACZ,WAAW;QACX,SAAS;QACT,eAAe;QACf,aAAa;QACb,cAAc;QACd,aAAa;QACb,WAAW;QACX,aAAa;QACb,UAAU;QACV,WAAW;QACX,YAAY;QACZ,OAAO;MACP;AAEK,UAAM,aAAa,GAAG;;IC3C7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;UAWa,OAAO,CAAA;IAGlB,IAAA,WAAA,CAAY,MAAe,EAAA;YAF3B,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;SAEqB;IAE/B,IAAA,UAAU,MAAW;IAErB,IAAA,OAAO,MAAW;IAElB,IAAA,aAAa,MAAW;IACzB;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"viewer-core.module.js","sources":["../src/commands/Commands.ts","../src/options/IOptions.ts","../src/options/Options.ts","../src/viewer/CanvasEvents.ts","../src/viewer/IDragger.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IViewer } from \"../viewer/IViewer\";\nimport { ICommand, ICommandHandler, ICommandDescription, ICommandsMap, ICommands } from \"./ICommands\";\n\nclass Commands implements ICommands {\n private readonly _commands = new Map<string, ICommand>();\n\n registerCommand(id: string, handler: ICommandHandler, description?: ICommandDescription, thisArg?: any): void {\n this._commands.set(id, { id, handler, thisArg, description });\n }\n\n registerCommandAlias(id: string, alias: string): void {\n this.registerCommand(alias, (viewer: IViewer, ...args) => this.executeCommand(id, viewer, ...args));\n }\n\n getCommand(id: string): ICommand | undefined {\n return this._commands.get(id);\n }\n\n getCommands(): ICommandsMap {\n const map = new Map<string, ICommand>();\n this._commands.forEach((value, key) => map.set(key, value));\n return map;\n }\n\n executeCommand(id: string, viewer: IViewer, ...args: any[]): any {\n const command = this._commands.get(id);\n if (!command) {\n if (viewer) {\n const isDraggerCommand = viewer.draggers.includes(id);\n if (isDraggerCommand) return viewer.setActiveDragger(id);\n }\n\n console.warn(`Command '${id}' not found`);\n return undefined;\n }\n\n const { handler, thisArg } = command;\n const result = handler.apply(thisArg, [viewer, ...args]);\n\n viewer?.emit({ type: \"command\", data: id, args });\n\n return result;\n }\n}\n\nconst _commands = new Map<string, Commands>();\n\nfunction commands(viewerType = \"\"): ICommands {\n let result = _commands.get(viewerType);\n if (!result) {\n result = new Commands();\n _commands.set(viewerType, result);\n }\n return result;\n}\n\ncommands(\"\").registerCommand(\"noop\", () => {});\ncommands(\"VisualizeJS\").registerCommand(\"noop\", () => {});\ncommands(\"ThreeJS\").registerCommand(\"noop\", () => {});\n\nexport { commands };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport interface RGB {\n red: number;\n green: number;\n blue: number;\n}\n\n/**\n * Viewer parameters.\n */\nexport interface IOptions {\n /**\n * Show WCS\n *\n * @defaultValue true\n */\n showWCS?: boolean;\n\n /**\n * Enable camera animation\n *\n * @defaultValue true\n */\n cameraAnimation?: boolean;\n\n /**\n * Enable antialiasing use FXAA\n *\n * @defaultValue true\n */\n antialiasing?: boolean;\n\n /**\n * Enable ground shadows\n *\n * @defaultValue false\n */\n groundShadow?: boolean;\n\n /**\n * Enable shadows\n *\n * @defaultValue false\n */\n shadows?: boolean;\n\n /**\n * Camera speed on X axis\n *\n * @defaultValue 4\n */\n cameraAxisXSpeed?: number;\n\n /**\n * Camera speed on Y axis\n *\n * @defaultValue 1\n */\n cameraAxisYSpeed?: number;\n\n /**\n * Ambient occlusion\n *\n * @defaultValue false\n */\n ambientOcclusion?: boolean;\n\n /**\n * Enable streaming of drawings from the server\n *\n * If streaming is disabled, the file/assembly will be loaded in one go. If streaming is\n * enabled, partial download mode may be enabled as well.\n *\n * @defaultValue true\n */\n enableStreamingMode?: boolean;\n\n /**\n * Enable partial load mode to be able open large drawing. Only used if streaming is enabled.\n * If partial mode is enabled, then scene graph will be disabled.\n *\n * @defaultValue false\n */\n enablePartialMode?: boolean;\n\n /**\n * The size of the memory buffer that the Viewer can use for graphics data\n *\n * @defaultValue 3294967296\n */\n memoryLimit?: number;\n\n /**\n * Cutting plane fill color\n *\n * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }\n */\n cuttingPlaneFillColor?: RGB;\n\n /**\n * Outline edges color in RGB format.\n */\n edgesColor?: { r: number; g: number; b: number };\n\n /**\n * Faces color in the RGB format.\n */\n facesColor?: { r: number; g: number; b: number };\n\n /**\n * Show or hide edges.\n */\n edgesVisibility?: boolean;\n\n /**\n * Show edges over drawing.\n */\n edgesOverlap?: boolean;\n\n /**\n * Show faces over drawing.\n */\n facesOverlap?: boolean;\n\n /**\n * Faces transparency value from 0 to 255.\n */\n facesTransparancy?: number;\n\n /**\n * Enable custom highlight settings.\n */\n enableCustomHighlight?: boolean;\n\n /**\n * Enable or disable scene graph, it increases perfomance improvement, but consumes memory.\n * Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode\n * will be disabled\n */\n sceneGraph: boolean;\n\n /**\n * Edge display models. No edges is usefull for less memory consumption: `false` - no edges\n * are displayed, `true` - display isolines.\n */\n edgeModel: boolean;\n\n /**\n * Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,\n * moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.\n */\n reverseZoomWheel: boolean;\n\n /**\n * Enable mouse wheel zooming.\n */\n enableZoomWheel: boolean;\n\n /**\n * Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since\n * gestures contains touch zoom.\n */\n enableGestures: boolean;\n\n /**\n * Default file geometry data type. Can be one of:\n *\n * - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.\n * - `gltf` - `glTF`, for opening a file in `Three.js` viewer.\n */\n geometryType?: string;\n}\n\nexport function defaultOptions(): IOptions {\n return {\n showWCS: true,\n cameraAnimation: true,\n antialiasing: true,\n groundShadow: false,\n shadows: false,\n cameraAxisXSpeed: 4,\n cameraAxisYSpeed: 1,\n ambientOcclusion: false,\n enableStreamingMode: true,\n enablePartialMode: false,\n memoryLimit: 3294967296,\n cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },\n edgesColor: { r: 0xff, g: 0x98, b: 0x00 },\n facesColor: { r: 0xff, g: 0x98, b: 0x00 },\n edgesVisibility: true,\n edgesOverlap: true,\n facesOverlap: false,\n facesTransparancy: 200,\n enableCustomHighlight: true,\n sceneGraph: false,\n edgeModel: true,\n reverseZoomWheel: false,\n enableZoomWheel: true,\n enableGestures: true,\n geometryType: \"vsfx\",\n };\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { EventEmitter2 } from \"@inweb/eventemitter2\";\nimport { IOptions, RGB, defaultOptions } from \"./IOptions\";\n\nexport class Options implements IOptions {\n protected _emitter?: EventEmitter2;\n protected _data: IOptions;\n\n constructor(emitter?: EventEmitter2) {\n this._emitter = emitter;\n this._data = defaultOptions();\n this.loadFromStorage();\n }\n\n static defaults(): IOptions {\n return defaultOptions();\n }\n\n notifierChangeEvent(): void {\n console.warn(\n \"Options.notifierChangeEvent() has been deprecated since 25.3 and will be removed in a future release, use Options.change() instead.\"\n );\n this.change();\n }\n\n change(): void {\n if (this._emitter !== undefined) {\n this.saveToStorage();\n this._emitter.emit({ type: \"optionschange\", data: this });\n }\n }\n\n saveToStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n localStorage.setItem(\"od-client-settings\", JSON.stringify(this.data));\n } catch (error) {\n console.error(\"Cannot save client settings.\", error);\n }\n }\n\n loadFromStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n const item = localStorage.getItem(\"od-client-settings\");\n if (item) {\n const data = JSON.parse(item);\n this.data = { ...data };\n }\n } catch (error) {\n console.error(\"Cannot load client settings.\", error);\n }\n }\n\n /**\n * Reset options to default\n *\n * @param fields - Name of fields to be reset\n */\n resetToDefaults(fields?: string[]): void {\n if (fields !== undefined) {\n const defaults = Options.defaults();\n const resetData = fields.reduce((acc, field) => {\n acc[field] = defaults[field];\n return acc;\n }, {});\n\n this.data = { ...this.data, ...resetData };\n } else {\n this.data = { ...this.data, ...Options.defaults() };\n }\n }\n\n get data(): IOptions {\n return this._data;\n }\n\n set data(value: IOptions) {\n const enablePartialMode = value.enableStreamingMode ? value.enablePartialMode : false;\n const sceneGraph = enablePartialMode ? false : value.sceneGraph;\n this._data = { ...Options.defaults(), ...this._data, ...value, enablePartialMode, sceneGraph };\n this.change();\n }\n\n get showWCS(): boolean {\n return this._data.showWCS;\n }\n\n set showWCS(value: boolean) {\n this._data.showWCS = value;\n this.change();\n }\n\n get cameraAnimation(): boolean {\n return this._data.cameraAnimation;\n }\n\n set cameraAnimation(value: boolean) {\n this._data.cameraAnimation = value;\n this.change();\n }\n\n get antialiasing(): boolean {\n return this._data.antialiasing;\n }\n\n set antialiasing(value: boolean) {\n this._data.antialiasing = value;\n this.change();\n }\n\n get groundShadow(): boolean {\n return this._data.groundShadow;\n }\n\n set groundShadow(value: boolean) {\n this._data.groundShadow = value;\n this.change();\n }\n\n get shadows(): boolean {\n return this._data.shadows;\n }\n\n set shadows(value: boolean) {\n this._data.shadows = value;\n this.change();\n }\n\n get cameraAxisXSpeed(): number {\n return this._data.cameraAxisXSpeed;\n }\n\n set cameraAxisXSpeed(value: number) {\n this._data.cameraAxisXSpeed = value;\n this.change();\n }\n\n get cameraAxisYSpeed(): number {\n return this._data.cameraAxisYSpeed;\n }\n\n set cameraAxisYSpeed(value: number) {\n this.cameraAxisYSpeed = value;\n this.change();\n }\n\n get ambientOcclusion(): boolean {\n return this._data.ambientOcclusion;\n }\n\n set ambientOcclusion(value: boolean) {\n this._data.ambientOcclusion = value;\n this.change();\n }\n\n get enableStreamingMode(): boolean {\n return this._data.enableStreamingMode;\n }\n\n set enableStreamingMode(value: boolean) {\n this._data.enableStreamingMode = value;\n if (!value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get enablePartialMode(): boolean {\n return this._data.enablePartialMode;\n }\n\n set enablePartialMode(value: boolean) {\n this._data.enablePartialMode = value;\n if (value) {\n this._data.enableStreamingMode = true;\n this._data.sceneGraph = false;\n }\n this.change();\n }\n\n get memoryLimit(): number {\n return this._data.memoryLimit;\n }\n\n set memoryLimit(value: number) {\n this._data.memoryLimit = value;\n this.change();\n }\n\n get cuttingPlaneFillColor(): RGB {\n return this._data.cuttingPlaneFillColor;\n }\n\n set cuttingPlaneFillColor(value: RGB) {\n this._data.cuttingPlaneFillColor = value;\n this.change();\n }\n\n get edgesColor() {\n return this._data.edgesColor;\n }\n\n set edgesColor(value) {\n this._data.edgesColor = value;\n this.change();\n }\n\n get facesColor() {\n return this._data.facesColor;\n }\n\n set facesColor(value) {\n this._data.facesColor = value;\n this.change();\n }\n\n get edgesVisibility() {\n return this._data.edgesVisibility;\n }\n\n set edgesVisibility(value) {\n this._data.edgesVisibility = value;\n this.change();\n }\n\n get edgesOverlap() {\n return this._data.edgesOverlap;\n }\n\n set edgesOverlap(value) {\n this._data.edgesOverlap = value;\n this.change();\n }\n\n get facesOverlap() {\n return this._data.facesOverlap;\n }\n\n set facesOverlap(value) {\n this._data.facesOverlap = value;\n this.change();\n }\n\n get facesTransparancy() {\n return this._data.facesTransparancy;\n }\n\n set facesTransparancy(value) {\n this._data.facesTransparancy = value;\n this.change();\n }\n\n get enableCustomHighlight() {\n return this._data.enableCustomHighlight;\n }\n\n set enableCustomHighlight(value) {\n this._data.enableCustomHighlight = value;\n this.change();\n }\n\n get sceneGraph() {\n return this._data.sceneGraph;\n }\n\n set sceneGraph(value) {\n this._data.sceneGraph = value;\n if (value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get edgeModel() {\n return Boolean(this._data.edgeModel);\n }\n\n set edgeModel(value) {\n this._data.edgeModel = Boolean(value);\n this.change();\n }\n\n get reverseZoomWheel() {\n return this._data.reverseZoomWheel;\n }\n\n set reverseZoomWheel(value: boolean) {\n this._data.reverseZoomWheel = !!value;\n this.change();\n }\n\n get enableZoomWheel() {\n return this._data.enableZoomWheel;\n }\n\n set enableZoomWheel(value: boolean) {\n this._data.enableZoomWheel = !!value;\n this.change();\n }\n\n get enableGestures() {\n return this._data.enableGestures;\n }\n\n set enableGestures(value: boolean) {\n this._data.enableGestures = !!value;\n this.change();\n }\n\n get geometryType() {\n return this._data.geometryType;\n }\n\n set geometryType(value: string) {\n this._data.geometryType = value;\n this.change();\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport const CanvasEvents = [\n \"click\",\n \"contextmenu\",\n \"dblclick\",\n \"mousedown\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseup\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerup\",\n \"touchcancel\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n];\n\nexport const CANVAS_EVENTS = CanvasEvents;\n\n/**\n * Canvas Events.\n *\n * @event\n */\nexport interface CanvasEventMap {\n /**\n * Event that fires on mouse click.\n */\n click: MouseEvent;\n\n /**\n * Event that fires when the user attempts to open a context menu.\n */\n contextmenu: PointerEvent;\n\n /**\n * Event that fires on mouse double click.\n */\n dblclick: MouseEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n mousedown: MouseEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n mouseleave: MouseEvent;\n\n /**\n * Event that fires on mouse move.\n */\n mousemove: MouseEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n mouseup: MouseEvent;\n\n /**\n * Event is fired when the browser determines that there are unlikely to be any more pointer events.\n */\n pointercancel: PointerEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n pointerdown: PointerEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n pointerleave: PointerEvent;\n\n /**\n * Event that fires on mouse move.\n */\n pointermove: PointerEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n pointerup: PointerEvent;\n\n /**\n * Event that fires touch is canceled.\n */\n touchcancel: TouchEvent;\n\n /**\n * Event that fires touch is ended.\n */\n touchend: TouchEvent;\n\n /**\n * Event that fires touch is moving.\n */\n touchmove: TouchEvent;\n\n /**\n * Event that fires when touch is started.\n */\n touchstart: TouchEvent;\n\n /**\n * Event that fires when mouse wheel is moving.\n */\n wheel: MouseEvent;\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport type { IViewer } from \"./IViewer\";\n\nexport interface IDragger {\n name: string;\n initialize(): void;\n dispose(): void;\n updatePreview(): void;\n}\n\nexport class Dragger implements IDragger {\n name = \"\";\n\n constructor(viewer: IViewer) {}\n\n initialize(): void {}\n\n dispose(): void {}\n\n updatePreview(): void {}\n}\n"],"names":["Commands","constructor","this","_commands","Map","registerCommand","id","handler","description","thisArg","set","registerCommandAlias","alias","viewer","args","executeCommand","getCommand","get","getCommands","map","forEach","value","key","command","isDraggerCommand","draggers","includes","setActiveDragger","console","warn","undefined","result","apply","emit","type","data","commands","viewerType","defaultOptions","showWCS","cameraAnimation","antialiasing","groundShadow","shadows","cameraAxisXSpeed","cameraAxisYSpeed","ambientOcclusion","enableStreamingMode","enablePartialMode","memoryLimit","cuttingPlaneFillColor","red","green","blue","edgesColor","r","g","b","facesColor","edgesVisibility","edgesOverlap","facesOverlap","facesTransparancy","enableCustomHighlight","sceneGraph","edgeModel","reverseZoomWheel","enableZoomWheel","enableGestures","geometryType","Options","emitter","_emitter","_data","loadFromStorage","defaults","notifierChangeEvent","change","saveToStorage","window","localStorage","setItem","JSON","stringify","error","item","getItem","parse","resetToDefaults","fields","resetData","reduce","acc","field","Boolean","CanvasEvents","CANVAS_EVENTS","Dragger","name","initialize","d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E,MAAMN,oBAAoB9C;QAC/BnB,KAAK2E;AACN;IAED,kBAAIT;QACF,OAAOlE,KAAKuE,MAAML;AACnB;IAED,kBAAIA,CAAe/C;QACjBnB,KAAKuE,MAAML,mBAAmB/C;QAC9BnB,KAAK2E;AACN;IAED,gBAAIR;QACF,OAAOnE,KAAKuE,MAAMJ;AACnB;IAED,gBAAIA,CAAahD;QACfnB,KAAKuE,MAAMJ,eAAehD;QAC1BnB,KAAK2E;AACN;;;ACxTU,MAAAkB,eAAe,EAC1B,SACA,eACA,YACA,aACA,cACA,aACA,WACA,iBACA,eACA,gBACA,eACA,aACA,eACA,YACA,aACA,cACA;;AAGK,MAAMC,gBAAgBD;;MCXhBE;IAGX,WAAAhG,CAAYY;QAFZX,KAAIgG,OAAG;AAEwB;IAE/B,UAAAC,IAAqB;IAErB,OAAAC,IAAkB;IAElB,aAAAC,IAAwB;;;"}
1
+ {"version":3,"file":"viewer-core.module.js","sources":["../src/commands/Commands.ts","../src/options/IOptions.ts","../src/options/Options.ts","../src/viewer/CanvasEvents.ts","../src/viewer/IDragger.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IViewer } from \"../viewer/IViewer\";\nimport { ICommand, ICommandHandler, ICommandDescription, ICommandsMap, ICommands } from \"./ICommands\";\n\nclass Commands implements ICommands {\n private readonly _commands = new Map<string, ICommand>();\n\n registerCommand(id: string, handler: ICommandHandler, description?: ICommandDescription, thisArg?: any): void {\n this._commands.set(id, { id, handler, thisArg, description });\n }\n\n registerCommandAlias(id: string, alias: string): void {\n this.registerCommand(alias, (viewer: IViewer, ...args) => this.executeCommand(id, viewer, ...args));\n }\n\n getCommand(id: string): ICommand | undefined {\n return this._commands.get(id);\n }\n\n getCommands(): ICommandsMap {\n const map = new Map<string, ICommand>();\n this._commands.forEach((value, key) => map.set(key, value));\n return map;\n }\n\n executeCommand(id: string, viewer: IViewer, ...args: any[]): any {\n const command = this._commands.get(id);\n if (!command) {\n if (viewer) {\n const isDraggerCommand = viewer.draggers.includes(id);\n if (isDraggerCommand) return viewer.setActiveDragger(id);\n }\n\n console.warn(`Command '${id}' not found`);\n return undefined;\n }\n\n const { handler, thisArg } = command;\n const result = handler.apply(thisArg, [viewer, ...args]);\n\n viewer?.emit({ type: \"command\", data: id, args });\n\n return result;\n }\n}\n\nconst _commands = new Map<string, Commands>();\n\nfunction commands(viewerType = \"\"): ICommands {\n let result = _commands.get(viewerType);\n if (!result) {\n result = new Commands();\n _commands.set(viewerType, result);\n }\n return result;\n}\n\ncommands(\"\").registerCommand(\"noop\", () => {});\ncommands(\"VisualizeJS\").registerCommand(\"noop\", () => {});\ncommands(\"ThreeJS\").registerCommand(\"noop\", () => {});\n\nexport { commands };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport interface RGB {\n red: number;\n green: number;\n blue: number;\n}\n\n/**\n * Viewer options interface.\n */\nexport interface IOptions {\n /**\n * Show the world coordinate system axes in the bottom-left corner of the viewer.\n *\n * @defaultValue true\n */\n showWCS?: boolean;\n\n /**\n * Enable camera animation.\n *\n * @defaultValue true\n */\n cameraAnimation?: boolean;\n\n /**\n * Enable anti-aliasing using FXAA.\n *\n * @defaultValue true\n */\n antialiasing?: boolean;\n\n /**\n * Show ground shadows below the model.\n *\n * @defaultValue false\n */\n groundShadow?: boolean;\n\n /**\n * Enable ambient shadows.\n *\n * @defaultValue false\n */\n shadows?: boolean;\n\n /**\n * Camera speed on X axis.\n *\n * @defaultValue 4\n */\n cameraAxisXSpeed?: number;\n\n /**\n * Camera speed on Y axis.\n *\n * @defaultValue 1\n */\n cameraAxisYSpeed?: number;\n\n /**\n * Enable ambient occlusion.\n *\n * @defaultValue false\n */\n ambientOcclusion?: boolean;\n\n /**\n * Enable streaming of drawings from the server.\n *\n * If streaming is disabled, the file/assembly will be loaded in one go. The viewer will only\n * update once the loading is complete, which may take a while.\n *\n * If streaming is enabled, {@link enablePartialMode | partial download} mode may be enabled as well.\n *\n * @defaultValue true\n */\n enableStreamingMode?: boolean;\n\n /**\n * Enable partial load mode to be able open large drawing.\n *\n * In partial loading mode, the viewer keeps only visible objects in memory and loads other\n * objects when the zoom or viewpoint changes.\n *\n * Only used if {@link enableStreamingMode | streaming} is enabled. If partial mode is\n * enabled, then {@link sceneGraph | scene graph} will be disabled.\n *\n * @defaultValue false\n */\n enablePartialMode?: boolean;\n\n /**\n * The size of the memory buffer for graphics data, in bytes.\n *\n * @defaultValue 3294967296\n */\n memoryLimit?: number;\n\n /**\n * Cutting planes fill color.\n *\n * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }\n */\n cuttingPlaneFillColor?: RGB;\n\n /**\n * Edges highlight color.\n */\n edgesColor?: { r: number; g: number; b: number };\n\n /**\n * Faces highlight color.\n */\n facesColor?: { r: number; g: number; b: number };\n\n /**\n * Show highlighted edges.\n */\n edgesVisibility?: boolean;\n\n /**\n * Show highlighted edges over drawing.\n */\n edgesOverlap?: boolean;\n\n /**\n * Show highlighted faces over drawing.\n */\n facesOverlap?: boolean;\n\n /**\n * Highlighted faces transparency value, from 0 to 255.\n */\n facesTransparancy?: number;\n\n /**\n * Enable custom highlight settings.\n */\n enableCustomHighlight?: boolean;\n\n /**\n * Enable scene graph.\n *\n * Scene graph increases perfomance improvement, but consumes memory. Large drawings can take\n * up a lot of memory. If scene graph is enabled, then\n * {@link enablePartialMode | partial load mode} will be disabled.\n */\n sceneGraph: boolean;\n\n /**\n * Show the edges of the model:\n *\n * - `false` - No model edges are displayed. Usefull for less memory consumption.\n * - `true` - Display isolines.\n */\n edgeModel: boolean;\n\n /**\n * Reverse the mouse wheel direction for zooming:\n *\n * - `false` - Moving the wheel up zooms in, moving down zooms out.\n * - `true` - Moving the wheel up zooms out, moving down zooms in.\n */\n reverseZoomWheel: boolean;\n\n /**\n * Enable mouse wheel zooming.\n */\n enableZoomWheel: boolean;\n\n /**\n * Enable touch gestures.\n *\n * This option will be ignored when {@link enableZoomWheel | mouse wheel zooming} is disabled,\n * since gestures contains touch zoom.\n */\n enableGestures: boolean;\n\n /**\n * Deprecated since `25.8`.\n */\n geometryType?: string;\n\n /**\n * Resets options to default values.\n *\n * @param fields - Name of fields to be reset.\n */\n resetToDefaults?: (fields?: string[]) => void;\n}\n\nexport function defaultOptions(): IOptions {\n return {\n showWCS: true,\n cameraAnimation: true,\n antialiasing: true,\n groundShadow: false,\n shadows: false,\n cameraAxisXSpeed: 4,\n cameraAxisYSpeed: 1,\n ambientOcclusion: false,\n enableStreamingMode: true,\n enablePartialMode: false,\n memoryLimit: 3294967296,\n cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },\n edgesColor: { r: 0xff, g: 0x98, b: 0x00 },\n facesColor: { r: 0xff, g: 0x98, b: 0x00 },\n edgesVisibility: true,\n edgesOverlap: true,\n facesOverlap: false,\n facesTransparancy: 200,\n enableCustomHighlight: true,\n sceneGraph: false,\n edgeModel: true,\n reverseZoomWheel: false,\n enableZoomWheel: true,\n enableGestures: true,\n geometryType: \"vsfx\",\n };\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { EventEmitter2 } from \"@inweb/eventemitter2\";\nimport { IOptions, RGB, defaultOptions } from \"./IOptions\";\n\nexport class Options implements IOptions {\n protected _emitter?: EventEmitter2;\n protected _data: IOptions;\n\n constructor(emitter?: EventEmitter2) {\n this._emitter = emitter;\n this._data = defaultOptions();\n this.loadFromStorage();\n }\n\n static defaults(): IOptions {\n return defaultOptions();\n }\n\n notifierChangeEvent(): void {\n console.warn(\n \"Options.notifierChangeEvent() has been deprecated since 25.3 and will be removed in a future release, use Options.change() instead.\"\n );\n this.change();\n }\n\n change(): void {\n if (this._emitter !== undefined) {\n this.saveToStorage();\n this._emitter.emit({ type: \"optionschange\", data: this });\n }\n }\n\n saveToStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n localStorage.setItem(\"od-client-settings\", JSON.stringify(this.data));\n } catch (error) {\n console.error(\"Cannot save client settings.\", error);\n }\n }\n\n loadFromStorage(): void {\n if (typeof window !== \"undefined\")\n try {\n const item = localStorage.getItem(\"od-client-settings\");\n if (item) {\n const data = JSON.parse(item);\n this.data = { ...data };\n }\n } catch (error) {\n console.error(\"Cannot load client settings.\", error);\n }\n }\n\n /**\n * Resets options to default values.\n *\n * @param fields - Name of fields to be reset. Specify `undefined` to reset all.\n */\n resetToDefaults(fields?: string[]): void {\n if (fields !== undefined) {\n const defaults = Options.defaults();\n const resetData = fields.reduce((acc, field) => {\n acc[field] = defaults[field];\n return acc;\n }, {});\n this.data = { ...this.data, ...resetData };\n } else {\n this.data = { ...this.data, ...Options.defaults() };\n }\n }\n\n get data(): IOptions {\n return this._data;\n }\n\n set data(value: IOptions) {\n const enablePartialMode = value.enableStreamingMode ? value.enablePartialMode : false;\n const sceneGraph = enablePartialMode ? false : value.sceneGraph;\n this._data = { ...Options.defaults(), ...this._data, ...value, enablePartialMode, sceneGraph };\n this.change();\n }\n\n get showWCS(): boolean {\n return this._data.showWCS;\n }\n\n set showWCS(value: boolean) {\n this._data.showWCS = value;\n this.change();\n }\n\n get cameraAnimation(): boolean {\n return this._data.cameraAnimation;\n }\n\n set cameraAnimation(value: boolean) {\n this._data.cameraAnimation = value;\n this.change();\n }\n\n get antialiasing(): boolean {\n return this._data.antialiasing;\n }\n\n set antialiasing(value: boolean) {\n this._data.antialiasing = value;\n this.change();\n }\n\n get groundShadow(): boolean {\n return this._data.groundShadow;\n }\n\n set groundShadow(value: boolean) {\n this._data.groundShadow = value;\n this.change();\n }\n\n get shadows(): boolean {\n return this._data.shadows;\n }\n\n set shadows(value: boolean) {\n this._data.shadows = value;\n this.change();\n }\n\n get cameraAxisXSpeed(): number {\n return this._data.cameraAxisXSpeed;\n }\n\n set cameraAxisXSpeed(value: number) {\n this._data.cameraAxisXSpeed = value;\n this.change();\n }\n\n get cameraAxisYSpeed(): number {\n return this._data.cameraAxisYSpeed;\n }\n\n set cameraAxisYSpeed(value: number) {\n this.cameraAxisYSpeed = value;\n this.change();\n }\n\n get ambientOcclusion(): boolean {\n return this._data.ambientOcclusion;\n }\n\n set ambientOcclusion(value: boolean) {\n this._data.ambientOcclusion = value;\n this.change();\n }\n\n get enableStreamingMode(): boolean {\n return this._data.enableStreamingMode;\n }\n\n set enableStreamingMode(value: boolean) {\n this._data.enableStreamingMode = value;\n if (!value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get enablePartialMode(): boolean {\n return this._data.enablePartialMode;\n }\n\n set enablePartialMode(value: boolean) {\n this._data.enablePartialMode = value;\n if (value) {\n this._data.enableStreamingMode = true;\n this._data.sceneGraph = false;\n }\n this.change();\n }\n\n get memoryLimit(): number {\n return this._data.memoryLimit;\n }\n\n set memoryLimit(value: number) {\n this._data.memoryLimit = value;\n this.change();\n }\n\n get cuttingPlaneFillColor(): RGB {\n return this._data.cuttingPlaneFillColor;\n }\n\n set cuttingPlaneFillColor(value: RGB) {\n this._data.cuttingPlaneFillColor = value;\n this.change();\n }\n\n get edgesColor() {\n return this._data.edgesColor;\n }\n\n set edgesColor(value) {\n this._data.edgesColor = value;\n this.change();\n }\n\n get facesColor() {\n return this._data.facesColor;\n }\n\n set facesColor(value) {\n this._data.facesColor = value;\n this.change();\n }\n\n get edgesVisibility() {\n return this._data.edgesVisibility;\n }\n\n set edgesVisibility(value) {\n this._data.edgesVisibility = value;\n this.change();\n }\n\n get edgesOverlap() {\n return this._data.edgesOverlap;\n }\n\n set edgesOverlap(value) {\n this._data.edgesOverlap = value;\n this.change();\n }\n\n get facesOverlap() {\n return this._data.facesOverlap;\n }\n\n set facesOverlap(value) {\n this._data.facesOverlap = value;\n this.change();\n }\n\n get facesTransparancy() {\n return this._data.facesTransparancy;\n }\n\n set facesTransparancy(value) {\n this._data.facesTransparancy = value;\n this.change();\n }\n\n get enableCustomHighlight() {\n return this._data.enableCustomHighlight;\n }\n\n set enableCustomHighlight(value) {\n this._data.enableCustomHighlight = value;\n this.change();\n }\n\n get sceneGraph() {\n return this._data.sceneGraph;\n }\n\n set sceneGraph(value) {\n this._data.sceneGraph = value;\n if (value) this._data.enablePartialMode = false;\n this.change();\n }\n\n get edgeModel() {\n return Boolean(this._data.edgeModel);\n }\n\n set edgeModel(value) {\n this._data.edgeModel = Boolean(value);\n this.change();\n }\n\n get reverseZoomWheel() {\n return this._data.reverseZoomWheel;\n }\n\n set reverseZoomWheel(value: boolean) {\n this._data.reverseZoomWheel = !!value;\n this.change();\n }\n\n get enableZoomWheel() {\n return this._data.enableZoomWheel;\n }\n\n set enableZoomWheel(value: boolean) {\n this._data.enableZoomWheel = !!value;\n this.change();\n }\n\n get enableGestures() {\n return this._data.enableGestures;\n }\n\n set enableGestures(value: boolean) {\n this._data.enableGestures = !!value;\n this.change();\n }\n\n get geometryType() {\n return this._data.geometryType;\n }\n\n set geometryType(value: string) {\n this._data.geometryType = value;\n this.change();\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport const CanvasEvents = [\n \"click\",\n \"contextmenu\",\n \"dblclick\",\n \"mousedown\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseup\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerup\",\n \"touchcancel\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n];\n\nexport const CANVAS_EVENTS = CanvasEvents;\n\n/**\n * Canvas Events.\n *\n * @event\n */\nexport interface CanvasEventMap {\n /**\n * Event that fires on mouse click.\n */\n click: MouseEvent;\n\n /**\n * Event that fires when the user attempts to open a context menu.\n */\n contextmenu: PointerEvent;\n\n /**\n * Event that fires on mouse double click.\n */\n dblclick: MouseEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n mousedown: MouseEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n mouseleave: MouseEvent;\n\n /**\n * Event that fires on mouse move.\n */\n mousemove: MouseEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n mouseup: MouseEvent;\n\n /**\n * Event is fired when the browser determines that there are unlikely to be any more pointer events.\n */\n pointercancel: PointerEvent;\n\n /**\n * Event that fires on mouse button is down.\n */\n pointerdown: PointerEvent;\n\n /**\n * Event that fires on mouse leave.\n */\n pointerleave: PointerEvent;\n\n /**\n * Event that fires on mouse move.\n */\n pointermove: PointerEvent;\n\n /**\n * Event that fires on mouse button is up.\n */\n pointerup: PointerEvent;\n\n /**\n * Event that fires touch is canceled.\n */\n touchcancel: TouchEvent;\n\n /**\n * Event that fires touch is ended.\n */\n touchend: TouchEvent;\n\n /**\n * Event that fires touch is moving.\n */\n touchmove: TouchEvent;\n\n /**\n * Event that fires when touch is started.\n */\n touchstart: TouchEvent;\n\n /**\n * Event that fires when mouse wheel is moving.\n */\n wheel: MouseEvent;\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport type { IViewer } from \"./IViewer\";\n\nexport interface IDragger {\n name: string;\n initialize(): void;\n dispose(): void;\n updatePreview(): void;\n}\n\nexport class Dragger implements IDragger {\n name = \"\";\n\n constructor(viewer: IViewer) {}\n\n initialize(): void {}\n\n dispose(): void {}\n\n updatePreview(): void {}\n}\n"],"names":["Commands","constructor","this","_commands","Map","registerCommand","id","handler","description","thisArg","set","registerCommandAlias","alias","viewer","args","executeCommand","getCommand","get","getCommands","map","forEach","value","key","command","isDraggerCommand","draggers","includes","setActiveDragger","console","warn","undefined","result","apply","emit","type","data","commands","viewerType","defaultOptions","showWCS","cameraAnimation","antialiasing","groundShadow","shadows","cameraAxisXSpeed","cameraAxisYSpeed","ambientOcclusion","enableStreamingMode","enablePartialMode","memoryLimit","cuttingPlaneFillColor","red","green","blue","edgesColor","r","g","b","facesColor","edgesVisibility","edgesOverlap","facesOverlap","facesTransparancy","enableCustomHighlight","sceneGraph","edgeModel","reverseZoomWheel","enableZoomWheel","enableGestures","geometryType","Options","emitter","_emitter","_data","loadFromStorage","defaults","notifierChangeEvent","change","saveToStorage","window","localStorage","setItem","JSON","stringify","error","item","getItem","parse","resetToDefaults","fields","resetData","reduce","acc","field","Boolean","CanvasEvents","CANVAS_EVENTS","Dragger","name","initialize","dispose","updatePreview"],"mappings":"AA0BA,MAAMA;IAAN,WAAAC;QACmBC,KAAAC,YAAY,IAAIC;AAuClC;IArCC,eAAAC,CAAgBC,IAAYC,SAA0BC,aAAmCC;QACvFP,KAAKC,UAAUO,IAAIJ,IAAI;YAAEA;YAAIC;YAASE;YAASD;;AAChD;IAED,oBAAAG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;AACnB;IAED,gBAAIA,CAAahD;QACfnB,KAAKuE,MAAMJ,eAAehD;QAC1BnB,KAAK2E;AACN;;;ACvTU,MAAAkB,eAAe,EAC1B,SACA,eACA,YACA,aACA,cACA,aACA,WACA,iBACA,eACA,gBACA,eACA,aACA,eACA,YACA,aACA,cACA;;AAGK,MAAMC,gBAAgBD;;MCXhBE;IAGX,WAAAhG,CAAYY;QAFZX,KAAIgG,OAAG;AAEwB;IAE/B,UAAAC,IAAqB;IAErB,OAAAC,IAAkB;IAElB,aAAAC,IAAwB;;;"}
@@ -4,87 +4,94 @@ export interface RGB {
4
4
  blue: number;
5
5
  }
6
6
  /**
7
- * Viewer parameters.
7
+ * Viewer options interface.
8
8
  */
9
9
  export interface IOptions {
10
10
  /**
11
- * Show WCS
11
+ * Show the world coordinate system axes in the bottom-left corner of the viewer.
12
12
  *
13
13
  * @defaultValue true
14
14
  */
15
15
  showWCS?: boolean;
16
16
  /**
17
- * Enable camera animation
17
+ * Enable camera animation.
18
18
  *
19
19
  * @defaultValue true
20
20
  */
21
21
  cameraAnimation?: boolean;
22
22
  /**
23
- * Enable antialiasing use FXAA
23
+ * Enable anti-aliasing using FXAA.
24
24
  *
25
25
  * @defaultValue true
26
26
  */
27
27
  antialiasing?: boolean;
28
28
  /**
29
- * Enable ground shadows
29
+ * Show ground shadows below the model.
30
30
  *
31
31
  * @defaultValue false
32
32
  */
33
33
  groundShadow?: boolean;
34
34
  /**
35
- * Enable shadows
35
+ * Enable ambient shadows.
36
36
  *
37
37
  * @defaultValue false
38
38
  */
39
39
  shadows?: boolean;
40
40
  /**
41
- * Camera speed on X axis
41
+ * Camera speed on X axis.
42
42
  *
43
43
  * @defaultValue 4
44
44
  */
45
45
  cameraAxisXSpeed?: number;
46
46
  /**
47
- * Camera speed on Y axis
47
+ * Camera speed on Y axis.
48
48
  *
49
49
  * @defaultValue 1
50
50
  */
51
51
  cameraAxisYSpeed?: number;
52
52
  /**
53
- * Ambient occlusion
53
+ * Enable ambient occlusion.
54
54
  *
55
55
  * @defaultValue false
56
56
  */
57
57
  ambientOcclusion?: boolean;
58
58
  /**
59
- * Enable streaming of drawings from the server
59
+ * Enable streaming of drawings from the server.
60
60
  *
61
- * If streaming is disabled, the file/assembly will be loaded in one go. If streaming is
62
- * enabled, partial download mode may be enabled as well.
61
+ * If streaming is disabled, the file/assembly will be loaded in one go. The viewer will only
62
+ * update once the loading is complete, which may take a while.
63
+ *
64
+ * If streaming is enabled, {@link enablePartialMode | partial download} mode may be enabled as well.
63
65
  *
64
66
  * @defaultValue true
65
67
  */
66
68
  enableStreamingMode?: boolean;
67
69
  /**
68
- * Enable partial load mode to be able open large drawing. Only used if streaming is enabled.
69
- * If partial mode is enabled, then scene graph will be disabled.
70
+ * Enable partial load mode to be able open large drawing.
71
+ *
72
+ * In partial loading mode, the viewer keeps only visible objects in memory and loads other
73
+ * objects when the zoom or viewpoint changes.
74
+ *
75
+ * Only used if {@link enableStreamingMode | streaming} is enabled. If partial mode is
76
+ * enabled, then {@link sceneGraph | scene graph} will be disabled.
70
77
  *
71
78
  * @defaultValue false
72
79
  */
73
80
  enablePartialMode?: boolean;
74
81
  /**
75
- * The size of the memory buffer that the Viewer can use for graphics data
82
+ * The size of the memory buffer for graphics data, in bytes.
76
83
  *
77
84
  * @defaultValue 3294967296
78
85
  */
79
86
  memoryLimit?: number;
80
87
  /**
81
- * Cutting plane fill color
88
+ * Cutting planes fill color.
82
89
  *
83
90
  * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }
84
91
  */
85
92
  cuttingPlaneFillColor?: RGB;
86
93
  /**
87
- * Outline edges color in RGB format.
94
+ * Edges highlight color.
88
95
  */
89
96
  edgesColor?: {
90
97
  r: number;
@@ -92,7 +99,7 @@ export interface IOptions {
92
99
  b: number;
93
100
  };
94
101
  /**
95
- * Faces color in the RGB format.
102
+ * Faces highlight color.
96
103
  */
97
104
  facesColor?: {
98
105
  r: number;
@@ -100,19 +107,19 @@ export interface IOptions {
100
107
  b: number;
101
108
  };
102
109
  /**
103
- * Show or hide edges.
110
+ * Show highlighted edges.
104
111
  */
105
112
  edgesVisibility?: boolean;
106
113
  /**
107
- * Show edges over drawing.
114
+ * Show highlighted edges over drawing.
108
115
  */
109
116
  edgesOverlap?: boolean;
110
117
  /**
111
- * Show faces over drawing.
118
+ * Show highlighted faces over drawing.
112
119
  */
113
120
  facesOverlap?: boolean;
114
121
  /**
115
- * Faces transparency value from 0 to 255.
122
+ * Highlighted faces transparency value, from 0 to 255.
116
123
  */
117
124
  facesTransparancy?: number;
118
125
  /**
@@ -120,19 +127,25 @@ export interface IOptions {
120
127
  */
121
128
  enableCustomHighlight?: boolean;
122
129
  /**
123
- * Enable or disable scene graph, it increases perfomance improvement, but consumes memory.
124
- * Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode
125
- * will be disabled
130
+ * Enable scene graph.
131
+ *
132
+ * Scene graph increases perfomance improvement, but consumes memory. Large drawings can take
133
+ * up a lot of memory. If scene graph is enabled, then
134
+ * {@link enablePartialMode | partial load mode} will be disabled.
126
135
  */
127
136
  sceneGraph: boolean;
128
137
  /**
129
- * Edge display models. No edges is usefull for less memory consumption: `false` - no edges
130
- * are displayed, `true` - display isolines.
138
+ * Show the edges of the model:
139
+ *
140
+ * - `false` - No model edges are displayed. Usefull for less memory consumption.
141
+ * - `true` - Display isolines.
131
142
  */
132
143
  edgeModel: boolean;
133
144
  /**
134
- * Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,
135
- * moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.
145
+ * Reverse the mouse wheel direction for zooming:
146
+ *
147
+ * - `false` - Moving the wheel up zooms in, moving down zooms out.
148
+ * - `true` - Moving the wheel up zooms out, moving down zooms in.
136
149
  */
137
150
  reverseZoomWheel: boolean;
138
151
  /**
@@ -140,16 +153,21 @@ export interface IOptions {
140
153
  */
141
154
  enableZoomWheel: boolean;
142
155
  /**
143
- * Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since
144
- * gestures contains touch zoom.
156
+ * Enable touch gestures.
157
+ *
158
+ * This option will be ignored when {@link enableZoomWheel | mouse wheel zooming} is disabled,
159
+ * since gestures contains touch zoom.
145
160
  */
146
161
  enableGestures: boolean;
147
162
  /**
148
- * Default file geometry data type. Can be one of:
149
- *
150
- * - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.
151
- * - `gltf` - `glTF`, for opening a file in `Three.js` viewer.
163
+ * Deprecated since `25.8`.
152
164
  */
153
165
  geometryType?: string;
166
+ /**
167
+ * Resets options to default values.
168
+ *
169
+ * @param fields - Name of fields to be reset.
170
+ */
171
+ resetToDefaults?: (fields?: string[]) => void;
154
172
  }
155
173
  export declare function defaultOptions(): IOptions;
@@ -10,9 +10,9 @@ export declare class Options implements IOptions {
10
10
  saveToStorage(): void;
11
11
  loadFromStorage(): void;
12
12
  /**
13
- * Reset options to default
13
+ * Resets options to default values.
14
14
  *
15
- * @param fields - Name of fields to be reset
15
+ * @param fields - Name of fields to be reset. Specify `undefined` to reset all.
16
16
  */
17
17
  resetToDefaults(fields?: string[]): void;
18
18
  get data(): IOptions;
@@ -10,7 +10,7 @@ export interface OptionsChangeEvent {
10
10
  */
11
11
  type: "optionschange";
12
12
  /**
13
- * New parameters.
13
+ * New options.
14
14
  */
15
15
  data: IOptions;
16
16
  }
@@ -154,7 +154,7 @@ export interface ISnapshot {
154
154
  data: string;
155
155
  }
156
156
  /**
157
- * BCF-style Viewpoint with markup objects
157
+ * BCF-style Viewpoint with markup objects.
158
158
  */
159
159
  export interface IViewpoint {
160
160
  bitmaps?: IBitmap[];
@@ -109,9 +109,10 @@ export interface DisposeEvent {
109
109
  type: "dispose";
110
110
  }
111
111
  /**
112
- * Event that fires when the model geometry data chunk has been loaded. Note that small files
113
- * are loaded in one chunk, and `geometrychunk` event does not fire, only the `databasechink`
114
- * event fires.
112
+ * Event that fires when the model geometry data chunk has been loaded.
113
+ *
114
+ * Note that small files are loaded in one chunk, and `geometrychunk` event does not fire, only
115
+ * the `databasechink` event fires.
115
116
  *
116
117
  * @event
117
118
  */
@@ -269,7 +270,7 @@ export interface OpenEvent {
269
270
  */
270
271
  type: "open";
271
272
  /**
272
- * File instance to open.
273
+ * File instance to open. Only defined when loading a file from the server.
273
274
  */
274
275
  file?: File | Assembly | Model;
275
276
  /**
@@ -279,7 +280,7 @@ export interface OpenEvent {
279
280
  */
280
281
  model?: File | Assembly | Model;
281
282
  /**
282
- * Buffer to open.
283
+ * Buffer to open. Only defined when loading a local file.
283
284
  */
284
285
  buffer?: Uint8Array | ArrayBuffer;
285
286
  }
@@ -423,11 +424,11 @@ export interface PanEvent {
423
424
  */
424
425
  y: number;
425
426
  /**
426
- * delta X coordinate.
427
+ * Delta X coordinate.
427
428
  */
428
429
  dX: number;
429
430
  /**
430
- * delta Y coordinate.
431
+ * Delta Y coordinate.
431
432
  */
432
433
  dY: number;
433
434
  }
@@ -457,12 +458,12 @@ export interface ZoomAtEvent {
457
458
  */
458
459
  type: "zoomat";
459
460
  /**
460
- * Zoom factor
461
+ * New zoom factor.
461
462
  */
462
463
  data: number;
463
464
  }
464
465
  /**
465
- * Event that fires when zooming to entity.
466
+ * Event that fires when zooming to object.
466
467
  *
467
468
  * @event
468
469
  */
@@ -472,7 +473,7 @@ export interface ZoomToEntityEvent {
472
473
  */
473
474
  type: "zoomtoentity";
474
475
  /**
475
- * Entity
476
+ * Object to zoom.
476
477
  */
477
478
  data: any;
478
479
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/viewer-core",
3
- "version": "25.8.16",
3
+ "version": "25.8.19",
4
4
  "description": "3D CAD and BIM data Viewer core",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -26,9 +26,9 @@
26
26
  "test": "karma start karma.conf.js"
27
27
  },
28
28
  "devDependencies": {
29
- "@inweb/eventemitter2": "~25.8.16"
29
+ "@inweb/eventemitter2": "~25.8.19"
30
30
  },
31
31
  "peerDependencies": {
32
- "@inweb/eventemitter2": "~25.8.16"
32
+ "@inweb/eventemitter2": "~25.8.19"
33
33
  }
34
34
  }
@@ -28,124 +28,131 @@ export interface RGB {
28
28
  }
29
29
 
30
30
  /**
31
- * Viewer parameters.
31
+ * Viewer options interface.
32
32
  */
33
33
  export interface IOptions {
34
34
  /**
35
- * Show WCS
35
+ * Show the world coordinate system axes in the bottom-left corner of the viewer.
36
36
  *
37
37
  * @defaultValue true
38
38
  */
39
39
  showWCS?: boolean;
40
40
 
41
41
  /**
42
- * Enable camera animation
42
+ * Enable camera animation.
43
43
  *
44
44
  * @defaultValue true
45
45
  */
46
46
  cameraAnimation?: boolean;
47
47
 
48
48
  /**
49
- * Enable antialiasing use FXAA
49
+ * Enable anti-aliasing using FXAA.
50
50
  *
51
51
  * @defaultValue true
52
52
  */
53
53
  antialiasing?: boolean;
54
54
 
55
55
  /**
56
- * Enable ground shadows
56
+ * Show ground shadows below the model.
57
57
  *
58
58
  * @defaultValue false
59
59
  */
60
60
  groundShadow?: boolean;
61
61
 
62
62
  /**
63
- * Enable shadows
63
+ * Enable ambient shadows.
64
64
  *
65
65
  * @defaultValue false
66
66
  */
67
67
  shadows?: boolean;
68
68
 
69
69
  /**
70
- * Camera speed on X axis
70
+ * Camera speed on X axis.
71
71
  *
72
72
  * @defaultValue 4
73
73
  */
74
74
  cameraAxisXSpeed?: number;
75
75
 
76
76
  /**
77
- * Camera speed on Y axis
77
+ * Camera speed on Y axis.
78
78
  *
79
79
  * @defaultValue 1
80
80
  */
81
81
  cameraAxisYSpeed?: number;
82
82
 
83
83
  /**
84
- * Ambient occlusion
84
+ * Enable ambient occlusion.
85
85
  *
86
86
  * @defaultValue false
87
87
  */
88
88
  ambientOcclusion?: boolean;
89
89
 
90
90
  /**
91
- * Enable streaming of drawings from the server
91
+ * Enable streaming of drawings from the server.
92
92
  *
93
- * If streaming is disabled, the file/assembly will be loaded in one go. If streaming is
94
- * enabled, partial download mode may be enabled as well.
93
+ * If streaming is disabled, the file/assembly will be loaded in one go. The viewer will only
94
+ * update once the loading is complete, which may take a while.
95
+ *
96
+ * If streaming is enabled, {@link enablePartialMode | partial download} mode may be enabled as well.
95
97
  *
96
98
  * @defaultValue true
97
99
  */
98
100
  enableStreamingMode?: boolean;
99
101
 
100
102
  /**
101
- * Enable partial load mode to be able open large drawing. Only used if streaming is enabled.
102
- * If partial mode is enabled, then scene graph will be disabled.
103
+ * Enable partial load mode to be able open large drawing.
104
+ *
105
+ * In partial loading mode, the viewer keeps only visible objects in memory and loads other
106
+ * objects when the zoom or viewpoint changes.
107
+ *
108
+ * Only used if {@link enableStreamingMode | streaming} is enabled. If partial mode is
109
+ * enabled, then {@link sceneGraph | scene graph} will be disabled.
103
110
  *
104
111
  * @defaultValue false
105
112
  */
106
113
  enablePartialMode?: boolean;
107
114
 
108
115
  /**
109
- * The size of the memory buffer that the Viewer can use for graphics data
116
+ * The size of the memory buffer for graphics data, in bytes.
110
117
  *
111
118
  * @defaultValue 3294967296
112
119
  */
113
120
  memoryLimit?: number;
114
121
 
115
122
  /**
116
- * Cutting plane fill color
123
+ * Cutting planes fill color.
117
124
  *
118
125
  * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }
119
126
  */
120
127
  cuttingPlaneFillColor?: RGB;
121
128
 
122
129
  /**
123
- * Outline edges color in RGB format.
130
+ * Edges highlight color.
124
131
  */
125
132
  edgesColor?: { r: number; g: number; b: number };
126
133
 
127
134
  /**
128
- * Faces color in the RGB format.
135
+ * Faces highlight color.
129
136
  */
130
137
  facesColor?: { r: number; g: number; b: number };
131
138
 
132
139
  /**
133
- * Show or hide edges.
140
+ * Show highlighted edges.
134
141
  */
135
142
  edgesVisibility?: boolean;
136
143
 
137
144
  /**
138
- * Show edges over drawing.
145
+ * Show highlighted edges over drawing.
139
146
  */
140
147
  edgesOverlap?: boolean;
141
148
 
142
149
  /**
143
- * Show faces over drawing.
150
+ * Show highlighted faces over drawing.
144
151
  */
145
152
  facesOverlap?: boolean;
146
153
 
147
154
  /**
148
- * Faces transparency value from 0 to 255.
155
+ * Highlighted faces transparency value, from 0 to 255.
149
156
  */
150
157
  facesTransparancy?: number;
151
158
 
@@ -155,21 +162,27 @@ export interface IOptions {
155
162
  enableCustomHighlight?: boolean;
156
163
 
157
164
  /**
158
- * Enable or disable scene graph, it increases perfomance improvement, but consumes memory.
159
- * Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode
160
- * will be disabled
165
+ * Enable scene graph.
166
+ *
167
+ * Scene graph increases perfomance improvement, but consumes memory. Large drawings can take
168
+ * up a lot of memory. If scene graph is enabled, then
169
+ * {@link enablePartialMode | partial load mode} will be disabled.
161
170
  */
162
171
  sceneGraph: boolean;
163
172
 
164
173
  /**
165
- * Edge display models. No edges is usefull for less memory consumption: `false` - no edges
166
- * are displayed, `true` - display isolines.
174
+ * Show the edges of the model:
175
+ *
176
+ * - `false` - No model edges are displayed. Usefull for less memory consumption.
177
+ * - `true` - Display isolines.
167
178
  */
168
179
  edgeModel: boolean;
169
180
 
170
181
  /**
171
- * Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,
172
- * moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.
182
+ * Reverse the mouse wheel direction for zooming:
183
+ *
184
+ * - `false` - Moving the wheel up zooms in, moving down zooms out.
185
+ * - `true` - Moving the wheel up zooms out, moving down zooms in.
173
186
  */
174
187
  reverseZoomWheel: boolean;
175
188
 
@@ -179,18 +192,24 @@ export interface IOptions {
179
192
  enableZoomWheel: boolean;
180
193
 
181
194
  /**
182
- * Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since
183
- * gestures contains touch zoom.
195
+ * Enable touch gestures.
196
+ *
197
+ * This option will be ignored when {@link enableZoomWheel | mouse wheel zooming} is disabled,
198
+ * since gestures contains touch zoom.
184
199
  */
185
200
  enableGestures: boolean;
186
201
 
187
202
  /**
188
- * Default file geometry data type. Can be one of:
189
- *
190
- * - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.
191
- * - `gltf` - `glTF`, for opening a file in `Three.js` viewer.
203
+ * Deprecated since `25.8`.
192
204
  */
193
205
  geometryType?: string;
206
+
207
+ /**
208
+ * Resets options to default values.
209
+ *
210
+ * @param fields - Name of fields to be reset.
211
+ */
212
+ resetToDefaults?: (fields?: string[]) => void;
194
213
  }
195
214
 
196
215
  export function defaultOptions(): IOptions {
@@ -75,9 +75,9 @@ export class Options implements IOptions {
75
75
  }
76
76
 
77
77
  /**
78
- * Reset options to default
78
+ * Resets options to default values.
79
79
  *
80
- * @param fields - Name of fields to be reset
80
+ * @param fields - Name of fields to be reset. Specify `undefined` to reset all.
81
81
  */
82
82
  resetToDefaults(fields?: string[]): void {
83
83
  if (fields !== undefined) {
@@ -86,7 +86,6 @@ export class Options implements IOptions {
86
86
  acc[field] = defaults[field];
87
87
  return acc;
88
88
  }, {});
89
-
90
89
  this.data = { ...this.data, ...resetData };
91
90
  } else {
92
91
  this.data = { ...this.data, ...Options.defaults() };
@@ -12,7 +12,7 @@ export interface OptionsChangeEvent {
12
12
  type: "optionschange";
13
13
 
14
14
  /**
15
- * New parameters.
15
+ * New options.
16
16
  */
17
17
  data: IOptions;
18
18
  }
@@ -194,7 +194,7 @@ export interface ISnapshot {
194
194
  }
195
195
 
196
196
  /**
197
- * BCF-style Viewpoint with markup objects
197
+ * BCF-style Viewpoint with markup objects.
198
198
  */
199
199
  export interface IViewpoint {
200
200
  bitmaps?: IBitmap[];
@@ -120,9 +120,10 @@ export interface DisposeEvent {
120
120
  }
121
121
 
122
122
  /**
123
- * Event that fires when the model geometry data chunk has been loaded. Note that small files
124
- * are loaded in one chunk, and `geometrychunk` event does not fire, only the `databasechink`
125
- * event fires.
123
+ * Event that fires when the model geometry data chunk has been loaded.
124
+ *
125
+ * Note that small files are loaded in one chunk, and `geometrychunk` event does not fire, only
126
+ * the `databasechink` event fires.
126
127
  *
127
128
  * @event
128
129
  */
@@ -305,7 +306,7 @@ export interface OpenEvent {
305
306
  type: "open";
306
307
 
307
308
  /**
308
- * File instance to open.
309
+ * File instance to open. Only defined when loading a file from the server.
309
310
  */
310
311
  file?: File | Assembly | Model;
311
312
 
@@ -317,7 +318,7 @@ export interface OpenEvent {
317
318
  model?: File | Assembly | Model;
318
319
 
319
320
  /**
320
- * Buffer to open.
321
+ * Buffer to open. Only defined when loading a local file.
321
322
  */
322
323
  buffer?: Uint8Array | ArrayBuffer;
323
324
  }
@@ -475,16 +476,19 @@ export interface PanEvent {
475
476
  * X coordinate.
476
477
  */
477
478
  x: number;
479
+
478
480
  /**
479
481
  * Y coordinate.
480
482
  */
481
483
  y: number;
484
+
482
485
  /**
483
- * delta X coordinate.
486
+ * Delta X coordinate.
484
487
  */
485
488
  dX: number;
489
+
486
490
  /**
487
- * delta Y coordinate.
491
+ * Delta Y coordinate.
488
492
  */
489
493
  dY: number;
490
494
  }
@@ -518,13 +522,13 @@ export interface ZoomAtEvent {
518
522
  type: "zoomat";
519
523
 
520
524
  /**
521
- * Zoom factor
525
+ * New zoom factor.
522
526
  */
523
527
  data: number;
524
528
  }
525
529
 
526
530
  /**
527
- * Event that fires when zooming to entity.
531
+ * Event that fires when zooming to object.
528
532
  *
529
533
  * @event
530
534
  */
@@ -535,7 +539,7 @@ export interface ZoomToEntityEvent {
535
539
  type: "zoomtoentity";
536
540
 
537
541
  /**
538
- * Entity
542
+ * Object to zoom.
539
543
  */
540
544
  data: any;
541
545
  }