[ { "__docId__": 1, "kind": "external", "name": "Infinity", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Infinity", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 2, "kind": "external", "name": "NaN", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~NaN", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 3, "kind": "external", "name": "undefined", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~undefined", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 4, "kind": "external", "name": "null", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~null", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 5, "kind": "external", "name": "Object", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Object", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 6, "kind": "external", "name": "object", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~object", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 7, "kind": "external", "name": "Function", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Function", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 8, "kind": "external", "name": "function", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~function", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 9, "kind": "external", "name": "Boolean", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Boolean", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 10, "kind": "external", "name": "boolean", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~boolean", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 11, "kind": "external", "name": "Symbol", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Symbol", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 12, "kind": "external", "name": "Error", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Error", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 13, "kind": "external", "name": "EvalError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~EvalError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 14, "kind": "external", "name": "InternalError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~InternalError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 15, "kind": "external", "name": "RangeError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~RangeError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 16, "kind": "external", "name": "ReferenceError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~ReferenceError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 17, "kind": "external", "name": "SyntaxError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~SyntaxError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 18, "kind": "external", "name": "TypeError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~TypeError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 19, "kind": "external", "name": "URIError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~URIError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 20, "kind": "external", "name": "Number", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Number", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 21, "kind": "external", "name": "number", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~number", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 22, "kind": "external", "name": "Date", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Date", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 23, "kind": "external", "name": "String", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~String", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 24, "kind": "external", "name": "string", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~string", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 25, "kind": "external", "name": "RegExp", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~RegExp", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 26, "kind": "external", "name": "Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 27, "kind": "external", "name": "Int8Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int8Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 28, "kind": "external", "name": "Uint8Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint8Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 29, "kind": "external", "name": "Uint8ClampedArray", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint8ClampedArray", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 30, "kind": "external", "name": "Int16Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int16Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 31, "kind": "external", "name": "Uint16Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint16Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 32, "kind": "external", "name": "Int32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 33, "kind": "external", "name": "Uint32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 34, "kind": "external", "name": "Float32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Float32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 35, "kind": "external", "name": "Float64Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Float64Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 36, "kind": "external", "name": "Map", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Map", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 37, "kind": "external", "name": "Set", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Set", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 38, "kind": "external", "name": "WeakMap", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~WeakMap", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 39, "kind": "external", "name": "WeakSet", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~WeakSet", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 40, "kind": "external", "name": "ArrayBuffer", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~ArrayBuffer", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 41, "kind": "external", "name": "DataView", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~DataView", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 42, "kind": "external", "name": "JSON", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~JSON", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 43, "kind": "external", "name": "Promise", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Promise", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 44, "kind": "external", "name": "Generator", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Generator", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 45, "kind": "external", "name": "GeneratorFunction", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~GeneratorFunction", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 46, "kind": "external", "name": "Reflect", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Reflect", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 47, "kind": "external", "name": "Proxy", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Proxy", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 48, "kind": "file", "name": "src/BIMViewer.js", "content": "import {BCFViewpointsPlugin, FastNavPlugin, math, stats, Viewer,} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nimport {Controller} from \"./Controller.js\";\nimport {BusyModal} from \"./BusyModal.js\";\nimport {ResetAction} from \"./toolbar/ResetAction.js\";\nimport {FitAction} from \"./toolbar/FitAction.js\";\nimport {FirstPersonMode} from \"./toolbar/FirstPersonMode.js\";\nimport {HideTool} from \"./toolbar/HideTool.js\";\nimport {SelectionTool} from \"./toolbar/SelectionTool.js\";\nimport {ShowSpacesMode} from \"./toolbar/ShowSpacesMode.js\";\nimport {QueryTool} from \"./toolbar/QueryTool.js\";\nimport {SectionTool} from \"./toolbar/SectionTool.js\";\nimport {NavCubeMode} from \"./toolbar/NavCubeMode.js\";\n\nimport {ModelsExplorer} from \"./explorer/ModelsExplorer.js\";\nimport {ObjectsExplorer} from \"./explorer/ObjectsExplorer.js\";\nimport {ClassesExplorer} from \"./explorer/ClassesExplorer.js\";\nimport {StoreysExplorer} from \"./explorer/StoreysExplorer.js\";\n\nimport {ThreeDMode} from \"./toolbar/ThreeDMode.js\";\nimport {ObjectContextMenu} from \"./contextMenus/ObjectContextMenu.js\";\nimport {CanvasContextMenu} from \"./contextMenus/CanvasContextMenu.js\";\nimport {OrthoMode} from \"./toolbar/OrthoMode.js\";\nimport {PropertiesInspector} from \"./inspector/PropertiesInspector.js\";\nimport {ObjectsKdTree3} from \"./collision/ObjectsKdTree3.js\";\nimport {MarqueeSelectionTool} from \"./toolbar/MarqueeSelectionTool.js\";\n\n\nconst hideEdgesMinDrawCount = 5; // FastNavPlugin enables dynamic edges when xeokit's per-frame draw count drops below this\nconst scaleCanvasResolutionMinDrawCount = 1000; // FastNavPlugin switches to low-res canvas when xeokit's per-frame draw count rises above this\n\nfunction createExplorerTemplate(cfg) {\n const explorerTemplate = `
\n
\n Models\n
\n
\n \n ` +\n (cfg.enableEditModels ? `` : ``) + `
\n
\n
\n
\n
\n Objects\n
\n
\n \n \n
\n
\n
\n
\n
\n Classes\n
\n
\n \n \n
\n
\n
\n
\n
\n Storeys\n
\n
\n \n \n
\n
\n
\n
\n
`;\n return explorerTemplate;\n}\n\nfunction createToolbarTemplate() {\n const toolbarTemplate = `
\n \n
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n \n \n \n \n \n \n \n
\n
`;\n return toolbarTemplate;\n}\n\nfunction createInspectorTemplate() {\n const inspectorTemplate = `
\n
\n Properties\n
\n
\n
\n
\n
`;\n return inspectorTemplate;\n}\n\nfunction initTabs(containerElement) {\n\n const tabsClass = 'xeokit-tabs';\n const tabClass = 'xeokit-tab';\n const tabButtonClass = 'xeokit-tab-btn';\n const activeClass = 'active';\n\n // Activates the chosen tab and deactivates the rest\n function activateTab(chosenTabElement) {\n let tabList = chosenTabElement.parentNode.querySelectorAll('.' + tabClass);\n for (let i = 0; i < tabList.length; i++) {\n let tabElement = tabList[i];\n if (tabElement.isEqualNode(chosenTabElement)) {\n tabElement.classList.add(activeClass)\n } else {\n tabElement.classList.remove(activeClass)\n }\n }\n }\n\n // Initialize each tabbed container\n let tabbedContainers = containerElement.querySelectorAll('.' + tabsClass);\n for (let i = 0; i < tabbedContainers.length; i++) {\n let tabbedContainer = tabbedContainers[i];\n let tabList = tabbedContainer.querySelectorAll('.' + tabClass);\n activateTab(tabList[0]);\n for (let i = 0; i < tabList.length; i++) {\n let tabElement = tabList[i];\n let tabButton = tabElement.querySelector('.' + tabButtonClass);\n tabButton.addEventListener('click', function (event) {\n event.preventDefault();\n if (this.classList.contains(\"disabled\")) {\n return;\n }\n activateTab(event.target.parentNode);\n })\n }\n }\n}\n\n\n/**\n * @desc A BIM viewer based on the [xeokit SDK](http://xeokit.io).\n *\n *\n */\nclass BIMViewer extends Controller {\n\n /**\n * Constructs a BIMViewer.\n * @param {Server} server Data access strategy.\n * @param {*} cfg Configuration.\n * @param {Boolean} [cfg.enableEditModels=false] Set ````true```` to show \"Add\", \"Edit\" and \"Delete\" options in the Models tab's context menu.\n * @param {Boolean} [cfg.keyboardEventsElement] Optional reference to HTML element on which key events should be handled. Defaults to the HTML Document.\n */\n constructor(server, cfg = {}) {\n\n if (!cfg.canvasElement) {\n throw \"Config expected: canvasElement\";\n }\n\n if (!cfg.explorerElement) {\n throw \"Config expected: explorerElement\";\n }\n\n if (!cfg.toolbarElement) {\n throw \"Config expected: toolbarElement\";\n }\n\n if (!cfg.navCubeCanvasElement) {\n throw \"Config expected: navCubeCanvasElement\";\n }\n\n const canvasElement = cfg.canvasElement;\n const explorerElement = cfg.explorerElement;\n const inspectorElement = cfg.inspectorElement;\n const toolbarElement = cfg.toolbarElement;\n const navCubeCanvasElement = cfg.navCubeCanvasElement;\n const busyModelBackdropElement = cfg.busyModelBackdropElement;\n\n explorerElement.oncontextmenu = (e) => {\n e.preventDefault();\n };\n\n toolbarElement.oncontextmenu = (e) => {\n e.preventDefault();\n };\n\n navCubeCanvasElement.oncontextmenu = (e) => {\n e.preventDefault();\n };\n\n const viewer = new Viewer({\n localeService: cfg.localeService,\n canvasElement: canvasElement,\n keyboardEventsElement: cfg.keyboardEventsElement,\n transparent: false,\n backgroundColor: [1, 1, 1],\n backgroundColorFromAmbientLight: false,\n saoEnabled: true,\n pbrEnabled: false,\n colorTextureEnabled: true\n });\n\n super(null, cfg, server, viewer);\n\n this._configs = {};\n\n this._enableAddModels = !!cfg.enableEditModels;\n this._enablePropertiesInspector = !!cfg.inspectorElement;\n\n /**\n * The xeokit [Viewer](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html) at the core of this BIMViewer.\n *\n * @type {Viewer}\n */\n this.viewer = viewer;\n\n this._objectsKdTree3 = new ObjectsKdTree3(({\n viewer\n }))\n\n this._customizeViewer();\n this._initCanvasContextMenus();\n\n explorerElement.innerHTML = createExplorerTemplate(cfg);\n toolbarElement.innerHTML = createToolbarTemplate();\n if (this._enablePropertiesInspector) {\n inspectorElement.innerHTML = createInspectorTemplate();\n }\n\n this._explorerElement = explorerElement;\n this._inspectorElement = inspectorElement;\n\n initTabs(explorerElement);\n if (this._enablePropertiesInspector) {\n initTabs(inspectorElement);\n }\n\n this._modelsExplorer = new ModelsExplorer(this, {\n modelsTabElement: explorerElement.querySelector(\".xeokit-modelsTab\"),\n loadModelsButtonElement: explorerElement.querySelector(\".xeokit-loadAllModels\"), // Can be undefined\n unloadModelsButtonElement: explorerElement.querySelector(\".xeokit-unloadAllModels\"),\n addModelButtonElement: explorerElement.querySelector(\".xeokit-addModel\"), // Can be undefined\n modelsElement: explorerElement.querySelector(\".xeokit-models\"),\n enableEditModels: this._enableAddModels\n });\n\n this._objectsExplorer = new ObjectsExplorer(this, {\n objectsTabElement: explorerElement.querySelector(\".xeokit-objectsTab\"),\n showAllObjectsButtonElement: explorerElement.querySelector(\".xeokit-showAllObjects\"),\n hideAllObjectsButtonElement: explorerElement.querySelector(\".xeokit-hideAllObjects\"),\n objectsElement: explorerElement.querySelector(\".xeokit-objects\")\n });\n\n this._classesExplorer = new ClassesExplorer(this, {\n classesTabElement: explorerElement.querySelector(\".xeokit-classesTab\"),\n showAllClassesButtonElement: explorerElement.querySelector(\".xeokit-showAllClasses\"),\n hideAllClassesButtonElement: explorerElement.querySelector(\".xeokit-hideAllClasses\"),\n classesElement: explorerElement.querySelector(\".xeokit-classes\")\n });\n\n this._storeysExplorer = new StoreysExplorer(this, {\n storeysTabElement: explorerElement.querySelector(\".xeokit-storeysTab\"),\n showAllStoreysButtonElement: explorerElement.querySelector(\".xeokit-showAllStoreys\"),\n hideAllStoreysButtonElement: explorerElement.querySelector(\".xeokit-hideAllStoreys\"),\n storeysElement: explorerElement.querySelector(\".xeokit-storeys\")\n });\n\n if (this._enablePropertiesInspector) {\n this._propertiesInspector = new PropertiesInspector(this, {\n propertiesTabElement: inspectorElement.querySelector(\".xeokit-propertiesTab\"),\n propertiesElement: inspectorElement.querySelector(\".xeokit-properties\")\n });\n }\n\n this._resetAction = new ResetAction(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-reset\"),\n active: false\n });\n\n this._fitAction = new FitAction(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-fit\"),\n active: false\n });\n\n // Allows Three-D and First Person toggle buttons to cooperatively switch\n // CameraControl#navMode between \"orbit\", \"firstPerson\" and \"planView\" modes\n\n const cameraControlNavModeMediator = new (function (bimViewer) {\n\n let threeDActive = false;\n let firstPersonActive = false;\n\n this.setThreeDModeActive = (active) => {\n if (active) {\n bimViewer._firstPersonMode.setActive(false);\n bimViewer._marqueeSelectionTool.setEnabled(true);\n bimViewer.viewer.cameraControl.navMode = \"orbit\";\n } else {\n bimViewer._marqueeSelectionTool.setEnabled(false);\n bimViewer._marqueeSelectionTool.setActive(false);\n bimViewer._firstPersonMode.setActive(false);\n bimViewer.viewer.cameraControl.navMode = \"planView\";\n }\n threeDActive = active;\n };\n\n this.setFirstPersonModeActive = (active) => {\n bimViewer.viewer.cameraControl.navMode = active ? \"firstPerson\" : (threeDActive ? \"orbit\" : \"planView\");\n firstPersonActive = active;\n };\n\n })(this);\n\n this._threeDMode = new ThreeDMode(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-threeD\"),\n cameraControlNavModeMediator,\n active: false\n });\n\n this._orthoMode = new OrthoMode(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-ortho\"),\n active: false\n });\n\n this._firstPersonMode = new FirstPersonMode(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-firstPerson\"),\n cameraControlNavModeMediator,\n active: false\n });\n\n this._hideTool = new HideTool(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-hide\"),\n active: false\n });\n\n this._selectionTool = new SelectionTool(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-select\"),\n active: false\n });\n\n this._marqueeSelectionTool = new MarqueeSelectionTool(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-marquee\"),\n active: false,\n objectsKdTree3: this._objectsKdTree3\n });\n\n this._showSpacesMode = new ShowSpacesMode(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-showSpaces\"),\n active: false\n });\n\n this._queryTool = new QueryTool(this, {\n active: false\n });\n\n this._sectionTool = new SectionTool(this, {\n buttonElement: toolbarElement.querySelector(\".xeokit-section\"),\n counterElement: toolbarElement.querySelector(\".xeokit-section-counter\"),\n menuButtonElement: toolbarElement.querySelector(\".xeokit-section-menu-button\"),\n menuButtonArrowElement: toolbarElement.querySelector(\".xeokit-section-menu-button-arrow\"),\n active: false\n });\n\n this._navCubeMode = new NavCubeMode(this, {\n navCubeCanvasElement: navCubeCanvasElement,\n active: true\n });\n\n this._busyModal = new BusyModal(this, {\n busyModalBackdropElement: busyModelBackdropElement\n });\n\n this._threeDMode.setActive(true);\n this._firstPersonMode.setActive(false);\n this._navCubeMode.setActive(true);\n\n this._modelsExplorer.on(\"modelLoaded\", (modelId) => {\n if (this._modelsExplorer.getNumModelsLoaded() > 0) {\n this.setControlsEnabled(true);\n }\n this.fire(\"modelLoaded\", modelId);\n });\n\n this._modelsExplorer.on(\"modelUnloaded\", (modelId) => {\n if (this._modelsExplorer.getNumModelsLoaded() === 0) {\n this.setControlsEnabled(false);\n this.openTab(\"models\");\n }\n this.fire(\"modelUnloaded\", modelId);\n });\n\n this._resetAction.on(\"reset\", () => {\n this.fire(\"reset\", true);\n });\n\n this._mutexActivation([this._hideTool, this._selectionTool, this._marqueeSelectionTool, this._sectionTool]);\n\n explorerElement.querySelector(\".xeokit-showAllObjects\").addEventListener(\"click\", (event) => {\n this.setAllObjectsVisible(true);\n this.setAllObjectsXRayed(false);\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-hideAllObjects\").addEventListener(\"click\", (event) => {\n this.setAllObjectsVisible(false);\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-showAllClasses\").addEventListener(\"click\", (event) => {\n this.setAllObjectsVisible(true);\n this.setAllObjectsXRayed(false);\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-hideAllClasses\").addEventListener(\"click\", (event) => {\n this.setAllObjectsVisible(false);\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-showAllStoreys\").addEventListener(\"click\", (event) => {\n this.setAllObjectsVisible(true);\n this.setAllObjectsXRayed(false);\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-hideAllStoreys\").addEventListener(\"click\", (event) => {\n this.setAllObjectsVisible(false);\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-loadAllModels\").addEventListener(\"click\", (event) => {\n this.setControlsEnabled(false); // For quick UI feedback\n this.loadAllModels();\n event.preventDefault();\n });\n\n explorerElement.querySelector(\".xeokit-unloadAllModels\").addEventListener(\"click\", (event) => {\n this.setControlsEnabled(false); // For quick UI feedback\n this._modelsExplorer.unloadAllModels();\n event.preventDefault();\n });\n\n if (this._enableAddModels) {\n explorerElement.querySelector(\".xeokit-addModel\").addEventListener(\"click\", (event) => {\n this.fire(\"addModel\", {});\n event.preventDefault();\n });\n }\n\n this._bcfViewpointsPlugin = new BCFViewpointsPlugin(this.viewer, {});\n\n this._fastNavPlugin = new FastNavPlugin(viewer, {\n hideEdges: true,\n hideSAO: true,\n hidePBR: false,\n hideColorTexture: false,\n hideTransparentObjects: false,\n scaleCanvasResolution: false,\n scaleCanvasResolutionFactor: 0.6\n });\n\n this.viewer.scene.on(\"rendered\", () => {\n const fastNavPlugin = this._fastNavPlugin;\n fastNavPlugin.hideEdges = (hideEdgesMinDrawCount < (stats.frame.drawElements + stats.frame.drawArrays));\n fastNavPlugin.scaleCanvasResolution = (scaleCanvasResolutionMinDrawCount < (stats.frame.drawElements + stats.frame.drawArrays));\n });\n\n this._initConfigs();\n this.setControlsEnabled(false);\n }\n\n /**\n * Returns the LocaleService that was configured on this Viewer.\n *\n * @return {LocaleService} The LocaleService.\n */\n get localeService() {\n return this.viewer.localeService;\n }\n\n _customizeViewer() {\n\n const scene = this.viewer.scene;\n\n // Emphasis effects\n\n scene.xrayMaterial.fill = false;\n scene.xrayMaterial.fillAlpha = 0.3;\n scene.xrayMaterial.fillColor = [0, 0, 0];\n scene.xrayMaterial.edges = true;\n scene.xrayMaterial.edgeAlpha = 0.1;\n scene.xrayMaterial.edgeColor = [0, 0, 0];\n\n scene.highlightMaterial.edges = true;\n scene.highlightMaterial.edgeColor = [1, 1, 0];\n scene.highlightMaterial.edgeAlpha = 0.9;\n scene.highlightMaterial.fill = true;\n scene.highlightMaterial.fillAlpha = 0.1;\n scene.highlightMaterial.fillColor = [1, 0, 0];\n\n //------------------------------------------------------------------------------------------------------------------\n // Configure points material\n //------------------------------------------------------------------------------------------------------------------\n\n scene.pointsMaterial.pointSize = 1;\n scene.pointsMaterial.roundPoints = true;\n scene.pointsMaterial.perspectivePoints = true;\n scene.pointsMaterial.minPerspectivePointSize = 2;\n scene.pointsMaterial.maxPerspectivePointSize = 4;\n\n // Camera control\n\n this.viewer.cameraControl.panRightClick = true;\n this.viewer.cameraControl.followPointer = true;\n this.viewer.cameraControl.doublePickFlyTo = false;\n this.viewer.cameraControl.smartPivot = true;\n\n // Dolly tweaks for best precision when aligning camera for BCF snapshots\n\n this.viewer.cameraControl.keyboardDollyRate = 100.0;\n this.viewer.cameraControl.mouseWheelDollyRate = 100.0;\n this.viewer.cameraControl.dollyInertia = 0;\n this.viewer.cameraControl.dollyMinSpeed = 0.04;\n this.viewer.cameraControl.dollyProximityThreshold = 30.0;\n\n const cameraPivotElement = document.createRange().createContextualFragment(\"
\").firstChild;\n document.body.appendChild(cameraPivotElement);\n this.viewer.cameraControl.pivotElement = cameraPivotElement;\n\n scene.camera.perspective.near = 0.01;\n scene.camera.perspective.far = 3000.0;\n scene.camera.ortho.near = 0.01;\n scene.camera.ortho.far = 2000.0; //\n\n // Scalable Ambient Obscurance (SAO) defaults\n // Since SAO is non-interactive, set to higher-quality\n\n const sao = scene.sao;\n sao.enabled = true;\n sao.numSamples = 50;\n sao.kernelRadius = 200;\n }\n\n _initCanvasContextMenus() {\n\n this._canvasContextMenu = new CanvasContextMenu(this, {\n hideOnAction: true\n });\n this._objectContextMenu = new ObjectContextMenu(this, {\n hideOnAction: true\n });\n\n this.viewer.cameraControl.on(\"rightClick\", (e) => {\n\n const event = e.event;\n\n const hit = this.viewer.scene.pick({\n canvasPos: e.canvasPos\n });\n\n if (hit && hit.entity.isObject) {\n this._canvasContextMenu.hide();\n this._objectContextMenu.context = {\n viewer: this.viewer,\n bimViewer: this,\n showObjectInExplorers: (objectId) => {\n const openTabId = this.getOpenTab();\n if (openTabId !== \"objects\" && openTabId !== \"classes\" && openTabId !== \"storeys\") {\n // Scroll won't work if tab not open\n this.openTab(\"objects\");\n }\n this.showObjectInExplorers(objectId);\n },\n entity: hit.entity\n };\n this._objectContextMenu.show(e.pagePos[0], e.pagePos[1]);\n } else {\n this._objectContextMenu.hide();\n this._canvasContextMenu.context = {\n viewer: this.viewer,\n bimViewer: this\n };\n this._canvasContextMenu.show(e.pagePos[0], e.pagePos[1]);\n }\n });\n }\n\n _initConfigs() {\n this.setConfigs({\n \"cameraNear\": \"0.05\",\n \"cameraFar\": \"3000.0\",\n \"smartPivot\": \"true\",\n \"saoEnabled\": \"true\",\n \"pbrEnabled\": \"false\",\n \"saoBias\": \"0.5\",\n \"saoIntensity\": \"0.15\",\n \"saoNumSamples\": \"40\",\n \"saoKernelRadius\": \"100\",\n \"edgesEnabled\": true,\n \"xrayContext\": true,\n \"xrayPickable\": false,\n \"selectedGlowThrough\": true,\n \"highlightGlowThrough\": true,\n \"backgroundColor\": [1.0, 1.0, 1.0],\n \"externalMetadata\": false,\n \"dtxEnabled\" : false\n });\n }\n\n /**\n * Sets a batch of viewer configurations.\n *\n * Note that this method is not to be confused with {@link BIMViewer#setViewerState}, which batch-updates various states of the viewer's UI and 3D view.\n *\n * See [Viewer Configurations](https://xeokit.github.io/xeokit-bim-viewer/docs/#viewer-configurations) for the list of available configurations.\n *\n * @param {*} viewerConfigs Map of key-value configuration pairs.\n */\n setConfigs(viewerConfigs) {\n for (let name in viewerConfigs) {\n if (viewerConfigs.hasOwnProperty(name)) {\n const value = viewerConfigs[name];\n this.setConfig(name, value);\n }\n }\n }\n\n /**\n * Sets a viewer configuration.\n *\n * See [Viewer Configurations](https://xeokit.github.io/xeokit-bim-viewer/docs/#viewer-configurations) for the list of available configurations.\n *\n * @param {String} name Configuration name.\n * @param {*} value Configuration value.\n */\n setConfig(name, value) {\n\n function parseBool(value) {\n return ((value === true) || (value === \"true\"));\n }\n\n try {\n switch (name) {\n\n case \"backgroundColor\":\n const rgbColor = value;\n this.setBackgroundColor(rgbColor);\n this._configs[name] = rgbColor;\n break;\n\n case \"cameraNear\":\n const near = parseFloat(value);\n this.viewer.scene.camera.perspective.near = near;\n this.viewer.scene.camera.ortho.near = near;\n this._configs[name] = near;\n break;\n\n case \"cameraFar\":\n const far = parseFloat(value);\n this.viewer.scene.camera.perspective.far = far;\n // this.viewer.scene.camera.ortho.far = far;\n this._configs[name] = far;\n break;\n\n case \"smartPivot\":\n this.viewer.cameraControl.smartPivot = this._configs[name] = parseBool(value);\n break;\n\n case \"saoEnabled\":\n this._fastNavPlugin.saoEnabled = this._configs[name] = parseBool(value);\n break;\n\n case \"saoBias\":\n this.viewer.scene.sao.bias = parseFloat(value);\n break;\n\n case \"saoIntensity\":\n this.viewer.scene.sao.intensity = parseFloat(value);\n break;\n\n case \"saoKernelRadius\":\n this.viewer.scene.sao.kernelRadius = this._configs[name] = parseFloat(value);\n break;\n\n case \"saoNumSamples\":\n this.viewer.scene.sao.numSamples = this._configs[name] = parseFloat(value);\n break;\n\n case \"saoBlur\":\n this.viewer.scene.sao.blur = this._configs[name] = parseBool(value);\n break;\n\n case \"edgesEnabled\":\n this._fastNavPlugin.edgesEnabled = this._configs[name] = parseBool(value);\n break;\n\n case \"pbrEnabled\":\n this._fastNavPlugin.pbrEnabled = this._configs[name] = parseBool(value);\n break;\n\n case \"viewFitFOV\":\n this.viewer.cameraFlight.fitFOV = this._configs[name] = parseFloat(value);\n break;\n\n case \"viewFitDuration\":\n this.viewer.cameraFlight.duration = this._configs[name] = parseFloat(value);\n break;\n\n case \"perspectiveFOV\":\n this.viewer.camera.perspective.fov = this._configs[name] = parseFloat(value);\n break;\n\n case \"excludeUnclassifiedObjects\":\n this._configs[name] = parseBool(value);\n break;\n\n case \"xrayContext\":\n this._configs[name] = value;\n break;\n\n case \"xrayPickable\":\n this._configs[name] = parseBool(value);\n break;\n\n case \"selectedGlowThrough\":\n const selectedGlowThrough = this._configs[name] = parseBool(value);\n const selectedMaterial = this.viewer.scene.selectedMaterial;\n selectedMaterial.glowThrough = selectedGlowThrough;\n selectedMaterial.fillAlpha = selectedGlowThrough ? 0.5 : 1.0;\n selectedMaterial.edgeAlpha = selectedGlowThrough ? 0.5 : 1.0;\n break;\n\n case \"highlightGlowThrough\":\n const highlightGlowThrough = this._configs[name] = parseBool(value);\n const highlightMaterial = this.viewer.scene.highlightMaterial;\n highlightMaterial.glowThrough = highlightGlowThrough;\n highlightMaterial.fillAlpha = highlightGlowThrough ? 0.5 : 1.0;\n highlightMaterial.edgeAlpha = highlightGlowThrough ? 0.5 : 1.0;\n break;\n\n case \"externalMetadata\":\n this._configs[name] = parseBool(value);\n break;\n\n case \"showSpaces\":\n this._configs[name] = parseBool(value);\n this._showSpacesMode.setActive(value);\n break;\n\n case \"dtxEnabled\":\n this._configs[name] = parseBool(value);\n this.viewer.scene.dtxEnabled = value;\n break;\n\n case \"objectColors\":\n this._configs[name] = value;\n this._modelsExplorer.setObjectColors(value);\n break;\n\n default:\n this.warn(\"setConfig() - unsupported configuration: '\" + name + \"'\");\n }\n\n } catch (e) {\n this.error(\"setConfig() - failed to configure '\" + name + \"': \" + e);\n }\n }\n\n /**\n * Gets the value of a viewer configuration.\n *\n * These are set with {@link BIMViewer#setConfig} and {@link BIMViewer#setConfigs}.\n *\n * @param {String} name Configuration name.\n * @ereturns {*} Configuration value.\n */\n getConfig(name) {\n return this._configs[name];\n }\n\n //------------------------------------------------------------------------------------------------------------------\n // Content querying methods\n //------------------------------------------------------------------------------------------------------------------\n\n /**\n * Gets information on all available projects.\n * Gets information on all available projects.\n *\n * See [Getting Info on Available Projects](https://xeokit.github.io/xeokit-bim-viewer/docs/#getting-info-on-available-projects) for usage.\n *\n * @param {Function} done Callback invoked on success, into which the projects information JSON is passed.\n * @param {Function} error Callback invoked on failure, into which the error message string is passed.\n */\n getProjectsInfo(done, error) {\n if (!done) {\n this.error(\"getProjectsInfo() - Argument expected: 'done'\");\n return;\n }\n this.server.getProjects(done, (errorMsg) => {\n this.error(\"getProjectsInfo() - \" + errorMsg);\n if (error) {\n error(errorMsg);\n }\n });\n }\n\n /**\n * Gets information on the given project.\n *\n * See [Getting Info on a Project](https://xeokit.github.io/xeokit-bim-viewer/docs/#getting-info-on-a-project) for usage.\n *\n * @param {String} projectId ID of the project to get information on. Must be the ID of one of the projects in the information obtained by {@link BIMViewer#getProjects}.\n * @param {Function} done Callback invoked on success, into which the project information JSON is passed.\n * @param {Function} error Callback invoked on failure, into which the error message string is passed.\n */\n getProjectInfo(projectId, done, error) {\n if (!projectId) {\n this.error(\"getProjectInfo() - Argument expected: projectId\");\n return;\n }\n if (!done) {\n this.error(\"getProjectInfo() - Argument expected: 'done'\");\n return;\n }\n this.server.getProject(projectId,\n done, (errorMsg) => {\n this.error(\"getProjectInfo() - \" + errorMsg);\n if (error) {\n error(errorMsg);\n }\n });\n }\n\n /**\n * Gets information on the given object, belonging to the given model, within the given project.\n *\n * See [Getting Info on an Object](https://xeokit.github.io/xeokit-bim-viewer/docs/#getting-info-on-an-object) for usage.\n *\n * @param {String} projectId ID of the project to get information on. Must be the ID of one of the projects in the information obtained by {@link BIMViewer#getProjects}.\n * @param {String} modelId ID of a model within the project. Must be the ID of one of the models in the information obtained by {@link BIMViewer#getProjectInfo}.\n * @param {String} objectId ID of an object in the model.\n * @param {Function} done Callback invoked on success, into which the object information JSON is passed.\n * @param {Function} error Callback invoked on failure, into which the error message string is passed.\n */\n getObjectInfo(projectId, modelId, objectId, done, error) {\n if (!projectId) {\n this.error(\"getObjectInfo() - Argument expected: projectId\");\n return;\n }\n if (!modelId) {\n this.error(\"getObjectInfo() - Argument expected: modelId\");\n return;\n }\n if (!objectId) {\n this.error(\"getObjectInfo() - Argument expected: objectId\");\n return;\n }\n if (!done) {\n this.error(\"getProjectInfo() - Argument expected: 'done'\");\n return;\n }\n this.server.getObjectInfo(projectId, modelId, objectId,\n done,\n (errorMsg) => {\n if (error) {\n error(errorMsg);\n }\n });\n }\n\n //------------------------------------------------------------------------------------------------------------------\n // Content loading methods\n //------------------------------------------------------------------------------------------------------------------\n\n /**\n * Loads a project into the viewer.\n *\n * Unloads any currently loaded project and its models first. If the given project is already loaded, will unload that project first.\n *\n * @param {String} projectId ID of the project to load. Must be the ID of one of the projects in the information obtained by {@link BIMViewer#getProjects}.\n * @param {Function} done Callback invoked on success.\n * @param {Function} error Callback invoked on failure, into which the error message string is passed.\n */\n loadProject(projectId, done, error) {\n if (!projectId) {\n this.error(\"loadProject() - Argument expected: objectId\");\n return;\n }\n this._modelsExplorer.loadProject(projectId,\n () => {\n if (done) {\n done();\n }\n }, (errorMsg) => {\n this.error(\"loadProject() - \" + errorMsg);\n if (error) {\n error(errorMsg);\n }\n });\n }\n\n /**\n * Unloads whatever project is currently loaded.\n */\n unloadProject() {\n this._modelsExplorer.unloadProject();\n this.openTab(\"models\");\n this.setControlsEnabled(false); // For quick UI feedback\n }\n\n /**\n * Returns the ID of the currently loaded project, if any.\n *\n * @returns {String} The ID of the currently loaded project, otherwise ````null```` if no project is currently loaded.\n */\n getLoadedProjectId() {\n return this._modelsExplorer.getLoadedProjectId();\n }\n\n /**\n * Returns the IDs of the models in the currently loaded project.\n *\n * @returns {String[]} The IDs of the models in the currently loaded project.\n */\n getModelIds() {\n return this._modelsExplorer.getModelIds();\n }\n\n /**\n * Loads a model into the viewer.\n *\n * Assumes that the project containing the model is currently loaded.\n *\n * @param {String} modelId ID of the model to load. Must be the ID of one of the models in the currently loaded project.\n * @param {Function} done Callback invoked on success.\n * @param {Function} error Callback invoked on failure, into which the error message string is passed.\n */\n loadModel(modelId, done, error) {\n if (!modelId) {\n this.error(\"loadModel() - Argument expected: modelId\");\n return;\n }\n this._modelsExplorer.loadModel(modelId,\n () => {\n if (done) {\n done();\n }\n }, (errorMsg) => {\n this.error(\"loadModel() - \" + errorMsg);\n if (error) {\n error(errorMsg);\n }\n });\n }\n\n /**\n * Load all models in the currently loaded project.\n *\n * Doesn't reload any models that are currently loaded.\n *\n * @param {Function} done Callback invoked on successful loading of the models.\n */\n loadAllModels(done = function () {\n }) {\n const modelIds = this._modelsExplorer.getModelIds();\n const loadNextModel = (i, done2) => {\n if (i >= modelIds.length) {\n done2();\n } else {\n const modelId = modelIds[i];\n if (!this._modelsExplorer.isModelLoaded(modelId)) {\n this._modelsExplorer.loadModel(modelId, () => {\n loadNextModel(i + 1, done2);\n }, (errorMsg) => {\n this.error(\"loadAllModels() - \" + errorMsg);\n loadNextModel(i + 1, done2);\n });\n } else {\n loadNextModel(i + 1, done2);\n }\n }\n };\n loadNextModel(0, done);\n }\n\n /**\n * Returns the IDs of the currently loaded models, if any.\n *\n * @returns {String[]} The IDs of the currently loaded models, otherwise an empty array if no models are currently loaded.\n */\n getLoadedModelIds() {\n return this._modelsExplorer._getLoadedModelIds();\n }\n\n /**\n * Gets if the given model is loaded.\n *\n * @param {String} modelId ID of the model to check. Must be the ID of one of the models in the currently loaded project.\n * @returns {Boolean} True if the given model is loaded.\n */\n isModelLoaded(modelId) {\n if (!modelId) {\n this.error(\"unloadModel() - Argument expected: modelId\");\n return;\n }\n return this._modelsExplorer.isModelLoaded(modelId);\n }\n\n /**\n * Unloads a model from the viewer.\n *\n * Does nothing if the model is not currently loaded.\n *\n * @param {String} modelId ID of the model to unload.\n */\n unloadModel(modelId) {\n if (!modelId) {\n this.error(\"unloadModel() - Argument expected: modelId\");\n return;\n }\n this._modelsExplorer.unloadModel(modelId);\n }\n\n /**\n * Unloads all currently loaded models.\n */\n unloadAllModels() {\n this._modelsExplorer.unloadAllModels();\n }\n\n /**\n * Edits a model.\n *\n * Assumes that the project containing the model is currently loaded.\n *\n * @param {String} modelId ID of the model to edit. Must be the ID of one of the models in the currently loaded project.\n */\n editModel(modelId) {\n this.fire(\"editModel\", {\n modelId: modelId\n });\n }\n\n /**\n * Deletes a model.\n *\n * Assumes that the project containing the model is currently loaded.\n *\n * @param {String} modelId ID of the model to delete. Must be the ID of one of the models in the currently loaded project.\n */\n deleteModel(modelId) {\n this.fire(\"deleteModel\", {\n modelId: modelId\n });\n }\n\n /**\n * Adds a model.\n *\n */\n addModel() {\n this.fire(\"addModel\", {});\n }\n\n /**\n * Sets the viewer's background color.\n *\n * @param {Number[]} rgbColor Three-element array of RGB values, each in range ````[0..1]````.\n */\n setBackgroundColor(rgbColor) {\n this.viewer.scene.canvas.backgroundColor = rgbColor;\n }\n\n /**\n * Sets where the colors for model objects will be loaded from.\n *\n * Options are:\n *\n * * \"model\" - (default) load colors from models, and\n * * \"viewer\" - load colors from the viewer's inbuilt table of colors for IFC types.\n *\n * This is \"model\" by default.\n *\n * @deprecated\n * @param {String} source Where colors will be loaded from - \"model\" or \"viewer\".\n */\n setObjectColorSource(source) {\n console.log(\"BIMViewer.setObjectColorSource() is now deprecated and no longer functional. By default, \" +\n \"BIMViewer.getObjectColorSource() will now always return the (formerly) default value of `model`.\");\n }\n\n /**\n * Gets where the colors for model objects will be loaded from.\n *\n * This is \"model\" by default.\n *\n * @deprecated\n * @return {String} Where colors will be loaded from - \"model\" to get colors from the model, or \"viewer\" to get them from the viewer's built-in table of colors for IFC types.\n */\n getObjectColorSource() {\n return \"model\";\n }\n\n /**\n * Updates viewer UI state according to the properties in the given object.\n *\n * Note that, since some updates could be animated (e.g. flying the camera to fit objects to view) this\n * method optionally takes a callback, which it invokes after updating the UI.\n *\n * Also, this method is not to be confused with {@link BIMViewer#setConfigs}, which is used to batch-update various configurations and user preferences on the viewer.\n *\n * See [Viewer States](https://xeokit.github.io/xeokit-bim-viewer/docs/#viewer_states) for the list of states that may be batch-updated with this method.\n *\n * @param {Object} viewerState Specifies the viewer UI state updates.\n * @param {Function} done Callback invoked on successful update of the viewer states.\n */\n setViewerState(viewerState, done = () => {\n }) {\n if (viewerState.tabOpen) {\n this.openTab(viewerState.tabOpen);\n }\n if (viewerState.expandObjectsTree) {\n this._objectsExplorer.expandTreeViewToDepth(viewerState.expandObjectsTree);\n }\n if (viewerState.expandClassesTree) {\n this._classesExplorer.expandTreeViewToDepth(viewerState.expandClassesTree);\n }\n if (viewerState.expandStoreysTree) {\n this._storeysExplorer.expandTreeViewToDepth(viewerState.expandStoreysTree);\n }\n if (viewerState.setCamera) {\n this.setCamera(viewerState.setCamera);\n }\n this._parseSelectedStorey(viewerState, () => {\n this._parseThreeDMode(viewerState, () => {\n done();\n });\n });\n }\n\n _parseSelectedStorey(viewerState, done) {\n if (viewerState.selectedStorey) {\n this.selectStorey(viewerState.selectedStorey);\n done();\n } else {\n done();\n }\n }\n\n _parseThreeDMode(viewerState, done) {\n const activateThreeDMode = (viewerState.threeDActive !== false);\n this.set3DEnabled(activateThreeDMode, done);\n }\n\n /**\n * Highlights the given object in the tree views within the Objects, Classes and Storeys tabs.\n *\n * Also scrolls the object's node into view within each tree, then highlights it.\n *\n * De-highlights whatever node is currently highlighted in each of those trees.\n *\n * @param {String} objectId ID of the object\n */\n showObjectInExplorers(objectId) {\n if (!objectId) {\n this.error(\"showObjectInExplorers() - Argument expected: objectId\");\n return;\n }\n this._objectsExplorer.showNodeInTreeView(objectId);\n this._classesExplorer.showNodeInTreeView(objectId);\n this._storeysExplorer.showNodeInTreeView(objectId);\n this.fire(\"openExplorer\", {});\n }\n\n /**\n * De-highlights the object previously highlighted with {@link BIMViewer#showObjectInExplorers}.\n *\n * This only de-highlights the node. If the node is currently scrolled into view, then the node will remain in view.\n *\n * For each tab, does nothing if a node is currently highlighted.\n */\n unShowObjectInExplorers() {\n this._objectsExplorer.unShowNodeInTreeView();\n this._classesExplorer.unShowNodeInTreeView();\n this._storeysExplorer.unShowNodeInTreeView();\n }\n\n /**\n * Shows the properties of the given object in the Properties tab.\n *\n * @param {String} objectId ID of the object\n */\n showObjectProperties(objectId) {\n if (!objectId) {\n this.error(\"showObjectInExplorers() - Argument expected: objectId\");\n return;\n }\n if (this._enablePropertiesInspector) {\n this._propertiesInspector.showObjectPropertySets(objectId);\n }\n this.fire(\"openInspector\", {});\n }\n\n /**\n * Sets whether or not the given objects are visible.\n *\n * @param {String[]} objectIds IDs of objects.\n * @param {Boolean} visible True to set objects visible, false to set them invisible.\n */\n setObjectsVisible(objectIds, visible) {\n this._withObjectsInSubtree(objectIds, (entity) => {\n entity.visible = visible;\n });\n }\n\n /**\n * Sets the visibility of all objects.\n *\n * @param {Boolean} visible True to set objects visible, false to set them invisible.\n */\n setAllObjectsVisible(visible) {\n if (visible) {\n this.viewer.scene.setObjectsVisible(this.viewer.scene.objectIds, true);\n } else {\n this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds, false);\n }\n }\n\n /**\n * Sets whether or not the given objects are X-rayed.\n *\n * @param {String[]} objectIds IDs of objects.\n * @param {Boolean} xrayed Whether or not to X-ray the objects.\n */\n setObjectsXRayed(objectIds, xrayed) {\n this._withObjectsInSubtree(objectIds, (entity) => {\n entity.xrayed = xrayed;\n });\n }\n\n /**\n * Sets whether or not all objects are X-rayed.\n *\n * @param {Boolean} xrayed Whether or not to set all objects X-rayed.\n */\n setAllObjectsXRayed(xrayed) {\n if (xrayed) {\n this.viewer.scene.setObjectsXRayed(this.viewer.scene.objectIds, true);\n } else {\n this.viewer.scene.setObjectsXRayed(this.viewer.scene.xrayedObjectIds, false);\n }\n }\n\n /**\n * Sets whether or not the given objects are selected.\n *\n * @param {String[]} objectIds IDs of objects.\n * @param {Boolean} selected Whether or not to set the objects selected.\n */\n setObjectsSelected(objectIds, selected) {\n this._withObjectsInSubtree(objectIds, (entity) => {\n entity.selected = selected;\n });\n }\n\n /**\n * Sets whether or not all objects are selected.\n *\n * @param {Boolean} selected Whether or not to set all objects selected.\n */\n setAllObjectsSelected(selected) {\n if (selected) {\n this.viewer.scene.setObjectsSelected(this.viewer.scene.objectIds, true);\n } else {\n this.viewer.scene.setObjectsSelected(this.viewer.scene.selectedObjectIds, false);\n }\n }\n\n _withObjectsInSubtree(objectIds, callback) {\n if (!objectIds) {\n this.error(\"Argument expected: objectIds\");\n return;\n }\n for (let i = 0, len = objectIds.length; i < len; i++) {\n const objectId = objectIds[i];\n this.viewer.metaScene.withMetaObjectsInSubtree(objectId, (metaObject) => {\n const entity = this.viewer.scene.objects[metaObject.id];\n if (entity) {\n callback(entity);\n }\n });\n }\n }\n\n /**\n * Flies the camera to fit the given object in view.\n *\n * @param {String} objectId ID of the object\n * @param {Function} done Callback invoked on completion\n */\n flyToObject(objectId, done) {\n if (!objectId) {\n this.error(\"flyToObject() - Argument expected: objectId\");\n return;\n }\n const viewer = this.viewer;\n const scene = viewer.scene;\n const objectIds = [];\n this.viewer.metaScene.withMetaObjectsInSubtree(objectId, (metaObject) => {\n if (scene.objects[metaObject.id]) {\n objectIds.push(metaObject.id);\n }\n });\n if (objectIds.length === 0) {\n this.error(\"Object not found in viewer: '\" + objectId + \"'\");\n if (done) {\n done();\n }\n return;\n }\n scene.setObjectsVisible(objectIds, true);\n scene.setObjectsHighlighted(objectIds, true);\n const aabb = scene.getAABB(objectIds);\n viewer.cameraFlight.flyTo({\n aabb: aabb\n }, () => {\n if (done) {\n done();\n }\n setTimeout(function () {\n scene.setObjectsHighlighted(scene.highlightedObjectIds, false);\n }, 500);\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb);\n }\n\n /**\n * Flies the camera to fit the given objects in view.\n *\n * @param {String[]} objectIds IDs of the objects\n * @param {Function} done Callback invoked on completion\n */\n viewFitObjects(objectIds, done) {\n if (!objectIds) {\n this.error(\"flyToObject() - Argument expected: objectIds\");\n return;\n }\n const viewer = this.viewer;\n const scene = viewer.scene;\n\n const entityIds = [];\n\n for (var i = 0, len = objectIds.length; i < len; i++) {\n const objectId = objectIds[i];\n this.viewer.metaScene.withMetaObjectsInSubtree(objectId, (metaObject) => {\n if (scene.objects[metaObject.id]) {\n entityIds.push(metaObject.id);\n }\n });\n }\n if (entityIds.length === 0) {\n if (done) {\n done();\n }\n return;\n }\n scene.setObjectsVisible(entityIds, true);\n scene.setObjectsHighlighted(entityIds, true);\n const aabb = scene.getAABB(entityIds);\n viewer.cameraFlight.flyTo({\n aabb: aabb\n }, () => {\n if (done) {\n done();\n }\n setTimeout(function () {\n scene.setObjectsHighlighted(scene.highlightedObjectIds, false);\n }, 500);\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb);\n }\n\n /**\n * Flies the camera to fit all objects in view.\n *\n * @param {Function} done Callback invoked on completion\n */\n viewFitAll(done) {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const aabb = scene.getAABB();\n viewer.cameraFlight.flyTo({\n aabb: aabb\n }, () => {\n if (done) {\n done();\n }\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb);\n }\n\n /**\n * Jumps the camera to fit the given object in view.\n *\n * @param {String} objectId ID of the object\n */\n jumpToObject(objectId) {\n if (!objectId) {\n this.error(\"jumpToObject() - Argument expected: objectId\");\n return;\n }\n const viewer = this.viewer;\n const scene = viewer.scene;\n const objectIds = [];\n this.viewer.metaScene.withMetaObjectsInSubtree(objectId, (metaObject) => {\n if (scene.objects[metaObject.id]) {\n objectIds.push(metaObject.id);\n }\n });\n if (objectIds.length === 0) {\n this.error(\"Object not found in viewer: '\" + objectId + \"'\");\n return;\n }\n scene.setObjectsVisible(objectIds, true);\n const aabb = scene.getAABB(objectIds);\n viewer.cameraFlight.jumpTo({\n aabb: aabb\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb);\n }\n\n /**\n * Sets the camera to the given position.\n *\n * @param {Number[]} [params.eye] Eye position.\n * @param {Number[]} [params.look] Point of interest.\n * @param {Number[]} [params.up] Direction of \"up\".\n */\n setCamera(params) {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const camera = scene.camera;\n if (params.eye) {\n camera.eye = params.eye;\n }\n if (params.look) {\n camera.look = params.look;\n }\n if (params.up) {\n camera.up = params.up;\n }\n }\n\n /**\n * Fits the given models in view.\n *\n * @param {String[]} modelIds ID of the models.\n * @param {Function} [done] Callback invoked on completion. Will be animated if this is given, otherwise will be instantaneous.\n */\n viewFitModels(modelIds, done) {\n if (!modelIds) {\n this.error(\"viewFitModels() - Argument expected: modelIds\");\n return;\n }\n const viewer = this.viewer;\n const scene = viewer.scene;\n const aabb = math.AABB3();\n math.collapseAABB3(aabb);\n for (var i = 0, len = modelIds.length; i < len; i++) {\n const modelId = modelIds[i];\n const model = scene.models[modelId];\n if (!model) {\n this.error(\"Model not found in viewer: '\" + modelId + \"'\");\n continue;\n }\n model.visible = true;\n model.highlighted = true;\n math.expandAABB3(aabb, model.aabb);\n }\n if (done) {\n viewer.cameraFlight.flyTo({\n aabb: aabb\n }, () => {\n done();\n setTimeout(function () {\n scene.setObjectsHighlighted(scene.highlightedObjectIds, false);\n }, 500);\n });\n } else {\n viewer.cameraFlight.jumpTo({\n aabb: aabb\n });\n setTimeout(function () {\n scene.setObjectsHighlighted(scene.highlightedObjectIds, false);\n }, 500);\n }\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb);\n }\n\n /**\n * Opens the specified viewer tab.\n *\n * The available tabs are:\n *\n * * \"models\" - the Models tab, which lists the models available within the currently loaded project,\n * * \"objects\" - the Objects tab, which contains a tree view for each loaded model, organized to indicate the containment hierarchy of their objects,\n * * \"classes\" - the Classes tab, which contains a tree view for each loaded model, with nodes grouped by IFC types of their objects,\n * * \"storeys\" - the Storeys tab, which contains a tree view for each loaded model, with nodes grouped within ````IfcBuildingStoreys````, sub-grouped by their IFC types, and\n * * \"properties\" - the Properties tab, which shows property sets for a given object.\n *\n * @param {String} tabId ID of the tab to open - see method description.\n */\n openTab(tabId) {\n if (!tabId) {\n this.error(\"openTab() - Argument expected: tabId\");\n return;\n }\n let tabSelector;\n switch (tabId) {\n case \"models\":\n tabSelector = \"xeokit-modelsTab\";\n break;\n case \"objects\":\n tabSelector = \"xeokit-objectsTab\";\n break;\n case \"classes\":\n tabSelector = \"xeokit-classesTab\";\n break;\n case \"storeys\":\n tabSelector = \"xeokit-storeysTab\";\n break;\n case \"properties\":\n tabSelector = \"xeokit-propertiesTab\";\n break;\n default:\n this.error(\"openTab() - tab not recognized: '\" + tabId + \"'\");\n return;\n }\n this._openTab(this._explorerElement, tabSelector);\n // this._openTab(this._inspectorElement, tabSelector);\n }\n\n _openTab(element, tabSelector) {\n const tabClass = 'xeokit-tab';\n const activeClass = 'active';\n let tabs = element.querySelectorAll(\".\" + tabClass);\n let tab = element.querySelector(\".\" + tabSelector);\n for (let i = 0; i < tabs.length; i++) {\n let tabElement = tabs[i];\n if (tabElement.isEqualNode(tab)) {\n tabElement.classList.add(activeClass)\n } else {\n tabElement.classList.remove(activeClass)\n }\n }\n }\n\n /**\n * Returns the ID of the currently open viewer tab.\n *\n * The available tabs are:\n *\n * * \"models\" - the Models tab, which lists the models available within the currently loaded project,\n * * \"objects\" - the Objects tab, which contains a tree view for each loaded model, organized to indicate the containment hierarchy of their objects,\n * * \"classes\" - the Classes tab, which contains a tree view for each loaded model, with nodes grouped by IFC types of their objects,\n * * \"storeys\" - the Storeys tab, which contains a tree view for each loaded model, with nodes grouped within ````IfcBuildingStoreys````, sub-grouped by their IFC types,\n * * \"properties\" - the Properties tab, which shows property sets for a given object, and\n * * \"none\" - no tab is open; this is unlikely, since one of the above tabs should be open at a any time, but here for robustness.\n */\n getOpenTab() {\n function hasClass(element, className) {\n if (!element) {\n return false;\n }\n return (\" \" + element.className + \" \").indexOf(\" \" + className + \" \") > -1;\n }\n\n const activeClass = 'active';\n let modelsTab = this._explorerElement.querySelector(\".xeokit-modelsTab\");\n if (hasClass(modelsTab, activeClass)) {\n return \"models\";\n }\n let objectsTab = this._explorerElement.querySelector(\".xeokit-objectsTab\");\n if (hasClass(objectsTab, activeClass)) {\n return \"objects\";\n }\n let classesTab = this._explorerElement.querySelector(\".xeokit-classesTab\");\n if (hasClass(classesTab, activeClass)) {\n return \"classes\";\n }\n let storeysTab = this._explorerElement.querySelector(\".xeokit-storeysTab\");\n if (hasClass(storeysTab, activeClass)) {\n return \"storeys\";\n }\n let propertiesTab = this._inspectorElement.querySelector(\".xeokit-propertiesTab\");\n if (hasClass(propertiesTab, activeClass)) {\n return \"properties\";\n }\n return \"none\";\n }\n\n /**\n * Switches the viewer between 2D and 3D viewing modes.\n *\n * @param {Boolean} enabled Set true to switch into 3D mode, else false to switch into 2D mode.\n * @param {Function} done Callback to invoke when switch complete. Supplying this callback causes an animated transition. Otherwise, the transition will be instant.\n */\n set3DEnabled(enabled, done) {\n this._threeDMode.setActive(enabled, done);\n }\n\n /**\n * Gets whether the viewer is in 3D or 2D viewing mode.\n *\n * @returns {boolean} True when in 3D mode, else false.\n */\n get3DEnabled() {\n return this._threeDMode.getActive();\n }\n\n /**\n * Sets whether IFCSpace types are ever shown.\n *\n * @param {Boolean} shown Set true to allow IFCSpaces to be shown, else false to always keep them hidden.\n */\n setSpacesShown(shown) {\n this._showSpacesMode.setActive(shown);\n }\n\n /**\n * Gets whether the viewer allows IFCSpace types to be shown.\n *\n * @returns {boolean} True to allow IFCSpaces to be shown, else false to always keep them hidden.\n */\n getSpacesShown() {\n return this._showSpacesMode.getActive();\n }\n\n /**\n * Sets whether the viewer is in orthographic viewing mode.\n *\n * The viewer is either in orthographic mode or perspective mode. The viewer is in perspective mode by default.\n *\n * @param {Boolean} enabled Set true to switch into ortho mode, else false to switch into perspective mode.\n * @param {Function} done Callback to invoke when switch complete. Supplying this callback causes an animated transition. Otherwise, the transition will be instant.\n */\n setOrthoEnabled(enabled, done) {\n this._orthoMode.setActive(enabled, done);\n }\n\n /**\n * Gets whether the viewer is in orthographic viewing mode.\n *\n * The viewer is either in orthographic mode or perspective mode. The viewer is in perspective mode by default.\n *\n * @returns {boolean} True when in ortho mode, else false when in perspective mode.\n */\n getOrthoEnabled() {\n return this._orthoMode.getActive();\n }\n\n /**\n * Transitions the viewer into an isolated view of the given building storey.\n *\n * Does nothing and logs an error if no object of the given ID is in the viewer, or if the object is not an ````IfcBuildingStorey````.\n *\n * @param {String} storeyObjectId ID of an ````IfcBuildingStorey```` object.\n * @param {Function} [done] Optional callback to invoke on completion. When provided, the transition will be animated, with the camera flying into position. Otherwise, the transition will be instant, with the camera jumping into position.\n */\n selectStorey(storeyObjectId, done) {\n const metaScene = this.viewer.metaScene;\n const storeyMetaObject = metaScene.metaObjects[storeyObjectId];\n if (!storeyMetaObject) {\n this.error(\"selectStorey() - Object is not found: '\" + storeyObjectId + \"'\");\n return;\n }\n if (storeyMetaObject.type !== \"IfcBuildingStorey\") {\n this.error(\"selectStorey() - Object is not an IfcBuildingStorey: '\" + storeyObjectId + \"'\");\n return;\n }\n this._storeysExplorer.selectStorey(storeyObjectId, done);\n }\n\n /**\n * Saves viewer state to a BCF viewpoint.\n *\n * This does not save information about the project and model(s) that are currently loaded. When loading the viewpoint,\n * the viewer will assume that the same project and models will be currently loaded (the BCF viewpoint specification\n * does not contain that information).\n *\n * Note that xeokit's {@link Camera#look} is the **point-of-interest**, whereas the BCF ````camera_direction```` is a\n * direction vector. Therefore, we save ````camera_direction```` as the vector from {@link Camera#eye} to {@link Camera#look}.\n *\n * @param {*} [options] Options for getting the viewpoint.\n * @param {Boolean} [options.spacesVisible=false] Indicates whether ````IfcSpace```` types should be forced visible in the viewpoint.\n * @param {Boolean} [options.openingsVisible=false] Indicates whether ````IfcOpening```` types should be forced visible in the viewpoint.\n * @param {Boolean} [options.spaceBoundariesVisible=false] Indicates whether the boundaries of ````IfcSpace```` types should be visible in the viewpoint.\n * @param {Boolean} [options.reverseClippingPlanes=false] When ````true````, clipping planes are reversed (https://github.com/buildingSMART/BCF-XML/issues/193)\n * @param {Boolean} [options.defaultInvisible=false] When ````true````, will save the default visibility of all objects\n * as ````false````. This means that when we load the viewpoint again, and there are additional models loaded that\n * were not saved in the viewpoint, those models will be hidden when we load the viewpoint, and that only the\n * objects in the viewpoint will be visible.\n * @returns {*} BCF JSON viewpoint object\n * @example\n *\n * const viewpoint = bimViewer.saveBCFViewpoint({\n * spacesVisible: false, // Default\n * spaceBoundariesVisible: false, // Default\n * openingsVisible: false // Default\n * });\n *\n * // viewpoint will resemble the following:\n *\n * {\n * perspective_camera: {\n * camera_view_point: {\n * x: 0.0,\n * y: 0.0,\n * z: 0.0\n * },\n * camera_direction: {\n * x: 1.0,\n * y: 1.0,\n * z: 2.0\n * },\n * camera_up_vector: {\n * x: 0.0,\n * y: 0.0,\n * z: 1.0\n * },\n * field_of_view: 90.0\n * },\n * lines: [],\n * clipping_planes: [{\n * location: {\n * x: 0.5,\n * y: 0.5,\n * z: 0.5\n * },\n * direction: {\n * x: 1.0,\n * y: 0.0,\n * z: 0.0\n * }\n * }],\n * bitmaps: [],\n * snapshot: {\n * snapshot_type: png,\n * snapshot_data: \"data:image/png;base64,......\"\n * },\n * components: {\n * visibility: {\n * default_visibility: false,\n * exceptions: [{\n * ifc_guid: 4$cshxZO9AJBebsni$z9Yk,\n * originating_system: xeokit.io,\n * authoring_tool_id: xeokit/v1.0\n * }]\n * },\n * selection: [{\n * ifc_guid: \"4$cshxZO9AJBebsni$z9Yk\",\n * }]\n * }\n * }\n */\n saveBCFViewpoint(options) {\n return this._bcfViewpointsPlugin.getViewpoint(options);\n }\n\n /**\n * Sets viewer state to the given BCF viewpoint.\n *\n * This assumes that the viewer currently contains the same project and model(s) that were loaded at the time that the\n * viewpoint was originally saved (the BCF viewpoint specification does not contain that information).\n *\n * Note that xeokit's {@link Camera#look} is the **point-of-interest**, whereas the BCF ````camera_direction```` is a\n * direction vector. Therefore, when loading a BCF viewpoint, we set {@link Camera#look} to the absolute position\n * obtained by offsetting the BCF ````camera_view_point```` along ````camera_direction````.\n *\n * When loading a viewpoint, we also have the option to find {@link Camera#look} as the closest point of intersection\n * (on the surface of any visible and pickable {@link Entity}) with a 3D ray fired from ````camera_view_point```` in\n * the direction of ````camera_direction````.\n *\n * @param {*} bcfViewpoint BCF JSON viewpoint object or \"reset\" / \"RESET\" to reset the viewer, which clears SectionPlanes,\n * shows default visible entities and restores camera to initial default position.\n * @param {*} [options] Options for setting the viewpoint.\n * @param {Boolean} [options.rayCast=true] When ````true```` (default), will attempt to set {@link Camera#look} to the closest\n * point of surface intersection with a ray fired from the BCF ````camera_view_point```` in the direction of ````camera_direction````.\n * @param {Boolean} [options.immediate=true] When ````true```` (default), immediately set camera position.\n * @param {Boolean} [options.duration] Flight duration in seconds. Overrides {@link CameraFlightAnimation#duration}.\n * @param {Boolean} [options.reset=true] When ````true```` (default), set {@link Entity#xrayed} and {@link Entity#highlighted} ````false```` on all scene objects.\n * @param {Boolean} [options.reverseClippingPlanes=false] When ````true````, clipping planes are reversed (https://github.com/buildingSMART/BCF-XML/issues/193)\n * @param {Boolean} [options.updateCompositeObjects=false] When ````true````, then when visibility and selection updates refer to composite objects (eg. an IfcBuildingStorey),\n * then this method will apply the updates to objects within those composites.\n */\n loadBCFViewpoint(bcfViewpoint, options) {\n if (!bcfViewpoint) {\n this.error(\"loadBCFViewpoint() - Argument expected: bcfViewpoint\");\n return;\n }\n this._orthoMode.setActive(this.viewer.camera.projection === \"ortho\");\n this._bcfViewpointsPlugin.setViewpoint(bcfViewpoint, options);\n }\n\n /**\n * Resets the view.\n *\n * This resets object appearances (visibility, selection, highlight and X-ray), sets camera to\n * default position, and removes section planes.\n */\n resetView() {\n this._resetAction.reset();\n }\n\n /**\n * Enables or disables the various buttons and controls throughout the viewer.\n *\n * This also makes various buttons appear disabled.\n *\n * @param {Boolean} enabled Whether or not to disable the controls.\n */\n setControlsEnabled(enabled) {\n\n // Explorer\n\n // Models tab is always enabled\n this._objectsExplorer.setEnabled(enabled);\n this._classesExplorer.setEnabled(enabled);\n this._storeysExplorer.setEnabled(enabled);\n\n // Toolbar\n\n this._resetAction.setEnabled(enabled);\n this._fitAction.setEnabled(enabled);\n this._threeDMode.setEnabled(enabled);\n this._orthoMode.setEnabled(enabled);\n this._firstPersonMode.setEnabled(enabled);\n this._queryTool.setEnabled(enabled);\n this._hideTool.setEnabled(enabled);\n this._selectionTool.setEnabled(enabled);\n this._marqueeSelectionTool.setEnabled(enabled);\n this._showSpacesMode.setEnabled(enabled);\n this._sectionTool.setEnabled(enabled);\n\n //\n if (this._enablePropertiesInspector) {\n this._propertiesInspector.setEnabled(enabled);\n }\n }\n\n /**\n * Sets whether or not keyboard camera control is enabled.\n *\n * This is useful when we don't want key events over the canvas to clash with other UI elements outside the canvas.\n *\n * Default value is ````true````.\n *\n * @param {Boolean} enabled Set ````true```` to enable keyboard input.\n */\n setKeyboardEnabled(enabled) {\n this.viewer.scene.input.keyboardEnabled = enabled;\n }\n\n /**\n * Gets whether keyboard camera control is enabled.\n *\n * This is useful when we don't want key events over the canvas to clash with other UI elements outside the canvas.\n *\n * Default value is ````true````.\n *\n * @returns {Boolean} Returns ````true```` if keyboard input is enabled.\n */\n getKeyboardEnabled() {\n return this.viewer.scene.input.keyboardEnabled;\n }\n\n /**\n * Clears sections.\n *\n * Sections are the slicing planes, that we use to section models in order to see interior structures.\n */\n clearSections() {\n this._sectionTool.clear();\n }\n\n /**\n * Disables all sections.\n */\n disableSections() {\n this._sectionTool.disableSections();\n }\n\n /**\n * Enables all sections.\n */\n enableSections() {\n this._sectionTool.enableSections();\n }\n\n /**\n * Inverts the direction of sections.\n */\n flipSections() {\n this._sectionTool.flipSections();\n }\n\n /**\n * Hides the section edition control, if currently shown.\n */\n hideSectionEditControl() {\n this._sectionTool.hideControl();\n }\n\n /**\n * Returns the number of sections that currently exist.\n *\n * sections are the sliceing planes, that we use to slice models in order to see interior structures.\n *\n * @returns {Number} The number of sections.\n */\n getNumSections() {\n return this._sectionTool.getNumSections();\n }\n\n /**\n * Destroys the viewer, freeing all resources.\n */\n destroy() {\n this.viewer.destroy();\n this._bcfViewpointsPlugin.destroy();\n this._canvasContextMenu.destroy();\n this._objectContextMenu.destroy();\n }\n}\n\nexport {BIMViewer};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/BIMViewer.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 49, "kind": "variable", "name": "hideEdgesMinDrawCount", "memberof": "src/BIMViewer.js", "static": true, "longname": "src/BIMViewer.js~hideEdgesMinDrawCount", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": null, "description": null, "lineNumber": 29, "undocument": true, "type": { "types": [ "number" ] }, "ignore": true }, { "__docId__": 50, "kind": "variable", "name": "scaleCanvasResolutionMinDrawCount", "memberof": "src/BIMViewer.js", "static": true, "longname": "src/BIMViewer.js~scaleCanvasResolutionMinDrawCount", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": null, "description": null, "lineNumber": 30, "undocument": true, "type": { "types": [ "number" ] }, "ignore": true }, { "__docId__": 51, "kind": "function", "name": "createExplorerTemplate", "memberof": "src/BIMViewer.js", "generator": false, "async": false, "static": true, "longname": "src/BIMViewer.js~createExplorerTemplate", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": null, "description": null, "lineNumber": 32, "undocument": true, "params": [ { "name": "cfg", "types": [ "*" ] } ], "return": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 52, "kind": "function", "name": "createToolbarTemplate", "memberof": "src/BIMViewer.js", "generator": false, "async": false, "static": true, "longname": "src/BIMViewer.js~createToolbarTemplate", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": null, "description": null, "lineNumber": 78, "undocument": true, "params": [], "return": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 53, "kind": "function", "name": "createInspectorTemplate", "memberof": "src/BIMViewer.js", "generator": false, "async": false, "static": true, "longname": "src/BIMViewer.js~createInspectorTemplate", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": null, "description": null, "lineNumber": 116, "undocument": true, "params": [], "return": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 54, "kind": "function", "name": "initTabs", "memberof": "src/BIMViewer.js", "generator": false, "async": false, "static": true, "longname": "src/BIMViewer.js~initTabs", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": null, "description": null, "lineNumber": 128, "undocument": true, "params": [ { "name": "containerElement", "types": [ "*" ] } ], "return": null, "ignore": true }, { "__docId__": 55, "kind": "class", "name": "BIMViewer", "memberof": "src/BIMViewer.js", "static": true, "longname": "src/BIMViewer.js~BIMViewer", "access": "public", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/BIMViewer.js", "importStyle": "{BIMViewer}", "description": "A BIM viewer based on the [xeokit SDK](http://xeokit.io).", "lineNumber": 174, "interface": false, "extends": [ "src/Controller.js~Controller" ] }, { "__docId__": 56, "kind": "constructor", "name": "constructor", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#constructor", "access": "public", "description": "Constructs a BIMViewer.", "lineNumber": 183, "params": [ { "nullable": null, "types": [ "Server" ], "spread": false, "optional": false, "name": "server", "description": "Data access strategy." }, { "nullable": null, "types": [ "*" ], "spread": false, "optional": false, "name": "cfg", "description": "Configuration." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "cfg.enableEditModels", "description": "Set ````true```` to show \"Add\", \"Edit\" and \"Delete\" options in the Models tab's context menu." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "name": "cfg.keyboardEventsElement", "description": "Optional reference to HTML element on which key events should be handled. Defaults to the HTML Document." } ] }, { "__docId__": 57, "kind": "member", "name": "_configs", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_configs", "access": "private", "description": null, "lineNumber": 234, "undocument": true, "ignore": true, "type": { "types": [ "{}" ] } }, { "__docId__": 58, "kind": "member", "name": "_enableAddModels", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_enableAddModels", "access": "private", "description": null, "lineNumber": 236, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 59, "kind": "member", "name": "_enablePropertiesInspector", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_enablePropertiesInspector", "access": "private", "description": null, "lineNumber": 237, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 60, "kind": "member", "name": "viewer", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#viewer", "access": "public", "description": "The xeokit [Viewer](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html) at the core of this BIMViewer.", "lineNumber": 244, "type": { "nullable": null, "types": [ "Viewer" ], "spread": false, "description": null } }, { "__docId__": 61, "kind": "member", "name": "_objectsKdTree3", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_objectsKdTree3", "access": "private", "description": null, "lineNumber": 246, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 62, "kind": "member", "name": "_explorerElement", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_explorerElement", "access": "private", "description": null, "lineNumber": 259, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 63, "kind": "member", "name": "_inspectorElement", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_inspectorElement", "access": "private", "description": null, "lineNumber": 260, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 64, "kind": "member", "name": "_modelsExplorer", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_modelsExplorer", "access": "private", "description": null, "lineNumber": 267, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 65, "kind": "member", "name": "_objectsExplorer", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_objectsExplorer", "access": "private", "description": null, "lineNumber": 276, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 66, "kind": "member", "name": "_classesExplorer", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_classesExplorer", "access": "private", "description": null, "lineNumber": 283, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 67, "kind": "member", "name": "_storeysExplorer", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_storeysExplorer", "access": "private", "description": null, "lineNumber": 290, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 68, "kind": "member", "name": "_propertiesInspector", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_propertiesInspector", "access": "private", "description": null, "lineNumber": 298, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 69, "kind": "member", "name": "_resetAction", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_resetAction", "access": "private", "description": null, "lineNumber": 304, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 70, "kind": "member", "name": "_fitAction", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_fitAction", "access": "private", "description": null, "lineNumber": 309, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 71, "kind": "member", "name": "setThreeDModeActive", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#setThreeDModeActive", "access": "public", "description": null, "lineNumber": 322, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 72, "kind": "member", "name": "setFirstPersonModeActive", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#setFirstPersonModeActive", "access": "public", "description": null, "lineNumber": 336, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 73, "kind": "member", "name": "_threeDMode", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_threeDMode", "access": "private", "description": null, "lineNumber": 343, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 74, "kind": "member", "name": "_orthoMode", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_orthoMode", "access": "private", "description": null, "lineNumber": 349, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 75, "kind": "member", "name": "_firstPersonMode", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_firstPersonMode", "access": "private", "description": null, "lineNumber": 354, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 76, "kind": "member", "name": "_hideTool", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_hideTool", "access": "private", "description": null, "lineNumber": 360, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 77, "kind": "member", "name": "_selectionTool", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_selectionTool", "access": "private", "description": null, "lineNumber": 365, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 78, "kind": "member", "name": "_marqueeSelectionTool", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_marqueeSelectionTool", "access": "private", "description": null, "lineNumber": 370, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 79, "kind": "member", "name": "_showSpacesMode", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_showSpacesMode", "access": "private", "description": null, "lineNumber": 376, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 80, "kind": "member", "name": "_queryTool", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_queryTool", "access": "private", "description": null, "lineNumber": 381, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 81, "kind": "member", "name": "_sectionTool", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_sectionTool", "access": "private", "description": null, "lineNumber": 385, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 82, "kind": "member", "name": "_navCubeMode", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_navCubeMode", "access": "private", "description": null, "lineNumber": 393, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 83, "kind": "member", "name": "_busyModal", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_busyModal", "access": "private", "description": null, "lineNumber": 398, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 84, "kind": "member", "name": "_bcfViewpointsPlugin", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_bcfViewpointsPlugin", "access": "private", "description": null, "lineNumber": 479, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 85, "kind": "member", "name": "_fastNavPlugin", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_fastNavPlugin", "access": "private", "description": null, "lineNumber": 481, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 86, "kind": "get", "name": "localeService", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#localeService", "access": "public", "description": "Returns the LocaleService that was configured on this Viewer.", "lineNumber": 506, "return": { "nullable": null, "types": [ "LocaleService" ], "spread": false, "description": "The LocaleService." }, "type": { "types": [ "*" ] } }, { "__docId__": 87, "kind": "method", "name": "_customizeViewer", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_customizeViewer", "access": "private", "description": null, "lineNumber": 510, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 88, "kind": "method", "name": "_initCanvasContextMenus", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_initCanvasContextMenus", "access": "private", "description": null, "lineNumber": 573, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 89, "kind": "member", "name": "_canvasContextMenu", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_canvasContextMenu", "access": "private", "description": null, "lineNumber": 575, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 90, "kind": "member", "name": "_objectContextMenu", "memberof": "src/BIMViewer.js~BIMViewer", "static": false, "longname": "src/BIMViewer.js~BIMViewer#_objectContextMenu", "access": "private", "description": null, "lineNumber": 578, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 91, "kind": "method", "name": "_initConfigs", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_initConfigs", "access": "private", "description": null, "lineNumber": 617, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 92, "kind": "method", "name": "setConfigs", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setConfigs", "access": "public", "description": "Sets a batch of viewer configurations.\n\nNote that this method is not to be confused with {@link BIMViewer#setViewerState}, which batch-updates various states of the viewer's UI and 3D view.\n\nSee [Viewer Configurations](https://xeokit.github.io/xeokit-bim-viewer/docs/#viewer-configurations) for the list of available configurations.", "lineNumber": 648, "params": [ { "nullable": null, "types": [ "*" ], "spread": false, "optional": false, "name": "viewerConfigs", "description": "Map of key-value configuration pairs." } ], "return": null }, { "__docId__": 93, "kind": "method", "name": "setConfig", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setConfig", "access": "public", "description": "Sets a viewer configuration.\n\nSee [Viewer Configurations](https://xeokit.github.io/xeokit-bim-viewer/docs/#viewer-configurations) for the list of available configurations.", "lineNumber": 665, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "name", "description": "Configuration name." }, { "nullable": null, "types": [ "*" ], "spread": false, "optional": false, "name": "value", "description": "Configuration value." } ], "return": null }, { "__docId__": 94, "kind": "method", "name": "getConfig", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getConfig", "access": "public", "description": "Gets the value of a viewer configuration.\n\nThese are set with {@link BIMViewer#setConfig} and {@link BIMViewer#setConfigs}.", "lineNumber": 806, "unknown": [ { "tagName": "@ereturns", "tagValue": "{*} Configuration value." } ], "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "name", "description": "Configuration name." } ], "return": { "types": [ "*" ] } }, { "__docId__": 95, "kind": "method", "name": "getProjectsInfo", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getProjectsInfo", "access": "public", "description": "Gets information on all available projects.\nGets information on all available projects.\n\nSee [Getting Info on Available Projects](https://xeokit.github.io/xeokit-bim-viewer/docs/#getting-info-on-available-projects) for usage.", "lineNumber": 823, "params": [ { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on success, into which the projects information JSON is passed." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback invoked on failure, into which the error message string is passed." } ], "return": null }, { "__docId__": 96, "kind": "method", "name": "getProjectInfo", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getProjectInfo", "access": "public", "description": "Gets information on the given project.\n\nSee [Getting Info on a Project](https://xeokit.github.io/xeokit-bim-viewer/docs/#getting-info-on-a-project) for usage.", "lineNumber": 845, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project to get information on. Must be the ID of one of the projects in the information obtained by {@link BIMViewer#getProjects}." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on success, into which the project information JSON is passed." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback invoked on failure, into which the error message string is passed." } ], "return": null }, { "__docId__": 97, "kind": "method", "name": "getObjectInfo", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getObjectInfo", "access": "public", "description": "Gets information on the given object, belonging to the given model, within the given project.\n\nSee [Getting Info on an Object](https://xeokit.github.io/xeokit-bim-viewer/docs/#getting-info-on-an-object) for usage.", "lineNumber": 874, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project to get information on. Must be the ID of one of the projects in the information obtained by {@link BIMViewer#getProjects}." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of a model within the project. Must be the ID of one of the models in the information obtained by {@link BIMViewer#getProjectInfo}." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "objectId", "description": "ID of an object in the model." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on success, into which the object information JSON is passed." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback invoked on failure, into which the error message string is passed." } ], "return": null }, { "__docId__": 98, "kind": "method", "name": "loadProject", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#loadProject", "access": "public", "description": "Loads a project into the viewer.\n\nUnloads any currently loaded project and its models first. If the given project is already loaded, will unload that project first.", "lineNumber": 913, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project to load. Must be the ID of one of the projects in the information obtained by {@link BIMViewer#getProjects}." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on success." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback invoked on failure, into which the error message string is passed." } ], "return": null }, { "__docId__": 99, "kind": "method", "name": "unloadProject", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#unloadProject", "access": "public", "description": "Unloads whatever project is currently loaded.", "lineNumber": 934, "params": [], "return": null }, { "__docId__": 100, "kind": "method", "name": "getLoadedProjectId", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getLoadedProjectId", "access": "public", "description": "Returns the ID of the currently loaded project, if any.", "lineNumber": 945, "unknown": [ { "tagName": "@returns", "tagValue": "{String} The ID of the currently loaded project, otherwise ````null```` if no project is currently loaded." } ], "return": { "nullable": null, "types": [ "String" ], "spread": false, "description": "The ID of the currently loaded project, otherwise ````null```` if no project is currently loaded." }, "params": [] }, { "__docId__": 101, "kind": "method", "name": "getModelIds", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getModelIds", "access": "public", "description": "Returns the IDs of the models in the currently loaded project.", "lineNumber": 954, "unknown": [ { "tagName": "@returns", "tagValue": "{String[]} The IDs of the models in the currently loaded project." } ], "return": { "nullable": null, "types": [ "String[]" ], "spread": false, "description": "The IDs of the models in the currently loaded project." }, "params": [] }, { "__docId__": 102, "kind": "method", "name": "loadModel", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#loadModel", "access": "public", "description": "Loads a model into the viewer.\n\nAssumes that the project containing the model is currently loaded.", "lineNumber": 967, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model to load. Must be the ID of one of the models in the currently loaded project." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on success." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback invoked on failure, into which the error message string is passed." } ], "return": null }, { "__docId__": 103, "kind": "method", "name": "loadAllModels", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#loadAllModels", "access": "public", "description": "Load all models in the currently loaded project.\n\nDoesn't reload any models that are currently loaded.", "lineNumber": 992, "params": [ { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on successful loading of the models." } ], "return": null }, { "__docId__": 104, "kind": "method", "name": "getLoadedModelIds", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getLoadedModelIds", "access": "public", "description": "Returns the IDs of the currently loaded models, if any.", "lineNumber": 1020, "unknown": [ { "tagName": "@returns", "tagValue": "{String[]} The IDs of the currently loaded models, otherwise an empty array if no models are currently loaded." } ], "return": { "nullable": null, "types": [ "String[]" ], "spread": false, "description": "The IDs of the currently loaded models, otherwise an empty array if no models are currently loaded." }, "params": [] }, { "__docId__": 105, "kind": "method", "name": "isModelLoaded", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#isModelLoaded", "access": "public", "description": "Gets if the given model is loaded.", "lineNumber": 1030, "unknown": [ { "tagName": "@returns", "tagValue": "{Boolean} True if the given model is loaded." } ], "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model to check. Must be the ID of one of the models in the currently loaded project." } ], "return": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": "True if the given model is loaded." } }, { "__docId__": 106, "kind": "method", "name": "unloadModel", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#unloadModel", "access": "public", "description": "Unloads a model from the viewer.\n\nDoes nothing if the model is not currently loaded.", "lineNumber": 1045, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model to unload." } ], "return": null }, { "__docId__": 107, "kind": "method", "name": "unloadAllModels", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#unloadAllModels", "access": "public", "description": "Unloads all currently loaded models.", "lineNumber": 1056, "params": [], "return": null }, { "__docId__": 108, "kind": "method", "name": "editModel", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#editModel", "access": "public", "description": "Edits a model.\n\nAssumes that the project containing the model is currently loaded.", "lineNumber": 1067, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model to edit. Must be the ID of one of the models in the currently loaded project." } ], "return": null }, { "__docId__": 109, "kind": "method", "name": "deleteModel", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#deleteModel", "access": "public", "description": "Deletes a model.\n\nAssumes that the project containing the model is currently loaded.", "lineNumber": 1080, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model to delete. Must be the ID of one of the models in the currently loaded project." } ], "return": null }, { "__docId__": 110, "kind": "method", "name": "addModel", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#addModel", "access": "public", "description": "Adds a model.", "lineNumber": 1090, "params": [], "return": null }, { "__docId__": 111, "kind": "method", "name": "setBackgroundColor", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setBackgroundColor", "access": "public", "description": "Sets the viewer's background color.", "lineNumber": 1099, "params": [ { "nullable": null, "types": [ "Number[]" ], "spread": false, "optional": false, "name": "rgbColor", "description": "Three-element array of RGB values, each in range ````[0..1]````." } ], "return": null }, { "__docId__": 112, "kind": "method", "name": "setObjectColorSource", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setObjectColorSource", "access": "public", "description": "Sets where the colors for model objects will be loaded from.\n\nOptions are:\n\n* \"model\" - (default) load colors from models, and\n* \"viewer\" - load colors from the viewer's inbuilt table of colors for IFC types.\n\nThis is \"model\" by default.", "lineNumber": 1116, "deprecated": true, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "source", "description": "Where colors will be loaded from - \"model\" or \"viewer\"." } ], "return": null }, { "__docId__": 113, "kind": "method", "name": "getObjectColorSource", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getObjectColorSource", "access": "public", "description": "Gets where the colors for model objects will be loaded from.\n\nThis is \"model\" by default.", "lineNumber": 1129, "deprecated": true, "return": { "nullable": null, "types": [ "String" ], "spread": false, "description": "Where colors will be loaded from - \"model\" to get colors from the model, or \"viewer\" to get them from the viewer's built-in table of colors for IFC types." }, "params": [] }, { "__docId__": 114, "kind": "method", "name": "setViewerState", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setViewerState", "access": "public", "description": "Updates viewer UI state according to the properties in the given object.\n\nNote that, since some updates could be animated (e.g. flying the camera to fit objects to view) this\nmethod optionally takes a callback, which it invokes after updating the UI.\n\nAlso, this method is not to be confused with {@link BIMViewer#setConfigs}, which is used to batch-update various configurations and user preferences on the viewer.\n\nSee [Viewer States](https://xeokit.github.io/xeokit-bim-viewer/docs/#viewer_states) for the list of states that may be batch-updated with this method.", "lineNumber": 1146, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "viewerState", "description": "Specifies the viewer UI state updates." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on successful update of the viewer states." } ], "return": null }, { "__docId__": 115, "kind": "method", "name": "_parseSelectedStorey", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_parseSelectedStorey", "access": "private", "description": null, "lineNumber": 1170, "undocument": true, "ignore": true, "params": [ { "name": "viewerState", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 116, "kind": "method", "name": "_parseThreeDMode", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_parseThreeDMode", "access": "private", "description": null, "lineNumber": 1179, "undocument": true, "ignore": true, "params": [ { "name": "viewerState", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 117, "kind": "method", "name": "showObjectInExplorers", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#showObjectInExplorers", "access": "public", "description": "Highlights the given object in the tree views within the Objects, Classes and Storeys tabs.\n\nAlso scrolls the object's node into view within each tree, then highlights it.\n\nDe-highlights whatever node is currently highlighted in each of those trees.", "lineNumber": 1193, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "objectId", "description": "ID of the object" } ], "return": null }, { "__docId__": 118, "kind": "method", "name": "unShowObjectInExplorers", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#unShowObjectInExplorers", "access": "public", "description": "De-highlights the object previously highlighted with {@link BIMViewer#showObjectInExplorers}.\n\nThis only de-highlights the node. If the node is currently scrolled into view, then the node will remain in view.\n\nFor each tab, does nothing if a node is currently highlighted.", "lineNumber": 1211, "params": [], "return": null }, { "__docId__": 119, "kind": "method", "name": "showObjectProperties", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#showObjectProperties", "access": "public", "description": "Shows the properties of the given object in the Properties tab.", "lineNumber": 1222, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "objectId", "description": "ID of the object" } ], "return": null }, { "__docId__": 120, "kind": "method", "name": "setObjectsVisible", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setObjectsVisible", "access": "public", "description": "Sets whether or not the given objects are visible.", "lineNumber": 1239, "params": [ { "nullable": null, "types": [ "String[]" ], "spread": false, "optional": false, "name": "objectIds", "description": "IDs of objects." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "visible", "description": "True to set objects visible, false to set them invisible." } ], "return": null }, { "__docId__": 121, "kind": "method", "name": "setAllObjectsVisible", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setAllObjectsVisible", "access": "public", "description": "Sets the visibility of all objects.", "lineNumber": 1250, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "visible", "description": "True to set objects visible, false to set them invisible." } ], "return": null }, { "__docId__": 122, "kind": "method", "name": "setObjectsXRayed", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setObjectsXRayed", "access": "public", "description": "Sets whether or not the given objects are X-rayed.", "lineNumber": 1264, "params": [ { "nullable": null, "types": [ "String[]" ], "spread": false, "optional": false, "name": "objectIds", "description": "IDs of objects." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "xrayed", "description": "Whether or not to X-ray the objects." } ], "return": null }, { "__docId__": 123, "kind": "method", "name": "setAllObjectsXRayed", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setAllObjectsXRayed", "access": "public", "description": "Sets whether or not all objects are X-rayed.", "lineNumber": 1275, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "xrayed", "description": "Whether or not to set all objects X-rayed." } ], "return": null }, { "__docId__": 124, "kind": "method", "name": "setObjectsSelected", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setObjectsSelected", "access": "public", "description": "Sets whether or not the given objects are selected.", "lineNumber": 1289, "params": [ { "nullable": null, "types": [ "String[]" ], "spread": false, "optional": false, "name": "objectIds", "description": "IDs of objects." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "selected", "description": "Whether or not to set the objects selected." } ], "return": null }, { "__docId__": 125, "kind": "method", "name": "setAllObjectsSelected", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setAllObjectsSelected", "access": "public", "description": "Sets whether or not all objects are selected.", "lineNumber": 1300, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "selected", "description": "Whether or not to set all objects selected." } ], "return": null }, { "__docId__": 126, "kind": "method", "name": "_withObjectsInSubtree", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_withObjectsInSubtree", "access": "private", "description": null, "lineNumber": 1308, "undocument": true, "ignore": true, "params": [ { "name": "objectIds", "types": [ "*" ] }, { "name": "callback", "types": [ "*" ] } ], "return": null }, { "__docId__": 127, "kind": "method", "name": "flyToObject", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#flyToObject", "access": "public", "description": "Flies the camera to fit the given object in view.", "lineNumber": 1330, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "objectId", "description": "ID of the object" }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on completion" } ], "return": null }, { "__docId__": 128, "kind": "method", "name": "viewFitObjects", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#viewFitObjects", "access": "public", "description": "Flies the camera to fit the given objects in view.", "lineNumber": 1372, "params": [ { "nullable": null, "types": [ "String[]" ], "spread": false, "optional": false, "name": "objectIds", "description": "IDs of the objects" }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on completion" } ], "return": null }, { "__docId__": 129, "kind": "method", "name": "viewFitAll", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#viewFitAll", "access": "public", "description": "Flies the camera to fit all objects in view.", "lineNumber": 1417, "params": [ { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback invoked on completion" } ], "return": null }, { "__docId__": 130, "kind": "method", "name": "jumpToObject", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#jumpToObject", "access": "public", "description": "Jumps the camera to fit the given object in view.", "lineNumber": 1436, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "objectId", "description": "ID of the object" } ], "return": null }, { "__docId__": 131, "kind": "method", "name": "setCamera", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setCamera", "access": "public", "description": "Sets the camera to the given position.", "lineNumber": 1468, "params": [ { "nullable": null, "types": [ "Number[]" ], "spread": false, "optional": true, "name": "params.eye", "description": "Eye position." }, { "nullable": null, "types": [ "Number[]" ], "spread": false, "optional": true, "name": "params.look", "description": "Point of interest." }, { "nullable": null, "types": [ "Number[]" ], "spread": false, "optional": true, "name": "params.up", "description": "Direction of \"up\"." } ], "return": null }, { "__docId__": 132, "kind": "method", "name": "viewFitModels", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#viewFitModels", "access": "public", "description": "Fits the given models in view.", "lineNumber": 1489, "params": [ { "nullable": null, "types": [ "String[]" ], "spread": false, "optional": false, "name": "modelIds", "description": "ID of the models." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": true, "name": "done", "description": "Callback invoked on completion. Will be animated if this is given, otherwise will be instantaneous." } ], "return": null }, { "__docId__": 133, "kind": "method", "name": "openTab", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#openTab", "access": "public", "description": "Opens the specified viewer tab.\n\nThe available tabs are:\n\n * \"models\" - the Models tab, which lists the models available within the currently loaded project,\n * \"objects\" - the Objects tab, which contains a tree view for each loaded model, organized to indicate the containment hierarchy of their objects,\n * \"classes\" - the Classes tab, which contains a tree view for each loaded model, with nodes grouped by IFC types of their objects,\n * \"storeys\" - the Storeys tab, which contains a tree view for each loaded model, with nodes grouped within ````IfcBuildingStoreys````, sub-grouped by their IFC types, and\n * \"properties\" - the Properties tab, which shows property sets for a given object.", "lineNumber": 1542, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "tabId", "description": "ID of the tab to open - see method description." } ], "return": null }, { "__docId__": 134, "kind": "method", "name": "_openTab", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#_openTab", "access": "private", "description": null, "lineNumber": 1572, "undocument": true, "ignore": true, "params": [ { "name": "element", "types": [ "*" ] }, { "name": "tabSelector", "types": [ "*" ] } ], "return": null }, { "__docId__": 135, "kind": "method", "name": "getOpenTab", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getOpenTab", "access": "public", "description": "Returns the ID of the currently open viewer tab.\n\nThe available tabs are:\n\n * \"models\" - the Models tab, which lists the models available within the currently loaded project,\n * \"objects\" - the Objects tab, which contains a tree view for each loaded model, organized to indicate the containment hierarchy of their objects,\n * \"classes\" - the Classes tab, which contains a tree view for each loaded model, with nodes grouped by IFC types of their objects,\n * \"storeys\" - the Storeys tab, which contains a tree view for each loaded model, with nodes grouped within ````IfcBuildingStoreys````, sub-grouped by their IFC types,\n * \"properties\" - the Properties tab, which shows property sets for a given object, and\n * \"none\" - no tab is open; this is unlikely, since one of the above tabs should be open at a any time, but here for robustness.", "lineNumber": 1599, "params": [], "return": { "types": [ "string" ] } }, { "__docId__": 136, "kind": "method", "name": "set3DEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#set3DEnabled", "access": "public", "description": "Switches the viewer between 2D and 3D viewing modes.", "lineNumber": 1637, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "enabled", "description": "Set true to switch into 3D mode, else false to switch into 2D mode." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback to invoke when switch complete. Supplying this callback causes an animated transition. Otherwise, the transition will be instant." } ], "return": null }, { "__docId__": 137, "kind": "method", "name": "get3DEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#get3DEnabled", "access": "public", "description": "Gets whether the viewer is in 3D or 2D viewing mode.", "lineNumber": 1646, "unknown": [ { "tagName": "@returns", "tagValue": "{boolean} True when in 3D mode, else false." } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "True when in 3D mode, else false." }, "params": [] }, { "__docId__": 138, "kind": "method", "name": "setSpacesShown", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setSpacesShown", "access": "public", "description": "Sets whether IFCSpace types are ever shown.", "lineNumber": 1655, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "shown", "description": "Set true to allow IFCSpaces to be shown, else false to always keep them hidden." } ], "return": null }, { "__docId__": 139, "kind": "method", "name": "getSpacesShown", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getSpacesShown", "access": "public", "description": "Gets whether the viewer allows IFCSpace types to be shown.", "lineNumber": 1664, "unknown": [ { "tagName": "@returns", "tagValue": "{boolean} True to allow IFCSpaces to be shown, else false to always keep them hidden." } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "True to allow IFCSpaces to be shown, else false to always keep them hidden." }, "params": [] }, { "__docId__": 140, "kind": "method", "name": "setOrthoEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setOrthoEnabled", "access": "public", "description": "Sets whether the viewer is in orthographic viewing mode.\n\nThe viewer is either in orthographic mode or perspective mode. The viewer is in perspective mode by default.", "lineNumber": 1676, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "enabled", "description": "Set true to switch into ortho mode, else false to switch into perspective mode." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback to invoke when switch complete. Supplying this callback causes an animated transition. Otherwise, the transition will be instant." } ], "return": null }, { "__docId__": 141, "kind": "method", "name": "getOrthoEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getOrthoEnabled", "access": "public", "description": "Gets whether the viewer is in orthographic viewing mode.\n\nThe viewer is either in orthographic mode or perspective mode. The viewer is in perspective mode by default.", "lineNumber": 1687, "unknown": [ { "tagName": "@returns", "tagValue": "{boolean} True when in ortho mode, else false when in perspective mode." } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "True when in ortho mode, else false when in perspective mode." }, "params": [] }, { "__docId__": 142, "kind": "method", "name": "selectStorey", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#selectStorey", "access": "public", "description": "Transitions the viewer into an isolated view of the given building storey.\n\nDoes nothing and logs an error if no object of the given ID is in the viewer, or if the object is not an ````IfcBuildingStorey````.", "lineNumber": 1699, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "storeyObjectId", "description": "ID of an ````IfcBuildingStorey```` object." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": true, "name": "done", "description": "Optional callback to invoke on completion. When provided, the transition will be animated, with the camera flying into position. Otherwise, the transition will be instant, with the camera jumping into position." } ], "return": null }, { "__docId__": 143, "kind": "method", "name": "saveBCFViewpoint", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#saveBCFViewpoint", "access": "public", "description": "Saves viewer state to a BCF viewpoint.\n\nThis does not save information about the project and model(s) that are currently loaded. When loading the viewpoint,\nthe viewer will assume that the same project and models will be currently loaded (the BCF viewpoint specification\ndoes not contain that information).\n\nNote that xeokit's {@link Camera#look} is the **point-of-interest**, whereas the BCF ````camera_direction```` is a\ndirection vector. Therefore, we save ````camera_direction```` as the vector from {@link Camera#eye} to {@link Camera#look}.", "examples": [ "\nconst viewpoint = bimViewer.saveBCFViewpoint({\n spacesVisible: false, // Default\n spaceBoundariesVisible: false, // Default\n openingsVisible: false // Default\n});\n\n// viewpoint will resemble the following:\n\n{\n perspective_camera: {\n camera_view_point: {\n x: 0.0,\n y: 0.0,\n z: 0.0\n },\n camera_direction: {\n x: 1.0,\n y: 1.0,\n z: 2.0\n },\n camera_up_vector: {\n x: 0.0,\n y: 0.0,\n z: 1.0\n },\n field_of_view: 90.0\n },\n lines: [],\n clipping_planes: [{\n location: {\n x: 0.5,\n y: 0.5,\n z: 0.5\n },\n direction: {\n x: 1.0,\n y: 0.0,\n z: 0.0\n }\n }],\n bitmaps: [],\n snapshot: {\n snapshot_type: png,\n snapshot_data: \"data:image/png;base64,......\"\n },\n components: {\n visibility: {\n default_visibility: false,\n exceptions: [{\n ifc_guid: 4$cshxZO9AJBebsni$z9Yk,\n originating_system: xeokit.io,\n authoring_tool_id: xeokit/v1.0\n }]\n },\n selection: [{\n ifc_guid: \"4$cshxZO9AJBebsni$z9Yk\",\n }]\n }\n}" ], "lineNumber": 1795, "unknown": [ { "tagName": "@returns", "tagValue": "{*} BCF JSON viewpoint object" } ], "params": [ { "nullable": null, "types": [ "*" ], "spread": false, "optional": true, "name": "options", "description": "Options for getting the viewpoint." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.spacesVisible", "description": "Indicates whether ````IfcSpace```` types should be forced visible in the viewpoint." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.openingsVisible", "description": "Indicates whether ````IfcOpening```` types should be forced visible in the viewpoint." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.spaceBoundariesVisible", "description": "Indicates whether the boundaries of ````IfcSpace```` types should be visible in the viewpoint." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.reverseClippingPlanes", "description": "When ````true````, clipping planes are reversed (https://github.com/buildingSMART/BCF-XML/issues/193)" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.defaultInvisible", "description": "When ````true````, will save the default visibility of all objects\nas ````false````. This means that when we load the viewpoint again, and there are additional models loaded that\nwere not saved in the viewpoint, those models will be hidden when we load the viewpoint, and that only the\nobjects in the viewpoint will be visible." } ], "return": { "nullable": null, "types": [ "*" ], "spread": false, "description": "BCF JSON viewpoint object" } }, { "__docId__": 144, "kind": "method", "name": "loadBCFViewpoint", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#loadBCFViewpoint", "access": "public", "description": "Sets viewer state to the given BCF viewpoint.\n\nThis assumes that the viewer currently contains the same project and model(s) that were loaded at the time that the\nviewpoint was originally saved (the BCF viewpoint specification does not contain that information).\n\nNote that xeokit's {@link Camera#look} is the **point-of-interest**, whereas the BCF ````camera_direction```` is a\ndirection vector. Therefore, when loading a BCF viewpoint, we set {@link Camera#look} to the absolute position\nobtained by offsetting the BCF ````camera_view_point```` along ````camera_direction````.\n\nWhen loading a viewpoint, we also have the option to find {@link Camera#look} as the closest point of intersection\n(on the surface of any visible and pickable {@link Entity}) with a 3D ray fired from ````camera_view_point```` in\nthe direction of ````camera_direction````.", "lineNumber": 1825, "params": [ { "nullable": null, "types": [ "*" ], "spread": false, "optional": false, "name": "bcfViewpoint", "description": "BCF JSON viewpoint object or \"reset\" / \"RESET\" to reset the viewer, which clears SectionPlanes,\nshows default visible entities and restores camera to initial default position." }, { "nullable": null, "types": [ "*" ], "spread": false, "optional": true, "name": "options", "description": "Options for setting the viewpoint." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "options.rayCast", "description": "When ````true```` (default), will attempt to set {@link Camera#look} to the closest\npoint of surface intersection with a ray fired from the BCF ````camera_view_point```` in the direction of ````camera_direction````." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "options.immediate", "description": "When ````true```` (default), immediately set camera position." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "name": "options.duration", "description": "Flight duration in seconds. Overrides {@link CameraFlightAnimation#duration}." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "options.reset", "description": "When ````true```` (default), set {@link Entity#xrayed} and {@link Entity#highlighted} ````false```` on all scene objects." }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.reverseClippingPlanes", "description": "When ````true````, clipping planes are reversed (https://github.com/buildingSMART/BCF-XML/issues/193)" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "options.updateCompositeObjects", "description": "When ````true````, then when visibility and selection updates refer to composite objects (eg. an IfcBuildingStorey),\nthen this method will apply the updates to objects within those composites." } ], "return": null }, { "__docId__": 145, "kind": "method", "name": "resetView", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#resetView", "access": "public", "description": "Resets the view.\n\nThis resets object appearances (visibility, selection, highlight and X-ray), sets camera to\ndefault position, and removes section planes.", "lineNumber": 1840, "params": [], "return": null }, { "__docId__": 146, "kind": "method", "name": "setControlsEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setControlsEnabled", "access": "public", "description": "Enables or disables the various buttons and controls throughout the viewer.\n\nThis also makes various buttons appear disabled.", "lineNumber": 1851, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "enabled", "description": "Whether or not to disable the controls." } ], "return": null }, { "__docId__": 147, "kind": "method", "name": "setKeyboardEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#setKeyboardEnabled", "access": "public", "description": "Sets whether or not keyboard camera control is enabled.\n\nThis is useful when we don't want key events over the canvas to clash with other UI elements outside the canvas.\n\nDefault value is ````true````.", "lineNumber": 1889, "params": [ { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "enabled", "description": "Set ````true```` to enable keyboard input." } ], "return": null }, { "__docId__": 148, "kind": "method", "name": "getKeyboardEnabled", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getKeyboardEnabled", "access": "public", "description": "Gets whether keyboard camera control is enabled.\n\nThis is useful when we don't want key events over the canvas to clash with other UI elements outside the canvas.\n\nDefault value is ````true````.", "lineNumber": 1902, "unknown": [ { "tagName": "@returns", "tagValue": "{Boolean} Returns ````true```` if keyboard input is enabled." } ], "return": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": "Returns ````true```` if keyboard input is enabled." }, "params": [] }, { "__docId__": 149, "kind": "method", "name": "clearSections", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#clearSections", "access": "public", "description": "Clears sections.\n\nSections are the slicing planes, that we use to section models in order to see interior structures.", "lineNumber": 1911, "params": [], "return": null }, { "__docId__": 150, "kind": "method", "name": "disableSections", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#disableSections", "access": "public", "description": "Disables all sections.", "lineNumber": 1918, "params": [], "return": null }, { "__docId__": 151, "kind": "method", "name": "enableSections", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#enableSections", "access": "public", "description": "Enables all sections.", "lineNumber": 1925, "params": [], "return": null }, { "__docId__": 152, "kind": "method", "name": "flipSections", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#flipSections", "access": "public", "description": "Inverts the direction of sections.", "lineNumber": 1932, "params": [], "return": null }, { "__docId__": 153, "kind": "method", "name": "hideSectionEditControl", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#hideSectionEditControl", "access": "public", "description": "Hides the section edition control, if currently shown.", "lineNumber": 1939, "params": [], "return": null }, { "__docId__": 154, "kind": "method", "name": "getNumSections", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#getNumSections", "access": "public", "description": "Returns the number of sections that currently exist.\n\nsections are the sliceing planes, that we use to slice models in order to see interior structures.", "lineNumber": 1950, "unknown": [ { "tagName": "@returns", "tagValue": "{Number} The number of sections." } ], "return": { "nullable": null, "types": [ "Number" ], "spread": false, "description": "The number of sections." }, "params": [] }, { "__docId__": 155, "kind": "method", "name": "destroy", "memberof": "src/BIMViewer.js~BIMViewer", "generator": false, "async": false, "static": false, "longname": "src/BIMViewer.js~BIMViewer#destroy", "access": "public", "description": "Destroys the viewer, freeing all resources.", "lineNumber": 1957, "params": [], "return": null }, { "__docId__": 156, "kind": "file", "name": "src/BusyModal.js", "content": "import {Controller} from \"./Controller.js\";\n\n/** @private */\nclass BusyModal extends Controller {\n\n constructor(parent, cfg = {}) {\n\n super(parent, cfg);\n\n const busyModalBackdropElement = cfg.busyModalBackdropElement || document.body;\n\n if (!busyModalBackdropElement) {\n throw \"Missing config: busyModalBackdropElement\";\n }\n\n this._modal = document.createElement(\"div\");\n this._modal.classList.add(\"xeokit-busy-modal\");\n this._modal.innerHTML = '
Default text
';\n\n busyModalBackdropElement.appendChild(this._modal);\n\n this._modalVisible = false;\n this._modal.style.display = 'hidden';\n }\n\n show(message) {\n this._modalVisible = true;\n this._modal.querySelector('.xeokit-busy-modal-message').innerText = message;\n this._modal.style.display = 'block';\n }\n\n hide() {\n this._modalVisible = false;\n this._modal.style.display = 'none';\n }\n\n destroy() {\n super.destroy();\n if (this._modal) {\n this._modal.parentNode.removeChild(this._modal);\n this._modal = null;\n }\n }\n}\n\nexport {BusyModal};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/BusyModal.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 157, "kind": "class", "name": "BusyModal", "memberof": "src/BusyModal.js", "static": true, "longname": "src/BusyModal.js~BusyModal", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/BusyModal.js", "importStyle": "{BusyModal}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 158, "kind": "constructor", "name": "constructor", "memberof": "src/BusyModal.js~BusyModal", "generator": false, "async": false, "static": false, "longname": "src/BusyModal.js~BusyModal#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 159, "kind": "member", "name": "_modal", "memberof": "src/BusyModal.js~BusyModal", "static": false, "longname": "src/BusyModal.js~BusyModal#_modal", "access": "private", "description": null, "lineNumber": 16, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 160, "kind": "member", "name": "_modalVisible", "memberof": "src/BusyModal.js~BusyModal", "static": false, "longname": "src/BusyModal.js~BusyModal#_modalVisible", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "boolean" ] } }, { "__docId__": 161, "kind": "method", "name": "show", "memberof": "src/BusyModal.js~BusyModal", "generator": false, "async": false, "static": false, "longname": "src/BusyModal.js~BusyModal#show", "access": "public", "description": null, "lineNumber": 26, "undocument": true, "params": [ { "name": "message", "types": [ "*" ] } ], "return": null }, { "__docId__": 163, "kind": "method", "name": "hide", "memberof": "src/BusyModal.js~BusyModal", "generator": false, "async": false, "static": false, "longname": "src/BusyModal.js~BusyModal#hide", "access": "public", "description": null, "lineNumber": 32, "undocument": true, "params": [], "return": null }, { "__docId__": 165, "kind": "method", "name": "destroy", "memberof": "src/BusyModal.js~BusyModal", "generator": false, "async": false, "static": false, "longname": "src/BusyModal.js~BusyModal#destroy", "access": "public", "description": null, "lineNumber": 37, "undocument": true, "params": [], "return": null }, { "__docId__": 167, "kind": "file", "name": "src/Controller.js", "content": "import {Map} from \"./Map.js\";\n\n/** @private */\nclass Controller {\n\n /**\n * @protected\n */\n constructor(parent, cfg, server, viewer) {\n\n this.bimViewer = (parent ? (parent.bimViewer || parent) : this);\n this.server = parent ? parent.server : server;\n this.viewer = parent ? parent.viewer : viewer;\n\n this._children = [];\n\n if (parent) {\n parent._children.push(this);\n }\n\n this._subIdMap = null; // Subscription subId pool\n this._subIdEvents = null; // Subscription subIds mapped to event names\n this._eventSubs = null; // Event names mapped to subscribers\n this._events = null; // Maps names to events\n this._eventCallDepth = 0; // Helps us catch stack overflows from recursive events\n\n this._enabled = null; // Used by #setEnabled() and #getEnabled()\n this._active = null; // Used by #setActive() and #getActive()\n }\n\n /**\n * Fires an event on this Controller.\n *\n * @protected\n *\n * @param {String} event The event type name\n * @param {Object} value The event parameters\n * @param {Boolean} [forget=false] When true, does not retain for subsequent subscribers\n */\n fire(event, value, forget) {\n if (!this._events) {\n this._events = {};\n }\n if (!this._eventSubs) {\n this._eventSubs = {};\n }\n if (forget !== true) {\n this._events[event] = value || true; // Save notification\n }\n const subs = this._eventSubs[event];\n let sub;\n if (subs) { // Notify subscriptions\n for (const subId in subs) {\n if (subs.hasOwnProperty(subId)) {\n sub = subs[subId];\n this._eventCallDepth++;\n if (this._eventCallDepth < 300) {\n sub.callback.call(sub.scope, value);\n } else {\n this.error(\"fire: potential stack overflow from recursive event '\" + event + \"' - dropping this event\");\n }\n this._eventCallDepth--;\n }\n }\n }\n }\n\n /**\n * Subscribes to an event on this Controller.\n *\n * The callback is be called with this component as scope.\n *\n * @param {String} event The event\n * @param {Function} callback Called fired on the event\n * @param {Object} [scope=this] Scope for the callback\n * @return {String} Handle to the subscription, which may be used to unsubscribe with {@link #off}.\n */\n on(event, callback, scope) {\n if (!this._events) {\n this._events = {};\n }\n if (!this._subIdMap) {\n this._subIdMap = new Map(); // Subscription subId pool\n }\n if (!this._subIdEvents) {\n this._subIdEvents = {};\n }\n if (!this._eventSubs) {\n this._eventSubs = {};\n }\n let subs = this._eventSubs[event];\n if (!subs) {\n subs = {};\n this._eventSubs[event] = subs;\n }\n const subId = this._subIdMap.addItem(); // Create unique subId\n subs[subId] = {\n callback: callback,\n scope: scope || this\n };\n this._subIdEvents[subId] = event;\n const value = this._events[event];\n if (value !== undefined) { // A publication exists, notify callback immediately\n callback.call(scope || this, value);\n }\n return subId;\n }\n\n /**\n * Cancels an event subscription that was previously made with {@link Controller#on} or {@link Controller#once}.\n *\n * @param {String} subId Subscription ID\n */\n off(subId) {\n if (subId === undefined || subId === null) {\n return;\n }\n if (!this._subIdEvents) {\n return;\n }\n const event = this._subIdEvents[subId];\n if (event) {\n delete this._subIdEvents[subId];\n const subs = this._eventSubs[event];\n if (subs) {\n delete subs[subId];\n }\n this._subIdMap.removeItem(subId); // Release subId\n }\n }\n\n /**\n * Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is handled.\n *\n * This is equivalent to calling {@link Controller#on}, and then calling {@link Controller#off} inside the callback function.\n *\n * @param {String} event Data event to listen to\n * @param {Function} callback Called when fresh data is available at the event\n * @param {Object} [scope=this] Scope for the callback\n */\n once(event, callback, scope) {\n const self = this;\n const subId = this.on(event,\n function (value) {\n self.off(subId);\n callback.call(scope || this, value);\n },\n scope);\n }\n\n /**\n * Logs a console debugging message for this Controller.\n *\n * The console message will have this format: *````[LOG] [ : ````*\n *\n * @protected\n *\n * @param {String} message The message to log\n */\n log(message) {\n message = \"[LOG] \" + message;\n window.console.log(message);\n }\n\n /**\n * Logs a warning for this Controller to the JavaScript console.\n *\n * The console message will have this format: *````[WARN] [ =: ````*\n *\n * @protected\n *\n * @param {String} message The message to log\n */\n warn(message) {\n message = \"[WARN] \" + message;\n window.console.warn(message);\n }\n\n /**\n * Logs an error for this Controller to the JavaScript console.\n *\n * The console message will have this format: *````[ERROR] [ =: ````*\n *\n * @protected\n *\n * @param {String} message The message to log\n */\n error(message) {\n message = \"[ERROR] \" + message;\n window.console.error(message);\n }\n\n _mutexActivation(controllers) {\n const numControllers = controllers.length;\n for (let i = 0; i < numControllers; i++) {\n const controller = controllers[i];\n controller.on(\"active\", (function () {\n const _i = i;\n return function (active) {\n if (!active) {\n return;\n }\n for (let j = 0; j < numControllers; j++) {\n if (j === _i) {\n continue;\n }\n controllers[j].setActive(false);\n }\n };\n })());\n }\n }\n\n /**\n * Enables or disables this Controller.\n *\n * Fires an \"enabled\" event on update.\n *\n * @protected\n * @param {boolean} enabled Whether or not to enable.\n */\n setEnabled(enabled) {\n if (this._enabled === enabled) {\n return;\n }\n this._enabled = enabled;\n this.fire(\"enabled\", this._enabled);\n }\n\n /**\n * Gets whether or not this Controller is enabled.\n *\n * @protected\n *\n * @returns {boolean}\n */\n getEnabled() {\n return this._enabled;\n }\n\n /**\n * Activates or deactivates this Controller.\n *\n * Fires an \"active\" event on update.\n *\n * @protected\n *\n * @param {boolean} active Whether or not to activate.\n */\n setActive(active) {\n if (this._active === active) {\n return;\n }\n this._active = active;\n this.fire(\"active\", this._active);\n }\n\n /**\n * Gets whether or not this Controller is active.\n *\n * @protected\n *\n * @returns {boolean}\n */\n getActive() {\n return this._active;\n }\n\n /**\n * Destroys this Controller.\n *\n * @protected\n *\n */\n destroy() {\n if (this.destroyed) {\n return;\n }\n /**\n * Fired when this Controller is destroyed.\n * @event destroyed\n */\n this.fire(\"destroyed\", this.destroyed = true);\n this._subIdMap = null;\n this._subIdEvents = null;\n this._eventSubs = null;\n this._events = null;\n this._eventCallDepth = 0;\n for (let i = 0, len = this._children.length; i < len; i++) {\n this._children[i].destroy();\n }\n this._children = [];\n }\n}\n\nexport {Controller};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/Controller.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 168, "kind": "class", "name": "Controller", "memberof": "src/Controller.js", "static": true, "longname": "src/Controller.js~Controller", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/Controller.js", "importStyle": "{Controller}", "description": null, "lineNumber": 4, "interface": false, "ignore": true }, { "__docId__": 169, "kind": "constructor", "name": "constructor", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#constructor", "access": "protected", "description": "", "lineNumber": 9, "ignore": true }, { "__docId__": 170, "kind": "member", "name": "bimViewer", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#bimViewer", "access": "public", "description": null, "lineNumber": 11, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 171, "kind": "member", "name": "server", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#server", "access": "public", "description": null, "lineNumber": 12, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 172, "kind": "member", "name": "viewer", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#viewer", "access": "public", "description": null, "lineNumber": 13, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 173, "kind": "member", "name": "_children", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_children", "access": "private", "description": null, "lineNumber": 15, "undocument": true, "ignore": true, "type": { "types": [ "*[]" ] } }, { "__docId__": 174, "kind": "member", "name": "_subIdMap", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_subIdMap", "access": "private", "description": null, "lineNumber": 21, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 175, "kind": "member", "name": "_subIdEvents", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_subIdEvents", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 176, "kind": "member", "name": "_eventSubs", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_eventSubs", "access": "private", "description": null, "lineNumber": 23, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 177, "kind": "member", "name": "_events", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_events", "access": "private", "description": null, "lineNumber": 24, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 178, "kind": "member", "name": "_eventCallDepth", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_eventCallDepth", "access": "private", "description": null, "lineNumber": 25, "undocument": true, "ignore": true, "type": { "types": [ "number" ] } }, { "__docId__": 179, "kind": "member", "name": "_enabled", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_enabled", "access": "private", "description": null, "lineNumber": 27, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 180, "kind": "member", "name": "_active", "memberof": "src/Controller.js~Controller", "static": false, "longname": "src/Controller.js~Controller#_active", "access": "private", "description": null, "lineNumber": 28, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 181, "kind": "method", "name": "fire", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#fire", "access": "protected", "description": "Fires an event on this Controller.", "lineNumber": 40, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "event", "description": "The event type name" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "value", "description": "The event parameters" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "forget", "description": "When true, does not retain for subsequent subscribers" } ], "ignore": true, "return": null }, { "__docId__": 184, "kind": "method", "name": "on", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#on", "access": "public", "description": "Subscribes to an event on this Controller.\n\nThe callback is be called with this component as scope.", "lineNumber": 78, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "event", "description": "The event" }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "callback", "description": "Called fired on the event" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": true, "defaultValue": "this", "defaultRaw": "this", "name": "scope", "description": "Scope for the callback" } ], "return": { "nullable": null, "types": [ "String" ], "spread": false, "description": "Handle to the subscription, which may be used to unsubscribe with {@link #off}." } }, { "__docId__": 189, "kind": "method", "name": "off", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#off", "access": "public", "description": "Cancels an event subscription that was previously made with {@link Controller#on} or {@link Controller#once}.", "lineNumber": 114, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "subId", "description": "Subscription ID" } ], "return": null }, { "__docId__": 190, "kind": "method", "name": "once", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#once", "access": "public", "description": "Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is handled.\n\nThis is equivalent to calling {@link Controller#on}, and then calling {@link Controller#off} inside the callback function.", "lineNumber": 141, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "event", "description": "Data event to listen to" }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "callback", "description": "Called when fresh data is available at the event" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": true, "defaultValue": "this", "defaultRaw": "this", "name": "scope", "description": "Scope for the callback" } ], "return": null }, { "__docId__": 191, "kind": "method", "name": "log", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#log", "access": "protected", "description": "Logs a console debugging message for this Controller.\n\nThe console message will have this format: *````[LOG] [ : ````*", "lineNumber": 160, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "message", "description": "The message to log" } ], "ignore": true, "return": null }, { "__docId__": 192, "kind": "method", "name": "warn", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#warn", "access": "protected", "description": "Logs a warning for this Controller to the JavaScript console.\n\nThe console message will have this format: *````[WARN] [ =: ````*", "lineNumber": 174, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "message", "description": "The message to log" } ], "ignore": true, "return": null }, { "__docId__": 193, "kind": "method", "name": "error", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#error", "access": "protected", "description": "Logs an error for this Controller to the JavaScript console.\n\nThe console message will have this format: *````[ERROR] [ =: ````*", "lineNumber": 188, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "message", "description": "The message to log" } ], "ignore": true, "return": null }, { "__docId__": 194, "kind": "method", "name": "_mutexActivation", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#_mutexActivation", "access": "private", "description": null, "lineNumber": 193, "undocument": true, "ignore": true, "params": [ { "name": "controllers", "types": [ "*" ] } ], "return": null }, { "__docId__": 195, "kind": "method", "name": "setEnabled", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#setEnabled", "access": "protected", "description": "Enables or disables this Controller.\n\nFires an \"enabled\" event on update.", "lineNumber": 222, "params": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": false, "name": "enabled", "description": "Whether or not to enable." } ], "ignore": true, "return": null }, { "__docId__": 197, "kind": "method", "name": "getEnabled", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#getEnabled", "access": "protected", "description": "Gets whether or not this Controller is enabled.", "lineNumber": 237, "unknown": [ { "tagName": "@returns", "tagValue": "{boolean}" } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "" }, "ignore": true, "params": [] }, { "__docId__": 198, "kind": "method", "name": "setActive", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#setActive", "access": "protected", "description": "Activates or deactivates this Controller.\n\nFires an \"active\" event on update.", "lineNumber": 250, "params": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": false, "name": "active", "description": "Whether or not to activate." } ], "ignore": true, "return": null }, { "__docId__": 200, "kind": "method", "name": "getActive", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#getActive", "access": "protected", "description": "Gets whether or not this Controller is active.", "lineNumber": 265, "unknown": [ { "tagName": "@returns", "tagValue": "{boolean}" } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "" }, "ignore": true, "params": [] }, { "__docId__": 201, "kind": "method", "name": "destroy", "memberof": "src/Controller.js~Controller", "generator": false, "async": false, "static": false, "longname": "src/Controller.js~Controller#destroy", "access": "protected", "description": "Destroys this Controller.", "lineNumber": 275, "ignore": true, "params": [], "return": null }, { "__docId__": 208, "kind": "file", "name": "src/IFCElementDescriptions/IFCElementDescriptions.js", "content": "/**\n * @private\n */\nconst IFCElementDescriptions = {\n \"IfcActionRequest\": \"A request is the act or instance of asking for something, such as a request for information, bid submission, or performance of work.\",\n \"IfcActor\": \"The IfcActor defines all actors or human agents involved in a project during its full life cycle. It facilitates the use of person and organization definitions in the resource part of the IFC object model. This includes name, address, telecommunication addresses, and roles.\",\n \"IfcActorRole\": \"This entity indicates a role which is performed by an actor, either a person, an organization or a person related to an organization.\",\n \"IfcActuator\": \"An actuator is a mechanical device for moving or controlling a mechanism or system. An actuator takes energy, usually created by air, electricity, or liquid, and converts that into some kind of motion.\",\n \"IfcActuatorType\": \"The distribution control element type IfcActuatorType defines commonly shared information for occurrences of actuators. The set of shared information may include:\",\n \"IfcAddress\": \"This abstract entity represents various kinds of postal and telecom addresses.\",\n \"IfcAdvancedBrep\": \"An advanced B-rep is a boundary representation model in which all faces, edges and vertices are explicitly represented. It is a solid with explicit topology and elementary or free-form geometry. The faces of the B-rep are of type IfcAdvancedFace. An advanced B-rep has to meet the same topological constraints as the manifold solid B-rep.\",\n \"IfcAdvancedBrepWithVoids\": \"The IfcAdvancedBrepWithVoids is a specialization of an advanced B-rep which contains one or more voids in its interior. The voids are represented as closed shells which are defined so that the shell normal point into the void.\",\n \"IfcAdvancedFace\": \"An advanced face is a specialization of a face surface that has to meet requirements on using particular topological and geometric representation items for the definition of the faces, edges and vertices.\",\n \"IfcAirTerminal\": \"An air terminal is a terminating or origination point for the transfer of air between distribution system(s) and one or more spaces. It can also be used for the transfer of air between adjacent spaces.\",\n \"IfcAirTerminalBox\": \"An air terminal box typically participates in an HVAC duct distribution system and is used to control or modulate the amount of air delivered to its downstream ductwork. An air terminal box type is often referred to as an \\\"air flow regulator\\\".\",\n \"IfcAirTerminalBoxType\": \"The flow controller type IfcAirTerminalBoxType defines commonly shared information for occurrences of air terminal boxes. The set of shared information may include:\",\n \"IfcAirTerminalType\": \"The flow terminal type IfcAirTerminalType defines commonly shared information for occurrences of air terminals. The set of shared information may include:\",\n \"IfcAirToAirHeatRecovery\": \"An air-to-air heat recovery device employs a counter-flow heat exchanger between inbound and outbound air flow. It is typically used to transfer heat from warmer air in one chamber to cooler air in the second chamber (i.e., typically used to recover heat from the conditioned air being exhausted and the outside air being supplied to a building), resulting in energy savings from reduced heating (or cooling) requirements.\",\n \"IfcAirToAirHeatRecoveryType\": \"The energy conversion device type IfcAirToAirHeatRecoveryType defines commonly shared information for occurrences of air to air heat recoverys. The set of shared information may include:\",\n \"IfcAlarm\": \"An alarm is a device that signals the existence of a condition or situation that is outside the boundaries of normal expectation or that activates such a device.\",\n \"IfcAlarmType\": \"The distribution control element type IfcAlarmType defines commonly shared information for occurrences of alarms. The set of shared information may include:\",\n \"IfcAnnotation\": \"An annotation is an information element within the geometric (and spatial) context of a project, that adds a note or meaning to the objects which constitutes the project model. Annotations include additional points, curves, text, dimensioning, hatching and other forms of graphical notes. It also includes virtual or symbolic representations of additional model components, not representing products or spatial structures, such as event elements, survey points, contour lines or similar.\",\n \"IfcAnnotationFillArea\": \"The IfcAnnotationFillArea defines an area by a definite OuterBoundary, that might include InnerBoundaries. The areas defined by the InnerBoundaries are excluded from applying the fill area style. The InnerBoundaries shall not intersect with the OuterBoundary nor being outside of the OuterBoundary.\",\n \"IfcApplication\": \"IfcApplication holds the information about an IFC compliant application developed by an application developer. The IfcApplication utilizes a short identifying name as provided by the application developer.\",\n \"IfcAppliedValue\": \"This entity captures a value driven by a formula, with additional qualifications including unit basis, valid date range, and categorization.\",\n \"IfcApproval\": \"An IfcApproval represents information about approval processes such as for a plan, a design, a proposal, or a change order in a construction or facilities management project. IfcApproval is referenced by IfcRelAssociatesApproval in IfcControlExtension schema, and thereby can be related to all subtypes of IfcRoot. An approval may also be given to resource objects using IfcResourceApprovalRelationship\",\n \"IfcApprovalRelationship\": \"An IfcApprovalRelationship associates approvals (one relating approval and one or more related approvals), each having different status or level as the approval process or the approved objects evolve.\",\n \"IfcArbitraryClosedProfileDef\": \"The closed profile IfcArbitraryClosedProfileDef defines an arbitrary two-dimensional profile for the use within the swept surface geometry, the swept area solid or a sectioned spine. It is given by an outer boundary from which the surface or solid can be constructed.\",\n \"IfcArbitraryOpenProfileDef\": \"The open profile IfcArbitraryOpenProfileDef defines an arbitrary two-dimensional open profile for the use within the swept surface geometry. It is given by an open boundary from which the surface can be constructed.\",\n \"IfcArbitraryProfileDefWithVoids\": \"The IfcArbitraryProfileDefWithVoids defines an arbitrary closed two-dimensional profile with holes. It is given by an outer boundary and inner boundaries. A common usage of IfcArbitraryProfileDefWithVoids is as the cross section for the creation of swept surfaces or swept solids.\",\n \"IfcAsset\": \"An asset is a uniquely identifiable grouping of elements acting as a single entity that has a financial value or that can be operated on as a single unit.\",\n \"IfcAsymmetricIShapeProfileDef\": \"IfcAsymmetricIShapeProfileDef defines a section profile that provides the defining parameters of a singly symmetric I-shaped section. Its parameters and orientation relative to the position coordinate system are according to the following illustration. The centre of the position coordinate system is in the profile's centre of the bounding box.\",\n \"IfcAudioVisualAppliance\": \"An audio-visual appliance is a device that displays, captures, transmits, or receives audio or video.\",\n \"IfcAudioVisualApplianceType\": \"The flow terminal type IfcAudioVisualApplianceType defines commonly shared information for occurrences of audio visual appliances. The set of shared information may include:\",\n \"IfcAxis1Placement\": \"The IfcAxis1Placement provides location and direction of a single axis.\",\n \"IfcAxis2Placement2D\": \"The IfcAxis2Placement2D provides location and orientation to place items in a two-dimensional space. The attribute RefDirection defines the x axis, the y axis is derived. If the attribute RefDirection is not given, the placement defaults to P[1] (x-axis) as [1.,0.] and P[2] (y-axis) as [0.,1.].\",\n \"IfcAxis2Placement3D\": \"The IfcAxis2Placement3D provides location and orientations to place items in a three-dimensional space. The attribute Axis defines the Z direction, RefDirection the X direction. The Y direction is derived.\",\n \"IfcBeam\": \"An IfcBeam is a horizontal, or nearly horizontal, structural member that is capable of withstanding load primarily by resisting bending. It represents such a member from an architectural point of view. It is not required to be load bearing.\",\n \"IfcBeamStandardCase\": \"The standard beam, IfcBeamStandardCase, defines a beam with certain constraints for the provision of material usage, parameters and with certain constraints for the geometric representation. The IfcBeamStandardCase handles all cases of beams, that:\",\n \"IfcBeamType\": \"The element type IfcBeamType defines commonly shared information for occurrences of beams. The set of shared information may include:\",\n \"IfcBlobTexture\": \"An IfcBlobTexture provides a 2-dimensional distribution of the lighting parameters of a surface onto which it is mapped. The texture itself is given as a single binary blob, representing the content of a pixel format file. The file format of the pixel file is given by the RasterFormat attribute and allowable formats are guided by where rule SupportedRasterFormat.\",\n \"IfcBlock\": \"The IfcBlock is a Construction Solid Geometry (CSG) 3D primitive. It is defined by a position and a positve distance along the three orthogonal axes. The inherited Position attribute has the IfcAxisPlacement3D type and provides:\",\n \"IfcBoiler\": \"A boiler is a closed, pressure-rated vessel in which water or other fluid is heated using an energy source such as natural gas, heating oil, or electricity. The fluid in the vessel is then circulated out of the boiler for use in various processes or heating applications.\",\n \"IfcBoilerType\": \"The energy conversion device type IfcBoilerType defines commonly shared information for occurrences of boilers. The set of shared information may include:\",\n \"IfcBooleanClippingResult\": \"A clipping result is defined as a special subtype of the general IfcBooleanResult. It constrains the operands and the operator of the Boolean result.\",\n \"IfcBooleanResult\": \"The IfcBooleanResult is the result of applying a Boolean operation to two operands being solids.\",\n \"IfcBoundaryCondition\": \"The abstract entity IfcBoundaryCondition is the supertype of all boundary conditions that can be applied to structural connection definitions, either directly for the connection (e.g. the joint) or for the relation between a structural member and the connection.\",\n \"IfcBoundaryCurve\": \"An IfcBoundaryCurve defines a curve acting as the boundary of a surface.\",\n \"IfcBoundaryEdgeCondition\": \"Describes linearly elastic support conditions or connection conditions.\",\n \"IfcBoundaryFaceCondition\": \"Describes linearly elastic support conditions or connection conditions.\",\n \"IfcBoundaryNodeCondition\": \"Describes linearly elastic support conditions or connection conditions.\",\n \"IfcBoundaryNodeConditionWarping\": \"Describes linearly elastic support conditions or connection conditions, including linearly elastic warping restraints.\",\n \"IfcBoundedCurve\": \"An IfcBoundedCurve is a curve of finite length.\",\n \"IfcBoundedSurface\": \"An IfcBoundedSurface is a surface of finite area.\",\n \"IfcBoundingBox\": \"The IfcBoundingBox defines an orthogonal box oriented parallel to the axes of the object coordinate system in which it is defined. It is defined by a Corner being a three-dimensional Cartesian point and three length measures defining the X, Y and Z parameters of the box in the direction of the positive axes.\",\n \"IfcBoxedHalfSpace\": \"The IfcBoxedHalfSpace is used (as its supertype IfcHalfSpaceSolid) only within Boolean operations. It divides the domain into exactly two subsets, where the domain in question is that of the attribute Enclosure.\",\n \"IfcBSplineCurve\": \"The IfcBSplineCurve is a spline curve parameterized by spline functions.\",\n \"IfcBSplineCurveWithKnots\": \"The IfcBSplineCurveWithKnots is a spline curve parameterized by spline functions for which the knot values are explicitly given.\",\n \"IfcBSplineSurface\": \"The IfcBSplineSurface is a general form of rational or polynomial parametric surface.\",\n \"IfcBSplineSurfaceWithKnots\": \"The IfcBSplineSurfaceWithKnots is a general form of rational or polynomial parametric surface in which the knot values are explicitly given.\",\n \"IfcBuilding\": \"A building represents a structure that provides shelter for its occupants or contents and stands in one place. The building is also used to provide a basic element within the spatial structure hierarchy for the components of a building project (together with site, storey, and space).\",\n \"IfcBuildingElementPart\": \"IfcBuildingElementPart represents major components as subordinate parts of a building element. Typical usage examples include precast concrete sandwich walls, where the layers may have different geometry representations. In this case the layered material representation does not sufficiently describe the element. Each layer is represented by an own instance of the IfcBuildingElementPart with its own geometry description.\",\n \"IfcBuildingElementPartType\": \"The building element part type defines lists of commonly shared property set definitions and representation maps of parts of a building element.\",\n \"IfcBuildingElementProxy\": \"The IfcBuildingElementProxy is a proxy definition that provides the same functionality as subtypes of IfcBuildingElement, but without having a predefined meaning of the special type of building element, it represents.\",\n \"IfcBuildingElementProxyType\": \"IfcBuildingElementProxyType defines a list of commonly shared property set definitions of a building element proxy and an optional set of product representations. It is used to define an element specification (i.e. the specific product information, that is common to all occurrences of that product type).\",\n \"IfcBuildingStorey\": \"The building storey has an elevation and typically represents a (nearly) horizontal aggregation of spaces that are vertically bound.\",\n \"IfcBuildingSystem\": \"A building system is a group by which building elements are grouped according to a common function within the facility.\",\n \"IfcBurner\": \"A burner is a device that converts fuel into heat through combustion. It includes gas, oil, and wood burners.\",\n \"IfcBurnerType\": \"The energy conversion device type IfcBurnerType defines commonly shared information for occurrences of burners. The set of shared information may include:\",\n \"IfcCableCarrierFitting\": \"A cable carrier fitting is a fitting that is placed at junction or transition in a cable carrier system.\",\n \"IfcCableCarrierFittingType\": \"The flow fitting type IfcCableCarrierFittingType defines commonly shared information for occurrences of cable carrier fittings. The set of shared information may include:\",\n \"IfcCableCarrierSegment\": \"A cable carrier segment is a flow segment that is specifically used to carry and support cabling.\",\n \"IfcCableCarrierSegmentType\": \"The flow segment type IfcCableCarrierSegmentType defines commonly shared information for occurrences of cable carrier segments. The set of shared information may include:\",\n \"IfcCableFitting\": \"A cable fitting is a fitting that is placed at a junction, transition or termination in a cable system.\",\n \"IfcCableFittingType\": \"The flow fitting type IfcCableFittingType defines commonly shared information for occurrences of cable fittings. The set of shared information may include:\",\n \"IfcCableSegment\": \"A cable segment is a flow segment used to carry electrical power, data, or telecommunications signals.\",\n \"IfcCableSegmentType\": \"The flow segment type IfcCableSegmentType defines commonly shared information for occurrences of cable segments. The set of shared information may include:\",\n \"IfcCartesianPoint\": \"An IfcCartesianPoint defines a point by coordinates in an orthogonal, right-handed Cartesian coordinate system. For the purpose of this specification only two and three dimensional Cartesian points are used.\",\n \"IfcCartesianPointList\": \"The IfcCartesianPointList is the abstract supertype of list of points.\",\n \"IfcCartesianPointList2D\": \"The IfcCartesianPointList2D defines an ordered collection of two-dimentional Cartesian points. Each Cartesian point is provided as an two-dimensional point by a fixed list of two coordinates. The attribute CoordList is a two-dimensional list, where\",\n \"IfcCartesianPointList3D\": \"The IfcCartesianPointList3D defines an ordered collection of three-dimentional Cartesian points. Each Cartesian point is provided as an three-dimensional point by a fixed list of three coordinates. The attribute CoordList is a two-dimensional list, where\",\n \"IfcCartesianTransformationOperator\": \"An IfcCartesianTransformationOperator defines an abstract supertype of different kinds of geometric transformations.\",\n \"IfcCartesianTransformationOperator2D\": \"An IfcCartesianTransformationOperator2D defines a geometric transformation in two-dimensional space.\",\n \"IfcCartesianTransformationOperator2DnonUniform\": \"A Cartesian transformation operator 2d non uniform defines a geometric transformation in two-dimensional space composed of translation, rotation, mirroring and non uniform scaling. Non uniform scaling is given by two different scaling factors:\",\n \"IfcCartesianTransformationOperator3D\": \"An IfcCartesianTransformationOperator defines a geometric transformation in three-dimensional space.\",\n \"IfcCartesianTransformationOperator3DnonUniform\": \"A Cartesian transformation operator 3d non uniform defines a geometric transformation in three-dimensional space composed of translation, rotation, mirroring and non uniform scaling. Non uniform scaling is given by three different scaling factors:\",\n \"IfcCenterLineProfileDef\": \"The profile IfcCenterLineProfileDef defines an arbitrary two-dimensional open, not self intersecting profile for the use within the swept solid geometry. It is given by an area defined by applying a constant thickness to a centerline, generating an area from which the solid can be constructed.\",\n \"IfcChiller\": \"A chiller is a device used to remove heat from a liquid via a vapor-compression or absorption refrigeration cycle to cool a fluid, typically water or a mixture of water and glycol. The chilled fluid is then used to cool and dehumidify air in a building.\",\n \"IfcChillerType\": \"The energy conversion device type IfcChillerType defines commonly shared information for occurrences of chillers. The set of shared information may include:\",\n \"IfcChimney\": \"Chimneys are typically vertical, or as near as vertical, parts of the construction of a building and part of the building fabric. Often constructed by pre-cast or insitu concrete, today seldom by bricks.\",\n \"IfcChimneyType\": \"The building element type IfcChimneyType defines commonly shared information for occurrences of chimneys. The set of shared information may include:\",\n \"IfcCircle\": \"An IfcCircle is a curve consisting of a set of points having equal distance from the center.\",\n \"IfcCircleHollowProfileDef\": \"IfcCircleHollowProfileDef defines a section profile that provides the defining parameters of a circular hollow section (tube) to be used by the swept area solid. Its parameters and orientation relative to the position coordinate system are according to the following illustration.The centre of the position coordinate system is in the profile's centre of the bounding box (for symmetric profiles identical with the centre of gravity).\",\n \"IfcCircleProfileDef\": \"IfcCircleProfileDef defines a circle as the profile definition used by the swept surface geometry or by the swept area solid. It is given by its Radius attribute and placed within the 2D position coordinate system, established by the Position attribute.\",\n \"IfcCivilElement\": \"An IfcCivilElement is a generalization of all elements within a civil engineering works that cannot be represented as BuildingElements, DistributionElements or GeographicElements. Depending on the context of the construction project, included building work, such as buildings or factories, are represented as a collection of IfcBuildingElement's, distribution systems, such as piping or drainage, are represented as a collection of IfcDistributionElement's, and other geographic elements, such as trees, light posts, traffic signs etc. are represented as IfcGeographicElement's.\",\n \"IfcCivilElementType\": \"An IfcCivilElementType is used to define an element specification of an element used within civil engineering works. Civil element types include for different types of element that may be used to represent information for construction works external to a building. IfcCivilElementType's may include:\",\n \"IfcClassification\": \"An IfcClassification is used for the arrangement of objects into a class or category according to a common purpose or their possession of common characteristics. A classification in the sense of IfcClassification is taxonomy, or taxonomic scheme, arranged in a hierarchical structure. A category of objects relates to other categories in a generalization-specialization relationship. Therefore the classification items in an classification are organized in a tree structure.\",\n \"IfcClassificationReference\": \"An IfcClassificationReference is a reference into a classification system or source (see IfcClassification) for a specific classification key (or notation).\",\n \"IfcClosedShell\": \"\",\n \"IfcCoil\": \"A coil is a device used to provide heat transfer between non-mixing media. A common example is a cooling coil, which utilizes a finned coil in which circulates chilled water, antifreeze, or refrigerant that is used to remove heat from air moving across the surface of the coil. A coil may be used either for heating or cooling purposes by placing a series of tubes (the coil) carrying a heating or cooling fluid into an airstream. The coil may be constructed from tubes bundled in a serpentine form or from finned tubes that give a extended heat transfer surface.\",\n \"IfcCoilType\": \"The energy conversion device type IfcCoilType defines commonly shared information for occurrences of coils. The set of shared information may include:\",\n \"IfcColourRgb\": \"\",\n \"IfcColourRgbList\": \"The IfcColourRgbList defines an ordered collection of RGB colour values. Each colour value is a fixed list of three colour components (red, green, blue). The attribute ColourList is a two-dimensional list, where:\",\n \"IfcColourSpecification\": \"\",\n \"IfcColumn\": \" {\n this._needsRebuild = true;\n });\n\n this._onModelUnloaded = this.viewer.scene.on(\"modelUnloaded\", (modelId) => {\n this._needsRebuild = true;\n });\n }\n\n /**\n * Gets the root ObjectsKdTree3 node.\n */\n get root() {\n if (this._needsRebuild) {\n this._rebuild();\n }\n return this._root;\n }\n\n _rebuild() {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const depth = 0;\n this._root = {\n aabb: scene.getAABB()\n };\n for (let objectId in scene.objects) {\n const entity = scene.objects[objectId];\n this._insertEntity(this._root, entity, depth + 1);\n }\n this._needsRebuild = false;\n }\n\n _insertEntity(node, entity, depth) {\n\n const entityAABB = entity.aabb;\n\n if (depth >= this._maxTreeDepth) {\n node.entities = node.entities || [];\n node.entities.push(entity);\n return;\n }\n if (node.left) {\n if (math.containsAABB3(node.left.aabb, entityAABB)) {\n this._insertEntity(node.left, entity, depth + 1);\n return;\n }\n }\n if (node.right) {\n if (math.containsAABB3(node.right.aabb, entityAABB)) {\n this._insertEntity(node.right, entity, depth + 1);\n return;\n }\n }\n const nodeAABB = node.aabb;\n kdTreeDimLength[0] = nodeAABB[3] - nodeAABB[0];\n kdTreeDimLength[1] = nodeAABB[4] - nodeAABB[1];\n kdTreeDimLength[2] = nodeAABB[5] - nodeAABB[2];\n let dim = 0;\n if (kdTreeDimLength[1] > kdTreeDimLength[dim]) {\n dim = 1;\n }\n if (kdTreeDimLength[2] > kdTreeDimLength[dim]) {\n dim = 2;\n }\n if (!node.left) {\n const aabbLeft = nodeAABB.slice();\n aabbLeft[dim + 3] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n node.left = {\n aabb: aabbLeft\n };\n if (math.containsAABB3(aabbLeft, entityAABB)) {\n this._insertEntity(node.left, entity, depth + 1);\n return;\n }\n }\n if (!node.right) {\n const aabbRight = nodeAABB.slice();\n aabbRight[dim] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n node.right = {\n aabb: aabbRight\n };\n if (math.containsAABB3(aabbRight, entityAABB)) {\n this._insertEntity(node.right, entity, depth + 1);\n return;\n }\n }\n node.entities = node.entities || [];\n node.entities.push(entity);\n }\n\n /**\n * Destroys this ObjectsKdTree3.\n */\n destroy() {\n const scene = this.viewer.scene;\n scene.off(this._onModelLoaded);\n scene.off(this._onModelUnloaded);\n this._root = null;\n this._needsRebuild = true;\n }\n}\n", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/collision/ObjectsKdTree3.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 218, "kind": "variable", "name": "MAX_KD_TREE_DEPTH", "memberof": "src/collision/ObjectsKdTree3.js", "static": true, "longname": "src/collision/ObjectsKdTree3.js~MAX_KD_TREE_DEPTH", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/collision/ObjectsKdTree3.js", "importStyle": null, "description": null, "lineNumber": 3, "undocument": true, "type": { "types": [ "number" ] }, "ignore": true }, { "__docId__": 219, "kind": "variable", "name": "kdTreeDimLength", "memberof": "src/collision/ObjectsKdTree3.js", "static": true, "longname": "src/collision/ObjectsKdTree3.js~kdTreeDimLength", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/collision/ObjectsKdTree3.js", "importStyle": null, "description": null, "lineNumber": 4, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 220, "kind": "class", "name": "ObjectsKdTree3", "memberof": "src/collision/ObjectsKdTree3.js", "static": true, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "access": "public", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/collision/ObjectsKdTree3.js", "importStyle": "{ObjectsKdTree3}", "description": "A k-d tree for World-space 3D Entity collision detection with AABBs and frustums.", "lineNumber": 9, "interface": false }, { "__docId__": 221, "kind": "constructor", "name": "constructor", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "generator": false, "async": false, "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#constructor", "access": "public", "description": null, "lineNumber": 11, "undocument": true }, { "__docId__": 222, "kind": "member", "name": "viewer", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#viewer", "access": "public", "description": null, "lineNumber": 21, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 223, "kind": "member", "name": "_maxTreeDepth", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_maxTreeDepth", "access": "private", "description": null, "lineNumber": 23, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 224, "kind": "member", "name": "_root", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_root", "access": "private", "description": null, "lineNumber": 24, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 225, "kind": "member", "name": "_needsRebuild", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_needsRebuild", "access": "private", "description": null, "lineNumber": 25, "undocument": true, "ignore": true, "type": { "types": [ "boolean" ] } }, { "__docId__": 226, "kind": "member", "name": "_onModelLoaded", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_onModelLoaded", "access": "private", "description": null, "lineNumber": 27, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 228, "kind": "member", "name": "_onModelUnloaded", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_onModelUnloaded", "access": "private", "description": null, "lineNumber": 31, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 230, "kind": "get", "name": "root", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "generator": false, "async": false, "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#root", "access": "public", "description": "Gets the root ObjectsKdTree3 node.", "lineNumber": 39, "type": { "types": [ "*" ] } }, { "__docId__": 231, "kind": "method", "name": "_rebuild", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "generator": false, "async": false, "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_rebuild", "access": "private", "description": null, "lineNumber": 46, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 234, "kind": "method", "name": "_insertEntity", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "generator": false, "async": false, "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#_insertEntity", "access": "private", "description": null, "lineNumber": 60, "undocument": true, "ignore": true, "params": [ { "name": "node", "types": [ "*" ] }, { "name": "entity", "types": [ "*" ] }, { "name": "depth", "types": [ "*" ] } ], "return": null }, { "__docId__": 235, "kind": "method", "name": "destroy", "memberof": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3", "generator": false, "async": false, "static": false, "longname": "src/collision/ObjectsKdTree3.js~ObjectsKdTree3#destroy", "access": "public", "description": "Destroys this ObjectsKdTree3.", "lineNumber": 121, "params": [], "return": null }, { "__docId__": 238, "kind": "file", "name": "src/contextMenus/CanvasContextMenu.js", "content": "import {math, ContextMenu} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\n/**\n * @private\n */\nclass CanvasContextMenu extends ContextMenu {\n constructor(cfg = {}) {\n super({\n hideOnAction: cfg.hideOnAction,\n context: cfg.context,\n items: [\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.viewFitAll\") || \"View Fit All\";\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const sceneAABB = scene.getAABB(scene.visibleObjectIds);\n viewer.cameraFlight.flyTo({\n aabb: sceneAABB,\n duration: 0.5\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.viewFitSelection\") || \"View Fit Selected\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numSelectedObjects > 0);\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const sceneAABB = scene.getAABB(scene.selectedObjectIds);\n viewer.cameraFlight.flyTo({\n aabb: sceneAABB,\n duration: 0.5\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.hideAll\") || \"Hide All\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numVisibleObjects > 0);\n },\n doAction: (context) => {\n context.viewer.scene.setObjectsVisible(context.viewer.scene.visibleObjectIds, false);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.showAll\") || \"Show All\";\n },\n getEnabled: (context) => {\n const scene = context.viewer.scene;\n return ((scene.numVisibleObjects < scene.numObjects) || (context.viewer.scene.numXRayedObjects > 0));\n },\n doAction: (context) => {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.xRayAll\") || \"X-Ray All\";\n },\n getEnabled: (context) => {\n const scene = context.viewer.scene;\n return (scene.numXRayedObjects < scene.numObjects);\n },\n doAction: (context) => {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsXRayed(scene.objectIds, true);\n if (!context.bimViewer.getConfig(\"xrayPickable\")) {\n scene.setObjectsPickable(scene.objectIds, false);\n }\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.xRayNone\") || \"X-Ray None\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numXRayedObjects > 0);\n },\n doAction: (context) => {\n const xrayedObjectIds = context.viewer.scene.xrayedObjectIds;\n context.viewer.scene.setObjectsPickable(xrayedObjectIds, true);\n context.viewer.scene.setObjectsXRayed(xrayedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.selectNone\") || \"Select None\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numSelectedObjects > 0);\n },\n doAction: (context) => {\n context.viewer.scene.setObjectsSelected(context.viewer.scene.selectedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.resetView\") || \"Reset View\";\n },\n doAction: (context) => {\n context.bimViewer.resetView();\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.clearSlices\") || \"Clear Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.clearSections();\n }\n }\n ]\n ]\n });\n }\n}\n\nexport {CanvasContextMenu};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/contextMenus/CanvasContextMenu.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 239, "kind": "class", "name": "CanvasContextMenu", "memberof": "src/contextMenus/CanvasContextMenu.js", "static": true, "longname": "src/contextMenus/CanvasContextMenu.js~CanvasContextMenu", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/CanvasContextMenu.js", "importStyle": "{CanvasContextMenu}", "description": "", "lineNumber": 6, "interface": false, "extends": [ "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js~ContextMenu" ], "ignore": true }, { "__docId__": 240, "kind": "constructor", "name": "constructor", "memberof": "src/contextMenus/CanvasContextMenu.js~CanvasContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/CanvasContextMenu.js~CanvasContextMenu#constructor", "access": "public", "description": null, "lineNumber": 7, "undocument": true }, { "__docId__": 241, "kind": "file", "name": "src/contextMenus/ModelsContextMenu.js", "content": "import {ContextMenu} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\n/**\n * @private\n * @param {*} cfg Configs\n * @param {Boolean} [cfg.enableEditModels=false] Set true to show Add/Edit/Delete options in the menu.\n */\nclass ModelsContextMenu extends ContextMenu {\n\n constructor(cfg = {}) {\n\n const enableEditModels = (!!cfg.enableEditModels);\n\n const items = [\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.loadModel\") || \"Load\";\n },\n getEnabled: (context) => {\n return (!context.bimViewer.isModelLoaded(context.modelId));\n },\n doAction: (context) => {\n context.bimViewer.loadModel(context.modelId);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.unloadModel\") || \"Unload\";\n },\n getEnabled: (context) => {\n return context.bimViewer.isModelLoaded(context.modelId);\n },\n doAction: (context) => {\n context.bimViewer.unloadModel(context.modelId);\n }\n }\n ]\n ];\n\n if (enableEditModels) {\n\n items.push([\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.editModel\") || \"Edit\";\n },\n getEnabled: (context) => {\n return true;\n },\n doAction: (context) => {\n context.bimViewer.editModel(context.modelId);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.deleteModel\") || \"Delete\";\n },\n getEnabled: (context) => {\n return true;\n },\n doAction: (context) => {\n context.bimViewer.deleteModel(context.modelId);\n }\n }\n ]);\n }\n\n items.push([\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.loadAllModels\") || \"Load All\";\n },\n getEnabled: (context) => {\n const bimViewer = context.bimViewer;\n const modelIds = bimViewer.getModelIds();\n const loadedModelIds = bimViewer.getLoadedModelIds();\n return (loadedModelIds.length < modelIds.length);\n },\n doAction: (context) => {\n context.bimViewer.loadAllModels();\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.unloadAllModels\") || \"Unload All\";\n },\n getEnabled: (context) => {\n const loadedModelIds = context.bimViewer.getLoadedModelIds();\n return (loadedModelIds.length > 0);\n },\n doAction: (context) => {\n context.bimViewer.unloadAllModels();\n }\n }\n ]);\n\n items.push([\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"modelsContextMenu.clearSlices\") || \"Clear Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.clearSections();\n }\n }\n ]);\n\n super({\n hideOnAction: cfg.hideOnAction,\n context: cfg.context,\n items: items\n });\n }\n}\n\nexport {ModelsContextMenu};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/contextMenus/ModelsContextMenu.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 242, "kind": "class", "name": "ModelsContextMenu", "memberof": "src/contextMenus/ModelsContextMenu.js", "static": true, "longname": "src/contextMenus/ModelsContextMenu.js~ModelsContextMenu", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/ModelsContextMenu.js", "importStyle": "{ModelsContextMenu}", "description": "", "lineNumber": 8, "params": [ { "nullable": null, "types": [ "*" ], "spread": false, "optional": false, "name": "cfg", "description": "Configs" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "cfg.enableEditModels", "description": "Set true to show Add/Edit/Delete options in the menu." } ], "interface": false, "extends": [ "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js~ContextMenu" ], "ignore": true }, { "__docId__": 243, "kind": "constructor", "name": "constructor", "memberof": "src/contextMenus/ModelsContextMenu.js~ModelsContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/ModelsContextMenu.js~ModelsContextMenu#constructor", "access": "public", "description": null, "lineNumber": 10, "undocument": true }, { "__docId__": 244, "kind": "file", "name": "src/contextMenus/ObjectContextMenu.js", "content": "import {math, ContextMenu} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\n/**\n * @private\n */\nclass ObjectContextMenu extends ContextMenu {\n\n constructor(bimViewer, cfg={}) {\n super(cfg);\n this._bimViewer = bimViewer;\n this._buildMenu();\n }\n\n _buildMenu() {\n\n const showObjectItems = [];\n const focusObjectItems = [];\n\n if (this._bimViewer._enablePropertiesInspector) {\n showObjectItems.push(...[{\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.inspectProperties\") || \"Inspect Properties\";\n },\n doAction: (context) => {\n const objectId = context.entity.id;\n context.bimViewer.showObjectProperties(objectId);\n }\n }]);\n }\n\n showObjectItems.push(...[\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.showInTree\") || \"Show in Explorer\";\n },\n doAction: (context) => {\n const objectId = context.entity.id;\n context.showObjectInExplorers(objectId);\n }\n }\n ]);\n\n focusObjectItems.push(...[\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.viewFit\") || \"View Fit\";\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const entity = context.entity;\n viewer.cameraFlight.flyTo({\n aabb: entity.aabb,\n duration: 0.5\n }, () => {\n setTimeout(function () {\n scene.setObjectsHighlighted(scene.highlightedObjectIds, false);\n }, 500);\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(entity.aabb);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.viewFitSelection\") || \"View Fit Selected\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numSelectedObjects > 0);\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const sceneAABB = scene.getAABB(scene.selectedObjectIds);\n viewer.cameraFlight.flyTo({\n aabb: sceneAABB,\n duration: 0.5\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.viewFitAll\") || \"View Fit All\";\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const sceneAABB = scene.getAABB(scene.visibleObjectIds);\n viewer.cameraFlight.flyTo({\n aabb: sceneAABB,\n duration: 0.5\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);\n }\n }\n ]);\n\n this.items = [\n showObjectItems,\n focusObjectItems,\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.hide\") || \"Hide\";\n },\n getEnabled: (context) => {\n return context.entity.visible;\n },\n doAction: (context) => {\n context.entity.visible = false;\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.hideOthers\") || \"Hide Others\";\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const entity = context.entity;\n const metaObject = viewer.metaScene.metaObjects[entity.id];\n if (!metaObject) {\n return;\n }\n scene.setObjectsVisible(scene.visibleObjectIds, false);\n metaObject.withMetaObjectsInSubtree((metaObject) => {\n const entity = scene.objects[metaObject.id];\n if (entity) {\n entity.visible = true;\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.hideAll\") || \"Hide All\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numVisibleObjects > 0);\n },\n doAction: (context) => {\n context.viewer.scene.setObjectsVisible(context.viewer.scene.visibleObjectIds, false);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.showAll\") || \"Show All\";\n },\n getEnabled: (context) => {\n const scene = context.viewer.scene;\n return ((scene.numVisibleObjects < scene.numObjects) || (context.viewer.scene.numXRayedObjects > 0));\n },\n doAction: (context) => {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsPickable(scene.xrayedObjectIds, true);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.xray\") || \"X-Ray\";\n },\n getEnabled: (context) => {\n return (!context.entity.xrayed);\n },\n doAction: (context) => {\n const entity = context.entity;\n entity.xrayed = true;\n entity.pickable = context.bimViewer.getConfig(\"xrayPickable\");\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.xrayOthers\") || \"X-Ray Others\";\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const entity = context.entity;\n const metaObject = viewer.metaScene.metaObjects[entity.id];\n if (!metaObject) {\n return;\n }\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsXRayed(scene.objectIds, true);\n if (!context.bimViewer.getConfig(\"xrayPickable\")) {\n scene.setObjectsPickable(scene.objectIds, false);\n }\n metaObject.withMetaObjectsInSubtree((metaObject) => {\n const entity = scene.objects[metaObject.id];\n if (entity) {\n entity.xrayed = false;\n entity.pickable = true;\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.xrayAll\") || \"X-Ray All\";\n },\n getEnabled: (context) => {\n const scene = context.viewer.scene;\n return (scene.numXRayedObjects < scene.numObjects);\n },\n doAction: (context) => {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n if (!context.bimViewer.getConfig(\"xrayPickable\")) {\n scene.setObjectsPickable(scene.objectIds, false);\n }\n scene.setObjectsXRayed(scene.objectIds, true);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.xrayNone\") || \"X-Ray None\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numXRayedObjects > 0);\n },\n doAction: (context) => {\n const scene = context.viewer.scene;\n const xrayedObjectIds = scene.xrayedObjectIds;\n scene.setObjectsPickable(xrayedObjectIds, true);\n scene.setObjectsXRayed(xrayedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.select\") || \"Select\";\n },\n getEnabled: (context) => {\n return (!context.entity.selected);\n },\n doAction: (context) => {\n context.entity.selected = true;\n\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.undoSelect\") || \"Undo Select\";\n },\n getEnabled: (context) => {\n return context.entity.selected;\n },\n doAction: (context) => {\n context.entity.selected = false;\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.selectNone\") || \"Select None\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numSelectedObjects > 0);\n },\n doAction: (context) => {\n context.viewer.scene.setObjectsSelected(context.viewer.scene.selectedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"objectContextMenu.clearSlices\") || \"Clear Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.clearSections();\n }\n }\n ]\n ];\n }\n}\n\nexport {ObjectContextMenu};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/contextMenus/ObjectContextMenu.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 245, "kind": "class", "name": "ObjectContextMenu", "memberof": "src/contextMenus/ObjectContextMenu.js", "static": true, "longname": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/ObjectContextMenu.js", "importStyle": "{ObjectContextMenu}", "description": "", "lineNumber": 6, "interface": false, "extends": [ "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js~ContextMenu" ], "ignore": true }, { "__docId__": 246, "kind": "constructor", "name": "constructor", "memberof": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu#constructor", "access": "public", "description": null, "lineNumber": 8, "undocument": true }, { "__docId__": 247, "kind": "member", "name": "_bimViewer", "memberof": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu", "static": false, "longname": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu#_bimViewer", "access": "private", "description": null, "lineNumber": 10, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 248, "kind": "method", "name": "_buildMenu", "memberof": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu#_buildMenu", "access": "private", "description": null, "lineNumber": 14, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 249, "kind": "member", "name": "items", "memberof": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu", "static": false, "longname": "src/contextMenus/ObjectContextMenu.js~ObjectContextMenu#items", "access": "public", "description": null, "lineNumber": 98, "undocument": true, "type": { "types": [ "undefined[]" ] } }, { "__docId__": 250, "kind": "file", "name": "src/contextMenus/SectionToolContextMenu.js", "content": "import {ContextMenu, math, utils} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nconst tempAABB = math.AABB3();\nconst tempVec3 = math.vec3();\n\n/**\n * @private\n */\nclass SectionToolContextMenu extends ContextMenu {\n\n constructor(cfg = {}) {\n\n if (!cfg.sectionPlanesPlugin) {\n throw \"Missing config: sectionPlanesPlugin\";\n }\n\n super(utils.apply({}, cfg));\n\n this._sectionPlanesPlugin = cfg.sectionPlanesPlugin;\n this._viewer = this._sectionPlanesPlugin.viewer;\n\n this._onSceneSectionPlaneCreated = this._viewer.scene.on(\"sectionPlaneCreated\", () => {\n this._buildMenu();\n });\n\n this._onSceneSectionPlaneDestroyed = this._viewer.scene.on(\"sectionPlaneDestroyed\", () => {\n this._buildMenu();\n });\n\n this._buildMenu();\n }\n\n _buildMenu() {\n\n const sectionPlanesPlugin = this._sectionPlanesPlugin;\n const sectionPlanes = Object.values(sectionPlanesPlugin.sectionPlanes);\n\n const sectionPlanesMenuItems = [];\n\n for (let i = 0, len = sectionPlanes.length; i < len; i++) {\n\n const sectionPlane = sectionPlanes[i];\n\n sectionPlanesMenuItems.push({\n\n getTitle: (context) => {\n return `${context.viewer.localeService.translate(\"sectionToolContextMenu.slice\") || \"Slice\"} #` + (i + 1);\n },\n\n doHoverEnter(context) {\n sectionPlanesPlugin.hideControl();\n sectionPlanesPlugin.showControl(sectionPlane.id);\n },\n\n doHoverLeave(context) {\n sectionPlanesPlugin.hideControl();\n },\n\n items: [ // Submenu\n [ // Group\n {\n getTitle: (context) => {\n return sectionPlane.active\n ? context.viewer.localeService.translate(\"sectionToolContextMenu.deactivate\") || \"Disable\"\n : context.viewer.localeService.translate(\"sectionToolContextMenu.activate\") || \"Enable\";\n },\n doAction: (context) => {\n sectionPlane.active = !sectionPlane.active;\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.edit\") || \"Edit\";\n },\n getEnabled() {\n return sectionPlane.active;\n },\n doAction: (context) => {\n\n sectionPlanesPlugin.hideControl();\n sectionPlanesPlugin.showControl(sectionPlane.id);\n\n const sectionPlanePos = sectionPlane.pos;\n tempAABB.set(this._viewer.scene.aabb);\n math.getAABB3Center(tempAABB, tempVec3);\n tempAABB[0] += sectionPlanePos[0] - tempVec3[0];\n tempAABB[1] += sectionPlanePos[1] - tempVec3[1];\n tempAABB[2] += sectionPlanePos[2] - tempVec3[2];\n tempAABB[3] += sectionPlanePos[0] - tempVec3[0];\n tempAABB[4] += sectionPlanePos[1] - tempVec3[1];\n tempAABB[5] += sectionPlanePos[2] - tempVec3[2];\n\n this._viewer.cameraFlight.flyTo({\n aabb: tempAABB,\n fitFOV: 65\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.flip\") || \"Flip\";\n },\n getEnabled() {\n return sectionPlane.active;\n },\n doAction: (context) => {\n sectionPlane.flipDir();\n }\n },\n\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.delete\") || \"Delete\";\n },\n doAction: (context) => {\n sectionPlane.destroy();\n }\n }\n ]\n ]\n });\n }\n\n this.items = [\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.clearSlices\") || \"Clear Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.clearSections();\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.flipSlices\") || \"Flip Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.flipSections();\n }\n }\n ],\n\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.disableAllSlices\") || \"Disable all Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.disableSections();\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"sectionToolContextMenu.enableAllSlices\") || \"Enable all Slices\";\n },\n getEnabled: (context) => {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: (context) => {\n context.bimViewer.enableSections();\n }\n }\n ],\n sectionPlanesMenuItems\n ];\n }\n\n destroy() {\n super.destroy();\n const scene = this._viewer.scene;\n scene.off(this._onSceneSectionPlaneCreated);\n scene.off(this._onSceneSectionPlaneDestroyed);\n }\n}\n\n\nexport {SectionToolContextMenu};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/contextMenus/SectionToolContextMenu.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 251, "kind": "variable", "name": "tempAABB", "memberof": "src/contextMenus/SectionToolContextMenu.js", "static": true, "longname": "src/contextMenus/SectionToolContextMenu.js~tempAABB", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/SectionToolContextMenu.js", "importStyle": null, "description": null, "lineNumber": 3, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 252, "kind": "variable", "name": "tempVec3", "memberof": "src/contextMenus/SectionToolContextMenu.js", "static": true, "longname": "src/contextMenus/SectionToolContextMenu.js~tempVec3", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/SectionToolContextMenu.js", "importStyle": null, "description": null, "lineNumber": 4, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 253, "kind": "class", "name": "SectionToolContextMenu", "memberof": "src/contextMenus/SectionToolContextMenu.js", "static": true, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/SectionToolContextMenu.js", "importStyle": "{SectionToolContextMenu}", "description": "", "lineNumber": 9, "interface": false, "extends": [ "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js~ContextMenu" ], "ignore": true }, { "__docId__": 254, "kind": "constructor", "name": "constructor", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#constructor", "access": "public", "description": null, "lineNumber": 11, "undocument": true }, { "__docId__": 255, "kind": "member", "name": "_sectionPlanesPlugin", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#_sectionPlanesPlugin", "access": "private", "description": null, "lineNumber": 19, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 256, "kind": "member", "name": "_viewer", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#_viewer", "access": "private", "description": null, "lineNumber": 20, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 257, "kind": "member", "name": "_onSceneSectionPlaneCreated", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#_onSceneSectionPlaneCreated", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 258, "kind": "member", "name": "_onSceneSectionPlaneDestroyed", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#_onSceneSectionPlaneDestroyed", "access": "private", "description": null, "lineNumber": 26, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 259, "kind": "method", "name": "_buildMenu", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#_buildMenu", "access": "private", "description": null, "lineNumber": 33, "undocument": true, "ignore": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 260, "kind": "member", "name": "items", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#items", "access": "public", "description": null, "lineNumber": 124, "undocument": true, "type": { "types": [ "undefined[]" ] } }, { "__docId__": 261, "kind": "method", "name": "destroy", "memberof": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/SectionToolContextMenu.js~SectionToolContextMenu#destroy", "access": "public", "description": null, "lineNumber": 178, "undocument": true, "params": [], "return": null }, { "__docId__": 262, "kind": "file", "name": "src/contextMenus/TreeViewContextMenu.js", "content": "import {math, ContextMenu} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nconst tempVec3 = math.vec3();\n\n/**\n * @private\n */\nclass TreeViewContextMenu extends ContextMenu {\n\n constructor(bimViewer, cfg={}) {\n super(cfg);\n this._bimViewer = bimViewer;\n this._buildMenu();\n }\n\n _buildMenu() {\n\n const showObjectItems = [];\n const focusObjectItems = [];\n\n if (this._bimViewer._enablePropertiesInspector) {\n showObjectItems.push({\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.inspectProperties\") || \"Inspect Properties\";\n },\n getShown(context) {\n return !!context.viewer.metaScene.metaObjects[context.treeViewNode.objectId];\n },\n doAction: (context) => {\n const objectId = context.treeViewNode.objectId;\n context.bimViewer.showObjectProperties(objectId);\n }\n });\n }\n\n focusObjectItems.push(...[\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.viewFit\") || \"View Fit\";\n },\n doAction: function (context) {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const objectIds = [];\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n objectIds.push(treeViewNode.objectId);\n }\n });\n scene.setObjectsVisible(objectIds, true);\n scene.setObjectsHighlighted(objectIds, true);\n const aabb = scene.getAABB(objectIds);\n viewer.cameraFlight.flyTo({\n aabb: aabb,\n duration: 0.5\n }, () => {\n setTimeout(function () {\n scene.setObjectsHighlighted(scene.highlightedObjectIds, false);\n }, 500);\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"canvasContextMenu.viewFitSelection\") || \"View Fit Selected\";\n },\n getEnabled: (context) => {\n return (context.viewer.scene.numSelectedObjects > 0);\n },\n doAction: (context) => {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const sceneAABB = scene.getAABB(scene.selectedObjectIds);\n viewer.cameraFlight.flyTo({\n aabb: sceneAABB,\n duration: 0.5\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.viewFitAll\") || \"View Fit All\";\n },\n doAction: function (context) {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const sceneAABB = scene.getAABB(scene.visibleObjectIds);\n viewer.cameraFlight.flyTo({\n aabb: sceneAABB,\n duration: 0.5\n });\n viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);\n }\n }\n ]);\n\n this.items = [\n showObjectItems,\n focusObjectItems,\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.isolate\") || \"Isolate\";\n },\n doAction: function (context) {\n const viewer = context.viewer;\n const scene = viewer.scene;\n const objectIds = [];\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n objectIds.push(treeViewNode.objectId);\n }\n });\n const aabb = scene.getAABB(objectIds);\n\n viewer.cameraControl.pivotPos = math.getAABB3Center(aabb, tempVec3);\n\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n scene.setObjectsVisible(scene.visibleObjectIds, false);\n // scene.setObjectsPickable(scene.objectIds, false);\n scene.setObjectsSelected(scene.selectedObjectIds, false);\n\n scene.setObjectsVisible(objectIds, true);\n // scene.setObjectsPickable(objectIds, true);\n\n viewer.cameraFlight.flyTo({\n aabb: aabb\n }, () => {\n });\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.hide\") || \"Hide\";\n },\n doAction: function (context) {\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = context.viewer.scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.visible = false;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.hideOthers\") || \"Hide Others\";\n },\n doAction: function (context) {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.visibleObjectIds, false);\n scene.setObjectsPickable(scene.xrayedObjectIds, true);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.visible = true;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.hideAll\") || \"Hide All\";\n },\n getEnabled: function (context) {\n return (context.viewer.scene.visibleObjectIds.length > 0);\n },\n doAction: function (context) {\n context.viewer.scene.setObjectsVisible(context.viewer.scene.visibleObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.show\") || \"Show\";\n },\n doAction: function (context) {\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = context.viewer.scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.visible = true;\n if (entity.xrayed) {\n entity.pickable = true;\n }\n entity.xrayed = false;\n entity.selected = false;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.showOthers\") || \"Shows Others\";\n },\n doAction: function (context) {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsPickable(scene.xrayedObjectIds, true);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.visible = false;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.showAll\") || \"Show All\";\n },\n getEnabled: function (context) {\n const scene = context.viewer.scene;\n return ((scene.numVisibleObjects < scene.numObjects) || (context.viewer.scene.numXRayedObjects > 0));\n },\n doAction: function (context) {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsPickable(scene.xrayedObjectIds, true);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.xray\") || \"X-Ray\";\n },\n doAction: function (context) {\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = context.viewer.scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.selected = false;\n entity.xrayed = true;\n entity.visible = true;\n entity.pickable = context.bimViewer.getConfig(\"xrayPickable\");\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.undoXray\") || \"Undo X-Ray\";\n },\n doAction: function (context) {\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = context.viewer.scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.xrayed = false;\n entity.pickable = true;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.xrayOthers\") || \"X-Ray Others\";\n },\n doAction: function (context) {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n if (!context.bimViewer.getConfig(\"xrayPickable\")) {\n scene.setObjectsPickable(scene.objectIds, false);\n }\n scene.setObjectsXRayed(scene.objectIds, true);\n scene.setObjectsSelected(scene.selectedObjectIds, false);\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.xrayed = false;\n entity.pickable = true;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.xrayAll\") || \"X-Ray All\";\n },\n doAction: function (context) {\n const scene = context.viewer.scene;\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsXRayed(scene.objectIds, true);\n scene.setObjectsSelected(scene.selectedObjectIds, false);\n scene.setObjectsPickable(scene.objectIds, false);\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.xrayNone\") || \"X-Ray None\";\n },\n getEnabled: function (context) {\n return (context.viewer.scene.numXRayedObjects > 0);\n },\n doAction: function (context) {\n const scene = context.viewer.scene;\n const xrayedObjectIds = scene.xrayedObjectIds;\n scene.setObjectsPickable(xrayedObjectIds, true);\n scene.setObjectsXRayed(xrayedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.select\") || \"Select\";\n },\n doAction: function (context) {\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = context.viewer.scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.selected = true;\n entity.visible = true;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.undoSelect\") || \"Undo Select\";\n },\n doAction: function (context) {\n context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n const entity = context.viewer.scene.objects[treeViewNode.objectId];\n if (entity) {\n entity.selected = false;\n }\n }\n });\n }\n },\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.selectNone\") || \"Select None\";\n },\n getEnabled: function (context) {\n return (context.viewer.scene.numSelectedObjects > 0);\n },\n doAction: function (context) {\n context.viewer.scene.setObjectsSelected(context.viewer.scene.selectedObjectIds, false);\n }\n }\n ],\n [\n {\n getTitle: (context) => {\n return context.viewer.localeService.translate(\"treeViewContextMenu.clearSlices\") || \"Clear Slices\";\n },\n getEnabled: function (context) {\n return (context.bimViewer.getNumSections() > 0);\n },\n doAction: function (context) {\n context.bimViewer.clearSections();\n }\n }]\n ];\n }\n}\n\nexport {TreeViewContextMenu};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/contextMenus/TreeViewContextMenu.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 263, "kind": "variable", "name": "tempVec3", "memberof": "src/contextMenus/TreeViewContextMenu.js", "static": true, "longname": "src/contextMenus/TreeViewContextMenu.js~tempVec3", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/TreeViewContextMenu.js", "importStyle": null, "description": null, "lineNumber": 3, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 264, "kind": "class", "name": "TreeViewContextMenu", "memberof": "src/contextMenus/TreeViewContextMenu.js", "static": true, "longname": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/contextMenus/TreeViewContextMenu.js", "importStyle": "{TreeViewContextMenu}", "description": "", "lineNumber": 8, "interface": false, "extends": [ "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js~ContextMenu" ], "ignore": true }, { "__docId__": 265, "kind": "constructor", "name": "constructor", "memberof": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu#constructor", "access": "public", "description": null, "lineNumber": 10, "undocument": true }, { "__docId__": 266, "kind": "member", "name": "_bimViewer", "memberof": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu", "static": false, "longname": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu#_bimViewer", "access": "private", "description": null, "lineNumber": 12, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 267, "kind": "method", "name": "_buildMenu", "memberof": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu", "generator": false, "async": false, "static": false, "longname": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu#_buildMenu", "access": "private", "description": null, "lineNumber": 16, "undocument": true, "ignore": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 268, "kind": "member", "name": "items", "memberof": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu", "static": false, "longname": "src/contextMenus/TreeViewContextMenu.js~TreeViewContextMenu#items", "access": "public", "description": null, "lineNumber": 99, "undocument": true, "type": { "types": [ "undefined[]" ] } }, { "__docId__": 269, "kind": "file", "name": "src/explorer/ClassesExplorer.js", "content": "import {TreeViewPlugin, math} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\nimport {Controller} from \"../Controller.js\";\nimport {TreeViewContextMenu} from \"../contextMenus/TreeViewContextMenu.js\";\n\n/** @private */\nclass ClassesExplorer extends Controller {\n\n constructor(parent, cfg = {}) {\n\n super(parent);\n\n if (!cfg.classesTabElement) {\n throw \"Missing config: classesTabElement\";\n }\n\n if (!cfg.showAllClassesButtonElement) {\n throw \"Missing config: showAllClassesButtonElement\";\n }\n\n if (!cfg.hideAllClassesButtonElement) {\n throw \"Missing config: hideAllClassesButtonElement\";\n }\n\n if (!cfg.classesElement) {\n throw \"Missing config: classesElement\";\n }\n\n this._classesTabElement = cfg.classesTabElement;\n this._showAllClassesButtonElement = cfg.showAllClassesButtonElement;\n this._hideAllClassesButtonElement = cfg.hideAllClassesButtonElement;\n this._classesTabButtonElement = this._classesTabElement.querySelector(\".xeokit-tab-btn\");\n\n if (!this._classesTabButtonElement) {\n throw \"Missing DOM element: xeokit-tab-btn\";\n }\n\n const classesElement = cfg.classesElement;\n\n this._treeView = new TreeViewPlugin(this.viewer, {\n containerElement: classesElement,\n hierarchy: \"types\",\n autoAddModels: false,\n pruneEmptyNodes: true\n });\n\n this._treeViewContextMenu = new TreeViewContextMenu(this.bimViewer, {\n hideOnAction: true\n });\n\n this._treeView.on(\"contextmenu\", (e) => {\n this._treeViewContextMenu.context = {\n bimViewer: this.bimViewer,\n viewer: e.viewer,\n treeViewPlugin: e.treeViewPlugin,\n treeViewNode: e.treeViewNode\n };\n this._treeViewContextMenu.show(e.event.pageX, e.event.pageY);\n });\n\n this._treeView.on(\"nodeTitleClicked\", (e) => {\n const scene = this.viewer.scene;\n const objectIds = [];\n e.treeViewPlugin.withNodeTree(e.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n objectIds.push(treeViewNode.objectId);\n }\n });\n const checked = e.treeViewNode.checked;\n if (checked) {\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, false);\n scene.setObjectsPickable(objectIds, true);\n } else {\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, true);\n scene.setObjectsPickable(objectIds, true);\n }\n });\n\n this._onModelLoaded = this.viewer.scene.on(\"modelLoaded\", (modelId) => {\n if (this.viewer.metaScene.metaModels[modelId]) {\n const modelInfo = this.bimViewer._modelsExplorer.getModelInfo(modelId);\n if (!modelInfo) {\n return;\n }\n this._treeView.addModel(modelId, {\n rootName: modelInfo.name\n });\n }\n });\n\n this._onModelUnloaded = this.viewer.scene.on(\"modelUnloaded\", (modelId) => {\n if (this.viewer.metaScene.metaModels[modelId]) {\n this._treeView.removeModel(modelId);\n }\n });\n\n this.bimViewer.on(\"reset\", () => {\n this._treeView.collapse();\n });\n }\n\n setEnabled(enabled) {\n if (!enabled) {\n this._classesTabButtonElement.classList.add(\"disabled\");\n this._showAllClassesButtonElement.classList.add(\"disabled\");\n this._hideAllClassesButtonElement.classList.add(\"disabled\");\n } else {\n this._classesTabButtonElement.classList.remove(\"disabled\");\n this._showAllClassesButtonElement.classList.remove(\"disabled\");\n this._hideAllClassesButtonElement.classList.remove(\"disabled\");\n }\n }\n\n expandTreeViewToDepth(depth) {\n this._treeView.expandToDepth(depth);\n }\n\n showNodeInTreeView(objectId) {\n this._treeView.collapse();\n this._treeView.showNode(objectId);\n }\n\n unShowNodeInTreeView() {\n this._treeView.unShowNode();\n }\n\n destroy() {\n super.destroy();\n this._treeView.destroy();\n this._treeViewContextMenu.destroy();\n this.viewer.scene.off(this._onModelLoaded);\n this.viewer.scene.off(this._onModelUnloaded);\n }\n}\n\nexport {ClassesExplorer};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/explorer/ClassesExplorer.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 270, "kind": "class", "name": "ClassesExplorer", "memberof": "src/explorer/ClassesExplorer.js", "static": true, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/ClassesExplorer.js", "importStyle": "{ClassesExplorer}", "description": null, "lineNumber": 6, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 271, "kind": "constructor", "name": "constructor", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#constructor", "access": "public", "description": null, "lineNumber": 8, "undocument": true }, { "__docId__": 272, "kind": "member", "name": "_classesTabElement", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_classesTabElement", "access": "private", "description": null, "lineNumber": 28, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 273, "kind": "member", "name": "_showAllClassesButtonElement", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_showAllClassesButtonElement", "access": "private", "description": null, "lineNumber": 29, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 274, "kind": "member", "name": "_hideAllClassesButtonElement", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_hideAllClassesButtonElement", "access": "private", "description": null, "lineNumber": 30, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 275, "kind": "member", "name": "_classesTabButtonElement", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_classesTabButtonElement", "access": "private", "description": null, "lineNumber": 31, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 276, "kind": "member", "name": "_treeView", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_treeView", "access": "private", "description": null, "lineNumber": 39, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 277, "kind": "member", "name": "_treeViewContextMenu", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_treeViewContextMenu", "access": "private", "description": null, "lineNumber": 46, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 278, "kind": "member", "name": "_onModelLoaded", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_onModelLoaded", "access": "private", "description": null, "lineNumber": 80, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 279, "kind": "member", "name": "_onModelUnloaded", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#_onModelUnloaded", "access": "private", "description": null, "lineNumber": 92, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 280, "kind": "method", "name": "setEnabled", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#setEnabled", "access": "public", "description": null, "lineNumber": 103, "undocument": true, "params": [ { "name": "enabled", "types": [ "*" ] } ], "return": null }, { "__docId__": 281, "kind": "method", "name": "expandTreeViewToDepth", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#expandTreeViewToDepth", "access": "public", "description": null, "lineNumber": 115, "undocument": true, "params": [ { "name": "depth", "types": [ "*" ] } ], "return": null }, { "__docId__": 282, "kind": "method", "name": "showNodeInTreeView", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#showNodeInTreeView", "access": "public", "description": null, "lineNumber": 119, "undocument": true, "params": [ { "name": "objectId", "types": [ "*" ] } ], "return": null }, { "__docId__": 283, "kind": "method", "name": "unShowNodeInTreeView", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#unShowNodeInTreeView", "access": "public", "description": null, "lineNumber": 124, "undocument": true, "params": [], "return": null }, { "__docId__": 284, "kind": "method", "name": "destroy", "memberof": "src/explorer/ClassesExplorer.js~ClassesExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ClassesExplorer.js~ClassesExplorer#destroy", "access": "public", "description": null, "lineNumber": 128, "undocument": true, "params": [], "return": null }, { "__docId__": 285, "kind": "file", "name": "src/explorer/ModelsExplorer.js", "content": "import {math, XKTLoaderPlugin} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\nimport {Controller} from \"../Controller.js\";\nimport {ModelsContextMenu} from \"../contextMenus/ModelsContextMenu.js\";\n\nconst tempVec3a = math.vec3();\n\n\n/**\n * Custom data access strategy for {@link XKTLoaderPlugin}.\n * @private\n */\nclass BIMViewerDataSource {\n\n constructor(server) {\n this._server = server;\n }\n\n setProjectId(projectId) {\n this._projectId = projectId;\n }\n\n setModelId(modelId) {\n this._modelId = modelId;\n }\n\n getManifest(src, ok, error) {\n this._server.getSplitModelManifest(this._projectId, this._modelId, src, ok, error);\n }\n\n getMetaModel(src, ok, error) {\n this._server.getSplitModelMetadata(this._projectId, this._modelId, src, ok, error);\n }\n\n getXKT(src, ok, error) {\n this._server.getSplitModelGeometry(this._projectId, this._modelId, src, ok, error)\n }\n}\n\n\n/** @private */\nclass ModelsExplorer extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.modelsTabElement) {\n throw \"Missing config: modelsTabElement\";\n }\n\n if (!cfg.unloadModelsButtonElement) {\n throw \"Missing config: unloadModelsButtonElement\";\n }\n\n if (!cfg.modelsElement) {\n throw \"Missing config: modelsElement\";\n }\n\n this._enableAddModels = !!cfg.enableEditModels;\n this._modelsTabElement = cfg.modelsTabElement;\n this._loadModelsButtonElement = cfg.loadModelsButtonElement;\n this._unloadModelsButtonElement = cfg.unloadModelsButtonElement;\n this._addModelButtonElement = cfg.addModelButtonElement;\n this._modelsElement = cfg.modelsElement;\n this._modelsTabButtonElement = this._modelsTabElement.querySelector(\".xeokit-tab-btn\");\n\n if (!this._modelsTabButtonElement) {\n throw \"Missing DOM element: ,xeokit-tab-btn\";\n }\n\n this._dataSource = new BIMViewerDataSource(this.server);\n\n this._xktLoader = new XKTLoaderPlugin(this.viewer, {\n dataSource: this._dataSource\n });\n\n this._modelsContextMenu = new ModelsContextMenu({\n enableEditModels: cfg.enableEditModels,\n hideOnAction: true\n });\n\n this._modelsInfo = {};\n this._numModels = 0;\n this._numModelsLoaded = 0;\n this._projectId = null;\n }\n\n setObjectColors(objectColors) {\n this._xktLoader.objectDefaults = objectColors;\n }\n\n loadProject(projectId, done, error) {\n this.server.getProject(projectId, (projectInfo) => {\n this.unloadProject();\n this._projectId = projectId;\n this._modelsInfo = {};\n this._numModels = 0;\n this._parseProject(projectInfo, done);\n if (this._numModelsLoaded < this._numModels) {\n this._loadModelsButtonElement.classList.remove(\"disabled\");\n }\n if (this._numModelsLoaded > 0) {\n this._unloadModelsButtonElement.classList.remove(\"disabled\");\n }\n if (this._enableAddModels) {\n this._addModelButtonElement.classList.remove(\"disabled\");\n }\n }, (errMsg) => {\n this.error(errMsg);\n if (error) {\n error(errMsg);\n }\n });\n }\n\n _parseProject(projectInfo, done) {\n this._buildModelsMenu(projectInfo);\n this._parseViewerConfigs(projectInfo);\n this._parseViewerContent(projectInfo, () => {\n this._parseViewerState(projectInfo, () => {\n done();\n });\n });\n }\n\n _buildModelsMenu(projectInfo) {\n var html = \"\";\n const modelsInfo = projectInfo.models || [];\n this._modelsInfo = {};\n this._numModels = modelsInfo.length;\n for (let i = 0, len = modelsInfo.length; i < len; i++) {\n const modelInfo = modelsInfo[i];\n this._modelsInfo[modelInfo.id] = modelInfo;\n html += \"
\";\n html += \"\" + modelInfo.name + \"\";\n html += \"
\";\n }\n this._modelsElement.innerHTML = html;\n for (let i = 0, len = modelsInfo.length; i < len; i++) {\n const modelInfo = modelsInfo[i];\n const modelId = modelInfo.id;\n const checkBox = document.getElementById(\"\" + modelId);\n const span = document.getElementById(\"span-\" + modelId);\n checkBox.addEventListener(\"click\", () => {\n if (checkBox.checked) {\n this.loadModel(modelId);\n } else {\n this.unloadModel(modelInfo.id);\n }\n });\n span.addEventListener(\"click\", () => {\n const model = this.viewer.scene.models[modelId];\n const modelLoaded = (!!model);\n if (!modelLoaded) {\n this.loadModel(modelId);\n } else {\n this.unloadModel(modelInfo.id);\n }\n });\n span.oncontextmenu = (e) => {\n this._modelsContextMenu.context = {\n bimViewer: this.bimViewer,\n viewer: this.viewer,\n modelId: modelId\n };\n this._modelsContextMenu.show(e.pageX, e.pageY);\n e.preventDefault();\n };\n }\n }\n\n _parseViewerConfigs(projectInfo) {\n const viewerConfigs = projectInfo.viewerConfigs;\n if (viewerConfigs) {\n this.bimViewer.setConfigs(viewerConfigs);\n }\n }\n\n _parseViewerContent(projectInfo, done) {\n const viewerContent = projectInfo.viewerContent;\n if (!viewerContent) {\n done();\n return;\n }\n this._parseModelsLoaded(viewerContent, () => {\n done();\n });\n }\n\n _parseModelsLoaded(viewerContent, done) {\n const modelsLoaded = viewerContent.modelsLoaded;\n if (!modelsLoaded || (modelsLoaded.length === 0)) {\n done();\n return;\n }\n this._loadNextModel(modelsLoaded.slice(0), done);\n }\n\n _loadNextModel(modelsLoaded, done) {\n if (modelsLoaded.length === 0) {\n done();\n return;\n }\n const modelId = modelsLoaded.pop();\n this.loadModel(modelId,\n () => { // Done\n this._loadNextModel(modelsLoaded, done);\n },\n () => { // Error - recover and attempt to load next model\n this._loadNextModel(modelsLoaded, done);\n });\n }\n\n _parseViewerState(projectInfo, done) {\n const viewerState = projectInfo.viewerState;\n if (!viewerState) {\n done();\n return;\n }\n this.bimViewer.setViewerState(viewerState, done);\n }\n\n unloadProject() {\n if (!this._projectId) {\n return;\n }\n const models = this.viewer.scene.models;\n for (var modelId in models) {\n if (models.hasOwnProperty(modelId)) {\n const model = models[modelId];\n model.destroy();\n }\n }\n this._modelsElement.innerHTML = \"\";\n this._numModelsLoaded = 0;\n\n this._loadModelsButtonElement.classList.add(\"disabled\");\n this._unloadModelsButtonElement.classList.add(\"disabled\");\n if (this._enableAddModels) {\n this._addModelButtonElement.classList.add(\"disabled\");\n }\n const lastProjectId = this._projectId;\n this._projectId = null;\n this.fire(\"projectUnloaded\", {\n projectId: lastProjectId\n });\n }\n\n getLoadedProjectId() {\n return this._projectId;\n }\n\n getModelIds() {\n return Object.keys(this._modelsInfo);\n }\n\n loadModel(modelId, done, error) {\n if (!this._projectId) {\n const errMsg = \"No project currently loaded\";\n this.error(errMsg);\n if (error) {\n error(errMsg);\n }\n return;\n }\n const modelInfo = this._modelsInfo[modelId];\n if (!modelInfo) {\n const errMsg = \"Model not in currently loaded project\";\n this.error(errMsg);\n if (error) {\n error(errMsg);\n }\n return;\n }\n\n this.bimViewer._busyModal.show(`${this.viewer.localeService.translate(\"busyModal.loading\") || \"Loading\"} ${modelInfo.name}`);\n\n const externalMetadata = this.bimViewer.getConfig(\"externalMetadata\");\n\n if (externalMetadata && !modelInfo.manifest) {\n this.server.getMetadata(this._projectId, modelId, (json) => {\n this._loadGeometry(modelId, modelInfo, json, done, error);\n },\n (errMsg) => {\n this.bimViewer._busyModal.hide();\n this.error(errMsg);\n if (error) {\n error(errMsg);\n }\n });\n } else {\n this._loadGeometry(modelId, modelInfo, null, done, error);\n }\n }\n\n _loadGeometry(modelId, modelInfo, json, done, error) {\n\n const modelLoaded = () => {\n const checkbox = document.getElementById(\"\" + modelId);\n checkbox.checked = true;\n this._numModelsLoaded++;\n this._unloadModelsButtonElement.classList.remove(\"disabled\");\n if (this._numModelsLoaded < this._numModels) {\n this._loadModelsButtonElement.classList.remove(\"disabled\");\n } else {\n this._loadModelsButtonElement.classList.add(\"disabled\");\n }\n if (this._numModelsLoaded === 1) { // Jump camera to view-fit first model loaded\n this._jumpToInitialCamera();\n this.fire(\"modelLoaded\", modelId);\n this.bimViewer._busyModal.hide();\n if (done) {\n done();\n }\n } else {\n this.fire(\"modelLoaded\", modelId);\n this.bimViewer._busyModal.hide();\n if (done) {\n done();\n }\n }\n };\n\n const loadError = (errMsg) => {\n this.bimViewer._busyModal.hide();\n this.error(errMsg);\n if (error) {\n error(errMsg);\n }\n };\n\n if (modelInfo.manifest) {\n\n // Load multi-part split model;\n // Uses the BIMViewerDataSource, which then uses the BIMViewer's Server strategy\n\n this._dataSource.setProjectId(this._projectId);\n this._dataSource.setModelId(modelId);\n\n const model = this._xktLoader.load({\n id: modelId,\n manifestSrc: modelInfo.manifest,\n excludeUnclassifiedObjects: true,\n origin: modelInfo.origin || modelInfo.position,\n scale: modelInfo.scale,\n rotation: modelInfo.rotation,\n matrix: modelInfo.matrix,\n edges: (modelInfo.edges !== false),\n saoEnabled: modelInfo.saoEnabled,\n pbrEnabled: modelInfo.pbrEnabled,\n backfaces: modelInfo.backfaces,\n globalizeObjectIds: modelInfo.globalizeObjectIds,\n reuseGeometries: (modelInfo.reuseGeometries !== false)\n });\n\n model.on(\"loaded\", modelLoaded);\n model.on(\"error\", loadError);\n\n } else {\n\n // Load single XKT/Metamodel file model;\n // Uses the BIMViewer's Server strategy directly\n\n this.server.getGeometry(this._projectId, modelId, (arraybuffer) => {\n const model = this._xktLoader.load({\n id: modelId,\n metaModelData: json,\n xkt: arraybuffer,\n excludeUnclassifiedObjects: true,\n origin: modelInfo.origin || modelInfo.position,\n scale: modelInfo.scale,\n rotation: modelInfo.rotation,\n matrix: modelInfo.matrix,\n edges: (modelInfo.edges !== false),\n saoEnabled: modelInfo.saoEnabled,\n pbrEnabled: modelInfo.pbrEnabled,\n backfaces: modelInfo.backfaces,\n globalizeObjectIds: modelInfo.globalizeObjectIds,\n reuseGeometries: (modelInfo.reuseGeometries !== false)\n });\n model.on(\"loaded\", modelLoaded);\n model.on(\"error\", loadError);\n }, loadError);\n }\n }\n\n _jumpToInitialCamera() {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const aabb = scene.getAABB(scene.visibleObjectIds);\n const diag = math.getAABB3Diag(aabb);\n const center = math.getAABB3Center(aabb, tempVec3a);\n const camera = scene.camera;\n const fitFOV = camera.perspective.fov;\n const dist = Math.abs(diag / Math.tan(45 * math.DEGTORAD));\n const dir = math.normalizeVec3((camera.yUp) ? [-0.5, -0.7071, -0.5] : [-1, 1, -1]);\n const up = math.normalizeVec3((camera.yUp) ? [-0.5, 0.7071, -0.5] : [-1, 1, 1]);\n viewer.cameraControl.pivotPos = center;\n viewer.cameraControl.planView = false;\n viewer.cameraFlight.jumpTo({\n look: center,\n eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],\n up: up,\n orthoScale: diag * 1.1\n });\n }\n\n unloadModel(modelId) {\n const model = this.viewer.scene.models[modelId];\n if (!model) {\n this.error(\"Model not loaded: \" + modelId);\n return;\n }\n model.destroy();\n const checkbox = document.getElementById(\"\" + modelId);\n checkbox.checked = false;\n const span = document.getElementById(\"span-\" + modelId);\n this._numModelsLoaded--;\n if (this._numModelsLoaded > 0) {\n this._unloadModelsButtonElement.classList.remove(\"disabled\");\n } else {\n this._unloadModelsButtonElement.classList.add(\"disabled\");\n }\n if (this._numModelsLoaded < this._numModels) {\n this._loadModelsButtonElement.classList.remove(\"disabled\");\n } else {\n this._loadModelsButtonElement.classList.add(\"disabled\");\n }\n this.fire(\"modelUnloaded\", modelId);\n }\n\n unloadAllModels() {\n const models = this.viewer.scene.models;\n const modelIds = Object.keys(models);\n for (var i = 0, len = modelIds.length; i < len; i++) {\n const modelId = modelIds[i];\n this.unloadModel(modelId);\n }\n }\n\n getNumModelsLoaded() {\n return this._numModelsLoaded;\n }\n\n _getLoadedModelIds() {\n return Object.keys(this.viewer.scene.models);\n }\n\n isModelLoaded(modelId) {\n return (!!this.viewer.scene.models[modelId]);\n }\n\n getModelsInfo() {\n return this._modelsInfo;\n }\n\n getModelInfo(modelId) {\n return this._modelsInfo[modelId];\n }\n\n setEnabled(enabled) {\n if (!enabled) {\n this._modelsTabButtonElement.classList.add(\"disabled\");\n this._unloadModelsButtonElement.classList.add(\"disabled\");\n } else {\n this._modelsTabButtonElement.classList.remove(\"disabled\");\n this._unloadModelsButtonElement.classList.remove(\"disabled\");\n }\n }\n\n /** @private */\n destroy() {\n super.destroy();\n this._xktLoader.destroy();\n }\n}\n\nexport {ModelsExplorer};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/explorer/ModelsExplorer.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 286, "kind": "variable", "name": "tempVec3a", "memberof": "src/explorer/ModelsExplorer.js", "static": true, "longname": "src/explorer/ModelsExplorer.js~tempVec3a", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/ModelsExplorer.js", "importStyle": null, "description": null, "lineNumber": 5, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 287, "kind": "class", "name": "BIMViewerDataSource", "memberof": "src/explorer/ModelsExplorer.js", "static": true, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "access": "private", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/ModelsExplorer.js", "importStyle": null, "description": "Custom data access strategy for {@link XKTLoaderPlugin}.", "lineNumber": 12, "interface": false, "ignore": true }, { "__docId__": 288, "kind": "constructor", "name": "constructor", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#constructor", "access": "public", "description": null, "lineNumber": 14, "undocument": true }, { "__docId__": 289, "kind": "member", "name": "_server", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#_server", "access": "private", "description": null, "lineNumber": 15, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 290, "kind": "method", "name": "setProjectId", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#setProjectId", "access": "public", "description": null, "lineNumber": 18, "undocument": true, "params": [ { "name": "projectId", "types": [ "*" ] } ], "return": null }, { "__docId__": 291, "kind": "member", "name": "_projectId", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#_projectId", "access": "private", "description": null, "lineNumber": 19, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 292, "kind": "method", "name": "setModelId", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#setModelId", "access": "public", "description": null, "lineNumber": 22, "undocument": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": null }, { "__docId__": 293, "kind": "member", "name": "_modelId", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#_modelId", "access": "private", "description": null, "lineNumber": 23, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 294, "kind": "method", "name": "getManifest", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#getManifest", "access": "public", "description": null, "lineNumber": 26, "undocument": true, "params": [ { "name": "src", "types": [ "*" ] }, { "name": "ok", "types": [ "*" ] }, { "name": "error", "types": [ "*" ] } ], "return": null }, { "__docId__": 295, "kind": "method", "name": "getMetaModel", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#getMetaModel", "access": "public", "description": null, "lineNumber": 30, "undocument": true, "params": [ { "name": "src", "types": [ "*" ] }, { "name": "ok", "types": [ "*" ] }, { "name": "error", "types": [ "*" ] } ], "return": null }, { "__docId__": 296, "kind": "method", "name": "getXKT", "memberof": "src/explorer/ModelsExplorer.js~BIMViewerDataSource", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~BIMViewerDataSource#getXKT", "access": "public", "description": null, "lineNumber": 34, "undocument": true, "params": [ { "name": "src", "types": [ "*" ] }, { "name": "ok", "types": [ "*" ] }, { "name": "error", "types": [ "*" ] } ], "return": null }, { "__docId__": 297, "kind": "class", "name": "ModelsExplorer", "memberof": "src/explorer/ModelsExplorer.js", "static": true, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/ModelsExplorer.js", "importStyle": "{ModelsExplorer}", "description": null, "lineNumber": 41, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 298, "kind": "constructor", "name": "constructor", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#constructor", "access": "public", "description": null, "lineNumber": 43, "undocument": true }, { "__docId__": 299, "kind": "member", "name": "_enableAddModels", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_enableAddModels", "access": "private", "description": null, "lineNumber": 59, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 300, "kind": "member", "name": "_modelsTabElement", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_modelsTabElement", "access": "private", "description": null, "lineNumber": 60, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 301, "kind": "member", "name": "_loadModelsButtonElement", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_loadModelsButtonElement", "access": "private", "description": null, "lineNumber": 61, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 302, "kind": "member", "name": "_unloadModelsButtonElement", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_unloadModelsButtonElement", "access": "private", "description": null, "lineNumber": 62, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 303, "kind": "member", "name": "_addModelButtonElement", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_addModelButtonElement", "access": "private", "description": null, "lineNumber": 63, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 304, "kind": "member", "name": "_modelsElement", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_modelsElement", "access": "private", "description": null, "lineNumber": 64, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 305, "kind": "member", "name": "_modelsTabButtonElement", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_modelsTabButtonElement", "access": "private", "description": null, "lineNumber": 65, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 306, "kind": "member", "name": "_dataSource", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_dataSource", "access": "private", "description": null, "lineNumber": 71, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 307, "kind": "member", "name": "_xktLoader", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_xktLoader", "access": "private", "description": null, "lineNumber": 73, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 308, "kind": "member", "name": "_modelsContextMenu", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_modelsContextMenu", "access": "private", "description": null, "lineNumber": 77, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 309, "kind": "member", "name": "_modelsInfo", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_modelsInfo", "access": "private", "description": null, "lineNumber": 82, "undocument": true, "ignore": true, "type": { "types": [ "{}" ] } }, { "__docId__": 310, "kind": "member", "name": "_numModels", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_numModels", "access": "private", "description": null, "lineNumber": 83, "undocument": true, "ignore": true, "type": { "types": [ "number" ] } }, { "__docId__": 311, "kind": "member", "name": "_numModelsLoaded", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_numModelsLoaded", "access": "private", "description": null, "lineNumber": 84, "undocument": true, "ignore": true, "type": { "types": [ "number" ] } }, { "__docId__": 312, "kind": "member", "name": "_projectId", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_projectId", "access": "private", "description": null, "lineNumber": 85, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 313, "kind": "method", "name": "setObjectColors", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#setObjectColors", "access": "public", "description": null, "lineNumber": 88, "undocument": true, "params": [ { "name": "objectColors", "types": [ "*" ] } ], "return": null }, { "__docId__": 314, "kind": "method", "name": "loadProject", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#loadProject", "access": "public", "description": null, "lineNumber": 92, "undocument": true, "params": [ { "name": "projectId", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] }, { "name": "error", "types": [ "*" ] } ], "return": null }, { "__docId__": 318, "kind": "method", "name": "_parseProject", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_parseProject", "access": "private", "description": null, "lineNumber": 116, "undocument": true, "ignore": true, "params": [ { "name": "projectInfo", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 319, "kind": "method", "name": "_buildModelsMenu", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_buildModelsMenu", "access": "private", "description": null, "lineNumber": 126, "undocument": true, "ignore": true, "params": [ { "name": "projectInfo", "types": [ "*" ] } ], "return": null }, { "__docId__": 322, "kind": "method", "name": "_parseViewerConfigs", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_parseViewerConfigs", "access": "private", "description": null, "lineNumber": 172, "undocument": true, "ignore": true, "params": [ { "name": "projectInfo", "types": [ "*" ] } ], "return": null }, { "__docId__": 323, "kind": "method", "name": "_parseViewerContent", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_parseViewerContent", "access": "private", "description": null, "lineNumber": 179, "undocument": true, "ignore": true, "params": [ { "name": "projectInfo", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 324, "kind": "method", "name": "_parseModelsLoaded", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_parseModelsLoaded", "access": "private", "description": null, "lineNumber": 190, "undocument": true, "ignore": true, "params": [ { "name": "viewerContent", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 325, "kind": "method", "name": "_loadNextModel", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_loadNextModel", "access": "private", "description": null, "lineNumber": 199, "undocument": true, "ignore": true, "params": [ { "name": "modelsLoaded", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 326, "kind": "method", "name": "_parseViewerState", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_parseViewerState", "access": "private", "description": null, "lineNumber": 214, "undocument": true, "ignore": true, "params": [ { "name": "projectInfo", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 327, "kind": "method", "name": "unloadProject", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#unloadProject", "access": "public", "description": null, "lineNumber": 223, "undocument": true, "params": [], "return": null }, { "__docId__": 330, "kind": "method", "name": "getLoadedProjectId", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#getLoadedProjectId", "access": "public", "description": null, "lineNumber": 249, "undocument": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 331, "kind": "method", "name": "getModelIds", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#getModelIds", "access": "public", "description": null, "lineNumber": 253, "undocument": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 332, "kind": "method", "name": "loadModel", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#loadModel", "access": "public", "description": null, "lineNumber": 257, "undocument": true, "params": [ { "name": "modelId", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] }, { "name": "error", "types": [ "*" ] } ], "return": null }, { "__docId__": 333, "kind": "method", "name": "_loadGeometry", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_loadGeometry", "access": "private", "description": null, "lineNumber": 296, "undocument": true, "ignore": true, "params": [ { "name": "modelId", "types": [ "*" ] }, { "name": "modelInfo", "types": [ "*" ] }, { "name": "json", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] }, { "name": "error", "types": [ "*" ] } ], "return": null }, { "__docId__": 334, "kind": "method", "name": "_jumpToInitialCamera", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_jumpToInitialCamera", "access": "private", "description": null, "lineNumber": 387, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 335, "kind": "method", "name": "unloadModel", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#unloadModel", "access": "public", "description": null, "lineNumber": 408, "undocument": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": null }, { "__docId__": 336, "kind": "method", "name": "unloadAllModels", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#unloadAllModels", "access": "public", "description": null, "lineNumber": 432, "undocument": true, "params": [], "return": null }, { "__docId__": 337, "kind": "method", "name": "getNumModelsLoaded", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#getNumModelsLoaded", "access": "public", "description": null, "lineNumber": 441, "undocument": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 338, "kind": "method", "name": "_getLoadedModelIds", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#_getLoadedModelIds", "access": "private", "description": null, "lineNumber": 445, "undocument": true, "ignore": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 339, "kind": "method", "name": "isModelLoaded", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#isModelLoaded", "access": "public", "description": null, "lineNumber": 449, "undocument": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": { "types": [ "*" ] } }, { "__docId__": 340, "kind": "method", "name": "getModelsInfo", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#getModelsInfo", "access": "public", "description": null, "lineNumber": 453, "undocument": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 341, "kind": "method", "name": "getModelInfo", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#getModelInfo", "access": "public", "description": null, "lineNumber": 457, "undocument": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": { "types": [ "*" ] } }, { "__docId__": 342, "kind": "method", "name": "setEnabled", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#setEnabled", "access": "public", "description": null, "lineNumber": 461, "undocument": true, "params": [ { "name": "enabled", "types": [ "*" ] } ], "return": null }, { "__docId__": 343, "kind": "method", "name": "destroy", "memberof": "src/explorer/ModelsExplorer.js~ModelsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ModelsExplorer.js~ModelsExplorer#destroy", "access": "private", "description": null, "lineNumber": 472, "ignore": true, "params": [], "return": null }, { "__docId__": 344, "kind": "file", "name": "src/explorer/ObjectsExplorer.js", "content": "import {TreeViewPlugin} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\nimport {TreeViewContextMenu} from \"../contextMenus/TreeViewContextMenu.js\";\nimport {Controller} from \"../Controller.js\";\n\n/** @private */\nclass ObjectsExplorer extends Controller {\n\n constructor(parent, cfg = {}) {\n\n super(parent);\n\n if (!cfg.objectsTabElement) {\n throw \"Missing config: objectsTabElement\";\n }\n\n if (!cfg.showAllObjectsButtonElement) {\n throw \"Missing config: showAllObjectsButtonElement\";\n }\n\n if (!cfg.hideAllObjectsButtonElement) {\n throw \"Missing config: hideAllObjectsButtonElement\";\n }\n\n if (!cfg.objectsElement) {\n throw \"Missing config: objectsElement\";\n }\n\n this._objectsTabElement = cfg.objectsTabElement;\n this._showAllObjectsButtonElement = cfg.showAllObjectsButtonElement;\n this._hideAllObjectsButtonElement = cfg.hideAllObjectsButtonElement;\n this._objectsTabButtonElement = this._objectsTabElement.querySelector(\".xeokit-tab-btn\");\n\n if (!this._objectsTabButtonElement) {\n throw \"Missing DOM element: ,xeokit-tab-btn\";\n }\n\n const objectsElement = cfg.objectsElement;\n\n this._treeView = new TreeViewPlugin(this.viewer, {\n containerElement: objectsElement,\n hierarchy: \"containment\",\n autoAddModels: false,\n pruneEmptyNodes: true\n });\n\n this._treeViewContextMenu = new TreeViewContextMenu(this.bimViewer, {\n hideOnAction: true\n });\n\n this._treeView.on(\"contextmenu\", (e) => {\n this._treeViewContextMenu.context = {\n bimViewer: this.bimViewer,\n viewer: e.viewer,\n treeViewPlugin: e.treeViewPlugin,\n treeViewNode: e.treeViewNode\n };\n this._treeViewContextMenu.show(e.event.pageX, e.event.pageY);\n });\n\n this._treeView.on(\"nodeTitleClicked\", (e) => {\n const scene = this.viewer.scene;\n const objectIds = [];\n e.treeViewPlugin.withNodeTree(e.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n objectIds.push(treeViewNode.objectId);\n }\n });\n const checked = e.treeViewNode.checked;\n if (checked) {\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, false);\n scene.setObjectsPickable(objectIds, true);\n } else {\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, true);\n scene.setObjectsPickable(objectIds, true);\n }\n });\n\n this._onModelLoaded = this.viewer.scene.on(\"modelLoaded\", (modelId) => {\n if (this.viewer.metaScene.metaModels[modelId]) {\n const modelInfo = this.bimViewer._modelsExplorer.getModelInfo(modelId);\n if (!modelInfo) {\n return;\n }\n this._treeView.addModel(modelId, {\n rootName: modelInfo.name\n });\n }\n });\n\n this._onModelUnloaded = this.viewer.scene.on(\"modelUnloaded\", (modelId) => {\n if (this.viewer.metaScene.metaModels[modelId]) {\n this._treeView.removeModel(modelId);\n }\n });\n\n this.bimViewer.on(\"reset\", () => {\n this._treeView.collapse();\n });\n }\n\n setEnabled(enabled) {\n if (!enabled) {\n this._objectsTabButtonElement.classList.add(\"disabled\");\n this._showAllObjectsButtonElement.classList.add(\"disabled\");\n this._hideAllObjectsButtonElement.classList.add(\"disabled\");\n } else {\n this._objectsTabButtonElement.classList.remove(\"disabled\");\n this._showAllObjectsButtonElement.classList.remove(\"disabled\");\n this._hideAllObjectsButtonElement.classList.remove(\"disabled\");\n }\n }\n\n expandTreeViewToDepth(depth) {\n this._treeView.expandToDepth(depth);\n }\n\n showNodeInTreeView(objectId) {\n this._treeView.collapse();\n this._treeView.showNode(objectId);\n }\n\n unShowNodeInTreeView() {\n this._treeView.unShowNode();\n }\n\n destroy() {\n super.destroy();\n this._treeView.destroy();\n this._treeViewContextMenu.destroy();\n this.viewer.scene.off(this._onModelLoaded);\n this.viewer.scene.off(this._onModelUnloaded);\n }\n}\n\nexport {ObjectsExplorer};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/explorer/ObjectsExplorer.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 345, "kind": "class", "name": "ObjectsExplorer", "memberof": "src/explorer/ObjectsExplorer.js", "static": true, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/ObjectsExplorer.js", "importStyle": "{ObjectsExplorer}", "description": null, "lineNumber": 6, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 346, "kind": "constructor", "name": "constructor", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#constructor", "access": "public", "description": null, "lineNumber": 8, "undocument": true }, { "__docId__": 347, "kind": "member", "name": "_objectsTabElement", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_objectsTabElement", "access": "private", "description": null, "lineNumber": 28, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 348, "kind": "member", "name": "_showAllObjectsButtonElement", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_showAllObjectsButtonElement", "access": "private", "description": null, "lineNumber": 29, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 349, "kind": "member", "name": "_hideAllObjectsButtonElement", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_hideAllObjectsButtonElement", "access": "private", "description": null, "lineNumber": 30, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 350, "kind": "member", "name": "_objectsTabButtonElement", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_objectsTabButtonElement", "access": "private", "description": null, "lineNumber": 31, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 351, "kind": "member", "name": "_treeView", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_treeView", "access": "private", "description": null, "lineNumber": 39, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 352, "kind": "member", "name": "_treeViewContextMenu", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_treeViewContextMenu", "access": "private", "description": null, "lineNumber": 46, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 353, "kind": "member", "name": "_onModelLoaded", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_onModelLoaded", "access": "private", "description": null, "lineNumber": 80, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 354, "kind": "member", "name": "_onModelUnloaded", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#_onModelUnloaded", "access": "private", "description": null, "lineNumber": 92, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 355, "kind": "method", "name": "setEnabled", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#setEnabled", "access": "public", "description": null, "lineNumber": 103, "undocument": true, "params": [ { "name": "enabled", "types": [ "*" ] } ], "return": null }, { "__docId__": 356, "kind": "method", "name": "expandTreeViewToDepth", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#expandTreeViewToDepth", "access": "public", "description": null, "lineNumber": 115, "undocument": true, "params": [ { "name": "depth", "types": [ "*" ] } ], "return": null }, { "__docId__": 357, "kind": "method", "name": "showNodeInTreeView", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#showNodeInTreeView", "access": "public", "description": null, "lineNumber": 119, "undocument": true, "params": [ { "name": "objectId", "types": [ "*" ] } ], "return": null }, { "__docId__": 358, "kind": "method", "name": "unShowNodeInTreeView", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#unShowNodeInTreeView", "access": "public", "description": null, "lineNumber": 124, "undocument": true, "params": [], "return": null }, { "__docId__": 359, "kind": "method", "name": "destroy", "memberof": "src/explorer/ObjectsExplorer.js~ObjectsExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/ObjectsExplorer.js~ObjectsExplorer#destroy", "access": "public", "description": null, "lineNumber": 128, "undocument": true, "params": [], "return": null }, { "__docId__": 360, "kind": "file", "name": "src/explorer/StoreysExplorer.js", "content": "import {TreeViewPlugin, math} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\nimport {Controller} from \"../Controller.js\";\nimport {TreeViewContextMenu} from \"../contextMenus/TreeViewContextMenu.js\";\n\nconst tempVec3 = math.vec3();\n\n/** @private */\nclass StoreysExplorer extends Controller {\n\n constructor(parent, cfg = {}) {\n\n super(parent);\n\n if (!cfg.storeysTabElement) {\n throw \"Missing config: storeysTabElement\";\n }\n\n if (!cfg.showAllStoreysButtonElement) {\n throw \"Missing config: showAllStoreysButtonElement\";\n }\n\n if (!cfg.hideAllStoreysButtonElement) {\n throw \"Missing config: hideAllStoreysButtonElement\";\n }\n\n if (!cfg.storeysElement) {\n throw \"Missing config: storeysElement\";\n }\n\n this._storeysTabElement = cfg.storeysTabElement;\n this._showAllStoreysButtonElement = cfg.showAllStoreysButtonElement;\n this._hideAllStoreysButtonElement = cfg.hideAllStoreysButtonElement;\n this._storeysTabButtonElement = this._storeysTabElement.querySelector(\".xeokit-tab-btn\");\n\n if (!this._storeysTabButtonElement) {\n throw \"Missing DOM element: .xeokit-tab-btn\";\n }\n\n const storeysElement = cfg.storeysElement;\n\n this._treeView = new TreeViewPlugin(this.viewer, {\n containerElement: storeysElement,\n autoAddModels: false,\n hierarchy: \"storeys\",\n autoExpandDepth: 1\n });\n\n this._treeViewContextMenu = new TreeViewContextMenu(this.bimViewer, {\n hideOnAction: true\n });\n\n this._treeView.on(\"contextmenu\", (e) => {\n this._treeViewContextMenu.context = {\n bimViewer: this.bimViewer,\n viewer: e.viewer,\n treeViewPlugin: e.treeViewPlugin,\n treeViewNode: e.treeViewNode,\n pruneEmptyNodes: true\n };\n this._treeViewContextMenu.show(e.event.pageX, e.event.pageY);\n });\n\n this._treeView.on(\"nodeTitleClicked\", (e) => {\n const scene = this.viewer.scene;\n const objectIds = [];\n e.treeViewPlugin.withNodeTree(e.treeViewNode, (treeViewNode) => {\n if (treeViewNode.objectId) {\n objectIds.push(treeViewNode.objectId);\n }\n });\n const checked = e.treeViewNode.checked;\n if (checked) {\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, false);\n scene.setObjectsPickable(objectIds, true);\n } else {\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, true);\n scene.setObjectsPickable(objectIds, true);\n }\n });\n\n this._onModelLoaded = this.viewer.scene.on(\"modelLoaded\", (modelId) =>{\n const modelInfo = this.bimViewer._modelsExplorer.getModelInfo(modelId);\n if (!modelInfo) {\n return;\n }\n this._treeView.addModel(modelId, {\n rootName: modelInfo.name\n });\n });\n\n this._onModelUnloaded = this.viewer.scene.on(\"modelUnloaded\", (modelId) => {\n if (this.viewer.metaScene.metaModels[modelId]) {\n this._treeView.removeModel(modelId);\n }\n });\n\n this.bimViewer.on(\"reset\", () => {\n this._treeView.collapse();\n this._treeView.expandToDepth(1);\n });\n }\n\n setEnabled(enabled) {\n if (!enabled) {\n this._storeysTabButtonElement.classList.add(\"disabled\");\n this._showAllStoreysButtonElement.classList.add(\"disabled\");\n this._hideAllStoreysButtonElement.classList.add(\"disabled\");\n } else {\n this._storeysTabButtonElement.classList.remove(\"disabled\");\n this._showAllStoreysButtonElement.classList.remove(\"disabled\");\n this._hideAllStoreysButtonElement.classList.remove(\"disabled\");\n }\n }\n\n expandTreeViewToDepth(depth) {\n this._treeView.expandToDepth(depth);\n }\n\n showNodeInTreeView(objectId) {\n this._treeView.collapse();\n this._treeView.showNode(objectId);\n }\n\n unShowNodeInTreeView() {\n this._treeView.unShowNode();\n }\n\n selectStorey(storeyObjectId, done) {\n const metaScene = this.viewer.metaScene;\n const storeyMetaObject = metaScene.metaObjects[storeyObjectId];\n if (!storeyMetaObject) {\n this.error(\"selectStorey() - object is not found: '\" + storeyObjectId + \"'\");\n return;\n }\n if (storeyMetaObject.type !== \"IfcBuildingStorey\") {\n this.error(\"selectStorey() - object is not found: '\" + storeyObjectId + \"'\");\n return;\n }\n const objectIds = storeyMetaObject.getObjectIDsInSubtree();\n this._selectObjects(objectIds, done);\n }\n\n _selectObjects(objectIds, done) {\n const scene = this.viewer.scene;\n const aabb = scene.getAABB(objectIds);\n\n this.viewer.cameraControl.pivotPos = math.getAABB3Center(aabb, tempVec3);\n\n if (done) {\n\n scene.setObjectsXRayed(scene.objectIds, true);\n scene.setObjectsVisible(scene.objectIds, true);\n scene.setObjectsPickable(scene.objectIds, false);\n scene.setObjectsSelected(scene.selectedObjectIds, false);\n\n scene.setObjectsXRayed(objectIds, false);\n scene.setObjectsVisible(objectIds, true);\n scene.setObjectsPickable(objectIds, true);\n\n this.viewer.cameraFlight.flyTo({\n aabb: aabb\n }, () => {\n setTimeout(function () {\n scene.setObjectsVisible(scene.xrayedObjectIds, false);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n }, 500);\n done();\n });\n } else {\n\n scene.setObjectsVisible(scene.objectIds, false);\n scene.setObjectsPickable(scene.xrayedObjectIds, true);\n scene.setObjectsXRayed(scene.xrayedObjectIds, false);\n scene.setObjectsSelected(scene.selectedObjectIds, false);\n\n scene.setObjectsVisible(objectIds, true);\n\n this.viewer.cameraFlight.jumpTo({\n aabb: aabb\n });\n }\n }\n\n destroy() {\n super.destroy();\n this._treeView.destroy();\n this._treeViewContextMenu.destroy();\n this.viewer.scene.off(this._onModelLoaded);\n this.viewer.scene.off(this._onModelUnloaded);\n }\n}\n\nexport {StoreysExplorer};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/explorer/StoreysExplorer.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 361, "kind": "variable", "name": "tempVec3", "memberof": "src/explorer/StoreysExplorer.js", "static": true, "longname": "src/explorer/StoreysExplorer.js~tempVec3", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/StoreysExplorer.js", "importStyle": null, "description": null, "lineNumber": 5, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 362, "kind": "class", "name": "StoreysExplorer", "memberof": "src/explorer/StoreysExplorer.js", "static": true, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/explorer/StoreysExplorer.js", "importStyle": "{StoreysExplorer}", "description": null, "lineNumber": 8, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 363, "kind": "constructor", "name": "constructor", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#constructor", "access": "public", "description": null, "lineNumber": 10, "undocument": true }, { "__docId__": 364, "kind": "member", "name": "_storeysTabElement", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_storeysTabElement", "access": "private", "description": null, "lineNumber": 30, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 365, "kind": "member", "name": "_showAllStoreysButtonElement", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_showAllStoreysButtonElement", "access": "private", "description": null, "lineNumber": 31, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 366, "kind": "member", "name": "_hideAllStoreysButtonElement", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_hideAllStoreysButtonElement", "access": "private", "description": null, "lineNumber": 32, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 367, "kind": "member", "name": "_storeysTabButtonElement", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_storeysTabButtonElement", "access": "private", "description": null, "lineNumber": 33, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 368, "kind": "member", "name": "_treeView", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_treeView", "access": "private", "description": null, "lineNumber": 41, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 369, "kind": "member", "name": "_treeViewContextMenu", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_treeViewContextMenu", "access": "private", "description": null, "lineNumber": 48, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 370, "kind": "member", "name": "_onModelLoaded", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_onModelLoaded", "access": "private", "description": null, "lineNumber": 83, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 371, "kind": "member", "name": "_onModelUnloaded", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_onModelUnloaded", "access": "private", "description": null, "lineNumber": 93, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 372, "kind": "method", "name": "setEnabled", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#setEnabled", "access": "public", "description": null, "lineNumber": 105, "undocument": true, "params": [ { "name": "enabled", "types": [ "*" ] } ], "return": null }, { "__docId__": 373, "kind": "method", "name": "expandTreeViewToDepth", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#expandTreeViewToDepth", "access": "public", "description": null, "lineNumber": 117, "undocument": true, "params": [ { "name": "depth", "types": [ "*" ] } ], "return": null }, { "__docId__": 374, "kind": "method", "name": "showNodeInTreeView", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#showNodeInTreeView", "access": "public", "description": null, "lineNumber": 121, "undocument": true, "params": [ { "name": "objectId", "types": [ "*" ] } ], "return": null }, { "__docId__": 375, "kind": "method", "name": "unShowNodeInTreeView", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#unShowNodeInTreeView", "access": "public", "description": null, "lineNumber": 126, "undocument": true, "params": [], "return": null }, { "__docId__": 376, "kind": "method", "name": "selectStorey", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#selectStorey", "access": "public", "description": null, "lineNumber": 130, "undocument": true, "params": [ { "name": "storeyObjectId", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 377, "kind": "method", "name": "_selectObjects", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#_selectObjects", "access": "private", "description": null, "lineNumber": 145, "undocument": true, "ignore": true, "params": [ { "name": "objectIds", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 378, "kind": "method", "name": "destroy", "memberof": "src/explorer/StoreysExplorer.js~StoreysExplorer", "generator": false, "async": false, "static": false, "longname": "src/explorer/StoreysExplorer.js~StoreysExplorer#destroy", "access": "public", "description": null, "lineNumber": 186, "undocument": true, "params": [], "return": null }, { "__docId__": 379, "kind": "file", "name": "src/inspector/PropertiesInspector.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass PropertiesInspector extends Controller {\n\n constructor(parent, cfg = {}) {\n\n super(parent);\n\n if (!cfg.propertiesTabElement) {\n throw \"Missing config: propertiesTabElement\";\n }\n\n if (!cfg.propertiesElement) {\n throw \"Missing config: propertiesElement\";\n }\n\n this._metaObject = null;\n\n this._propertiesTabElement = cfg.propertiesTabElement;\n this._propertiesElement = cfg.propertiesElement;\n this._propertiesTabButtonElement = this._propertiesTabElement.querySelector(\".xeokit-tab-btn\");\n\n if (!this._propertiesTabButtonElement) {\n throw \"Missing DOM element: ,xeokit-tab-btn\";\n }\n\n this._onModelUnloaded = this.viewer.scene.on(\"modelUnloaded\", (modelId) => {\n if (this._metaObject) {\n const metaModels = this._metaObject.metaModels;\n for (let i = 0, len = metaModels.length; i < len; i++) {\n if (metaModels[i].id === modelId) {\n this.clear();\n return;\n }\n }\n }\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.clear();\n });\n\n document.addEventListener('click', this._clickListener = (e) => {\n if (!e.target.matches('.xeokit-accordion .xeokit-accordion-button')) {\n return;\n } else {\n if (!e.target.parentElement.classList.contains('active')) {\n e.target.parentElement.classList.add('active');\n } else {\n e.target.parentElement.classList.remove('active');\n }\n }\n });\n\n this.clear();\n }\n\n showObjectPropertySets(objectId) {\n const metaObject = this.viewer.metaScene.metaObjects[objectId];\n if (!metaObject) {\n return;\n }\n const propertySets = metaObject.propertySets;\n if (propertySets && propertySets.length > 0) {\n this._setPropertySets(metaObject, propertySets);\n } else {\n this._setPropertySets(metaObject);\n }\n this._metaObject = metaObject;\n }\n\n clear() {\n const html = [],\n localizedText = this.viewer.localeService.translate('propertiesInspector.noObjectSelectedWarning') || 'No object inspected. Right-click or long-tab an object and select \\'Inspect Properties\\' to view its properties here.';\n html.push(`
`);\n html.push(`

${localizedText}

`);\n html.push(`
`);\n const htmlStr = html.join(\"\");\n this._propertiesElement.innerHTML = htmlStr;\n }\n\n _setPropertySets(metaObject, propertySets) {\n const html = [];\n html.push(`
`);\n if (!metaObject) {\n html.push(`

No object selected

`);\n } else {\n html.push('');\n html.push(``);\n if (metaObject.type) {\n html.push(``);\n }\n html.push(``);\n html.push(``);\n const attributes = metaObject.attributes;\n if (attributes) {\n for (let key in attributes) {\n html.push(``);\n }\n }\n html.push('
Name:${metaObject.name}
Class:${metaObject.type}
UUID:${metaObject.originalSystemId}
Viewer ID:${metaObject.id}
${capitalizeFirstChar(key)}:${attributes[key]}
');\n if (!propertySets || propertySets.length === 0) {\n const localizedText = this.viewer.localeService.translate('propertiesInspector.noPropSetWarning') || 'No properties sets found for this object';\n html.push(`

${localizedText}

`);\n html.push(`
`);\n } else {\n html.push(``);\n html.push(`
`);\n for (let i = 0, len = propertySets.length; i < len; i++) {\n const propertySet = propertySets[i];\n const properties = propertySet.properties || [];\n if (properties.length > 0) {\n html.push(`
\n

${propertySet.name}

\n
\n `);\n for (let i = 0, len = properties.length; i < len; i++) {\n const property = properties[i];\n html.push(``);\n }\n html.push(`
${property.name || property.label}:${property.value}
\n
\n
`);\n } else {\n // html.push(`

No properties sets found.

`);\n }\n }\n html.push(`
`);\n }\n }\n this._propertiesElement.innerHTML = html.join(\"\");\n }\n\n setEnabled(enabled) {\n if (!enabled) {\n this._propertiesTabButtonElement.classList.add(\"disabled\");\n } else {\n this._propertiesTabButtonElement.classList.remove(\"disabled\");\n }\n }\n\n destroy() {\n super.destroy();\n this.viewer.scene.off(this._onModelLoaded);\n this.viewer.scene.off(this._onModelUnloaded);\n document.removeEventListener('click', this._clickListener);\n }\n}\n\nfunction capitalizeFirstChar(str) {\n if (!str) {\n return str;\n }\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport {PropertiesInspector};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/inspector/PropertiesInspector.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 380, "kind": "function", "name": "capitalizeFirstChar", "memberof": "src/inspector/PropertiesInspector.js", "generator": false, "async": false, "static": true, "longname": "src/inspector/PropertiesInspector.js~capitalizeFirstChar", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/inspector/PropertiesInspector.js", "importStyle": null, "description": null, "lineNumber": 151, "undocument": true, "params": [ { "name": "str", "types": [ "*" ] } ], "return": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 381, "kind": "class", "name": "PropertiesInspector", "memberof": "src/inspector/PropertiesInspector.js", "static": true, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/inspector/PropertiesInspector.js", "importStyle": "{PropertiesInspector}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 382, "kind": "constructor", "name": "constructor", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "generator": false, "async": false, "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 383, "kind": "member", "name": "_metaObject", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#_metaObject", "access": "private", "description": null, "lineNumber": 18, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 384, "kind": "member", "name": "_propertiesTabElement", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#_propertiesTabElement", "access": "private", "description": null, "lineNumber": 20, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 385, "kind": "member", "name": "_propertiesElement", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#_propertiesElement", "access": "private", "description": null, "lineNumber": 21, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 386, "kind": "member", "name": "_propertiesTabButtonElement", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#_propertiesTabButtonElement", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 387, "kind": "member", "name": "_onModelUnloaded", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#_onModelUnloaded", "access": "private", "description": null, "lineNumber": 28, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 388, "kind": "method", "name": "showObjectPropertySets", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "generator": false, "async": false, "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#showObjectPropertySets", "access": "public", "description": null, "lineNumber": 59, "undocument": true, "params": [ { "name": "objectId", "types": [ "*" ] } ], "return": null }, { "__docId__": 390, "kind": "method", "name": "clear", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "generator": false, "async": false, "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#clear", "access": "public", "description": null, "lineNumber": 73, "undocument": true, "params": [], "return": null }, { "__docId__": 391, "kind": "method", "name": "_setPropertySets", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "generator": false, "async": false, "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#_setPropertySets", "access": "private", "description": null, "lineNumber": 83, "undocument": true, "ignore": true, "params": [ { "name": "metaObject", "types": [ "*" ] }, { "name": "propertySets", "types": [ "*" ] } ], "return": null }, { "__docId__": 392, "kind": "method", "name": "setEnabled", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "generator": false, "async": false, "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#setEnabled", "access": "public", "description": null, "lineNumber": 135, "undocument": true, "params": [ { "name": "enabled", "types": [ "*" ] } ], "return": null }, { "__docId__": 393, "kind": "method", "name": "destroy", "memberof": "src/inspector/PropertiesInspector.js~PropertiesInspector", "generator": false, "async": false, "static": false, "longname": "src/inspector/PropertiesInspector.js~PropertiesInspector#destroy", "access": "public", "description": null, "lineNumber": 143, "undocument": true, "params": [], "return": null }, { "__docId__": 394, "kind": "file", "name": "src/server/Server.js", "content": "import {utils} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\n/**\n * Default server client which loads content for a {@link BIMViewer} via HTTP from the file system.\n *\n * A BIMViewer is instantiated with an instance of this class.\n *\n * To load content from an alternative source, instantiate BIMViewer with your own custom implementation of this class.\n */\nclass Server {\n\n /**\n * Constructs a Server.\n *\n * @param {*} [cfg] Server configuration.\n * @param {String} [cfg.dataDir] Base directory for content.\n */\n constructor(cfg = {}) {\n this._dataDir = cfg.dataDir || \"\";\n }\n\n /**\n * Gets information on all available projects.\n *\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getProjects(done, error) {\n const url = this._dataDir + \"/projects/index.json\";\n utils.loadJSON(url, done, error);\n }\n\n /**\n * Gets information for a project.\n *\n * @param {String} projectId ID of the project.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getProject(projectId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/index.json\";\n utils.loadJSON(url, done, error);\n }\n\n /**\n * Gets metadata for a model within a project.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getMetadata(projectId, modelId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/metadata.json\";\n utils.loadJSON(url, done, error);\n }\n\n /**\n * Gets geometry for a model within a project.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getGeometry(projectId, modelId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/geometry.xkt\";\n utils.loadArraybuffer(url, done, error);\n }\n\n /**\n * Gets metadata for an object within a model within a project.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {String} objectId ID of the object.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getObjectInfo(projectId, modelId, objectId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/props/\" + objectId + \".json\";\n utils.loadJSON(url, done, error);\n }\n\n /**\n * Gets existing issues for a model within a project.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getIssues(projectId, modelId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/issues.json\";\n utils.loadJSON(url, done, error);\n }\n\n\n /**\n * Gets a JSON manifest file for a model that's split into multiple XKT files (and maybe also JSON metadata files).\n *\n * The manifest can have an arbitrary name, and will list all the XKT (and maybe separate JSON metada files)\n * that comprise the model.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {String} manifestName Filename of the manifest.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getSplitModelManifest(projectId, modelId, manifestName, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/\" + manifestName;\n utils.loadJSON(url, done, error);\n }\n\n /**\n * Gets one of the metadata files within a split model within a project.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {String} metadataFileName Filename of the metadata file.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getSplitModelMetadata(projectId, modelId, metadataFileName, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/\" + metadataFileName;\n utils.loadJSON(url, done, error);\n }\n\n /**\n * Gets one of the XKT geometry files within a split model within a project.\n *\n * @param {String} projectId ID of the project.\n * @param {String} modelId ID of the model.\n * @param {String} geometryFileName Filename of the XKT geometry file.\n * @param {Function} done Callback through which the JSON result is returned.\n * @param {Function} error Callback through which an error message is returned on error.\n */\n getSplitModelGeometry(projectId, modelId, geometryFileName, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/models/\" + modelId + \"/\" + geometryFileName;\n utils.loadArraybuffer(url, done, error);\n }\n}\n\nexport {Server};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/server/Server.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 395, "kind": "class", "name": "Server", "memberof": "src/server/Server.js", "static": true, "longname": "src/server/Server.js~Server", "access": "public", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/server/Server.js", "importStyle": "{Server}", "description": "Default server client which loads content for a {@link BIMViewer} via HTTP from the file system.\n\nA BIMViewer is instantiated with an instance of this class.\n\nTo load content from an alternative source, instantiate BIMViewer with your own custom implementation of this class.", "lineNumber": 10, "interface": false }, { "__docId__": 396, "kind": "constructor", "name": "constructor", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#constructor", "access": "public", "description": "Constructs a Server.", "lineNumber": 18, "params": [ { "nullable": null, "types": [ "*" ], "spread": false, "optional": true, "name": "cfg", "description": "Server configuration." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": true, "name": "cfg.dataDir", "description": "Base directory for content." } ] }, { "__docId__": 397, "kind": "member", "name": "_dataDir", "memberof": "src/server/Server.js~Server", "static": false, "longname": "src/server/Server.js~Server#_dataDir", "access": "private", "description": null, "lineNumber": 19, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 398, "kind": "method", "name": "getProjects", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getProjects", "access": "public", "description": "Gets information on all available projects.", "lineNumber": 28, "params": [ { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 399, "kind": "method", "name": "getProject", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getProject", "access": "public", "description": "Gets information for a project.", "lineNumber": 40, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 400, "kind": "method", "name": "getMetadata", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getMetadata", "access": "public", "description": "Gets metadata for a model within a project.", "lineNumber": 53, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 401, "kind": "method", "name": "getGeometry", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getGeometry", "access": "public", "description": "Gets geometry for a model within a project.", "lineNumber": 66, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 402, "kind": "method", "name": "getObjectInfo", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getObjectInfo", "access": "public", "description": "Gets metadata for an object within a model within a project.", "lineNumber": 80, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "objectId", "description": "ID of the object." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 403, "kind": "method", "name": "getIssues", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getIssues", "access": "public", "description": "Gets existing issues for a model within a project.", "lineNumber": 93, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 404, "kind": "method", "name": "getSplitModelManifest", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getSplitModelManifest", "access": "public", "description": "Gets a JSON manifest file for a model that's split into multiple XKT files (and maybe also JSON metadata files).\n\nThe manifest can have an arbitrary name, and will list all the XKT (and maybe separate JSON metada files)\nthat comprise the model.", "lineNumber": 111, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "manifestName", "description": "Filename of the manifest." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 405, "kind": "method", "name": "getSplitModelMetadata", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getSplitModelMetadata", "access": "public", "description": "Gets one of the metadata files within a split model within a project.", "lineNumber": 125, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "metadataFileName", "description": "Filename of the metadata file." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 406, "kind": "method", "name": "getSplitModelGeometry", "memberof": "src/server/Server.js~Server", "generator": false, "async": false, "static": false, "longname": "src/server/Server.js~Server#getSplitModelGeometry", "access": "public", "description": "Gets one of the XKT geometry files within a split model within a project.", "lineNumber": 139, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "projectId", "description": "ID of the project." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "modelId", "description": "ID of the model." }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "geometryFileName", "description": "Filename of the XKT geometry file." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "done", "description": "Callback through which the JSON result is returned." }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "error", "description": "Callback through which an error message is returned on error." } ], "return": null }, { "__docId__": 407, "kind": "file", "name": "src/toolbar/FirstPersonMode.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass FirstPersonMode extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n const buttonElement = cfg.buttonElement;\n const cameraControl = this.viewer.cameraControl;\n const cameraControlNavModeMediator = cfg.cameraControlNavModeMediator;\n\n cameraControl.navMode = \"orbit\";\n cameraControl.followPointer = true;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n buttonElement.classList.add(\"disabled\");\n } else {\n buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n buttonElement.classList.add(\"active\");\n } else {\n buttonElement.classList.remove(\"active\");\n }\n });\n\n this.on(\"active\", (active) => {\n cameraControlNavModeMediator.setFirstPersonModeActive(active);\n if (active) {\n cameraControl.followPointer = true;\n cameraControl.pivoting = false;\n } else {\n cameraControl.pivoting = true;\n }\n });\n\n buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n const active = this.getActive();\n this.setActive(!active);\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", ()=>{\n this.setActive(false);\n });\n }\n}\n\nexport {FirstPersonMode};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/FirstPersonMode.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 408, "kind": "class", "name": "FirstPersonMode", "memberof": "src/toolbar/FirstPersonMode.js", "static": true, "longname": "src/toolbar/FirstPersonMode.js~FirstPersonMode", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/FirstPersonMode.js", "importStyle": "{FirstPersonMode}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 409, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/FirstPersonMode.js~FirstPersonMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FirstPersonMode.js~FirstPersonMode#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 410, "kind": "file", "name": "src/toolbar/FitAction.js", "content": "import {Controller} from \"../Controller.js\";\nimport {math} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nconst tempVec3 = math.vec3();\n\n/** @private */\nclass FitAction extends Controller {\n\n constructor(parent, cfg={}) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n const buttonElement = cfg.buttonElement;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n buttonElement.classList.add(\"disabled\");\n } else {\n buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n buttonElement.classList.add(\"active\");\n } else {\n buttonElement.classList.remove(\"active\");\n }\n });\n\n buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.fit();\n }\n event.preventDefault();\n });\n }\n\n fit() {\n const scene = this.viewer.scene;\n const aabb = scene.getAABB(scene.visibleObjectIds);\n this.viewer.cameraFlight.flyTo({\n aabb: aabb\n });\n this.viewer.cameraControl.pivotPos = math.getAABB3Center(aabb, tempVec3);\n }\n\n set fov(fov) {\n this.viewer.scene.cameraFlight.fitFOV = fov;\n }\n\n get fov() {\n return this.viewer.scene.cameraFlight.fitFOV;\n }\n\n set duration(duration) {\n this.viewer.scene.cameraFlight.duration = duration;\n }\n\n get duration() {\n return this.viewer.scene.cameraFlight.duration;\n }\n}\n\nexport {FitAction};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/FitAction.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 411, "kind": "variable", "name": "tempVec3", "memberof": "src/toolbar/FitAction.js", "static": true, "longname": "src/toolbar/FitAction.js~tempVec3", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/FitAction.js", "importStyle": null, "description": null, "lineNumber": 4, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 412, "kind": "class", "name": "FitAction", "memberof": "src/toolbar/FitAction.js", "static": true, "longname": "src/toolbar/FitAction.js~FitAction", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/FitAction.js", "importStyle": "{FitAction}", "description": null, "lineNumber": 7, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 413, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/FitAction.js~FitAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FitAction.js~FitAction#constructor", "access": "public", "description": null, "lineNumber": 9, "undocument": true }, { "__docId__": 414, "kind": "method", "name": "fit", "memberof": "src/toolbar/FitAction.js~FitAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FitAction.js~FitAction#fit", "access": "public", "description": null, "lineNumber": 43, "undocument": true, "params": [], "return": null }, { "__docId__": 415, "kind": "set", "name": "fov", "memberof": "src/toolbar/FitAction.js~FitAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FitAction.js~FitAction#fov", "access": "public", "description": null, "lineNumber": 52, "undocument": true }, { "__docId__": 416, "kind": "get", "name": "fov", "memberof": "src/toolbar/FitAction.js~FitAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FitAction.js~FitAction#fov", "access": "public", "description": null, "lineNumber": 56, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 417, "kind": "set", "name": "duration", "memberof": "src/toolbar/FitAction.js~FitAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FitAction.js~FitAction#duration", "access": "public", "description": null, "lineNumber": 60, "undocument": true }, { "__docId__": 418, "kind": "get", "name": "duration", "memberof": "src/toolbar/FitAction.js~FitAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/FitAction.js~FitAction#duration", "access": "public", "description": null, "lineNumber": 64, "undocument": true, "type": { "types": [ "*" ] } }, { "__docId__": 419, "kind": "file", "name": "src/toolbar/HideTool.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass HideTool extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n const buttonElement = cfg.buttonElement;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n buttonElement.classList.add(\"disabled\");\n } else {\n buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n buttonElement.classList.add(\"active\");\n this.viewer.cameraControl.doublePickFlyTo = false;\n this._onPick = this.viewer.cameraControl.on(\"picked\", (pickResult) => {\n if (!pickResult.entity) {\n return;\n }\n pickResult.entity.visible = false;\n });\n } else {\n buttonElement.classList.remove(\"active\");\n this.viewer.cameraControl.doublePickFlyTo = false;\n if (this._onPick !== undefined) {\n this.viewer.cameraControl.off(this._onPick);\n this._onPick = undefined;\n }\n }\n });\n\n buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.bimViewer._sectionTool.hideControl();\n const active = this.getActive();\n this.setActive(!active);\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.setActive(false);\n });\n }\n}\n\nexport {HideTool};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/HideTool.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 420, "kind": "class", "name": "HideTool", "memberof": "src/toolbar/HideTool.js", "static": true, "longname": "src/toolbar/HideTool.js~HideTool", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/HideTool.js", "importStyle": "{HideTool}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 421, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/HideTool.js~HideTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/HideTool.js~HideTool#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 422, "kind": "member", "name": "_onPick", "memberof": "src/toolbar/HideTool.js~HideTool", "static": false, "longname": "src/toolbar/HideTool.js~HideTool#_onPick", "access": "private", "description": null, "lineNumber": 28, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 424, "kind": "file", "name": "src/toolbar/MarqueeSelectionTool.js", "content": "import {Controller} from \"../Controller.js\";\nimport {Frustum, frustumIntersectsAABB3, math, setFrustum} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nconst LEFT_TO_RIGHT = 0;\nconst RIGHT_TO_LEFT = 1;\n\n/** @private */\nexport class MarqueeSelectionTool extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n this._objectsKdTree3 = cfg.objectsKdTree3;\n this._marquee = math.AABB2();\n this._marqueeFrustum = new Frustum();\n this._marqueeFrustumProjMat = math.mat4();\n this._marqueeDir = false;\n\n const buttonElement = cfg.buttonElement;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n buttonElement.classList.add(\"disabled\");\n } else {\n buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n buttonElement.classList.add(\"active\");\n const nop = this._objectsKdTree3.root; // Lazy-build the kd-tree\n } else {\n buttonElement.classList.remove(\"active\");\n }\n });\n\n buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n const active = this.getActive();\n this.setActive(!active);\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.setActive(false);\n });\n\n const scene = this.viewer.scene;\n const canvas = scene.canvas.canvas;\n\n this._marqueeElement = document.createElement('div');\n document.body.appendChild(this._marqueeElement);\n\n const marqueeElement = this._marqueeElement;\n const marqueeStyle = marqueeElement.style;\n marqueeStyle.position = \"absolute\";\n marqueeStyle[\"z-index\"] = \"40000005\";\n marqueeStyle.width = 8 + \"px\";\n marqueeStyle.height = 8 + \"px\";\n marqueeStyle.visibility = \"hidden\";\n marqueeStyle.top = 0 + \"px\";\n marqueeStyle.left = 0 + \"px\";\n marqueeStyle[\"box-shadow\"] = \"0 2px 5px 0 #182A3D;\";\n marqueeStyle[\"opacity\"] = 1.0;\n marqueeStyle[\"pointer-events\"] = \"none\";\n\n let canvasDragStartX;\n let canvasDragStartY;\n let canvasDragEndX;\n let canvasDragEndY;\n\n let canvasMarqueeStartX;\n let canvasMarqueeStartY;\n let canvasMarqueeEndX;\n let canvasMarqueeEndY;\n\n let isMouseDragging = false;\n let mouseWasUpOffCanvas = false;\n\n canvas.addEventListener(\"mousedown\", (e) => {\n if (!this.getActive() || !this.getEnabled()) {\n return;\n }\n if (e.button !== 0) { // Left button only\n return;\n }\n const input = this.bimViewer.viewer.scene.input;\n if (!input.keyDown[input.KEY_CTRL]) { // Clear selection unless CTRL down\n scene.setObjectsSelected(scene.selectedObjectIds, false);\n }\n canvasDragStartX = e.pageX;\n canvasDragStartY = e.pageY;\n marqueeStyle.visibility = \"visible\";\n marqueeStyle.left = `${canvasDragStartX}px`;\n marqueeStyle.top = `${canvasDragStartY}px`;\n marqueeStyle.width = \"0px\";\n marqueeStyle.height = \"0px\";\n marqueeStyle.display = \"block\";\n canvasMarqueeStartX = e.offsetX;\n canvasMarqueeStartY = e.offsetY;\n isMouseDragging = true;\n this.viewer.cameraControl.pointerEnabled = false; // Disable camera rotation\n });\n\n canvas.addEventListener(\"mouseup\", (e) => {\n if (!this.getActive() || !this.getEnabled()) {\n return;\n }\n if (!isMouseDragging && !mouseWasUpOffCanvas) {\n return\n }\n if (e.button !== 0) {\n return;\n }\n canvasDragEndX = e.pageX;\n canvasDragEndY = e.pageY;\n const width = Math.abs(canvasDragEndX - canvasDragStartX);\n const height = Math.abs(canvasDragEndY - canvasDragStartY);\n marqueeStyle.width = `${width}px`;\n marqueeStyle.height = `${height}px`;\n marqueeStyle.visibility = \"hidden\";\n isMouseDragging = false;\n this.viewer.cameraControl.pointerEnabled = true; // Enable camera rotation\n if (mouseWasUpOffCanvas) {\n mouseWasUpOffCanvas = false;\n }\n if (width > 3 || height > 3) { // Marquee pick if rectangle big enough\n this._marqueePick();\n }\n }); // Bubbling\n\n document.addEventListener(\"mouseup\", (e) => {\n if (!this.getActive() || !this.getEnabled()) {\n return;\n }\n if (e.button !== 0) { // check if left button was clicked\n return;\n }\n if (!isMouseDragging) {\n return\n }\n marqueeStyle.visibility = \"hidden\";\n isMouseDragging = false;\n mouseWasUpOffCanvas = true;\n this.viewer.cameraControl.pointerEnabled = true;\n }, true); // Capturing\n\n canvas.addEventListener(\"mousemove\", (e) => {\n if (!this.getActive() || !this.getEnabled()) {\n return;\n }\n if (e.button !== 0) { // check if left button was clicked\n return;\n }\n if (!isMouseDragging) {\n return\n }\n const x = e.pageX;\n const y = e.pageY;\n const width = x - canvasDragStartX;\n const height = y - canvasDragStartY;\n marqueeStyle.width = `${Math.abs(width)}px`;\n marqueeStyle.height = `${Math.abs(height)}px`;\n marqueeStyle.left = `${Math.min(canvasDragStartX, x)}px`;\n marqueeStyle.top = `${Math.min(canvasDragStartY, y)}px`;\n canvasMarqueeEndX = e.offsetX;\n canvasMarqueeEndY = e.offsetY;\n const marqueeDir = (canvasMarqueeStartX < canvasMarqueeEndX) ? LEFT_TO_RIGHT : RIGHT_TO_LEFT;\n this._setMarqueeDir(marqueeDir);\n this._marquee[0] = Math.min(canvasMarqueeStartX, canvasMarqueeEndX);\n this._marquee[1] = Math.min(canvasMarqueeStartY, canvasMarqueeEndY);\n this._marquee[2] = Math.max(canvasMarqueeStartX, canvasMarqueeEndX);\n this._marquee[3] = Math.max(canvasMarqueeStartY, canvasMarqueeEndY);\n });\n }\n\n _setMarqueeDir(marqueeDir) {\n if (marqueeDir !== this._marqueeDir) {\n this._marqueeElement.style[\"background-image\"] =\n marqueeDir === LEFT_TO_RIGHT\n /* Solid */ ? \"url(\\\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4'/%3e%3c/svg%3e\\\")\"\n /* Dashed */ : \"url(\\\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e\\\")\";\n this._marqueeDir = marqueeDir;\n }\n }\n\n _marqueePick() {\n this._buildMarqueeFrustum();\n const entities1 = [];\n const visitNode = (node, intersects = Frustum.INTERSECT) => {\n if (intersects === Frustum.INTERSECT) {\n intersects = frustumIntersectsAABB3(this._marqueeFrustum, node.aabb);\n }\n if (intersects === Frustum.OUTSIDE) {\n return;\n }\n if (node.entities) {\n const entities = node.entities;\n for (let i = 0, len = entities.length; i < len; i++) {\n const entity = entities[i];\n if (!entity.visible) {\n continue;\n }\n const entityAABB = entity.aabb;\n if (this._marqueeDir === LEFT_TO_RIGHT) {\n // Select entities that are completely inside marquee\n const intersection = frustumIntersectsAABB3(this._marqueeFrustum, entityAABB);\n if (intersection === Frustum.INSIDE) {\n entities1.push(entity);\n }\n } else {\n // Select entities that are partially inside marquee\n const intersection = frustumIntersectsAABB3(this._marqueeFrustum, entityAABB);\n if (intersection !== Frustum.OUTSIDE) {\n entities1.push(entity);\n }\n }\n }\n }\n // }\n if (node.left) {\n visitNode(node.left, intersects);\n }\n if (node.right) {\n visitNode(node.right, intersects);\n }\n }\n visitNode(this._objectsKdTree3.root);\n for (let i = 0, len = entities1.length; i < len; i++) {\n entities1[i].selected = true;\n }\n return entities1;\n }\n\n _buildMarqueeFrustum() { // https://github.com/xeokit/xeokit-sdk/issues/869#issuecomment-1165375770\n const canvas = this.viewer.scene.canvas.canvas;\n const canvasWidth = canvas.clientWidth;\n const canvasHeight = canvas.clientHeight;\n const xCanvasToClip = 2.0 / canvasWidth;\n const yCanvasToClip = 2.0 / canvasHeight;\n const NEAR_SCALING = 17;\n const ratio = canvas.clientHeight / canvas.clientWidth;\n const FAR_PLANE = 10000;\n const left = this._marquee[0] * xCanvasToClip + -1;\n const right = this._marquee[2] * xCanvasToClip + -1;\n const bottom = -this._marquee[3] * yCanvasToClip + 1;\n const top = -this._marquee[1] * yCanvasToClip + 1;\n const near = this.viewer.scene.camera.frustum.near * (NEAR_SCALING * ratio);\n const far = FAR_PLANE;\n math.frustumMat4(\n left,\n right,\n bottom * ratio,\n top * ratio,\n near,\n far,\n this._marqueeFrustumProjMat,\n );\n setFrustum(this._marqueeFrustum, this.viewer.scene.camera.viewMatrix, this._marqueeFrustumProjMat);\n }\n}\n", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/MarqueeSelectionTool.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 425, "kind": "variable", "name": "LEFT_TO_RIGHT", "memberof": "src/toolbar/MarqueeSelectionTool.js", "static": true, "longname": "src/toolbar/MarqueeSelectionTool.js~LEFT_TO_RIGHT", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/MarqueeSelectionTool.js", "importStyle": null, "description": null, "lineNumber": 4, "undocument": true, "type": { "types": [ "number" ] }, "ignore": true }, { "__docId__": 426, "kind": "variable", "name": "RIGHT_TO_LEFT", "memberof": "src/toolbar/MarqueeSelectionTool.js", "static": true, "longname": "src/toolbar/MarqueeSelectionTool.js~RIGHT_TO_LEFT", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/MarqueeSelectionTool.js", "importStyle": null, "description": null, "lineNumber": 5, "undocument": true, "type": { "types": [ "number" ] }, "ignore": true }, { "__docId__": 427, "kind": "class", "name": "MarqueeSelectionTool", "memberof": "src/toolbar/MarqueeSelectionTool.js", "static": true, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/MarqueeSelectionTool.js", "importStyle": "{MarqueeSelectionTool}", "description": null, "lineNumber": 8, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 428, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#constructor", "access": "public", "description": null, "lineNumber": 10, "undocument": true }, { "__docId__": 429, "kind": "member", "name": "_objectsKdTree3", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_objectsKdTree3", "access": "private", "description": null, "lineNumber": 18, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 430, "kind": "member", "name": "_marquee", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_marquee", "access": "private", "description": null, "lineNumber": 19, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 431, "kind": "member", "name": "_marqueeFrustum", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_marqueeFrustum", "access": "private", "description": null, "lineNumber": 20, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 432, "kind": "member", "name": "_marqueeFrustumProjMat", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_marqueeFrustumProjMat", "access": "private", "description": null, "lineNumber": 21, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 433, "kind": "member", "name": "_marqueeDir", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_marqueeDir", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "boolean" ] } }, { "__docId__": 434, "kind": "member", "name": "_marqueeElement", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_marqueeElement", "access": "private", "description": null, "lineNumber": 58, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 435, "kind": "method", "name": "_setMarqueeDir", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_setMarqueeDir", "access": "private", "description": null, "lineNumber": 184, "undocument": true, "ignore": true, "params": [ { "name": "marqueeDir", "types": [ "*" ] } ], "return": null }, { "__docId__": 437, "kind": "method", "name": "_marqueePick", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_marqueePick", "access": "private", "description": null, "lineNumber": 194, "undocument": true, "ignore": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 438, "kind": "method", "name": "_buildMarqueeFrustum", "memberof": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/MarqueeSelectionTool.js~MarqueeSelectionTool#_buildMarqueeFrustum", "access": "private", "description": null, "lineNumber": 242, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 439, "kind": "file", "name": "src/toolbar/NavCubeMode.js", "content": "import {Controller} from \"../Controller.js\";\nimport {NavCubePlugin} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\n/** @private */\nclass NavCubeMode extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.navCubeCanvasElement) {\n throw \"Missing config: navCubeCanvasElement\";\n }\n\n const navCubeCanvasElement = cfg.navCubeCanvasElement;\n\n this._navCube = new NavCubePlugin(this.viewer, {\n canvasElement: navCubeCanvasElement,\n fitVisible: true,\n color: \"#CFCFCF\"\n });\n\n this._navCube.setVisible(this._active);\n\n this.on(\"active\", (active) => {\n this._navCube.setVisible(active);\n });\n }\n\n destroy() {\n this._navCube.destroy();\n super.destroy();\n }\n}\n\nexport {NavCubeMode};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/NavCubeMode.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 440, "kind": "class", "name": "NavCubeMode", "memberof": "src/toolbar/NavCubeMode.js", "static": true, "longname": "src/toolbar/NavCubeMode.js~NavCubeMode", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/NavCubeMode.js", "importStyle": "{NavCubeMode}", "description": null, "lineNumber": 5, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 441, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/NavCubeMode.js~NavCubeMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/NavCubeMode.js~NavCubeMode#constructor", "access": "public", "description": null, "lineNumber": 7, "undocument": true }, { "__docId__": 442, "kind": "member", "name": "_navCube", "memberof": "src/toolbar/NavCubeMode.js~NavCubeMode", "static": false, "longname": "src/toolbar/NavCubeMode.js~NavCubeMode#_navCube", "access": "private", "description": null, "lineNumber": 17, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 443, "kind": "method", "name": "destroy", "memberof": "src/toolbar/NavCubeMode.js~NavCubeMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/NavCubeMode.js~NavCubeMode#destroy", "access": "public", "description": null, "lineNumber": 30, "undocument": true, "params": [], "return": null }, { "__docId__": 444, "kind": "file", "name": "src/toolbar/OrthoMode.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass OrthoMode extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n this._buttonElement = cfg.buttonElement;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n this._buttonElement.classList.add(\"disabled\");\n } else {\n this._buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this._buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.setActive(!this.getActive(), () => {\n });\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.setActive(false);\n });\n\n this.viewer.camera.on(\"projection\", () => {\n const isOrtho = (this.viewer.camera.projection === \"ortho\");\n this._active = isOrtho;\n if (this._active) {\n this._buttonElement.classList.add(\"active\");\n } else {\n this._buttonElement.classList.remove(\"active\");\n }\n });\n\n this._active = false;\n this._buttonElement.classList.remove(\"active\");\n }\n\n setActive(active, done) {\n if (this._active === active) {\n if (done) {\n done();\n }\n return;\n }\n this._active = active;\n if (active) {\n this._buttonElement.classList.add(\"active\");\n if (done) {\n this._enterOrthoMode(() => {\n this.fire(\"active\", this._active);\n done();\n });\n } else {\n this._enterOrthoMode();\n this.fire(\"active\", this._active);\n }\n } else {\n this._buttonElement.classList.remove(\"active\");\n if (done) {\n this._exitOrthoMode(() => {\n this.fire(\"active\", this._active);\n done();\n });\n } else {\n this._exitOrthoMode();\n this.fire(\"active\", this._active);\n }\n }\n }\n\n _enterOrthoMode(done) {\n if (done) {\n this.viewer.cameraFlight.flyTo({projection: \"ortho\", duration: 0.5}, done);\n } else {\n this.viewer.cameraFlight.jumpTo({projection: \"ortho\"});\n }\n }\n\n _exitOrthoMode(done) {\n if (done) {\n this.viewer.cameraFlight.flyTo({projection: \"perspective\", duration: 0.5}, done);\n } else {\n this.viewer.cameraFlight.jumpTo({projection: \"perspective\"});\n }\n }\n}\n\nexport {OrthoMode};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/OrthoMode.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 445, "kind": "class", "name": "OrthoMode", "memberof": "src/toolbar/OrthoMode.js", "static": true, "longname": "src/toolbar/OrthoMode.js~OrthoMode", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/OrthoMode.js", "importStyle": "{OrthoMode}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 446, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/OrthoMode.js~OrthoMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/OrthoMode.js~OrthoMode#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 447, "kind": "member", "name": "_buttonElement", "memberof": "src/toolbar/OrthoMode.js~OrthoMode", "static": false, "longname": "src/toolbar/OrthoMode.js~OrthoMode#_buttonElement", "access": "private", "description": null, "lineNumber": 14, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 448, "kind": "member", "name": "_active", "memberof": "src/toolbar/OrthoMode.js~OrthoMode", "static": false, "longname": "src/toolbar/OrthoMode.js~OrthoMode#_active", "access": "private", "description": null, "lineNumber": 38, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 450, "kind": "method", "name": "setActive", "memberof": "src/toolbar/OrthoMode.js~OrthoMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/OrthoMode.js~OrthoMode#setActive", "access": "public", "description": null, "lineNumber": 50, "undocument": true, "params": [ { "name": "active", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 452, "kind": "method", "name": "_enterOrthoMode", "memberof": "src/toolbar/OrthoMode.js~OrthoMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/OrthoMode.js~OrthoMode#_enterOrthoMode", "access": "private", "description": null, "lineNumber": 83, "undocument": true, "ignore": true, "params": [ { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 453, "kind": "method", "name": "_exitOrthoMode", "memberof": "src/toolbar/OrthoMode.js~OrthoMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/OrthoMode.js~OrthoMode#_exitOrthoMode", "access": "private", "description": null, "lineNumber": 91, "undocument": true, "ignore": true, "params": [ { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 454, "kind": "file", "name": "src/toolbar/QueryTool.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass QueryTool extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent);\n\n // this.on(\"active\", (active) => {\n // if (active) {\n // this._onPick = this.viewer.cameraControl.on(\"picked\", (pickResult) => {\n // if (!pickResult.entity) {\n // return;\n // }\n // // this.queryEntity(pickResult.entity);\n // });\n // this._onPickedNothing = this.viewer.cameraControl.on(\"pickedNothing\", () => {\n // this.fire(\"queryNotPicked\", false);\n // });\n // } else {\n //\n // if (this._onPick !== undefined) {\n // this.viewer.cameraControl.off(this._onPick);\n // this.viewer.cameraControl.off(this._onPickedNothing);\n // this._onPick = undefined;\n // this._onPickedNothing = undefined;\n // }\n // }\n // });\n //\n // this.bimViewer.on(\"reset\", () => {\n // this.setActive(false);\n // });\n }\n}\n\nexport {QueryTool};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/QueryTool.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 455, "kind": "class", "name": "QueryTool", "memberof": "src/toolbar/QueryTool.js", "static": true, "longname": "src/toolbar/QueryTool.js~QueryTool", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/QueryTool.js", "importStyle": "{QueryTool}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 456, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/QueryTool.js~QueryTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/QueryTool.js~QueryTool#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 457, "kind": "file", "name": "src/toolbar/ResetAction.js", "content": "import {Controller} from \"../Controller.js\";\nimport {ModelMemento, math} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nconst tempVec3a = math.vec3();\n\n/** @private */\nclass ResetAction extends Controller {\n\n constructor(parent, cfg = {}) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n const buttonElement = cfg.buttonElement;\n const camera = this.viewer.camera;\n\n this._modelMementos = {};\n\n // Initial camera position - looking down negative diagonal\n\n camera.eye = [0.577, 0.577, 0.577];\n camera.look = [0,0,0];\n camera.up = [-1, 1, -1];\n\n this.bimViewer._modelsExplorer.on(\"modelLoaded\", (modelId) => {\n this._saveModelMemento(modelId);\n });\n\n this.bimViewer._modelsExplorer.on(\"modelUnloaded\", (modelId) => {\n this._destroyModelMemento(modelId);\n });\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n buttonElement.classList.add(\"disabled\");\n } else {\n buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n buttonElement.classList.add(\"active\");\n } else {\n buttonElement.classList.remove(\"active\");\n }\n });\n\n buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.reset();\n }\n event.preventDefault();\n });\n }\n\n _saveModelMemento(modelId) {\n const metaModel = this.viewer.metaScene.metaModels[modelId];\n if (!metaModel) {\n return;\n }\n const modelMemento = new ModelMemento();\n modelMemento.saveObjects(this.viewer.scene, metaModel, {\n visible: true,\n edges: true,\n xrayed: true,\n highlighted: true,\n selected: true,\n clippable: true,\n pickable: true,\n colorize: false, // We don't colorize objects yet - also messes up point clouds\n opacity: false // FIXME: Restoring opacity broken by colorize fix - details at https://github.com/xeokit/xeokit-sdk/issues/239\n });\n this._modelMementos[modelId] = modelMemento;\n }\n\n _restoreModelMemento(modelId) {\n const metaModel = this.viewer.metaScene.metaModels[modelId];\n if (!metaModel) {\n return;\n }\n const modelMemento = this._modelMementos[modelId];\n modelMemento.restoreObjects(this.viewer.scene, metaModel);\n }\n\n _destroyModelMemento(modelId) {\n delete this._modelMementos[modelId];\n }\n\n reset() {\n const scene = this.viewer.scene;\n const modelIds = scene.modelIds;\n for (var i = 0, len = modelIds.length; i < len; i++) {\n const modelId = modelIds[i];\n this._restoreModelMemento(modelId);\n }\n this.bimViewer.unShowObjectInExplorers();\n this.fire(\"reset\", true);\n this._resetCamera();\n }\n\n _resetCamera() {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const aabb = scene.getAABB(scene.visibleObjectIds);\n const diag = math.getAABB3Diag(aabb);\n const center = math.getAABB3Center(aabb, tempVec3a);\n const camera = scene.camera;\n const fitFOV = camera.perspective.fov;\n const dist = Math.abs(diag / Math.tan(45 * math.DEGTORAD));\n const dir = math.normalizeVec3((camera.yUp) ? [-0.5, -0.7071, -0.5] : [-1, 1, -1]);\n const up = math.normalizeVec3((camera.yUp) ? [-0.5, 0.7071, -0.5] : [-1, 1, 1]);\n viewer.cameraControl.pivotPos = center;\n viewer.cameraControl.planView = false;\n viewer.cameraFlight.flyTo({\n look: center,\n eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],\n up: up,\n orthoScale: diag * 1.3,\n projection: \"perspective\",\n duration: 1\n });\n }\n}\n\nexport {ResetAction};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/ResetAction.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 458, "kind": "variable", "name": "tempVec3a", "memberof": "src/toolbar/ResetAction.js", "static": true, "longname": "src/toolbar/ResetAction.js~tempVec3a", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/ResetAction.js", "importStyle": null, "description": null, "lineNumber": 4, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 459, "kind": "class", "name": "ResetAction", "memberof": "src/toolbar/ResetAction.js", "static": true, "longname": "src/toolbar/ResetAction.js~ResetAction", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/ResetAction.js", "importStyle": "{ResetAction}", "description": null, "lineNumber": 7, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 460, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/ResetAction.js~ResetAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#constructor", "access": "public", "description": null, "lineNumber": 9, "undocument": true }, { "__docId__": 461, "kind": "member", "name": "_modelMementos", "memberof": "src/toolbar/ResetAction.js~ResetAction", "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#_modelMementos", "access": "private", "description": null, "lineNumber": 20, "undocument": true, "ignore": true, "type": { "types": [ "{}" ] } }, { "__docId__": 462, "kind": "method", "name": "_saveModelMemento", "memberof": "src/toolbar/ResetAction.js~ResetAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#_saveModelMemento", "access": "private", "description": null, "lineNumber": 60, "undocument": true, "ignore": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": null }, { "__docId__": 463, "kind": "method", "name": "_restoreModelMemento", "memberof": "src/toolbar/ResetAction.js~ResetAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#_restoreModelMemento", "access": "private", "description": null, "lineNumber": 80, "undocument": true, "ignore": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": null }, { "__docId__": 464, "kind": "method", "name": "_destroyModelMemento", "memberof": "src/toolbar/ResetAction.js~ResetAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#_destroyModelMemento", "access": "private", "description": null, "lineNumber": 89, "undocument": true, "ignore": true, "params": [ { "name": "modelId", "types": [ "*" ] } ], "return": null }, { "__docId__": 465, "kind": "method", "name": "reset", "memberof": "src/toolbar/ResetAction.js~ResetAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#reset", "access": "public", "description": null, "lineNumber": 93, "undocument": true, "params": [], "return": null }, { "__docId__": 466, "kind": "method", "name": "_resetCamera", "memberof": "src/toolbar/ResetAction.js~ResetAction", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ResetAction.js~ResetAction#_resetCamera", "access": "private", "description": null, "lineNumber": 105, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 467, "kind": "file", "name": "src/toolbar/SectionTool.js", "content": "import {Controller} from \"../Controller.js\";\nimport {SectionToolContextMenu} from \"./../contextMenus/SectionToolContextMenu.js\";\nimport {math, SectionPlanesPlugin} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\n/** @private */\nclass SectionTool extends Controller { // XX\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n if (!cfg.menuButtonElement) {\n throw \"Missing config: menuButtonElement\";\n }\n\n this._buttonElement = cfg.buttonElement;\n this._counterElement = cfg.counterElement;\n this._menuButtonElement = cfg.menuButtonElement;\n this._menuButtonArrowElement = cfg.menuButtonArrowElement;\n\n this._sectionPlanesPlugin = new SectionPlanesPlugin(this.viewer, {});\n\n this._sectionToolContextMenu = new SectionToolContextMenu({\n sectionPlanesPlugin: this._sectionPlanesPlugin,\n hideOnMouseDown: false,\n hideOnAction: false\n });\n\n this._sectionPlanesPlugin.setOverviewVisible(false);\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n this._buttonElement.classList.add(\"disabled\");\n if (this._counterElement) {\n this._counterElement.classList.add(\"disabled\");\n }\n this._menuButtonElement.classList.add(\"disabled\");\n this._menuButtonArrowElement.classList.add(\"disabled\");\n } else {\n this._buttonElement.classList.remove(\"disabled\");\n if (this._counterElement) {\n this._counterElement.classList.remove(\"disabled\");\n }\n this._menuButtonElement.classList.remove(\"disabled\");\n this._menuButtonArrowElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n this._buttonElement.classList.add(\"active\");\n if (this._counterElement) {\n this._counterElement.classList.add(\"active\");\n }\n this._menuButtonElement.classList.add(\"active\");\n this._menuButtonArrowElement.classList.add(\"active\");\n } else {\n this._buttonElement.classList.remove(\"active\");\n if (this._counterElement) {\n this._counterElement.classList.remove(\"active\");\n }\n this._menuButtonElement.classList.remove(\"active\");\n this._menuButtonArrowElement.classList.remove(\"active\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (!active) {\n this._sectionPlanesPlugin.hideControl();\n }\n });\n\n this._buttonElement.addEventListener(\"click\", (e) => {\n if (!this.getEnabled()) {\n return;\n }\n if (e.target === this._menuButtonElement || e.target.parentNode === this._menuButtonElement) {\n return;\n }\n const active = this.getActive();\n this.setActive(!active);\n e.preventDefault();\n });\n\n document.addEventListener(\"mousedown\", (e) => {\n\n if (e.target.classList.contains(\"xeokit-context-menu-item\")) {\n // Allow click on menu item\n return;\n }\n\n if (e.target === this._menuButtonElement || e.target.parentNode === this._menuButtonElement) {\n e.preventDefault();\n if (this._sectionToolContextMenu.shown) {\n this._sectionToolContextMenu.hide();\n } else {\n this._sectionToolContextMenu.context = {\n bimViewer: this.bimViewer,\n viewer: this.viewer,\n sectionTool: this\n };\n\n const rect = this._menuButtonElement.getBoundingClientRect();\n\n this._sectionToolContextMenu.show(rect.left, rect.bottom + 5);\n }\n } else {\n this._sectionToolContextMenu.hide();\n }\n });\n\n this._sectionToolContextMenu.on(\"shown\", () => {\n this._menuButtonArrowElement.classList.remove(\"xeokit-arrow-down\");\n this._menuButtonArrowElement.classList.add(\"xeokit-arrow-up\");\n });\n\n this._sectionToolContextMenu.on(\"hidden\", () => {\n this._menuButtonArrowElement.classList.remove(\"xeokit-arrow-up\");\n this._menuButtonArrowElement.classList.add(\"xeokit-arrow-down\");\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.clear();\n this.setActive(false);\n });\n\n this.viewer.scene.on(\"sectionPlaneCreated\", () => {\n this._updateSectionPlanesCount();\n });\n\n this.viewer.scene.on(\"sectionPlaneDestroyed\", () => {\n this._updateSectionPlanesCount();\n });\n\n this._initSectionMode();\n }\n\n _initSectionMode() {\n\n this.viewer.scene.input.on(\"mouseclicked\", (coords) => {\n\n if (!this.getActive() || !this.getEnabled()) {\n return;\n }\n\n const pickResult = this.viewer.scene.pick({\n canvasPos: coords,\n pickSurface: true // <<------ This causes picking to find the intersection point on the entity\n });\n\n if (pickResult) {\n\n const sectionPlane = this._sectionPlanesPlugin.createSectionPlane({\n pos: pickResult.worldPos,\n dir: math.mulVec3Scalar(pickResult.worldNormal, -1)\n });\n\n this._sectionPlanesPlugin.showControl(sectionPlane.id);\n }\n });\n\n this._updateSectionPlanesCount();\n }\n\n _updateSectionPlanesCount() {\n if (this._counterElement) {\n this._counterElement.innerText = (\"\" + this.getNumSections());\n }\n }\n\n getNumSections() {\n return Object.keys(this.viewer.scene.sectionPlanes).length;\n }\n\n clear() {\n this._sectionPlanesPlugin.clear();\n this._updateSectionPlanesCount();\n }\n\n flipSections() {\n this._sectionPlanesPlugin.flipSectionPlanes();\n }\n\n enableSections() {\n const sectionPlanes = this.viewer.scene.sectionPlanes;\n for (let id in sectionPlanes) {\n const sectionPlane = sectionPlanes[id];\n sectionPlane.active = true;\n }\n }\n\n disableSections() {\n const sectionPlanes = this.viewer.scene.sectionPlanes;\n for (let id in sectionPlanes) {\n const sectionPlane = sectionPlanes[id];\n sectionPlane.active = false;\n }\n }\n\n hideControl() {\n this._sectionPlanesPlugin.hideControl();\n }\n\n destroy() {\n this._sectionPlanesPlugin.destroy();\n this._sectionToolContextMenu.destroy();\n super.destroy();\n }\n}\n\nexport {SectionTool};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/SectionTool.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 468, "kind": "class", "name": "SectionTool", "memberof": "src/toolbar/SectionTool.js", "static": true, "longname": "src/toolbar/SectionTool.js~SectionTool", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/SectionTool.js", "importStyle": "{SectionTool}", "description": null, "lineNumber": 6, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 469, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#constructor", "access": "public", "description": null, "lineNumber": 8, "undocument": true }, { "__docId__": 470, "kind": "member", "name": "_buttonElement", "memberof": "src/toolbar/SectionTool.js~SectionTool", "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_buttonElement", "access": "private", "description": null, "lineNumber": 20, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 471, "kind": "member", "name": "_counterElement", "memberof": "src/toolbar/SectionTool.js~SectionTool", "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_counterElement", "access": "private", "description": null, "lineNumber": 21, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 472, "kind": "member", "name": "_menuButtonElement", "memberof": "src/toolbar/SectionTool.js~SectionTool", "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_menuButtonElement", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 473, "kind": "member", "name": "_menuButtonArrowElement", "memberof": "src/toolbar/SectionTool.js~SectionTool", "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_menuButtonArrowElement", "access": "private", "description": null, "lineNumber": 23, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 474, "kind": "member", "name": "_sectionPlanesPlugin", "memberof": "src/toolbar/SectionTool.js~SectionTool", "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_sectionPlanesPlugin", "access": "private", "description": null, "lineNumber": 25, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 475, "kind": "member", "name": "_sectionToolContextMenu", "memberof": "src/toolbar/SectionTool.js~SectionTool", "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_sectionToolContextMenu", "access": "private", "description": null, "lineNumber": 27, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 476, "kind": "method", "name": "_initSectionMode", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_initSectionMode", "access": "private", "description": null, "lineNumber": 142, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 477, "kind": "method", "name": "_updateSectionPlanesCount", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#_updateSectionPlanesCount", "access": "private", "description": null, "lineNumber": 169, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 478, "kind": "method", "name": "getNumSections", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#getNumSections", "access": "public", "description": null, "lineNumber": 175, "undocument": true, "params": [], "return": { "types": [ "*" ] } }, { "__docId__": 479, "kind": "method", "name": "clear", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#clear", "access": "public", "description": null, "lineNumber": 179, "undocument": true, "params": [], "return": null }, { "__docId__": 480, "kind": "method", "name": "flipSections", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#flipSections", "access": "public", "description": null, "lineNumber": 184, "undocument": true, "params": [], "return": null }, { "__docId__": 481, "kind": "method", "name": "enableSections", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#enableSections", "access": "public", "description": null, "lineNumber": 188, "undocument": true, "params": [], "return": null }, { "__docId__": 482, "kind": "method", "name": "disableSections", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#disableSections", "access": "public", "description": null, "lineNumber": 196, "undocument": true, "params": [], "return": null }, { "__docId__": 483, "kind": "method", "name": "hideControl", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#hideControl", "access": "public", "description": null, "lineNumber": 204, "undocument": true, "params": [], "return": null }, { "__docId__": 484, "kind": "method", "name": "destroy", "memberof": "src/toolbar/SectionTool.js~SectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SectionTool.js~SectionTool#destroy", "access": "public", "description": null, "lineNumber": 208, "undocument": true, "params": [], "return": null }, { "__docId__": 485, "kind": "file", "name": "src/toolbar/SelectionTool.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass SelectionTool extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n const buttonElement = cfg.buttonElement;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n buttonElement.classList.add(\"disabled\");\n } else {\n buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this.on(\"active\", (active) => {\n if (active) {\n buttonElement.classList.add(\"active\");\n this._onPick = this.viewer.cameraControl.on(\"picked\", (pickResult) => {\n if (!pickResult.entity) {\n return;\n }\n pickResult.entity.selected = !pickResult.entity.selected;\n });\n } else {\n buttonElement.classList.remove(\"active\");\n if (this._onPick !== undefined) {\n this.viewer.cameraControl.off(this._onPick);\n this._onPick = undefined;\n }\n }\n });\n\n buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.bimViewer._sectionTool.hideControl();\n const active = this.getActive();\n this.setActive(!active);\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.setActive(false);\n });\n }\n}\n\nexport {SelectionTool};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/SelectionTool.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 486, "kind": "class", "name": "SelectionTool", "memberof": "src/toolbar/SelectionTool.js", "static": true, "longname": "src/toolbar/SelectionTool.js~SelectionTool", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/SelectionTool.js", "importStyle": "{SelectionTool}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 487, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/SelectionTool.js~SelectionTool", "generator": false, "async": false, "static": false, "longname": "src/toolbar/SelectionTool.js~SelectionTool#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 488, "kind": "member", "name": "_onPick", "memberof": "src/toolbar/SelectionTool.js~SelectionTool", "static": false, "longname": "src/toolbar/SelectionTool.js~SelectionTool#_onPick", "access": "private", "description": null, "lineNumber": 27, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 490, "kind": "file", "name": "src/toolbar/ShowSpacesMode.js", "content": "import {Controller} from \"../Controller.js\";\n\n/** @private */\nclass ShowSpacesMode extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n this._buttonElement = cfg.buttonElement;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n this._buttonElement.classList.add(\"disabled\");\n } else {\n this._buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this._buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.setActive(!this.getActive(), () => {\n });\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.setActive(false); // IfcSpaces hidden by default\n });\n\n this.viewer.scene.on(\"modelLoaded\", (modelId) => {\n if (!this._active) {\n const objectIds = this.viewer.metaScene.getObjectIDsByType(\"IfcSpace\");\n this.viewer.scene.setObjectsCulled(objectIds, true);\n }\n });\n \n this._active = false;\n this._buttonElement.classList.remove(\"active\");\n }\n\n setActive(active) {\n if (this._active === active) {\n return;\n }\n this._active = active;\n if (active) {\n this._buttonElement.classList.add(\"active\");\n this._enterShowSpacesMode();\n this.fire(\"active\", this._active);\n } else {\n this._buttonElement.classList.remove(\"active\");\n this._exitShowSpacesMode();\n this.fire(\"active\", this._active);\n }\n }\n\n _enterShowSpacesMode() {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const metaScene = viewer.metaScene;\n const objectIds = metaScene.getObjectIDsByType(\"IfcSpace\");\n scene.setObjectsCulled(objectIds, false);\n }\n\n _exitShowSpacesMode() {\n const viewer = this.viewer;\n const scene = viewer.scene;\n const metaScene = viewer.metaScene;\n const objectIds = metaScene.getObjectIDsByType(\"IfcSpace\");\n scene.setObjectsCulled(objectIds, true);\n }\n}\n\nexport {ShowSpacesMode};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/ShowSpacesMode.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 491, "kind": "class", "name": "ShowSpacesMode", "memberof": "src/toolbar/ShowSpacesMode.js", "static": true, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/ShowSpacesMode.js", "importStyle": "{ShowSpacesMode}", "description": null, "lineNumber": 4, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 492, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode#constructor", "access": "public", "description": null, "lineNumber": 6, "undocument": true }, { "__docId__": 493, "kind": "member", "name": "_buttonElement", "memberof": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "static": false, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode#_buttonElement", "access": "private", "description": null, "lineNumber": 14, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 494, "kind": "member", "name": "_active", "memberof": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "static": false, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode#_active", "access": "private", "description": null, "lineNumber": 43, "undocument": true, "ignore": true, "type": { "types": [ "boolean" ] } }, { "__docId__": 495, "kind": "method", "name": "setActive", "memberof": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode#setActive", "access": "public", "description": null, "lineNumber": 47, "undocument": true, "params": [ { "name": "active", "types": [ "*" ] } ], "return": null }, { "__docId__": 497, "kind": "method", "name": "_enterShowSpacesMode", "memberof": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode#_enterShowSpacesMode", "access": "private", "description": null, "lineNumber": 63, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 498, "kind": "method", "name": "_exitShowSpacesMode", "memberof": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ShowSpacesMode.js~ShowSpacesMode#_exitShowSpacesMode", "access": "private", "description": null, "lineNumber": 71, "undocument": true, "ignore": true, "params": [], "return": null }, { "__docId__": 499, "kind": "file", "name": "src/toolbar/ThreeDMode.js", "content": "import {Controller} from \"../Controller.js\";\nimport {math} from \"@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js\";\n\nconst tempVec3a = math.vec3();\n\n/** @private */\nclass ThreeDMode extends Controller {\n\n constructor(parent, cfg) {\n\n super(parent, cfg);\n\n if (!cfg.buttonElement) {\n throw \"Missing config: buttonElement\";\n }\n\n this._saveOrthoActive = null;\n this._buttonElement = cfg.buttonElement;\n\n this._cameraControlNavModeMediator = cfg.cameraControlNavModeMediator;\n\n this._active = false;\n\n this.on(\"enabled\", (enabled) => {\n if (!enabled) {\n this._buttonElement.classList.add(\"disabled\");\n } else {\n this._buttonElement.classList.remove(\"disabled\");\n }\n });\n\n this._buttonElement.addEventListener(\"click\", (event) => {\n if (this.getEnabled()) {\n this.bimViewer._sectionTool.hideControl();\n this.setActive(!this.getActive(), () => { // Animated\n });\n }\n event.preventDefault();\n });\n\n this.bimViewer.on(\"reset\", () => {\n this.setActive(true, () => { // Animated\n });\n });\n }\n\n setEnabled(enabled) {\n super.setEnabled(enabled);\n this._saveOrthoActive = this.bimViewer._orthoMode.getActive();\n }\n\n setActive(active, done) {\n if (this._active === active) {\n if (done) {\n done();\n }\n return;\n }\n this._active = active;\n if (active) {\n this._buttonElement.classList.add(\"active\");\n if (done) {\n this._enterThreeDMode(() => {\n this.fire(\"active\", this._active);\n done();\n });\n } else {\n this._enterThreeDMode();\n this.fire(\"active\", this._active);\n }\n } else {\n this._buttonElement.classList.remove(\"active\");\n if (done) {\n this._exitThreeDMode(() => {\n this.fire(\"active\", this._active);\n done();\n });\n } else {\n this._exitThreeDMode();\n this.fire(\"active\", this._active);\n }\n }\n }\n\n _enterThreeDMode(done) {\n\n const viewer = this.viewer;\n const scene = viewer.scene;\n const aabb = scene.getAABB(scene.visibleObjectIds);\n const diag = math.getAABB3Diag(aabb);\n const center = math.getAABB3Center(aabb, tempVec3a);\n const dist = Math.abs(diag / Math.tan(65.0 / 2)); // TODO: fovy match with CameraFlight\n const camera = scene.camera;\n const dir = (camera.yUp) ? [-1, -1, -1] : [1, 1, 1];\n const up = (camera.yUp) ? [-1, 1, -1] : [-1, 1, 1];\n\n viewer.cameraControl.pivotPos = center;\n\n this.bimViewer._navCubeMode.setActive(true);\n this.bimViewer._firstPersonMode.setEnabled(true);\n this._cameraControlNavModeMediator.setThreeDModeActive(true);\n this.bimViewer._sectionTool.setEnabled(true);\n this.bimViewer._orthoMode.setEnabled(true);\n\n if (done) {\n viewer.cameraFlight.flyTo({\n look: center,\n eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],\n up: up,\n orthoScale: diag * 1.3,\n duration: 1,\n projection: this._saveOrthoActive ? \"ortho\" : \"perspective\"\n }, () => {\n done();\n });\n } else {\n viewer.cameraFlight.jumpTo({\n look: center,\n eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],\n up: up,\n orthoScale: diag * 1.3,\n projection: this._saveOrthoActive ? \"ortho\" : \"perspective\"\n });\n }\n }\n\n _exitThreeDMode(done) {\n\n const viewer = this.viewer;\n const scene = viewer.scene;\n const camera = scene.camera;\n const aabb = scene.getAABB(scene.visibleObjectIds);\n const look2 = math.getAABB3Center(aabb);\n const diag = math.getAABB3Diag(aabb);\n const fitFOV = 45; // fitFOV;\n const sca = Math.abs(diag / Math.tan(fitFOV * math.DEGTORAD));\n const orthoScale2 = diag * 1.3;\n const eye2 = tempVec3a;\n\n eye2[0] = look2[0] + (camera.worldUp[0] * sca);\n eye2[1] = look2[1] + (camera.worldUp[1] * sca);\n eye2[2] = look2[2] + (camera.worldUp[2] * sca);\n\n const up2 = math.mulVec3Scalar(camera.worldForward, -1, []);\n\n this.bimViewer._sectionTool.setActive(false);\n this.bimViewer._firstPersonMode.setEnabled(false);\n\n this._saveOrthoActive = this.bimViewer._orthoMode.getActive();\n this.bimViewer._orthoMode.setEnabled(false);\n\n this._cameraControlNavModeMediator.setThreeDModeActive(false);\n\n if (done) {\n viewer.cameraFlight.flyTo({\n eye: eye2,\n look: look2,\n up: up2,\n orthoScale: orthoScale2,\n projection: \"ortho\"\n }, () => {\n this.bimViewer._navCubeMode.setActive(false);\n });\n } else {\n viewer.cameraFlight.jumpTo({\n eye: eye2,\n look: look2,\n up: up2,\n orthoScale: orthoScale2,\n projection: \"ortho\"\n });\n this.bimViewer._navCubeMode.setActive(false);\n }\n }\n}\n\nexport {ThreeDMode};", "static": true, "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/src/toolbar/ThreeDMode.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 500, "kind": "variable", "name": "tempVec3a", "memberof": "src/toolbar/ThreeDMode.js", "static": true, "longname": "src/toolbar/ThreeDMode.js~tempVec3a", "access": "public", "export": false, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/ThreeDMode.js", "importStyle": null, "description": null, "lineNumber": 4, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 501, "kind": "class", "name": "ThreeDMode", "memberof": "src/toolbar/ThreeDMode.js", "static": true, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode", "access": "private", "export": true, "importPath": "@xeokit/xeokit-bim-viewer/src/toolbar/ThreeDMode.js", "importStyle": "{ThreeDMode}", "description": null, "lineNumber": 7, "interface": false, "extends": [ "src/Controller.js~Controller" ], "ignore": true }, { "__docId__": 502, "kind": "constructor", "name": "constructor", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#constructor", "access": "public", "description": null, "lineNumber": 9, "undocument": true }, { "__docId__": 503, "kind": "member", "name": "_saveOrthoActive", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#_saveOrthoActive", "access": "private", "description": null, "lineNumber": 17, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 504, "kind": "member", "name": "_buttonElement", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#_buttonElement", "access": "private", "description": null, "lineNumber": 18, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 505, "kind": "member", "name": "_cameraControlNavModeMediator", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#_cameraControlNavModeMediator", "access": "private", "description": null, "lineNumber": 20, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 506, "kind": "member", "name": "_active", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#_active", "access": "private", "description": null, "lineNumber": 22, "undocument": true, "ignore": true, "type": { "types": [ "boolean" ] } }, { "__docId__": 507, "kind": "method", "name": "setEnabled", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#setEnabled", "access": "public", "description": null, "lineNumber": 47, "undocument": true, "params": [ { "name": "enabled", "types": [ "*" ] } ], "return": null }, { "__docId__": 509, "kind": "method", "name": "setActive", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#setActive", "access": "public", "description": null, "lineNumber": 52, "undocument": true, "params": [ { "name": "active", "types": [ "*" ] }, { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 511, "kind": "method", "name": "_enterThreeDMode", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#_enterThreeDMode", "access": "private", "description": null, "lineNumber": 85, "undocument": true, "ignore": true, "params": [ { "name": "done", "types": [ "*" ] } ], "return": null }, { "__docId__": 512, "kind": "method", "name": "_exitThreeDMode", "memberof": "src/toolbar/ThreeDMode.js~ThreeDMode", "generator": false, "async": false, "static": false, "longname": "src/toolbar/ThreeDMode.js~ThreeDMode#_exitThreeDMode", "access": "private", "description": null, "lineNumber": 127, "undocument": true, "ignore": true, "params": [ { "name": "done", "types": [ "*" ] } ], "return": null }, { "kind": "index", "content": "# xeokit-bim-viewer\n\n[![npm version](https://badge.fury.io/js/%40xeokit%2Fxeokit-bim-viewer.svg)](https://badge.fury.io/js/%40xeokit%2Fxeokit-bim-viewer) [![](https://data.jsdelivr.com/v1/package/npm/@xeokit/xeokit-bim-viewer/badge)](https://www.jsdelivr.com/package/npm/@xeokit/xeokit-bim-viewer)\n\n[![Screenshot](https://github.com/xeokit/xeokit-bim-viewer/raw/master/images/xeokit-bim-viewer.png)](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=OTCConferenceCenter&tab=storeys)\n\n* [Run demo](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=OTCConferenceCenter&tab=storeys)\n\n---\n\n**[xeokit-bim-viewer](https://github.com/xeokit/xeokit-bim-viewer)** is an open source 2D/3D BIM viewer that runs in the\nbrowser and loads models from your file system.\n\nThe viewer is built on **[xeokit](http://xeokit.io)**, and is bundled as part of the **[xeokit SDK](http://xeokit.io)**.\n\nThe viewer is developed by [xeolabs](http://xeolabs.com) and [OpenProject](https://www.openproject.org/), and is\nintegrated within [OpenProject BIM 10.4](https://www.openproject.org/openproject-bim-10-4/) and later.\n\nThe viewer can be used as a stand-alone JavaScript application. In combination with open source CLI model conversion\ntools, it represents a low-cost, high-performance way to get your IFC models on the Web, that allows you the freedom to\nconvert and host your models on your own server or GitHub repository.\n\nTo view your models with this viewer:\n\n1. Fork the [xeokit-bim-viewer](https://github.com/xeokit/xeokit-bim-viewer) repository on GitHub.\n1. Convert your IFC STEP files\n using [open source CLI tools](https://www.notion.so/xeokit/Viewing-an-IFC-Model-with-xeokit-c373e48bc4094ff5b6e5c5700ff580ee)\n .\n3. Add your converted models to your fork's data directory.\n4. Serve your fork using [GitHub Pages](https://pages.github.com/).\n\nThen users can view your models in their browsers, with URLs like this:\n\n[````https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=OTCConferenceCenter&tab=storeys````](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=OTCConferenceCenter&tab=storeys)\n\nRead the documentation below to get started.\n\n--- \n\n* [Releases / Changelog](https://github.com/xeokit/xeokit-bim-viewer/releases)\n* [Source Code](https://github.com/xeokit/xeokit-bim-viewer)\n* [API Docs](https://xeokit.github.io/xeokit-bim-viewer/docs)\n* [xeokit SDK](http://xeokit.io)\n\n---\n\n# Contents\n\n- [Features](#features)\n- [Demos](#demos)\n- [License](#license)\n- [The Viewer Application](#the-viewer-application)\n- [Model Database](#model-database)\n- [Viewer Configurations](#viewer-configurations)\n * [Viewer States](#viewer-states)\n- [Deploying XKT V7 and Earlier](#deploying-xkt-v7-and-earlier)\n- [Support for Multi-Part (Split) Models](#support-for-multi-part--split--models)\n- [Split Model with Separate Metadata Files](#split-model-with-separate-metadata-files)\n- [Programming API](#programming-api)\n * [Creating a Viewer](#creating-a-viewer)\n * [Configuring the Viewer](#configuring-the-viewer)\n * [Querying Projects, Models and Objects](#querying-projects--models-and-objects)\n + [Getting Info on Available Projects](#getting-info-on-available-projects)\n + [Getting Info on a Project](#getting-info-on-a-project)\n + [Getting Info on an Object](#getting-info-on-an-object)\n * [Loading Projects and Models](#loading-projects-and-models)\n + [Loading a Project](#loading-a-project)\n + [Loading a Model](#loading-a-model)\n * [Controlling Viewer State](#controlling-viewer-state)\n * [Saving and Loading BCF Viewpoints](#saving-and-loading-bcf-viewpoints)\n- [Customizing Viewer Style](#customizing-viewer-style)\n * [Modal Busy Dialog](#modal-busy-dialog)\n * [Tooltips](#tooltips)\n * [Customizing Appearances of IFC Types](#customizing-appearances-of-ifc-types)\n * [Localizing a Viewer](#localizing-a-viewer)\n- [xeokit Components Used in the Viewer](#xeokit-components-used-in-the-viewer)\n- [Building the Viewer](#building-the-viewer)\n * [Installing from NPM](#installing-from-npm)\n * [Building the Binary](#building-the-binary)\n * [Building the Documentation](#building-the-documentation)\n\n---\n\n# Features\n\n* Uses [xeokit](https://xeokit.io) for efficient model loading and rendering.\n* Works in all major browsers, including mobile.\n* Can load models from the file system.\n* Loads multiple models.\n* Saves and loads BCF viewpoints.\n* 3D and 2D viewing modes.\n* Interactively X-ray, highlight, show, hide and section objects.\n* Tree views of structure, layers and storeys.\n* Full-precision geometry.\n* Point clouds.\n* Supports IFC2x3 and IFC4.\n* Customize viewer appearance with your own CSS.\n* Localization support.\n* JavaScript programming API for all viewer functions.\n\n# Demos\n\nClick the links below to run some demos.\n\n| Live Demo | Model Source |\n|---|---|\n| [Double-Precision Model](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=MAP) | [BIMData](https://bimdata.io) |\n| [Point Cloud](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=MAPPointCloud)| [BIMData](https://bimdata.io) |\n| [OTC Conference Center](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=OTCConferenceCenter&tab=storeys) | [Details](http://openifcmodel.cs.auckland.ac.nz/Model/Details/301) |\n| [Revit Sample Project](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=RevitSamples&tab=models) | [Details](https://knowledge.autodesk.com/support/revit-products/getting-started/caas/CloudHelp/cloudhelp/2020/ENU/Revit-GetStarted/files/GUID-61EF2F22-3A1F-4317-B925-1E85F138BE88-htm.html) |\n| [Holter Tower](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=HolterTower&tab=storeys)| [Details](http://openifcmodel.cs.auckland.ac.nz/Model/Details/316) |\n| [West Riverside Hospital](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=WestRiversideHospital&tab=models)| [Details](http://openifcmodel.cs.auckland.ac.nz/Model/Details/308) |\n| [Schependomlaan](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=Schependomlaan&tab=storeys)| [Details](https://github.com/openBIMstandards/DataSetSchependomlaan) |\n| [Schependomlaan Ground Floor](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=Schependomlaan_selectedStorey&tab=storeys)| [Details](https://github.com/openBIMstandards/DataSetSchependomlaan) |\n| [Duplex](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=Duplex&tab=storeys)| [Details](http://openifcmodel.cs.auckland.ac.nz/Model/Details/274) |\n\n# License\n\nxeokit-bim-viewer is bundled within the [xeokit SDK](http://xeokit.io), which is licensed under the AGPL3. See\nour [Pricing](https://xeokit.io/index.html#pricing) page for custom licensing options.\n\n# The Viewer Application\n\nThe [````./app/index.html````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/index.html) page provides a\nready-to-use instance of xeokit-bim-viewer. We'll just call it *viewer* from now on.\n\nThe viewer loads projects and models from\nthe [````./app/data/projects````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/data/projects) directory.\n\nTo view a project, load the viewer with the project's ID on the URL:\n\n[````https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=WestRiversideHospital````](https://xeokit.github.io/xeokit-bim-viewer/app/index.html?projectId=WestRiversideHospital)\n\n# Model Database\n\n> **This section shows how to add your own models to the viewer application. These instructions rely on the most\n> recent versions of XKT (V8 or later) and the conversion tools, which you can learn about\nin *[Viewing an IFC Model with xeokit](https://www.notion.so/xeokit/Viewing-an-IFC-Model-with-xeokit-c373e48bc4094ff5b6e5c5700ff580ee)*\n.**\n\nLet's examine the structure of\nthe [````./app/data/projects````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/data) directory, where the\nviewer keeps its projects and models.\n\nShown below is a portion of the ````./app/data/projects```` directory. We'll describe it from the root directory\ndownwards.\n\nWithin the root, we have a directory for each project, along with a manifest of the projects in ````index.json````.\n\nWithin a project directory, we have a directory for each model in the project, along with a manifest of the models\nin ````index.json````.\n\nWithin a model directory, we have the ````.XKT```` file which contains the model's geometry and metadata.\n\n````\n.app/data/projects\n │\n ├── index.json\n │\n ├── Duplex\n │ │\n │ ├── index.json\n │ │\n │ └── models\n │ └── design\n │ └── geometry.xkt\n │\n └── WestRiversideHospital\n │\n ├── index.json\n │\n └── models\n ├── architecture \n │ └── geometry.xkt\n ├── structure \n │ └── geometry.xkt\n └── electrical\n └── geometry.xkt \n````\n\nThe ````index.json```` at the root of ````./app/data/projects```` is shown below.\n\nWithin this file, the ````id```` of each project matches the name of that project's subdirectory.\n\n````json\n{\n \"projects\": [\n {\n \"id\": \"Duplex\",\n \"name\": \"Duplex\"\n },\n {\n \"id\": \"WestRiversideHospital\",\n \"name\": \"West Riverside Hospital\"\n }\n //..\n ]\n}\n````\n\nThe ````index.json```` for the \"WestRiversideHospital\" project is shown below.\n\nWithin this file, the ````id```` of each model matches the name of that model's subdirectory. Each model's ````name````\nis the human-readable name that's displayed in the viewers Models tab.\n\n````json\n{\n \"id\": \"WestRiversideHospital\",\n \"name\": \"West Riverside Hospital Project\",\n \"models\": [\n {\n \"id\": \"architectural\",\n \"name\": \"Hospital Architecture\"\n },\n {\n \"id\": \"structure\",\n \"name\": \"Hospital Structure\"\n },\n {\n \"id\": \"electrical\",\n \"name\": \"Hospital Electrical\",\n \"saoEnabled\": false\n }\n ],\n \"viewerConfigs\": {\n \"backgroundColor\": [\n 0.9,\n 0.9,\n 1.0\n ]\n },\n \"viewerContent\": {\n \"modelsLoaded\": [\n \"structure\",\n \"architectural\"\n ]\n },\n \"viewerState\": {\n \"tabOpen\": \"models\"\n }\n}\n````\n\nThe optional ````viewerConfigs```` section specifies configurations for the viewer to set on itself as it loads the\nproject. See the complete list of available viewer configurations in [Viewer Configurations](#viewer-configurations).\n\nThe optional ````viewerContent```` array specifies IDs of models that the viewer will load initially, right after it's\napplied the configurations.\n\nThe optional ````viewerState```` section specifies how the viewer should set up the initial state of its UI, right after\nits loaded the initial models. See the complete list of available viewer states in [Viewer States](#viewer-states).\n\nThe ````geometry.xkt```` file for each model is created from an IFC file using open source CLI tools. Learn how to\ncreate those files\nin *[Viewing an IFC Model with xeokit](https://www.notion.so/xeokit/Viewing-an-IFC-Model-with-xeokit-c373e48bc4094ff5b6e5c5700ff580ee)*\n.\n\n# Viewer Configurations\n\nThe table below lists the complete set of available configurations. Think of these as user preferences. These may be\nprovided to the viewer within project info files, as described in [Model Database](#model-database), or set\nprogrammatically on the viewer\nwith [````BIMViewer#setConfigs()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html#instance-method-setConfigs)\n, as described in [Configuring the Viewer](#configuring-the-viewer).\n\n| Property | Type | Range | Default Value | Description |\n|:-----------------------|:--------|:-----------------------|:----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| \"backgroundColor\" | Array | | ````[1.0,1.0,1.0]```` | Canvas background color | \n| \"cameraNear\" | Number | ````[0.01-0.1]```` | ````0.05```` | Distance to the near clipping plane |\n| \"cameraFar\" | Number | ````[1-100000000]```` | ````3000.0```` | Distance to the far clipping plane |\n| \"smartPivot\" | Boolean | | ````true```` | Enables a better pivot-orbiting experience when click-dragging on empty space in camera orbit mode. |\n| \"saoEnabled\" | Boolean | | ````true```` | Whether or not to enable Scalable Ambient Obscurance (SAO) |\n| \"saoBias\" | Number | ````[0.0...10.0]```` | ````0.5```` | SAO bias |\n| \"saoIntensity\" | Number | ````[0.0...200.0]```` | ````100.0```` | SAO intensity factor |\n| \"saoScale\" | Number | ````[0.0...1000.0]```` | ````500.0```` | SAO scale factor |\n| \"saoKernelRadius\" | Number | ````[0.0...200.0]```` | ````100.0```` | The maximum area that SAO takes into account when checking for possible occlusion |\n| \"saoBlur\" | Boolean | | ````true```` | Whether Guassian blur is enabled for SAO |\n| \"edgesEnabled\" | Boolean | | ````true```` | Whether or not to enhance edges on objects |\n| \"pbrEnabled\" | Boolean | | ````false```` | Whether or not to enable Physically Based rendering (PBR) |\n| \"viewFitFOV\" | Number | ````[10.0...70.0]```` | ````30```` | When fitting objects to view, this is the amount in degrees of how much they should fit the user's field of view |\n| \"viewFitDuration\" | Number | ````[0..5]```` | ````0.5```` | When fitting objects to view with an animated transition, this is the duration of the transition in seconds |\n| \"perspectiveFOV\" | Number | ````[10.0...70.0]```` | ````55```` | When in perspective projection, this is the field of view, in degrees, that the user sees |\n| \"objectColors\" | Object | | ````undefined```` | A map of custom attributes for various IFC types |\n| \"externalMetadata\" | Boolean | | ````false```` | Whether to load a metadata.json file with each geometry.xkt file |\n| \"xrayPickable\" | Boolean | | ````false```` | Whether we can interact with X-rayed objects using mouse/touch input |\n| \"selectedGlowThrough\" | Boolean | | ````true```` | Whether selected objects appear to \"glow through\" other objects |\n| \"highlightGlowThrough\" | Boolean | | ````true```` | Whether highlighted objects appear to \"glow through\" other objects |\n| \"dtxEnabled\" | Boolean | | ````false```` | Whether to enable xeokit's data texture-based (DTX) scene representation and rendering mode. This has a lower memory footprint than the standard vertex buffer object-based (VBO) mode, and loads fast, but may be slower on low-spec GPUs. |\n| \"showSpaces\" | Boolean | | ````false```` | Whether to enable the visibility of IfcSpace elements. When this is ````false````, then even though we can instruct BIMViewer to make IfcSpaces visible in the tree view or context menus, they will remain invisible. This config is also dynamically controlled by the \"Show IfcSpaces\" tool in the toolbar. |\n\n## Viewer States\n\nIn [Model Database](#model-database) we saw how a project can specify directives for how the viewer should set up the\ninitial state of its UI, right after the project has loaded. The table below lists the available directives. These can\nalso be set on the viewer\nusing [````BIMViewer#setViewerState()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html#instance-method-setViewerState)\n. So far, we have:\n\n| Property | Type | Range | Default Value | Description |\n|:----------------------|:------------------|:----------------------|:------------------|:----------------------------------|\n| \"focusObject\" | String | | | ID of object to focus on | \n| \"tabOpen\" | String | \"objects\", \"classes\" or \"storeys\" | | Which explorer tab to open | \n| \"expandObjectsTree\" | Number | [0..*] | 0 | How deep to expand the \"objects\" tree |\n| \"expandClassesTree\" | Number | [0..*] | 0 | How deep to expand the \"classes\" tree |\n| \"expandStoreysTree\" | Number | [0..*] | 0 | How deep to expand the \"storeys\" tree |\n| \"setCamera\" | { eye: Number[], look: Number[], up: Number[] } | | 0 | Camera position |\n\n# Deploying XKT V7 and Earlier\n\n> **This section describes how to deploy models that use older versions of XKT that don't combine geometry and metadata.\nFor those older versions,\n> we need a little extra plumbing to deploy an additional JSON metadata file for each model.**\n\nThe previous section described how to deploy models that used XKT V8 and later. The XKT V8+ format combines geometry and\nmetadata into the same XKT file, and was introduced in the\n[xeokit v1.9 release](https://www.notion.so/xeokit/What-s-New-in-xeokit-1-9-b7503ca7647e43e4b9c76e1505fa4484).\n\nXKT versions prior to V8 only contained geometry, and needed to be accompanied by a JSON file that contained the model's\nIFC metadata. In this section, we'll describe how to deploy models that use XKT versions prior to V8.\n\nLet's imagine that we want to deploy the Duplex and West Riverside Hospital projects, using XKT V7. For each model\nwithin our database, we'll deploy a ````geometry.xkt````, which is an XKT V7 file containing the model's geometry, and\na ````metadata.json ````, containing IFC metadata for the model.\n\nWe'll just assume that you've got those files already, and are not ready to convert their original IFC files into XKT\nV8+.\n\nHere's our database files again, this time with XKT V7 and accompanying metadata files:\n\n````\n.app/data/projects\n │\n ├── index.json\n │\n ├── Duplex\n │ │\n │ ├── index.json\n │ │\n │ └── models\n │ └── design\n │ ├── geometry.xkt\n │ └── metadata.json\n │\n └── WestRiversideHospital\n │\n ├── index.json\n │\n └── models\n ├── architecture \n │ ├── geometry.xkt\n │ └── metadata.json\n ├── structure \n │ ├── geometry.xkt\n │ └── metadata.json\n └── electrical\n ├── geometry.xkt \n └── metadata.json \n````\n\nTo make BIMViewer load both the ````geometry.xkt```` and ````metadata.json```` files for each model, we need to add a\nnew ````externalMetadata: true```` configuration to the ````viewerConfigs```` in the project's ````index.json```` file:\n\n````json\n{\n \"id\": \"WestRiversideHospital\",\n \"name\": \"West Riverside Hospital\",\n \"models\": [\n {\n \"id\": \"architectural\",\n \"name\": \"Hospital Architecture\"\n },\n {\n \"id\": \"structure\",\n \"name\": \"Hospital Structure\"\n },\n {\n \"id\": \"electrical\",\n \"name\": \"Hospital Electrical\",\n \"saoEnabled\": false\n }\n ],\n \"viewerConfigs\": {\n \"externalMetadata\": true, // <<------------ ADD THIS\n \"backgroundColor\": [\n 0.9,\n 0.9,\n 1.0\n ]\n },\n \"viewerContent\": {\n \"modelsLoaded\": [\n \"structure\",\n \"architectural\"\n ]\n },\n \"viewerState\": {\n \"tabOpen\": \"models\"\n }\n}\n````\n\n# Support for Multi-Part (Split) Models\n\nSince xeokit-bim-viewer 2.4, we can deploy models that are split into multiple XKT files (with optional external JSON\nmetadadata files).\n\nThe `ifc2gltf` tool from Creoox, which converts IFC files into glTF geometry and JSON metadata files, has the option to\nsplit its output into multiple pairs of glTF and JSON files, accompanied by a JSON manifest that lists the files.\n\nTo integrate with that option, the `convert2xkt` tool, which converts glTF geometry and JSON metadata files into XKT\nfiles, also has the option to batch-convert the glTF+JSON files in the manifest, in one invocation.\n\nWhen we use this option, convert2xkt will output a bunch of XKT files, along with a JSON manifest file that lists those\nXKT files.\n\nThis feature extends BIMViewer with the option to load models comprised of multiple XKT files, combining the XKT files into a single tree view for each model, and enabling the unloading of the model to unload all its XKT files in one shot. In other words, instead of having a separate model and tree view for each XKT, we can now group a bunch of XKT files together to behave as one model in BIMViewer.\n\nLearn more about the conversion of IFC models into multiple XKT files in [this tutorial](https://www.notion.so/xeokit/Importing-Huge-IFC-Models-as-Multiple-XKT-Files-165fc022e94742cf966ee50003572259).\n\nTo show how to deploy one of these multi-XKT models in BIMViewer, let's examine the Karhumaki project.\n\n---\n* [Load the Karhumaki Project in BIMViewer](https://xeokit.io/demo.html?projectId=Karhumaki)\n---\n\n````\n.app/data/projects\n │\n ├── index.json\n │\n └── Karhumaki\n │\n ├── index.json\n │\n └── models\n └── KarhumakiBridge \n ├── manifest.json \n ├── model.xkt \n ├── model_1.xkt\n ├── model_2.xkt\n ├── model_3.xkt\n ├── model_4.xkt\n ├── model_5.xkt\n ├── model_6.xkt\n ├── model_7.xkt\n ├── model_8.xkt\n └── model_9.xkt \n````\n\nThe `manifest.json` XKT manifest looks like this:\n\n````json\n{\n \"xktFiles\": [\n \"model.xkt\",\n \"model_1.xkt\",\n \"model_2.xkt\",\n \"model_3.xkt\",\n \"model_4.xkt\",\n \"model_5.xkt\",\n \"model_6.xkt\",\n \"model_7.xkt\",\n \"model_8.xkt\",\n \"model_9.xkt\"\n ]\n}\n````\n\nThe ````index.json```` for the \"Karhumaki\" project is shown below.\n\nWithin this file, as usual, the ````id```` of each model matches the name of that model's subdirectory. Each model's ````name```` is the human-readable name that's displayed in the viewers Models tab.\n\nTo indicate that the model is a multi-part model, with multiple XKTs, the model entry gets a ````manifest```` property containing the file name of our `manifest.json` file.\n\nIn `viewerContent`, we specify that our multipart model gets loaded immediately, as soon as the project is loaded.\n\n````json\n{\n \"id\": \"Karhumaki\",\n \"name\": \"Karhumaki\",\n \"models\": [\n {\n \"id\": \"Karhumaki-Bridge\",\n \"name\": \"Karhumaki Bridge\",\n \"manifest\": \"manifest.json\"\n }\n ],\n \"viewerConfigs\": {\n \"backgroundColor\": [\n 0.9,\n 0.9,\n 1.0\n ]\n },\n \"viewerContent\": {\n \"modelsLoaded\": [\n \"Karhumaki-Bridge\"\n ]\n },\n \"viewerState\": {\n \"tabOpen\": \"models\"\n }\n}\n````\n\n# Split Model with Separate Metadata Files\n\nIn recent versions of xeokit, we combine the geometry and metadata into the XKT files, for simplicity within the pipeline, as we've done in the example above.\n\nIn older versions of XKT, as mentioned above, we would have the metadata in separate JSON files, so that each XKT file would have the geometry, and would be accompanied by a JSON file containing its IFC metadata.\n\nBIMViewer, and the rest of the xeokit SDK, remains backwardly compatible with this XKT+JSON separation. The split-model loading feature also remains backwardly-compatible, as demonstrated in the \"WestRiversideHospital_Combined\" example project, described below.\n\n---\n* [Load the WestRiversideHospital_Combined Project in BIMViewer](https://xeokit.io/demo.html?projectId=WestRiversideHospital_Combined)\n---\n\nWe have our separated XKT and JSON metadata files in the `models` directory:\n\n````\n.app/data/projects\n │\n ├── index.json\n │\n └── WestRiversideHospital_Combined\n ├── index.json\n │\n └── models\n │\n └── WestRiversideHospital\n ├── architectural.json\n ├── architectural.xkt\n ├── electrical.json\n ├── electrical.xkt\n ├── fireAlarms.json\n ├── fireAlarms.xkt\n ├── manifest.json\n ├── mechanical.json\n ├── mechanical.xkt\n ├── plumbing.json\n ├── plumbing.xkt\n ├── sprinklers.json\n ├── sprinklers.xkt\n ├── structure.json\n └── structure.xkt\n````\n\nThe `manifest.json` XKT manifest looks as below. Notice the additional `metaModelFiles` property, which lists the JSON files that comprise the metamodel for the \"WestRiversideHospital\" model:\n\n````\n{\n \"xktFiles\": [\n \"architectural.xkt\",\n \"electrical.xkt\",\n \"fireAlarms.xkt\",\n \"mechanical.xkt\",\n \"plumbing.xkt\",\n \"sprinklers.xkt\",\n \"structure.xkt\"\n ],\n \"metaModelFiles\": [\n \"architectural.json\",\n \"electrical.json\",\n \"fireAlarms.json\",\n \"mechanical.json\",\n \"plumbing.json\",\n \"sprinklers.json\",\n \"structure.json\"\n ]\n}\n````\n\nFinally, the ````index.json```` for the \"WestRiversideHospital_Combined\" project is shown below.\n\nWithin this file, as before, the ````id```` of each model matches the name of that model's subdirectory, and Each model's ````name```` is the human-readable name that's displayed in the viewers Models tab.\n\nAs before, to indicate that the model is a multi-part model, with multiple XKTs, the model entry gets a ````manifest```` property containing the file name of our `manifest.json` file.\n\nIn `viewerContent`, we specify that our multipart model gets loaded immediately, as soon as the project is loaded.\n\n````json\n{\n \"id\": \"WestRiversideHospital_Combined\",\n \"name\": \"West Riverside Hospital\",\n \"models\": [\n {\n \"id\": \"WestRiversideHospital\",\n \"name\": \"West Riverside Hospital\",\n \"saoEnabled\": true,\n \"manifest\": \"manifest.json\"\n }\n ],\n \"viewerConfigs\": {\n \"backgroundColor\": [0.9, 0.9, 1.0],\n \"externalMetadata\": true\n },\n \"viewerContent\": {\n \"modelsLoaded\": [\n \"WestRiversideHospital\"\n ]\n },\n \"viewerState\": {\n \"viewCubeEnabled\": true,\n \"threeDEnabled\": true,\n \"tabOpen\": \"models\"\n }\n}\n````\n\n# Programming API\n\n> **This section goes deeper into the viewer, describing how to instantiate a viewer, and how to use its JavaScript\nprogramming API.**\n\nThe viewer is implemented by the\nJavaScript [````BIMViewer````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html)\nclass, which provides a complete set of methods to programmatically control it.\n\nUsing these methods, we can:\n\n* create and configure a viewer,\n* query what models are available,\n* load projects and models,\n* interact with the 3D view,\n* save and load BCF viewpoints,\n* control the various viewer tools, and\n* drive the state of the viewer's UI.\n\n## Creating a Viewer\n\nIn the example below, we'll create\na [````BIMViewer````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html), with\na [````Server````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/server/Server.js~Server.html) through which\nit will load projects and models from the file system.\n\nWe'll configure the ````Server```` to load that data from\nthe [````./app/data````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/data) directory.\n\nWe'll also configure our ````BimViewer```` with DOM elements to hold the four parts of its UI, which are:\n\n1. the 3D canvas,\n2. the explorer panel containing the tree views,\n3. the toolbar,\n4. the NavCube, and\n4. the \"backdrop\" element, which covers everything in the UI to prevent interaction whenever the viewer is busy loading\n a model.\n\n````javascript\nconst server = new Server({\n dataDir: \"./data\"\n});\n\nconst myBIMViewer = new BIMViewer(server, {\n canvasElement: document.getElementById(\"myCanvas\"), // The 3D WebGL canvas\n explorerElement: document.getElementById(\"myExplorer\"), // Container for the explorer panel\n toolbarElement: document.getElementById(\"myToolbar\"), // Container for the toolbar\n navCubeCanvasElement: document.getElementById(\"myNavCubeCanvas\"), // Canvas for the NavCube\n busyModelBackdropElement: document.querySelector(\".xeokit-busy-modal-backdrop\") // Busy modal dialog backdrop element\n});\n````\n\nConfiguring the ````BIMViewer```` with separate places in the document to locate its parts allows us to integrate them\nmore flexibly into our web page.\n\nIn our [````app/index.html````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/app/index.html) page, the HTML\nelements look like this:\n\n````html\n\n
\n
\n
\n
\n \n
\n
\n\n````\n\nSee [````app/css/style.css````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/app/css/style.css) for how we've\nstyled these elements.\n\nAlso\nsee [````dist/xeokit-bim-viewer.css````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/dist/xeokit-bim-viewer.css)\nfor the CSS styles that BIMViewer applies to the elements it creates internally.\n\n## Configuring the Viewer\n\nWith our viewer created, let's\nuse [````BIMViewer#setConfigs()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html#instance-method-setConfigs)\nto configure it.\n\nWe'll just set the canvas background color to white:\n\n````javascript\nmyBIMViewer.setConfigs({\n \"backgroundColor\": [1.0, 1.0, 1.0]\n});\n````\n\nSee [Viewer Configurations](#viewer-configurations) for the list of available configurations.\n\n## Querying Projects, Models and Objects\n\nWith our viewer created and configured, let's find out what content is available.\n\n### Getting Info on Available Projects\n\nLet's query what projects are available.\n\n````javascript\nmyBIMViewer.getProjectsInfo((projectsInfo) => {\n console.log(JSON.stringify(projectsInfo, null, \"\\t\"));\n});\n````\n\nInternally, the viewer will\ncall [````Server#getProjects()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/server/Server.js~Server.html#instance-method-getProjects)\nto get the projects info.\n\nAs described earlier in [Model Database](#model-database), the projects info is the JSON\nin [````./app/data/projects/index.json````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/data/projects/index.json)\n. We'll just log that info to the console.\n\nThe projects info will look similar to:\n\n````json\n{\n \"projects\": [\n {\n \"id\": \"Duplex\",\n \"name\": \"Duplex\"\n },\n {\n \"id\": \"Schependomlaan\",\n \"name\": \"Schependomlaan\"\n },\n {\n \"id\": \"WestRiversideHospital\",\n \"name\": \"West Riverside Hospital\"\n }\n ]\n}\n````\n\n### Getting Info on a Project\n\nNow we know what projects are available, we'll get info on one of those projects.\n\n````javascript\nmyBIMViewer.getProjectInfo(\"WestRiversideHospital\", (projectInfo) => {\n console.log(JSON.stringify(projectInfo, null, \"\\t\"));\n});\n````\n\nInternally, the viewer will\ncall [````Server#getProject()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/server/Server.js~Server.html#instance-method-getProject)\nto get that project info. Like before, we'll just log it to the console.\n\nThe project info will be the contents\nof [````./app/data/projects/WestRiversideHospital/index.json````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/data/projects/WestRiversideHospital/index.json)\n.\n\nThe project info will be similar to:\n\n````json\n{\n \"id\": \"WestRiversideHospital\",\n \"name\": \"West Riverside Hospital\",\n \"models\": [\n {\n \"id\": \"architectural\",\n \"name\": \"Hospital Architecture\"\n },\n {\n \"id\": \"structure\",\n \"name\": \"Hospital Structure\"\n },\n {\n \"id\": \"electrical\",\n \"name\": \"Hospital Electrical\",\n \"saoEnabled\": false\n }\n ],\n \"viewerConfigs\": {\n \"backgroundColor\": [\n 0.9,\n 0.9,\n 1.0\n ],\n \"saoEnabled\": true\n },\n \"viewerContent\": {\n \"modelsLoaded\": [\n \"structure\",\n \"architectural\"\n ]\n },\n \"viewerState\": {\n \"tabOpen\": \"models\"\n }\n}\n````\n\nIn this project info, we have:\n\n* **````id````** - ID of the project,\n* **````name````** - human-readable name of the project,\n* **````models````** - info on each model in this project,\n* **````viewerConfigs````** - configurations for the viewer to apply when loading the project,\n* **````viewerContent````** - which models the viewer should immediately load when loading the project, and\n* **````viewerState````** - how the viewer should set up its UI after loading the project.\n\nWhen we later load the project in section [Loading a Project](#loading_a_project), the viewer is going to pass\nthe ````viewerConfigs````\nto [````BIMViewer#setConfigs()````](https://xeokit.github.io/xeokit-sdk/docs/class/src/BIMViewer.js~BIMViewer.html#instance-method-setConfigs)\n, which we described earlier in [Configuring the Viewer](#configuring-the-viewer).\n\nIn the ````viewerConfigs```` we're enabling the viewer's Scalable Ambient Obscurance effect, which will create ambient\nshadows in the crevices of our models. This is an expensive effect for the viewer to render, so we've disabled it for\nthe \"electrical\" model, which contains many long, thin wire objects that don't show the SAO effect well.\n\n### Getting Info on an Object\n\nLet's attempt to get some info on an object within one of our project's models.\n\nWe say \"attempt\" because it's up to\nthe [````Server````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/server/Server.js~Server.html) to try to\nfind that info for us, which might not exist.\n\nInternally, the viewer will\ncall [````Server#getObjectInfo()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/server/Server.js~Server.html#instance-method-getObjectInfo)\n, which will attempt to load that object info from a file.\n\nIf you were to substitute ````Server```` with your own implementation, your implementation might get that info from a\ndata store, such as a relational database, populated with metadata for all the objects in your project's models, keyed\nto their IDs.\n\nWe'll go ahead and assume that our ````Server```` has info an an object.\n\n````javascript\nmyViewer.getObjectInfo(\"WestRiversideHospital\", \"architectural\", \"2HaS6zNOX8xOGjmaNi_r6b\",\n (objectInfo) => {\n console.log(JSON.stringify(objectInfo, null, \"\\t\"));\n },\n (errMsg) => {\n console.log(\"Oops! There was an error getting info for this object: \" + errMsg);\n });\n````\n\nIf the object does not exist in the specified project and model, the method will invoke its error callback.\n\nOur file system database does happen to have info for that object, stored\nin [````./app/data/projects/WestRiversideHospital/models/architectural/objects/2HaS6zNOX8xOGjmaNi_r6b.json````](https://github.com/xeokit/xeokit-bim-viewer/tree/master/app/data/projects/WestRiversideHospital/models/architectural/objects/2HaS6zNOX8xOGjmaNi_r6b.json)\n.\n\nSince our object info exists, we'll get a result similar to this:\n\n````json\n{\n \"id\": \"2HaS6zNOX8xOGjmaNi_r6b\",\n \"projectId\": \"WestRiversideHospital\",\n \"modelId\": \"architectural\",\n \"name\": \"Basic Wall:Exterior - Metal Panel on Mtl. Stud:187578\",\n \"type\": \"IfcWall\",\n \"parent\": \"2hExBg8jj4NRG6zzD0RZML\"\n}\n```` \n\n> By now, you've probably noticed that our file system database is structured to\n> support [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) URIs, which\n> our [````Server````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/server/Server.js~Server.html) constructs\n> from the project, model and object IDs we supplied to the viewer's query methods.\n\n## Loading Projects and Models\n\nLet's now load some of the projects and models that we queried in the previous section.\n\n### Loading a Project\n\nLet's start by loading the project we just queried info on.\n\n````javascript\nmyBIMViewer.loadProject(\"WestRiversideHospital\",\n () => {\n console.log(\"Nice! The project loaded successfully.\");\n },\n (errMsg) => {\n console.log(\"Oops! There was an error loading this project: \" + errMsg);\n });\n````\n\nIf that succeeds, the viewer will now have two models loaded, ````\"architectural\"```` and ````\"structure\"````, since\nthose are specified in the project info's ````viewerContent````.\n\nThe viewer will also enable Scalable Ambient Obscurance, since that's specified by the ````saoEnabled```` property in\nthe ````viewerConfigs````. The viewer will also set various other configs on itself, as specified in that section.\n\nThe viewer will also open its \"Models\" tab, thanks to the ````tabOpen```` property in the project\ninfo's ````viewerState```` section.\n\nWe can confirm that the two models are loaded by querying the IDs of the models that are currently loaded in the viewer:\n\n````javascript\nconst modelIds = myBIMViewer.getModelLoadedIds();\n\nconsole.log(modelIds);\n````\n\nThe result would be:\n\n````json\n[\n \"architectural\",\n \"structure\"\n]\n````\n\n### Loading a Model\n\nWith our project loaded, let's load another of its models.\n\nWe could start by getting the IDs of all the models in our project, just to make sure the model is available:\n\n````javascript\nconst modelIds = myBIMViewer.getModelIds();\n\nconsole.log(modelIds);\n````\n\nThe result would be:\n\n````json\n[\n \"architectural\",\n \"structure\",\n \"electrical\"\n]\n````\n\nTo load the model:\n\n````javascript\nmyBIMViewer.loadModel(\"electrical\",\n () => {\n console.log(\"Nice! The model loaded successfully.\");\n },\n (errMsg) => {\n console.log(\"Oops! There was an error loading this model: \" + errMsg);\n });\n````\n\nIf we no longer need that model, we can unload it again:\n\n````javascript\nmyBIMViewer.unloadModel(\"electrical\");\n````\n\nWhen we no longer need the project, unload like so:\n\n````javascript\nmyBIMViewer.unloadProject();\n````\n\nNote that we can only load one project at a time.\n\n## Controlling Viewer State\n\n[````BIMViewer````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html) has various\nmethods with which we can programmatically control the state of its UI.\n\nLet's take a quick look at some of these methods to get an idea of what sort of UI state we can control with them. This\nwon't be an exhaustive guide - see the ````BIMViewer```` class documentation for the complete list.\n\nHaving loaded a couple of models in the previous section, let's open the viewer's Objects tab, which contains a tree\nview of the containment hierarchy of the objects within those models:\n\n````javascript\nmyBIMViewer.openTab(\"objects\");\n````\n\nTo confirm which tab is currently open:\n\n````javascript\nconst tabId = myBIMViewer.getOpenTab();\n\nconsole.log(\"Currently open tab: '\" + tabId + \"'\"); // \"objects\"\n````\n\nNow let's arrange the camera to fit an object in view:\n\n````javascript\nmyBIMViewer.flyToObject(\"1fOVjSd7T40PyRtVEklS6X\", () => { /* Done */\n});\n````\n\nTODO: Complete this section once API methods are finalized\n\n## Saving and Loading BCF Viewpoints\n\n[Bim Collaborative Format](https://en.wikipedia.org/wiki/BIM_Collaboration_Format) (BCF) is a format for managing issues\non a BIM project. A BCF record captures the visual state of a BIM viewer, which includes the camera position, the\nvisibility and selected states of the objects, and any section planes that are currently active.\n\nA BCF record saved from one BIM viewer can be loaded into another viewer, to synchronize the visual states of both\nviewers.\n\nNote that BCF viewpoints do not record which models are currently loaded. It's assumed that both the source and target\nviewers have the same models loaded.\n\nUse\nthe [````BIMViewer#saveBCFViewpoint()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html#instance-method-saveBCFViewpoint)\nto save a JSON BCF record of the current view:\n\n````javascript\nconst viewpoint = bimViewer.saveBCFViewpoint({\n // Options - see BIMViewer#saveBCFViewpoint() documentation for details\n});\n````\n\nOur viewpoint JSON will look similar to below. Before saving this viewpoint, we've hidden one object, selected another\nobject, and created section plane to slice our model. The viewpoint also contains a PNG snapshot of the viewer's canvas,\nwhich we've truncated here for brevity.\n\n````\n{\n perspective_camera: {\n camera_view_point: { x: 0.0, y: 0.0, z: 0.0 },\n camera_direction: { x: 1.0, y: 1.0, z: 2.0 },\n camera_up_vector: { x: 0.0, y: 0.0, z: 1.0 },\n field_of_view: 90.0\n },\n lines: [],\n clipping_planes: [{\n location: { x: 0.5, y: 0.5, z: 0.5 },\n direction: { x: 1.0, y: 0.0, z: 0.0 }\n }],\n bitmaps: [],\n snapshot: {\n snapshot_type: png,\n snapshot_data: \"data:image/png;base64,......\"\n },\n components: {\n visibility: {\n default_visibility: false,\n exceptions: [{\n ifc_guid: 4$cshxZO9AJBebsni$z9Yk,\n originating_system: xeokit.io,\n authoring_tool_id: xeokit/v1.0\n }]\n },\n selection: [{\n ifc_guid: \"4$cshxZO9AJBebsni$z9Yk\",\n }]\n }\n}\n````\n\nUse\nthe [````BIMViewer#loadBCFViewpoint()````](https://xeokit.github.io/xeokit-bim-viewer/docs/class/src/BIMViewer.js~BIMViewer.html#instance-method-loadBCFViewpoint)\nto load a JSON BCF record:\n\n````javascript\nbimViewer.loadBCFViewpoint(viewpoint, {\n // Options - see BIMViewer#loadBCFViewpoint() documentation for details\n});\n````\n\n# Customizing Viewer Style\n\nThe [````app/index.html````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/app/index.html) file for the\nstandalone viewer contains CSS rules for the various viewer elements, which you can modify as required.\n\n## Modal Busy Dialog\n\nThe viewer displays a modal dialog box whenever we load a model. The dialog box has a backdrop element, which overlays\nthe viewer. Whenever the dialog becomes visible, the backdrop will block interaction events on the viewer's UI.\n\nWithin our [````app/index.html````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/app/index.html) page, the\nmain ````
```` is the backdrop element:\n\n````html\n\n
\n
\n
\n
\n \n
\n
\n\n````\n\nAs defined in [````css/BIMViewer.css````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/css/BIMViewer.css),\nthe backdrop gets the following style, which allows the dialog to position itself correctly within the backdrop:\n\n````css\n.xeokit-busy-modal-backdrop {\n position: relative;\n}\n````\n\nIf you need to tweak CSS relating to the dialog, search for \"xeokit-busy-dialog\"\nwithin [````css/BIMViewer.css````](https://github.com/xeokit/xeokit-bim-viewer/blob/master/css/BIMViewer.css).\n\n## Tooltips\n\nTooltips are not part of the core JavaScript for the viewer. Instead, viewer HTML elements are marked\nwith ````data-tippy-content```` attributes that provide strings to show in their tooltips.\n\nFor example, the *Toggle 2D/3D* button's element looks like this:\n\n````html\n\n\n```` \n\nIn the [app/index.html](https://github.com/xeokit/xeokit-bim-viewer/blob/master/app/index.html) file for the standalone\nviewer, we're using [tippy.js](https://github.com/atomiks/tippyjs), which automatically creates tooltips for those\nelements.\n\n## Customizing Appearances of IFC Types\n\nBy default, BIMViewer loads whatever object colors and opacities are in the XKT model files, without changing them.\nSometimes, however, certain types of objects may have colors that make it hard for us to view the model. \n\nFor example, in some IFC models, ````IfcPlate```` types may be used to represent windows, and those types are often given opaque \ncolors. That results in the windows of our model being opaque. For this example, we can make the windows transparent \nby configuring the BIMViewer, or just that model, with a custom color or opacity, for that ````IfcPlate```` type. That would make\nall ````IfcPlate```` types transparent again. There are two ways we can do this - programmatically via ````BIMViewer.setConfigs````, or \nfor each project individually, via the project's `index.json` file.\n\nIn the code below, we'll configure all ````IfcSpace````, ````IfcWindow````, ````IfcOpeningElement```` and ````IfcPlate```` types \nto be transparent, and while we're at it, we'll make ````IfcWindow```` types to be always blue. Note that all values are in range ````[0..1]````. \n\n---\n\n Note that prior to v2.4, BIMViewer did change the colors and opacities of `IfcOpening`, `IfcSpace`, `IfcWindow` and `IfcPlate` by \n default. We've removed that in v2.4, because it was confusing \n and users wondered why those object types did not have the colors/opacities defined for them in the model.\n\n---\n\n````javascript\n// In case the model has opaque colors for IfcSpace, IfcWindow, IfcOpeningElement and IfcPlate \n// objects, let's make those objects always transparent. To make the model look extra nice,\n// let's force IfcWindows to always be blue, while we're at it. This will apply to all models,\n// except where we override the settings per-project, as shown next.\n\nbimViewer.setConfigs({\n \"objectColors\": {\n \"IfcSpace\": {\n \"opacity\": 0.3\n },\n \"IfcWindow\": {\n \"opacity\": 0.4,\n \"color\": [0, 0, 1]\n },\n \"IfcOpeningElement\": {\n \"opacity\": 0.3\n },\n \"IfcPlate\": {\n \"opacity\": 0.3\n }\n }\n});\n````\n\nThe other way we can set these color/opacity customizations is per-project, within the ````viewerConfigs```` section of \na project's ````index.json```` file. If we've also set them via ````BIMViewer.setConFigs````, then these will override \nthe ones set via that method.\n\nAs an example, we've done this for the `OTCConferenceCenter` demo model, which otherwise has its windows opaque, which would make it hard \nfor us to navigate around that model. Therefore, we provide a custom map of colors and opacities for certain IFC types via \nthe ```viewerConfigs``` in the [project ````index.json```` for that model](https://github.com/xeokit/xeokit-bim-viewer/blob/master/app/data/projects/OTCConferenceCenter/index.json), as shown below.\n\n````json\n{\n \"id\": \"otcConferenceCenter\",\n \"name\": \"OTC Conference Center\",\n \"models\": [\n {\n \"id\": \"design\",\n \"name\": \"OTC Conference Center Design\"\n }\n ],\n \"viewerConfigs\": {\n \"backgroundColor\": [\n 0.95,\n 0.95,\n 1.0\n ],\n \"objectColors\": {\n \"IfcSpace\": {\n \"opacity\": 0.3\n },\n \"IfcWindow\": {\n \"opacity\": 0.4\n },\n \"IfcOpeningElement\": {\n \"opacity\": 0.3\n },\n \"IfcPlate\": {\n \"opacity\": 0.3\n }\n }\n },\n \"viewerContent\": {\n \"modelsLoaded\": [\n \"design\"\n ]\n },\n \"viewerState\": {\n \"tabOpen\": \"objects\",\n \"expandObjectsTree\": 3,\n \"expandClassesTree\": 1,\n \"expandStoreysTree\": 1\n }\n}\n````\n\n\n## Localizing a Viewer\n\nThe easiest way to localize a BIMViewer is by loading translation strings into its locale service, which is implemented\nby a\nxeokit [LocaleService](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/localization/LocaleService.js~LocaleService.html)\n.\n\nThe snippet below shows how it's done, using a partial set of the translations expected by the components\nwithin the BIMViewer. We'll just show the translations for the faces of the NavCube. We'll also load the translations\ninline, rather than fetch them from a separate JSON file, as we would in practice.\n\nWe call translations \"messages\". Our metaphor is that the UI \"conveys messages to the user\".\n\nTo see all the translations expected by a BIMViewer, take a look at the translations we've configured for the bundled\nBIMViewer\ndemo application: [````/app/locales/messages.js````](/app/locales/messages.js).\n\n````javascript\nmyBIMViewer.localeService.loadMessages({\n \"en\": { // English\n \"NavCube\": {\n \"front\": \"Front\",\n \"back\": \"Back\",\n \"top\": \"Top\",\n \"bottom\": \"Bottom\",\n \"left\": \"Left\",\n \"right\": \"Right\"\n },\n //..\n },\n \"mi\": { // Māori\n \"NavCube\": {\n \"front\": \"Mua\",\n \"back\": \"Tuarā\",\n \"top\": \"Runga\",\n \"bottom\": \"Raro\",\n \"left\": \"Mauī\",\n \"right\": \"Tika\"\n },\n //..\n },\n \"fr\": { // French\n \"NavCube\": {\n \"front\": \"Avant\",\n \"back\": \"Arrière\",\n \"top\": \"Supérieur\",\n \"bottom\": \"Inférieur\",\n \"left\": \"Gauche\",\n \"right\": \"Droit\"\n },\n //..\n },\n \"jp\": { // Japanese\n \"NavCube\": {\n \"front\": \"前部\",\n \"backLabel\": \"裏\",\n \"topLabel\": \"上\",\n \"bottomLabel\": \"底\",\n \"leftLabel\": \"左\",\n \"rightLabel\": \"右\"\n },\n //..\n },\n});\n````\n\nOnce we've loaded our translations, we can switch the BIMViewer between locales like so:\n\n````javascript\nmyBIMViewer.localeService.locale = \"jp\";\n````\n\n# xeokit Components Used in the Viewer\n\nThe viewer is built on various [xeokit SDK](http://xeokit.io) components and plugins that are designed to accelerate the\ndevelopment of BIM and CAD visualization apps.\n\nThe table below lists the main ones used in this viewer.\n\n| Component | Purpose | \n|:-----------------------|:------------------|\n| [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html) | The WebGL-based viewer at the heart of ````BIMViewer````. |\n| [````XKTLoaderPlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js~XKTLoaderPlugin.html) | Loads model geometry and metadata. |\n| [````NavCubePlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/NavCubePlugin/NavCubePlugin.js~NavCubePlugin.html) | Navigation cube gizmo that allows us to rotate the scene and move the camera to look at it along a selected axis or diagonal. |\n| [````TreeViewPlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/TreeViewPlugin/TreeViewPlugin.js~TreeViewPlugin.html) | Implements the Objects, Classes and Storeys tree views within the explorer panel. |\n| [````SectionPlanesPlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js~SectionPlanesPlugin.html) | Manages interactive section planes, which are used to slice objects to reveal inner structures. |\n| [````BCFViewpointsPlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js~BCFViewpointsPlugin.html) | Saves and loads BCF viewpoints. |\n| [````ContextMenu````](https://xeokit.github.io/xeokit-sdk/docs/class/src/extras/ContextMenu/ContextMenu.js~ContextMenu.html) | Implements the context menus for the explorer tree views and 3D canvas. |\n\n# Building the Viewer\n\n## Installing from NPM\n\nTo install the npm package:\n\n````\nnpm i @xeokit/xeokit-bim-viewer\n````\n\n## Building the Binary\n\nRun the command below to build the ES6 module in ````/dist/xeokit-bim-viewer.es.js````.\n\n````\nnpm run build\n````\n\n## Building the Documentation\n\nTo build the API documentation in ````/docs/````:\n\n````\nnpm run docs\n````\n\n\n\n\n\n", "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/README.md", "name": "./README.md", "static": true, "access": "public" }, { "kind": "packageJSON", "content": "{\n \"name\": \"@xeokit/xeokit-bim-viewer\",\n \"version\": \"2.4.9-alpha-38\",\n \"description\": \"BIM viewer built on xeokit\",\n \"main\": \"dist/xeokit-bim-viewer.min.es.js\",\n \"files\": [\n \"/dist/xeokit-bim-viewer.min.es.js\",\n \"/dist/xeokit-bim-viewer.es.js\",\n \"/dist/xeokit-bim-viewer.css\",\n \"/dist/messages.js\"\n ],\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n \"build\": \"rollup --config rollup.config.js; rollup --config rollup.dev.config.js; cp locales/messages.js ./dist/.\",\n \"docs\": \"./node_modules/.bin/esdoc\",\n \"publish\": \"npm publish --access public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/xeokit/xeokit-bim-viewer.git\"\n },\n \"keywords\": [\n \"OpenProject\",\n \"webgl\",\n \"javascript\",\n \"xeokit\",\n \"xeolabs\",\n \"ifc\",\n \"bim\",\n \"buildingsmart\",\n \"openbim\",\n \"opensource\",\n \"3d-viewer\"\n ],\n \"author\": \"Lindsay Kay\",\n \"license\": \"See LICENSE.txt\",\n \"bugs\": {\n \"url\": \"https://github.com/xeokit/xeokit-bim-viewer/issues\"\n },\n \"homepage\": \"https://github.com/xeokit/xeokit-bim-viewer#readme\",\n \"devDependencies\": {\n \"@rollup/plugin-node-resolve\": \"^13.2.1\",\n \"autoprefixer\": \"^9.8.6\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"puppeteer\": \"^10.1.0\",\n \"rollup\": \"^2.70.2\",\n \"rollup-plugin-terser\": \"^7.0.2\"\n },\n \"dependencies\": {\n \"@xeokit/xeokit-sdk\": \"2.4.0-alpha-73\",\n \"http-server\": \"^13.0.2\"\n }\n}\n", "longname": "/home/lindsay/xeolabs/xeokit-bim-viewer-sep13/package.json", "name": "package.json", "static": true, "access": "public" } ]