element where the scene will be displayed\r\n\r\n\t\tconst fancyExtras_YES = true;\r\n\t\tthis.OB.comp = await init_OpenBimComponents(container, fancyExtras_YES, false);\r\n\r\n\t /* NB: init_OpenBimComponents won't work before here/this place, because we need DOM,\r\n to get viewerContainer, which is: UIManager._components.renderer.get().domElement.parentElement */\r\n\r\n\t\tif (this.turnOn_hoverHighlight) {\r\n\t\t\tinitHover_RayCaster(this.OB.comp); // just after init_OpenBimComponents.\r\n\t\t} // JG: I turn this off for possible TH speedup.\r\n\t\t\r\n\t\tthis.OB.highlighter = CollabHighlightInitiator.initSelection_Highlighter(this.OB.comp, this.OB);\r\n\t\tif (this.threeSel != null) {\r\n\t\t\tthis.threeSel.OB = this.OB;\r\n\t\t}\r\n\t\tconsole.log('openbim-container has now given ThreeSel access to OB/highlighter.');\r\n\t\t\r\n\t\tthis.OB.mgr = this.OB.comp.tools.get(OBC.FragmentManager); \r\n\r\n\t\tthis.OB.loader = makeIfcLoader(this.OB.comp);\r\n\t\tthis.OB.mpkLoader = new EgFragmentLoader(this.OB.comp);\r\n\t\tconst toolbar = init_IfcLoader_Toolbars(this.OB.comp, this.OB.mgr!, this.OB.loader);\r\n\t\t\r\n\t\ttoolbar.visible = false;\r\n\r\n\t\tthis.setupTools();\r\n\t\t\r\n\t\tconsole.log('now .model-revision-container is draggable..');\r\n\t\t$('.model-revision-container').draggable();\r\n\t\t\r\n\t\tconsole.log('XYQ openbim-container.attached wants to call load_An_IfcUrl with bound this.revisionId', this.revisionId);\r\n\t\tif (this.revisionId) {\r\n\t\t\tlet fragModel:FragmentsGroup|null = await this.load_An_IfcUrl(this.fileId, this.revisionId);//in-attached \r\n\t\t} else {\r\n\t\t\tconsole.warn('(OBC-attached: - as no revisionId yet, not trying to load anything yet.)');\r\n\t\t}\r\n\t}\r\n\r\n\tprivate setupTools() {\r\n\t\tconst defaultTool = new ObjectSelectionTool(this.OB, this.OB.highlighter!, this.aggr);\r\n\t\tthis.modeToolHandler = new ModeToolHandler(defaultTool);\r\n\t\tconst container: HTMLElement | null = document.getElementById('container');\r\n\t\tif (container == null) {\r\n\t\t\tthrow new Error('Could not find the container element. Please set the OpenBim viewer container id to \"container\"');\r\n\t\t}\r\n\t\tModeToolHandler.setupToolEventsWithoutAurelia(container, this.modeToolHandler);\r\n\t\tif (this.OB.comp) {\r\n\t\t\tconst openBimViewerThreeDService = new OpenBimViewerThreeDService(this.modeToolHandler, this.OB.comp, defaultTool);\r\n\t\t\tthis.T3D_Svc = openBimViewerThreeDService;\r\n\t\t\tthis.OB.openbimViewerThreeDService = openBimViewerThreeDService;\r\n\t\t\tthis.loadCallbackSubscribers.push(...openBimViewerThreeDService.loadEventsSubscribers);\r\n\t\t}\r\n\t}\r\n\r\n//public static theModel:FragmentsGroup|undefined;\r\n\r\n\tasync load_An_IfcUrl(\r\n\t\tIFC_model_id:string, //IFC_model: BimViewerFileDtoSplitView, \r\n\t\trevision_id:string //revision: BimViewerRevisionDtoSplitView\r\n\t):Promise
{\r\n\t\tconsole.log('openbimContainer.load_An_IfcUrl, projectId is now:', this.projectId);\r\n\t\t\r\n\t\tlet prjId = this.projectId;\r\n\t\tlet orgId = this.orgId2;\r\n\r\n\t\t//const fragmentsGroup_Model: FragmentsGroup = await this.loadIfcAsFragment(orgId, prjId, IFC_model_id, revision_id);\r\n\t\tconst fragmentsGroup_Model: FragmentsGroup|null = await this.getFragmentForRevision_Somehow(orgId, prjId, IFC_model_id, revision_id);\r\n\t\tif (!fragmentsGroup_Model) {\r\n\t\t\tconsole.warn('load_An_IfcUrl got no fragmentsGroup');\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t//OpenbimContainer.theModel = fragmentsGroup_Model; // fixme.\r\n\t\tthis.OB.theModel = fragmentsGroup_Model;\r\n\t\t\r\n\t\tconst THREE_scene:THREE.Scene = this.OB.comp!.scene.get();\r\n\t\tTHREE_scene.add(fragmentsGroup_Model);\t// (No Culler used here.)\r\n\t\t\r\n\t\t// Call all subscribers that the model is loaded\r\n\t\tthis.loadCallbackSubscribers.forEach(subscriber => subscriber.afterModelLoad());\r\n\t\t\r\n\t\treturn fragmentsGroup_Model;\r\n\t}\r\n\r\n\tprivate async getFragmentForRevision_Somehow(\r\n\t\torgId: string, prjId: string, IFC_model_id: string, revision_id: string\r\n\t) : Promise {\r\n\r\n console.log('fileId:', IFC_model_id);\r\n\t const media:OB_RevisionMediaStatus = await this.GetRevision_MediaStatus(revision_id, IFC_model_id);\r\n\t\tconsole.log('GetRevision_MediaStatus said:', media);\r\n \r\n //let fragmentsGroup_Model: FragmentsGroup|undefined;\r\n\t\t\r\n if (media.has_fragment && this.useMessagePack) {\r\n\t\t\tlet from_MDK: FragmentsGroup | null;\r\n\t\t\tconsole.log('will attempt MDK');\r\n\t\t\tfrom_MDK = await this.loadMpk(media);\r\n\t\t\tif (from_MDK) {\r\n\t\t\t\tconsole.log('got from MDK:', from_MDK);\r\n\t\t\t\treturn from_MDK;\r\n\t\t\t}\r\n }\r\n\r\n if (media.has_ifc) {\r\n\t\t\tlet from_ParsedIFC: FragmentsGroup | null;\r\n\t\t\tconsole.log('will attempt IFC');\r\n\t\t\tfrom_ParsedIFC = await this.load_IFC_AsFragment(orgId, prjId, IFC_model_id, revision_id, media);\r\n\t\t\tconsole.log('got from IFC:', from_ParsedIFC);\r\n\t\t\treturn from_ParsedIFC;\r\n }\r\n\t\t\r\n console.warn('no media found for revisionId:', revision_id);\r\n return null;\r\n\t}\r\n\r\n\r\n\t/*\r\n\tasync fetch_IFCFile_asArrayBuffer(url:string): Promise {\r\n\t\tif (this.FetchWithProgress) {\r\n\t\t\treturn await this.fetch_UrlBlob_asArrayBuffer(url); // this should work for both cases!\r\n\t\t}\r\n\t\t// IE fetch IFC, NOT MPK-fragment!\r\n\t\ttry {\r\n\t\t\t// IFC_file: Response = await fetch(media.ifc_url);\r\n\t\t\tlet IFC_file: Response = null;\r\n\t\t\tIFC_file = await fetch(url);\r\n\t\t\tif (IFC_file) {\r\n\t\t\t\tlet IFC_data: ArrayBuffer|undefined = await IFC_file.arrayBuffer();\r\n\t\t\t\treturn IFC_data;\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error('EMPTY IFC_file in loadIfcAsFragment?', IFC_file);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t} catch (problems) {\r\n\t\t\tconsole.error('exc in loadIfcAsFragment fetch', problems);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\t*/\r\n\r\n\tasync oldFetch(url:string):Promise {\r\n\t\tconst fragmentZipResponse : Response = await fetch(url); //media.fragment_url);\r\n\t\tconsole.log('After fetch of', url); //media.fragment_url)\r\n\t\tconst fragmentZipData : ArrayBuffer = await fragmentZipResponse.arrayBuffer();\r\n\t\treturn fragmentZipData;\r\n\t}\r\n\r\n\tasync parseMPK(fragmentZipData:ArrayBuffer|null): Promise {\r\n\t\tif (fragmentZipData == null) { return null; }\r\n\r\n\t\tconst fragmentBuffer = new Uint8Array(fragmentZipData);\r\n\t\t\r\n\t\tconst fragmentsGroup : FragmentsGroup = this.OB.mpkLoader?.loadFromMessagePackZip(fragmentBuffer, \"example\")!;\r\n\t\tif (fragmentsGroup) {\r\n\t\t\tthis.OB.mgr?.groups.push(fragmentsGroup);\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Could not load data\");\r\n\t\t}\r\n\r\n\t\tfragmentsGroup.items.forEach(f => {\r\n\t\t\tif (!this.OB.mgr) { return null; }\r\n\t\t\t\r\n\t\t\tthis.OB.mgr.meshes.push(f.mesh);\r\n\t\t\t//this.Manager.list[f.mesh.uuid] = f;\r\n\t\t\tthis.OB.mgr.list[f.id] = f;\r\n\t\t});\r\n\r\n\t\tawait this.OB.mgr?.updateWindow();\r\n\t\t\r\n\t\t// Raycast will not work without this\r\n\t\tthis.OB.comp?.meshes.push(...fragmentsGroup.items.map(f => f.mesh));\r\n\r\n\t\tconst camera = this.OB.comp?.camera.get();\r\n\t\tcamera.updateMatrixWorld(true);\r\n\t\tcamera.updateProjectionMatrix();\r\n\t\tawait this.OB.highlighter!.update();\r\n\t\treturn fragmentsGroup;\r\n\t}\r\n\r\n async loadMpk(media:OB_RevisionMediaStatus):Promise {\r\n\t\ttry {\r\n\t\t\t//const fragmentZipData:ArrayBuffer|null = await this.fetch_UrlBlob_asArrayBuffer(media.fragment_url);\r\n\t\t\t//return this.parseMPK(fragmentZipData);\r\n\t\t\tconst fragGroup:FragmentsGroup|null = await this.fetch_MpkBlob_as_FragGroup(media.fragment_url);\r\n\t\t\treturn fragGroup;\r\n\t\t} catch (error) { console.error('Loading of fragment failed. Aborting.', error); }\t\t\r\n\t\treturn null;\r\n }\r\n\t\r\n\tprivate async fetch_MpkBlob_as_FragGroup(fragment_url:string):Promise {\r\n\t\tconst self = this;\r\n\t\tconst model:DownloadModel = {\r\n\t\t\turl:fragment_url,\r\n\t\t\tasync act(inputModel:DownloadModel,arrayBuffer:ArrayBuffer):Promise { \r\n\t\t\t\tupdate_IFC_Progress(50,'Parsing MPK to Fragment Group');\r\n\t\t\t\treturn await self.parseMPK(arrayBuffer); \r\n\t\t\t}\r\n\t\t};\r\n\t\tconst ab:FragmentsGroup|null = await this.fetch_UrlBlob_asANY(model);\t\r\n\t\treturn ab;\r\n\t}\r\n\r\n\tasync fetch_UrlBlob_asANY(model:DownloadModel):Promise {\r\n\t\tconsole.log('fetch_UrlBlob_asArrayBuffer', model.url); \r\n\t\tlet dlgResult:DialogCloseResult = \r\n\t\t\tawait (this.dlg.open({model:model, viewModel:DownloadProgress}).whenClosed()); // (whenClosed corresponds to a double-await through .closeResult.)\t\r\n\t\t\r\n\t\tconsole.log('OB-container got DialogCloseResult:', dlgResult);\r\n\t\tconst fragGroupOrArrayBuffer:any|null = dlgResult.output;\r\n\t\tconsole.log('got fragmentsGroup:', fragGroupOrArrayBuffer);\r\n\t\treturn fragGroupOrArrayBuffer;\r\n\t}\r\n\r\n\tprivate async load_IFC_AsFragment(orgId: string, prjId: string, IFC_model_id: string, revision_id: string, media:OB_RevisionMediaStatus) : Promise {\r\n\t\tconst self = this;\r\n\t\tconst model:DownloadModel = {\r\n\t\t\turl:media.ifc_url,\r\n\t\t\tasync act(inputModel:DownloadModel,arrayBuffer:ArrayBuffer):Promise {\r\n\t\t\t\tupdate_IFC_Progress(50,'Parsing IFC to Fragment Group');\r\n\t\t\t\tconst fg:FragmentsGroup|null = await self.parse_OBFragment(arrayBuffer); \r\n\t\t\t\treturn fg;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst fg:FragmentsGroup|null = await this.fetch_UrlBlob_asANY(model);\t\r\n\t\treturn fg;\r\n\t}\r\n\r\n\tasync parse_OBFragment(IFC_data: ArrayBuffer|null):Promise {\r\n\t\tif (!IFC_data) { return null; }\r\n\t\ttry {\r\n\t\t\tconst IFC_buffer = new Uint8Array(IFC_data);\r\n\t\t\tconst IFC2Frag_loader = this.OB.loader!;\r\n\t\t\tconst fragmentsGroup_Model: FragmentsGroup = await IFC2Frag_loader.load(IFC_buffer, \"example\"); // mon vi burde sikre, at det NAME er bedre end 'example'? (hvis det f.eks. ryger i et map.)\r\n\t\t\tconsole.log('load_An_IfcUrl got FragmentsGroup', fragmentsGroup_Model);\r\n\t\t\tawait this.OB.highlighter!.update();\r\n\t\t\tconsole.log('doing highlight-update!', this.OB.highlighter);\r\n\t\t\treturn fragmentsGroup_Model;\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tconsole.error('loadIfcAsFragment, exc:', e);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\r\n\t/* we must offload this decision to the server.\r\n\tthe server must check the blob situation.\r\n\tit should use the proper storage account. (test, prod etc.)\r\n\tit will report back a dto with either what to do, or what is possible.\r\n\tProbably 'hasFragment bool' - presumption is, ifc would always be there..\r\n\tStill, server should only tell what is possible and how to do it,\r\n\tclient should decide 'what to do'.\r\n\t\r\n\tidea, first version milestone does NOT 'do fragments' / always replies false,\r\n\tinstead it just reports the correctly built URL.\r\n\t\t//let notUsed = `https://aoc1bim1sa.blob.core.windows.net/org-${orgId}/prj-${prjId}/file-${IFC_model_id}/rev-${revision_id}.ifc`;\r\n\t\t//console.log('old, url4 said:', notUsed);\t\r\n\t */\r\n\r\n\r\n\r\n\tasync GetRevision_MediaStatus(revisionId:string, modelId:string):Promise { // GetRevision_MediaStatus\r\n\t\tconst path = `BimsyncViewer/GetRevision_MediaStatus?aocProjectId=${this.appContext.projectId}&modelId=${modelId}&revisionId=${revisionId}`;\r\n\t\tlet ob_RevisionMediaStatus: OB_RevisionMediaStatus = \r\n\t\t\tawait this.api.project(this.appContext.projectId).get(path).jsonResult();\r\n\t\treturn ob_RevisionMediaStatus;\r\n\t}\r\n \r\n\t// A lot of this, we should define an interface for it?\r\n\t// cloned from bim-viewer-three-d.ts\r\n\tprivate subscriptions: Subscription[] = [];\r\n\r\n\t// We want our own OB-'RevisionInformation3d' to remember openBim stuff.\r\n\tprivate loadedRevisions: Map = new Map(); //Key revision, ModelInfo\r\n\t\r\n\thasModelShowing(): boolean {\r\n\t\tlet revs = Array.from( this.loadedRevisions.values() );\r\n\t\treturn !!revs.find(r=>r.isModelShowing);\r\n\t}\r\n\tshouldLookAtModel(): boolean { return !this.hasModelShowing(); }\r\n\r\n\tasync loadRevision_EH(x: FileAndRevisionDto) {\r\n\t\tconsole.log('loadRevision_EH',x);\r\n\t\tconsole.log('bound info was:', this.fileId, this.revisionId);\r\n\t\tlet fragModel:FragmentsGroup|null = await this.load_An_IfcUrl(x.fileId, x.revisionId);//in-loadRevision_EH\r\n\t}\r\n\r\n\t// BEGIN bim-viewer-three-d INTERFACE:\r\n\tasync turnOnRevision3d(model: BimViewerFileDtoSplitView, revision: BimViewerRevisionDtoSplitView): Promise {\t\r\n\t\tconsole.log('openbimContainer.turnOnRevision3d, retrieving/loading ifc revision.');\r\n\t\t//await this.load_A_FRAGMENT(model,revision); // (Raw-fragment (converted/prebaked IFC) loader.)\r\n\t\tlet fragModel:FragmentsGroup|null = await this.load_An_IfcUrl(model.id,revision.id);//in-turnOnRevision3d\r\n\t\tconsole.info('altUpload?', model.altUpload, revision.altUpload);\r\n\t\tlet allOK = !!fragModel; // If we got a model, all is OK.\t\r\n\r\n\t\tif (fragModel) {\r\n\t\t\tthis.remember_ModelInformation(revision, fragModel);\r\n\t\t}\r\n\r\n\t\t// (vi har ikke, behøver ikke, loadingModels tool her.)\r\n\t\t// this.eventAggregator.publish('ModelRevision:ModelReady', {model: model, revisionId: revision.id});\r\n\r\n\t\t/* We must fire the event 'Revision3FinishedLoading'\r\n\t\twhen we are 'pretty sure the model has loaded', because this is \r\n\t\twhat moves the UI '3D' button-indicator from the gray '..still..loading..' state to the black 'confirmed fully loaded' state,\r\n\t\tand THIS is what will enable us to turn-off-unload the revision again, by clicking its button again.\r\n\t\t*/\r\n\t\tthis.aggr.publish('Revision:Revision3FinishedLoading', {model: model, revisionId: revision.id} ) //model:BimViewerFileDtoSplitView\r\n\t\treturn new TurnOnRevision3dResponse(allOK,allOK); //false,false); //hasModelBeenLoaded, success); //hasModelBeenLoaded, success);\r\n\r\n\t\t/* The chain for turnOnRevision3d used to be:\r\n\t\tturnOnRevision3d -> loadUrl_forRevision -> loadUrl_forRevision_Catenda -> handleFinishedGettingObjectIds -> setupModelInformation (which registers 'allObjIDs'). \r\n\t\t(earlier, GetAllObjectIdsForRevision is also used.)\r\n\t\t*/\r\n\r\n\t\t/*\r\n\t\tlet hasModelBeenLoaded = false; //this.loadedRevisions.has(revision.id); \r\n\t\tlet success = hasModelBeenLoaded;\r\n\t\tif (hasModelBeenLoaded) {\r\n\t\tlet currentRevision: RevisionInformation3d = this.loadedRevisions.get(revision.id)!;\r\n\t\tif (currentRevision.isModelShowing != true) {\r\n\t\t\t//this.T3D_Svc.turnOnRevision(this.loadedRevisions, revision, this.shouldLookAtModel());\r\n\t\t\tcurrentRevision.isModelShowing = true;\r\n\t\t}\r\n\t\t} else { // (!hasModelBeenLoaded) \r\n\t\tconsole.log('turnOnRevision3d calls BV3D.loadUrl');\r\n\t\t//success = await this.loadUrl_forRevision(revision, model);\r\n\t\t}\r\n\t\t*/\r\n\r\n\t\t/* JG: Alt det der roderi-crap, har været knyttet til catendas\r\n\t\tunderlige ikke-korrekte-haandtering af at kunne swappe del-modeller ind og ud.\r\n\t\tFordi de kunne TILFOEJE del-modeller, men ikke 'tage dem af' igen,\r\n\t\tså har vi haft alt dette underlige gymnastik med \r\n\t\tat rode rundt med deres enkelte instans-element ID'er.\r\n\r\n\t\tVi skal istedet bare reducere det til \"loadUrl\" casen igen, i første omgang.\r\n\t\t*/\r\n\t}\r\n\r\n\tremember_ModelInformation(revision: BimViewerRevisionDtoSplitView, fragModel:FragmentsGroup): void { \r\n\t\tlet revisionInfo3d = new OB_RevisionInformation3d(); // in setupModelInformation.\r\n\t\t//revisionInfo3d.boundingBox = get_boundingBox;\r\n\t\t//revisionInfo3d.otherObjectIdsList = allObjectIds.otherObjectIdsList; // PROBABLY won't need that (at least, we will enumerate through in-memory fragment, not from server?)\r\n\t\t//revisionInfo3d.spaceIds = allObjectIds.spaceObjectIds;\r\n\t\t//revisionInfo3d.revisionBimId = revision.id; //.bimRevisionId; // not relevant, as no separate IDs (.. I think?)\r\n\t\trevisionInfo3d.openBim_model = fragModel; // We will have to decide if we store the parent, FragmentsGroup, or the child, Three.Scene. We probably end up needing the parent instead.\r\n\t\trevisionInfo3d.isModelShowing = true;\r\n\t\tthis.loadedRevisions.set(revision.id, revisionInfo3d);\r\n\t}\r\n\r\n\r\n\tasync turnOffRevision3d(revision: BimViewerRevisionDtoSplitView): Promise {\r\n\t\tlet has_loadedRevision:OB_RevisionInformation3d|undefined = this.loadedRevisions?.get(revision.id);\r\n\t\tif (!has_loadedRevision) { console.log('revision is not loaded:', revision.id); return; }\r\n\r\n\t\tlet loadedRevision:OB_RevisionInformation3d = has_loadedRevision;\r\n\t\tif (!loadedRevision.isModelShowing) { console.log('revision is not showing:', revision.id, loadedRevision.isModelShowing); return; }\r\n\t\t\r\n\t\t// I don't yet think we'll need a service for this?\r\n\t\t//this.bimViewerThreeDService.turnOffRevision(this.loadedRevisions, revision);\r\n\t\tlet model = loadedRevision.openBim_model!;\r\n\t\tconst THREE_scene:THREE.Scene = this.OB.comp!.scene.get();\r\n\r\n\t\t// symmetric remove:\r\n\t\tTHREE_scene.remove(model); // THREE_scene.add(model);\t\t \r\n\t\tloadedRevision.isModelShowing = false;\t\r\n\t}\r\n\r\n\tisNewestPluginRevisionActive:boolean = false;\r\n\tsetIsNewestPlugin(isNewestPlugin: boolean): void { this.isNewestPluginRevisionActive = isNewestPlugin; }\r\n\t// those were the three founding methods. The rest are fancy tools..\r\n\tasync lookAtSelectedObjects(objectListMgr: ObjectListManager): Promise {}\r\n\tasync highlightSelectedObjects(objectListMgr : ObjectListManager): Promise {\r\n\t\t/* in our catenda impl, this method uses as input, the number[] result from\r\n\t\tentityIdFinderService.getSelectedObjectsAsEntityIds.\r\n\t\tThat again is implemented by delegating to objectListMgr.selectedItems.filter(.) \r\n\t\tThe TLDR is, that on a high level, our selections are handled as a list of IFC_EntityId numbers,\r\n\t\twhich you can query from the EntityIdFinderService class.\r\n\t\tBut EntityIdFinderService gets its data from ObjectListManager - who tells him?\r\n\r\n\t\tHmm, but how does ObjectListManager.selectedItems get changed?\r\n\t\tI GAVE UP: We have not yet guessed how OLM.selectedItems is updated\r\n\t\twhen user clicks catenda 3d model.\r\n\t\t*/\r\n\t}\r\n\tasync highlightSimilarElements(objectListMgr: ObjectListManager) {}\r\n\tasync isolateSelectedObjects(objectListMgr: ObjectListManager): Promise {}\r\n\tasync hideAllOtherObjects(objectListMgr: ObjectListManager) {}\r\n\tresetColors(): void {}\r\n\tcolorInstances(colorData: InstanceColorDataCollection): void {}\r\n\tasync cropModel(direction: string[]): Promise {}\r\n\tremoveRevisionIdListFromLoadedRevisions(revisions: string[]): void {}\r\n\tsetupViewerBindings(): void {}\r\n\t// END bim-viewer-three-d INTERFACE.\r\n\r\n\tasync turnOn_3dRevision_EH(parameter: BimViewerModelAndRevision) { // EH is 'EventHandler'.\r\n\t\tconsole.log('(IF)the event 3dViewer:TurnOn3dRevision calls our turnOnRevision3d.', parameter.model.id, parameter.revision.id);\r\n\t\tif (!(await this.turnOnRevision3d(parameter.model, parameter.revision)).success) { return; }\r\n\r\n\t\tif (parameter.isNewestPluginRevision == true) { this.setIsNewestPlugin(parameter.isNewestPluginRevision); } // who turns this off??\r\n\t\t// JG: WTF is the meaning of this - why would you NOT want to fire the else-case?\r\n\t\tif (parameter.revision.objectsIdNotDoneLoading == false) { // head-spin, it means DoneLoading is true..\r\n\t\tconsole.log('IF, firing Revision3FinishedLoading');\r\n\t\tthis.aggr.publish('Revision:Revision3FinishedLoading', {model: parameter.model, revisionId: parameter.revision.id} )\r\n\t\t} else {\r\n\t\tconsole.log('IF, firing RevisionTurnedOn');\r\n\t\tthis.aggr.publish('Revision:RevisionTurnedOn', {model: parameter.model, revision: parameter.revision, is2d: false});\r\n\t\t}\r\n\t\tthis.aggr.publish('ModelRevision:HandleStateChange');\r\n\t}\r\n\r\n\tasync turnOff_Multiple(parameter: BimViewerModelAndAllRevisions): Promise {\r\n\t\tfor (let revision of parameter.revisions) {\r\n\t\tawait this.turnOffRevision3d(revision);\r\n\t\tif (parameter.isNewestPluginRevision) { this.setIsNewestPlugin(!parameter.isNewestPluginRevision); }\r\n\t\tthis.aggr.publish('Revision:RevisionTurnedOff', {model: parameter.model, revision: revision, is2d: false});\r\n\t\t}\r\n\t}\r\n\r\n\tasync turnOff_3dRevision(parameter: BimViewerModelAndRevision) {\r\n\t\tawait this.turnOffRevision3d(parameter.revision);\r\n\t\tif (parameter.isNewestPluginRevision) { this.setIsNewestPlugin(!parameter.isNewestPluginRevision); }\r\n\t\tthis.aggr.publish('Revision:RevisionTurnedOff', {model: parameter.model, revision: parameter.revision, is2d: false}); \r\n\t\t}\r\n\r\n\t\tstatic nrOfTimesSubscribed:number = 0;\r\n\t\tsetupSubscriptions(): void { // it is wrong to call this from attached, unless we also unsubscribe in detach! Hmm, we clean up below in dispose?\r\n\t\tconsole.log('setupSubscriptions', ++OpenbimContainer.nrOfTimesSubscribed);\r\n\t\tif (OpenbimContainer.nrOfTimesSubscribed>1) {\r\n\t\tconsole.error('\\n WRONG WRONG, too many subscriptions!', OpenbimContainer.nrOfTimesSubscribed);\r\n\t\treturn;\r\n\t\t}\r\n\t\t/* cookbook, ingredients:\r\n\t\t- load/unload REVISIONS (TurnOn3dRevision,TurnOff3dRevision,TurnOffMultiple3dRevision)\r\n\t\t- also, 'removeRevisions' - exactly what is it used for? (only catenda needs it?)\r\n\t\t- element-instance SELECTION (e.g. isolate-selected-items, highlight-selected-items)\r\n\t\twe count at least 8 events concerning ITEMS(..'selection').\r\n\t\t- a number of 'ALL-*' operations, I wonder what that signifies, it mostly sounds like 'reset'..? hide-all? show-all?\r\n\t\t- SUNDRY:\r\n\t\t- - SPACES, concerning.\r\n\t\t- - item-COLORING, concerning.\r\n\t\t- - CROP/\"chop\",(cut-away) concerning.\r\n\r\n\t\tSUMMARY: \r\n\t\t(1) (mouse-)selection-mode/selection-model.\r\n\t\t(2) elements/items\r\n\t\tMy hunch is to start with mouse (1) to easier learn about (2).\r\n\t\t*/\r\n\r\n\t\t// \t\tself.events.publish('base-viewer-combined:loadRevision',{fileAndRevisionId: fileAndRevisionId});\r\n\r\n\t\tlet self = this;\r\n\t\tthis.subscriptions = [\r\n\t\tthis.aggr.subscribe('base-viewer-combined:loadRevision', async (x:FileAndRevisionDto) => self.loadRevision_EH(x) ),\r\n\r\n\t\t\t// existing/old model:\r\n\t\tthis.aggr.subscribe('3dViewer:TurnOn3dRevision', async (parameter: BimViewerModelAndRevision) => { await self.turnOn_3dRevision_EH(parameter); }),\r\n\t\tthis.aggr.subscribe('3dViewer:TurnOff3dRevision', async (parameter: BimViewerModelAndRevision) => { await self.turnOff_3dRevision(parameter); }),\r\n\t\tthis.aggr.subscribe('3dViewer:TurnOffMultiple3dRevision', async (parameter: BimViewerModelAndAllRevisions) => { await self.turnOff_Multiple(parameter); }),\t\t\r\n\t\tthis.aggr.subscribe('3dViewer:isolate-selected-items', async (objectListMgr: ObjectListManager) => {await self.isolateSelectedObjects(objectListMgr)}),\r\n\t\tthis.aggr.subscribe('3dViewer:hide-other-items', async (objectListMgr: ObjectListManager) => {await self.hideAllOtherObjects(objectListMgr)}),\r\n\t\tthis.aggr.subscribe('3dViewer:focus-selected-items', async (objectListMgr: ObjectListManager) => { await self.lookAtSelectedObjects(objectListMgr)}),\r\n\t\tthis.aggr.subscribe('3dViewer:select-all-instances', async (objectListMgr: ObjectListManager) => {await self.highlightSimilarElements(objectListMgr)}),\r\n\t\tthis.aggr.subscribe('3dViewer:highlight-selected-items', async (objectListMgr: ObjectListManager) => { await self.highlightSelectedObjects(objectListMgr)}),\r\n\t\tthis.aggr.subscribe('3dViewer:isolate-items',(objectIds: number[]) => self.T3D_Svc?.transluteObjects(objectIds) ),\r\n\t\tthis.aggr.subscribe('3dViewer:hide-items', (objectIds: number[]) => self.T3D_Svc?.hideObjects(objectIds) ),\r\n\t\tthis.aggr.subscribe('3dViewer:show-items', (objectIds: number[]) => self.T3D_Svc?.showObjects(objectIds) ),\r\n\t\tthis.aggr.subscribe('3dViewer:ChangeTool', (toolNumber: number) => self.T3D_Svc?.changeSelectedTool(toolNumber)),\r\n\t\tthis.aggr.subscribe('3dViewer:TransluteAll', () => { if (self.loadedRevisions) { self.T3D_Svc?.transluteAllObjects(self.loadedRevisions); } }),\r\n\t\tthis.aggr.subscribe('3dViewer:ShowAll', () => { if (self.loadedRevisions) { self.T3D_Svc?.showAllObjects(self.loadedRevisions); } }),\r\n\t\tthis.aggr.subscribe('3dViewer:HideAll', () => { if (self.loadedRevisions) { self.T3D_Svc?.hideAllObjects(self.loadedRevisions); } }),\r\n\t\tthis.aggr.subscribe('3dViewer:ShowSpaces', (shouldShowSpaces: boolean) => { if (self.loadedRevisions) { self.T3D_Svc?.handleSpaces( self.loadedRevisions, shouldShowSpaces); } }),\r\n\t\tthis.aggr.subscribe('3dViewer:removeRevisions', (revisionIds: string[]) => {self.removeRevisionIdListFromLoadedRevisions(revisionIds)}),\r\n\t\tthis.aggr.subscribe('3dViewer:color-instances', (instanceColorDataCollection: InstanceColorDataCollection) => { self.colorInstances(instanceColorDataCollection)}),\r\n\t\tthis.aggr.subscribe('3dViewer:reset-colors', () => {self.resetColors()}),\r\n\t\tthis.aggr.subscribe('3dViewer:crop', async (direction: string[]) => {await self.cropModel(direction)}),\r\n\t\tthis.aggr.subscribe('viewer:enable-bindings-and-options', () => { self.setupViewerBindings(); }), //Ensuring viewers are setup before bindings are handled.\r\n\t\t\t\r\n\t\tthis.aggr.subscribe('debug:useFragments', async (useFragments: boolean) => {\r\n\t\t\tself.useMessagePack = useFragments;\r\n\t\t\t//self.OB.comp?.scene.get().clear();\r\n\t\t\tself.OB.mgr?.reset();\r\n\t\t\tawait self.load_An_IfcUrl(self.fileId, self.revisionId!);\r\n\t\t})\r\n\t\t];\r\n\t\tconsole.log('subs:', this.subscriptions);\r\n\t} //setupSubscriptions..\r\n\r\n\tunbind(): void {\r\n\t\t--OpenbimContainer.nrOfTimesSubscribed;\r\n\t\tthis.subscriptions.forEach((subscription: Subscription) => subscription.dispose());\r\n\t}\r\n}//end-class-openbimContainer.\r\n\r\n\r\nexport interface OB_RevisionMediaStatus {\r\n\tifc_url:string;\r\n\tfragment_url:string;\r\n\thas_ifc:boolean;\r\n\thas_fragment:boolean;\r\n}\r\n\r\n","//import { FragmentIdMap } from './openbim-highlighter';\r\n// openbim-highlighter\r\nimport * as THREE from \"three\"; // ALSO: npm i --save-dev @types/three\r\nimport * as OBC from \"openbim-components\";\r\n//import {FragmentIdMap} from \"openbim-components\";\r\nimport {Fragment,IfcProperties, FragmentsGroup} from 'bim-fragment';\r\n\r\n\r\nimport {OpenBimHandles} from \"./OpenBimHandles\";\r\n\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { ModeTool } from \"./Tools/ModeTool\";\r\n\r\n\r\nexport type HighlightResult = {\r\n\tid: string; // JG: Hmm, WHAT is this an ID for? The 3d-elm-instance? IfcId?\r\n\tfragments: Fragment[];\r\n} | null;\r\n\r\nexport interface ObjPropertySet {\r\n\t[attribute: string]: any;\r\n}\r\n\r\nexport const selectionHighlightName = 'selection';\r\n\r\nexport function openbim_highlightOnIDs(\r\n\thighlighter:OBC.FragmentHighlighter, \r\n\tnumIDsToSelect:OBC.FragmentIdMap, //idsToSelect_:OBC.FragmentIdMap\r\n) {\r\n\tif (Object.keys(numIDsToSelect).length == 0) { // aah javascript, hvorfor skal du sutte saa meget.\r\n\t\tconsole.warn('openbim_highlightOnIDs - as we need to highlight ZERO items, we bail out.');\r\n\t\treturn;\r\n\t}\r\n\r\n\tdisableHighlighterOutline(highlighter);\r\n\thighlighter.highlightByID(selectionHighlightName, numIDsToSelect);\r\n\r\n\t// Hmm, FragmentIdMap is this..:\r\n\t/**\r\n\t A list of IDs indexed by the fragments where they exist. As an item can be\r\n\t made of multiple fragments, there might be repeated IDs across entries.\r\n\t \r\n\texport interface FragmentMap {\r\n\t\t[fragmentID: string]: Set;\r\n\t}\r\n\texport interface FragmentIdMap {\r\n\t\t[fragmentID: string]: Set;\r\n\t}\r\n\t \r\n\t */\r\n}\r\n\r\nexport function disableHighlighterOutline(highlighter: OBC.FragmentHighlighter) {\r\n\tconsole.log('sherlock', highlighter.outlineEnabled);\r\n\t( highlighter)._outlineEnabled = false;\r\n\tif (!highlighter.excludeOutline.has(selectionHighlightName)) {\t// The selectionHighlightName is the name of the highlighter, like \"selection\".\r\n\t\thighlighter.excludeOutline.add(selectionHighlightName);\r\n\t}\r\n}\r\n\r\n/*\r\nfunction map2IDMap(numIDsToSelect: FragmentMap):OBC.FragmentIdMap {\r\n\tlet o:OBC.FragmentIdMap = {};\r\n\tfor (const fragmentId in numIDsToSelect) {\r\n\t\tconst numbers:Set = numIDsToSelect[fragmentId];\r\n\t\tconst strings:Set = new Set(Array.from(numbers, n => ''+n));\r\n\t\to[fragmentId] = strings;\r\n\t}\r\n\treturn o;\r\n}\r\n*/\r\n\r\nexport function collectIDsFromMap(selMap:OBC.FragmentIdMap):number[] {\r\n\tconsole.log('realSel:', selMap);\r\n\r\n\tlet os = new Set();\r\n\r\n\tfor (const fragmentId in selMap) {\r\n\t\tconst expressIDs_for_Fragment:Set = selMap[fragmentId];\r\n\t\tconsole.log('frag:', fragmentId, 'expressIDs:', expressIDs_for_Fragment);\r\n\t\tfor (const expressId of expressIDs_for_Fragment) {\r\n\t\t\tconsole.log('expressId:', expressId);\r\n\t\t\tos.add( Number(expressId) );\r\n\t\t}\r\n\t}\r\n\tconst asNumbers:number[] = Array.from(os);\r\n\treturn asNumbers;\r\n}\r\n\r\nexport interface Our_OB_ColorsIF {\r\n\tbackground:string, selection:string, outline:string;\r\n\toutline_w:number;\r\n}\r\n\r\nconst Old_OB_Colors:Our_OB_ColorsIF = {\r\n\tbackground: 'blue',\r\n\tselection: '#FF80FF', //'pink',\r\n\toutline: 'lime', \r\n\toutline_w:0.3\r\n}\r\n\r\nconst TH_OB_Colors:Our_OB_ColorsIF = {\r\n\tbackground: '#c0d0e8', //'#edf6ff',\r\n\tselection: '#198754', //'#63AC93', // '#198754', //FF80FF', //'pink',\r\n\toutline: '#198754', //'#63AC93', \r\n\toutline_w:0.3\r\n}\r\n\r\n\r\nfunction rnd():number { return Math.floor( Math.random()*255 ); }\r\nfunction rndCol():string {\r\n\tlet r = rnd(), g=rnd(), b=rnd();\r\n\treturn `rgb(${r},${g},${b})`;\r\n}\r\nfunction randomCols() {\r\n\tOld_OB_Colors.background = rndCol();\r\n\tOld_OB_Colors.selection = rndCol();\r\n\tOld_OB_Colors.outline = rndCol();\r\n}\r\n\r\nexport class CollabHighlightInitiator {\r\n\tpublic static initSelection_Highlighter(\r\n\t\tcomp:OBC.Components,\r\n\t\tOB:OpenBimHandles, // we may need to turn it into an interface, to avoid circular dep? we just need a way to pass it an event-sender thing.\r\n\t) : OBC.FragmentHighlighter\r\n\t{\r\n\t\t/* JG: This is a 'higher level' approach, which works OBC fragment entities instead. \r\n\t\tThat is, it has some..? OBC/IFC knowledge - as I understand it.\r\n\t\tIn their stomach/insides, the OBC fragments presumably still hold basic THREE entities. */\r\n\t\r\n\t\t// LIGHTS\r\n\t\r\n\t\t// https://docs.thatopen.com/Tutorials/FragmentHighlighter\r\n\t\tconst highlighter = new OBC.FragmentHighlighter(comp);//, fragments);\r\n\t\t\r\n\t\t// Seems FragmentHighlighter refuses to work with SimpleRenderer:\r\n\t\t//const realRenderer:OBC.SimpleRenderer = comp.renderer;\r\n\t\tconst realRenderer:OBC.PostproductionRenderer = comp.renderer;\r\n\t\t\r\n\t\t// Error: Custom effects not initialized!\r\n\t\t//console.log('highlighter, do you have outlineEnabled?', highlighter);\r\n\t\tif (realRenderer.postproduction.enabled) {\r\n\t\t\trealRenderer.postproduction.customEffects.outlineEnabled = true; // (otherwise highlighter.outlineEnabled gives error: \"Custom effects not initialized!\" \r\n\t\t\thighlighter.outlineEnabled = true; // hvis vi saetter FALSE her, faar vi ikke en fejl, men intet visuelt feedback.\r\n\t\t} else {\r\n\t\t\t/* We don't have do do anything actively in CollabHighlightInitiator to respect openbimFlag_EG_OutlineEnabled, \r\n \t\t\t because it happens automatically by realRenderer.postproduction being DISABLED.\r\n\t\t\t*/\r\n\t\t\t//!openbimFlag_EG_OutlineEnabled();\r\n\t\t\t//highlighter.outlineEnabled = false;\r\n\t\t}\r\n\t\thighlighter.fillEnabled = true; // har sgu ingen effekt.\r\n\t\r\n\t\t//randomCols(); // Our_OB_Colors\r\n\t\tconst THREE_scene:THREE.Scene = comp.scene.get();\r\n\t\tTHREE_scene.background = new THREE.Color(TH_OB_Colors.background); //'blue');\r\n\t\r\n\t\tconst highlightMaterial = new THREE.MeshBasicMaterial({\r\n\t\t\tcolor: TH_OB_Colors.selection, // PINK!\r\n\t\t\tdepthTest: false,\r\n\t\t\topacity: 0.8, //5, //0.95, //5, //0.8,\r\n\t\t\ttransparent: true //false //true\r\n\t\t})\r\n\t\t\r\n\t\t//const hiliteMaterialName:string = 'default1';\r\n\t\thighlighter.add(selectionHighlightName, [highlightMaterial]); // configure a named styling.\r\n\t\t\r\n\t\tlet outline = highlighter.outlineMaterial;\r\n\t\toutline.color.set(TH_OB_Colors.outline) ; // 'cyan'); \r\n\t\toutline.opacity = TH_OB_Colors.outline_w; // 0.15; //21; //9;\r\n\t\r\n\t\t//outline.wireframeLinewidth = 12; //4; // these have no effect?\r\n\t\t//outline.wireframe = false; //true;\r\n\t\r\n\t\tconsole.log('highlighter.outlineMaterial:',highlighter.outlineMaterial);\r\n\t\r\n\t\t// must happen just after fragmentLoader.load\r\n\t\t//highlighter.update(); // set i tutorial\r\n\t\r\n\t\t// (related to Error: Postproduction renderer is needed for outlines!)\r\n\t\t// (end of postproduction-styling crap.)\r\n\t\r\n\t\t// (app-dev, what did I mean with that?)\r\n\t\t//highlighter.update(); // JG: In earlier incarnation, app-dev would interact with this.. what did it do/when does it apply?\r\n\t\r\n\t\r\n\t\t// This needs to be moved out into the object selection tool.\r\n\t\t// Other than duration, we might look at how far the mouse has moved. For SELECTION, the mouse should not move much!\r\n\t\t//let mouseDownTime:number = 0;\r\n\t\t//container.addEventListener('mousedown', async (event:MouseEvent) => { mouseDownTime = event.timeStamp; } );\r\n\t\t//container.addEventListener( 'mouseup', async (event:MouseEvent) => highlightOnClick(event, event.timeStamp-mouseDownTime, highlighter, OB, aggr));\r\n\t\t//container.addEventListener('click', async (event:MouseEvent) => highlightOnClick(event));\r\n\t\t\r\n\t\treturn highlighter;\r\n\t} //initHighlighter\r\n}\r\n\r\nexport class ObjectSelectionTool implements ModeTool {\r\n\tconstructor(private OB:OpenBimHandles, private highlighter: OBC.FragmentHighlighter, private eventAggregator:EventAggregator) { }\r\n\t\r\n\tprivate mouseDownTime:number = 0;\r\n\t\r\n\tasync activate(): Promise {\r\n\t\tif (this.highlighter) { this.highlighter.enabled = true; }\r\n\t}\r\n\r\n\tasync deactivate(): Promise {\r\n\t\tif (this.highlighter) { this.highlighter.enabled = false; }\r\n\t\tthis.highlighter?.clear();\r\n\t}\r\n\r\n\tasync onDoubleClick(event: MouseEvent): Promise {}\r\n\tasync onMouseDown(event: MouseEvent): Promise { this.mouseDownTime = event.timeStamp; }\r\n\r\n\tasync onMouseUp(event: MouseEvent): Promise {\r\n\t\tawait ObjectSelectionTool.highlightOnClick(event, event.timeStamp - this.mouseDownTime, this.highlighter!, this.OB, this.eventAggregator)\r\n\t}\r\n\r\n\tprivate static async highlightOnClick(event:MouseEvent, dur:number, highlighter: OBC.FragmentHighlighter, OB: OpenBimHandles, aggr: EventAggregator): Promise {\r\n\t\tlet singleSelection = { value: false } ; //true };\r\n\r\n\t\tconst LeftMouseButton = 0;\r\n\r\n\t\tif (event.button != LeftMouseButton) { return; } // ignore everything but left mouse-button.\r\n\t\tif (dur>160) {\r\n\t\t\tconsole.log('highlightOnClick, ignoring mouse click longer than dur:', dur);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconsole.log('hiliter has mats:', highlighter.highlightMats);\r\n\t\tconst highlightMaterialName = selectionHighlightName;\r\n\t\tconst sel:HighlightResult|null = await highlighter.highlight(highlightMaterialName, singleSelection.value);\r\n\t\tconsole.log('sel result:', sel);\r\n\t\tconst realSel:OBC.FragmentIdMap = highlighter.selection[highlightMaterialName];\r\n\t\tconsole.log('realsel result:', realSel);\r\n\r\n\r\n\t\tif (!sel) {\r\n\t\t\tconsole.log('(null sel)');\r\n\t\t}\r\n\r\n\t\tconst sel_expressId:number = Number(sel?.id);\r\n\t\tconst someFrag:Fragment|undefined = sel?.fragments[0];\r\n\t\tconst group:FragmentsGroup|undefined = someFrag?.group;\r\n\t\tconst props:IfcProperties|undefined = group?.properties;\r\n\t\tconst objPropertySet:ObjPropertySet|undefined = props ? props[sel_expressId] : undefined; // https://standards.buildingsmart.org/IFC/RELEASE/IFC4_1/FINAL/HTML/schema/templates/property-sets-for-objects.htm\r\n\r\n\t\ttry {\r\n\t\t\tconst revitTag:string = objPropertySet?.Tag?.value ?? '(no Tag field)';\r\n\t\t\tconst ifcTypeNum:number = objPropertySet?.type;\r\n\t\t\tconst ifcGlobalId:string = objPropertySet?.GlobalId?.value;\r\n\t\t\tconst ifcName:string = objPropertySet?.Name?.value;\r\n\t\t\tconst inf = {sel_expressId, revitTag, ifcTypeNum, ifcGlobalId, ifcName};\r\n\t\t\t//console.table(inf);\r\n\t\t\tconsole.log(inf);\r\n\t\t\tthis.send_ElmsSelect_Event(aggr,realSel,OB,inf);\r\n\t\t} catch (s) {\r\n\t\t\tconsole.warn(s,objPropertySet);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static send_ElmsSelect_Event(\r\n\t\taggr:EventAggregator, // we need this one, so we can send messages.\r\n\t\trealSel:OBC.FragmentIdMap, // we need this one, to actually HAVE the current selection.\r\n\t\tOB:OpenBimHandles, // optional, not used, if-we-might-need-it.\r\n\t\tinf:{ // other earlier hints for selection. Think of cases where we are not only using expressIDs, e.g. IfcGlobalId.\r\n\t\t\tsel_expressId:number,\r\n\t\t\trevitTag:string, //= objPropertySet?.Tag?.value ?? '(no Tag field)';\r\n\t\t\tifcTypeNum:number, //= objPropertySet.type;\r\n\t\t\tifcGlobalId:string, //= objPropertySet.GlobalId.value;\r\n\t\t\tifcName:string //= objPropertySet.Name.value;\r\n\t\t},\r\n\t) {\r\n\t\tconst asArray = collectIDsFromMap(realSel);\r\n\t\tconsole.log('expressIDs collected:', asArray);\r\n\t\taggr.publish('base-viewer-combined:select', { // for the benefit of pivot-grid-component, and PivotGridComponent.highlightMatchingRows().\r\n\t\t\tevent: 'no-event-for-you',\r\n\t\t\tobjectIds: asArray\r\n\t\t});\r\n\t}\r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","OpenbimContainer","constructor","aggr","appContext","api","dlg","OB","projectId","orgId2","fileId","revisionId","undefined","useMessagePack","projectIdForMRP","T3D_Svc","modeToolHandler","loadCallbackSubscribers","turnOn_hoverHighlight","subscriptions","loadedRevisions","Map","isNewestPluginRevisionActive","console","log","this","async","n","o","load_An_IfcUrl","activate","params","warn","setupSubscriptions","container","document","getElementById","comp","highlighter","threeSel","mgr","tools","get","loader","mpkLoader","visible","setupTools","draggable","defaultTool","Error","openBimViewerThreeDService","openbimViewerThreeDService","loadEventsSubscribers","IFC_model_id","revision_id","prjId","orgId","fragmentsGroup_Model","getFragmentForRevision_Somehow","theModel","scene","add","forEach","subscriber","afterModelLoad","media","GetRevision_MediaStatus","has_fragment","from_MDK","loadMpk","has_ifc","from_ParsedIFC","load_IFC_AsFragment","url","fragmentZipResponse","fetch","arrayBuffer","fragmentZipData","fragmentBuffer","Uint8Array","fragmentsGroup","loadFromMessagePackZip","groups","items","f","meshes","mesh","list","updateWindow","map","camera","updateMatrixWorld","updateProjectionMatrix","update","fetch_MpkBlob_as_FragGroup","fragment_url","error","self","model","inputModel","parseMPK","fetch_UrlBlob_asANY","dlgResult","open","viewModel","whenClosed","fragGroupOrArrayBuffer","output","ifc_url","parse_OBFragment","IFC_data","IFC_buffer","IFC2Frag_loader","load","e","modelId","path","project","jsonResult","hasModelShowing","Array","from","values","find","r","isModelShowing","shouldLookAtModel","x","revision","fragModel","info","altUpload","allOK","remember_ModelInformation","publish","revisionInfo3d","openBim_model","set","has_loadedRevision","loadedRevision","remove","setIsNewestPlugin","isNewestPlugin","objectListMgr","resetColors","colorInstances","colorData","direction","removeRevisionIdListFromLoadedRevisions","revisions","setupViewerBindings","parameter","turnOnRevision3d","success","isNewestPluginRevision","objectsIdNotDoneLoading","is2d","turnOffRevision3d","nrOfTimesSubscribed","subscribe","loadRevision_EH","turnOn_3dRevision_EH","turnOff_3dRevision","turnOff_Multiple","isolateSelectedObjects","hideAllOtherObjects","lookAtSelectedObjects","highlightSimilarElements","highlightSelectedObjects","objectIds","transluteObjects","hideObjects","showObjects","toolNumber","changeSelectedTool","transluteAllObjects","showAllObjects","hideAllObjects","shouldShowSpaces","handleSpaces","revisionIds","instanceColorDataCollection","cropModel","useFragments","reset","unbind","subscription","dispose","bindable","autoinject","DialogService","selectionHighlightName","openbim_highlightOnIDs","numIDsToSelect","Object","keys","length","disableHighlighterOutline","highlightByID","outlineEnabled","_outlineEnabled","excludeOutline","has","collectIDsFromMap","selMap","os","Set","fragmentId","expressIDs_for_Fragment","expressId","Number","CollabHighlightInitiator","static","realRenderer","renderer","postproduction","enabled","customEffects","fillEnabled","background","highlightMaterial","color","depthTest","opacity","transparent","outline","outlineMaterial"],"sourceRoot":""}