{\r\n\t// view-source:https://ifcjs.github.io/components/src/ui/UIManager/index.html\r\n //const container = document.getElementById('container')!; // Get the element where the scene will be displayed\r\n\tconsole.log('OBC init run, container:', container);\r\n\tconst comp: OBC.Components = new OBC.Components(); // Initialize the basic components needed to use this library\r\n\treturn comp;\r\n}\r\n\r\nasync function activateQOL_Grid(comp: Components, world: World) {\r\n\tconst grids = comp.get(OBC.Grids);\r\n\tconst simpleGrid = grids.create(world);\r\n\r\n\ttryToExamineGrid_Issues(simpleGrid);\r\n //addRedDemoBox(world, comp, 0.5);\r\n}\r\n\r\nfunction tryToExamineGrid_Issues(grid: OBC.SimpleGrid) {\r\n\tconst mat:THREE.ShaderMaterial = grid.material;\r\n\tconst sm_uniforms:ShaderMat_UniformsMap = mat.uniforms;\r\n\tconsole.log('sm_uniforms:', sm_uniforms);\r\n\tif (sm_uniforms == undefined) {\r\n\t\tconsole.warn('initializing uniforms map on SimpleGrids THREE.ShaderMaterial because it is empty');\r\n\t\tmat.uniforms = {};\r\n\t}\r\n\t// we might use SimpleCamera.OnBeforeUpdate to inspect what is happening with the grid material?\r\n}\r\n\r\n\r\nexport function addRedDemoBox(world: World, comp: Components, size:number) { // Cube\r\n\tconst boxGeom = new THREE.BoxGeometry(size,size,size); //0.5,0.5,0.5); // Add some elements to the scene\r\n\tconst boxMat = new THREE.MeshStandardMaterial({ color: \"red\" });\r\n\tconst boxMesh = new THREE.Mesh(boxGeom, boxMat);\r\n\tboxMesh.position.set(0, 0, 0);\r\n\tworld.scene.three.add(boxMesh); \r\n\t// JG: Jeg fjerner den ene, fordi jeg tror ikke vi behoever den.\r\n\t//comp.meshes.push(boxMesh); // hvorfor er det nu, at det er en god ide at adde begge steder? \t\t\r\n}\r\n\r\nfunction addMyOwnLights(scene:THREE.Scene) { \r\n\tconsole.log('addMyOwnLights');\r\n\tconst light1 = new THREE.DirectionalLight('lightblue');\r\n\tlight1.position.set(5, 10, 3);\r\n\tlight1.intensity = 0.35;\r\n\tscene.add(light1);\r\n\tconst light2 = new THREE.AmbientLight('lightyellow');\r\n\tlight2.intensity = 0.75;\r\n\tscene.add(light2); \r\n}\r\n\r\n\r\n///////////////////////////////////////////////////////////////////////////////////\r\n\r\nexport async function add_a_default_fragment_on_startup(frag_url:string, components:OBC.Components,mgr:OBC.FragmentsManager):Promise {\r\n\tconsole.log('inside add_a_default_fragment_on_startup');\r\n\tconst file = await fetch(frag_url); // 400k. // NO STATIC/leave out the static prefix!\r\n\tconst arrayBuffer = await file.arrayBuffer(); // returns type ArrayBuffer\r\n\tconst FRAGMENT_buffer = new Uint8Array(arrayBuffer); // convert ArrayBuffer to UI8A.\r\n \r\n\tconst model:FragmentsGroup = mgr.load(FRAGMENT_buffer); // is really fragmentsGroup.\r\n \r\n\t// view-source:https://ifcjs.github.io/components/src/fragments/FragmentManager/index.html\r\n\t// Hmm, would the fragmentsManager.load above here actually display 3d model directly,\r\n\t// if we did not have the culler?\r\n\t\r\n\t// modelThroughCuller(components, model);\r\n\tconsole.log('add_a_default_fragment_on_startup, model:', model);\r\n\treturn model;\r\n}\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n\r\nlet toolbar = undefined;\r\n\r\nexport async function makeIfcLoader(comp: OBC.Components): Promise {\r\n\tconsole.log('init - makeIfcLoader, including fragmentIfcLoader.setup; this ought to trigger .wasm load.');\r\n\tlet fragmentIfcLoader = comp.get(OBC.IfcLoader);\r\n\tawait fragmentIfcLoader.setup();\t// Sets the options automatically // in makeIfcLoader.\r\n\t// fragmentIfcLoader.settings.wasm = { path: \"https://unpkg.com/web-ifc@0.0.46/\", absolute: true };\r\n\r\n\t// fragmentIfcLoader.settings.wasm = { path: \"./node_modules/web-ifc/\", absolute: true }; \r\n\t// https://unpkg.com/web-ifc@0.0.55/web-ifc.wasm is where it currently loads it from.\r\n /*\r\n\tc:\\dev\\aoc\\AO.Client\\ClientApp>grep web-ifc package.json\r\n \"web-ifc\": \"^0.0.55\",\r\n\t */\r\n\treturn fragmentIfcLoader;\r\n}\r\n\r\n// export function init_IfcLoader_Toolbars(comp:OBC.Components, mgr:OBC.FragmentsManager, fragmentIfcLoader:OBC.IfcLoader):OBC.Toolbar {\r\n// // noget gaar galt med disse toolbars,\r\n// // maaske er de der hvor revisions-UI vises?\r\n//\r\n// // https://top-docs.vercel.app/docs/Tutorials/FragmentIfcLoader\r\n// //let fragmentIfcLoader = new OBC.FragmentIfcLoader(comp);\r\n// //\r\n// toolbar = new OBC.Toolbar(comp); //const \r\n// comp.ui.addToolbar(toolbar);\r\n// // \r\n// const loadIfc_button:OBC.SimpleUIComponent = fragmentIfcLoader.uiElement.get(\"main\"); // (the 'primary' action of a tool is presumably named main)\r\n// const loaderButton:OBC.Button = loadIfc_button;\r\n// // why is there this mismatch between button and button?\r\n// toolbar.addChild(loaderButton); //loadIfc_button); // what does it mean when we accept ...Button[] ?\r\n// console.log('added fragmentIfcLoader-button to mainToolbar, tb is:', toolbar);\r\n//\r\n// toolbar.addChild(mgr.uiElement.get(\"main\"));\r\n// return toolbar;\r\n// }\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////////\r\n","import {autoinject} from \"aurelia-framework\";\r\nimport { AppContextService } from \"app/services/app-context-service\";\r\nimport { OpenBimHandles } from \"./OpenBimHandles\"; //import {EventAggregator} from \"aurelia-event-aggregator\";\r\n\r\n@autoinject\r\nexport class OpenbimTestbed { \r\n /*\r\n NB! OpenbimTestbed is just a vehicle for ,\r\n ie a container to host an element.\r\n That is, it provisions/provides the element\r\n with its necessary inputs \r\n (project-id and file-id bindings,\r\n AND its openBimHandles instance!)\r\n */\r\n public openBimHandles:OpenBimHandles = new OpenBimHandles();\r\n public projectIdForMRP : string = 'no-prj-yet'; // arggh, binds to this!\r\n public orgIdForOB:string = 'obtb-no-orgId-yet';\r\n fileId_forBind:string|undefined = undefined; //'obtb-has-no-fileId';\r\n revisionId_forBind:string|undefined = undefined; //'obtb-has-no-revId';\r\n constructor(private appContext: AppContextService ) {} // private aggr: EventAggregator, \r\n activate(params:any) {\r\n\ttry {\r\n\t\tconsole.log('OpenbimTestbed.activate sets projectId to ', params.projectId);\r\n\t\tthis.projectIdForMRP = params.projectId; // because binds to it, sigh.\r\n\t\tthis.appContext.setProject(params.projectId);\r\n\t\tlet prj = this.appContext.getSelectedProject()!;\r\n\t\tif (!prj) {\r\n\t\t\tconsole.log('avail projects:', this.appContext.projects);\r\n\t\t\tconsole.error('no selected project!');\r\n\t\t\tthis.orgIdForOB = 'OBTB-gotNoOrgId_From_Prj';\r\n\t\t} else {\r\n\t\t\tthis.orgIdForOB = prj.ownerCompanyId; //orgId\r\n\t\t}\r\n\t} catch {\r\n\t\tconsole.log('wtf');\r\n\t} \r\n } // called first.\r\n async attached() { console.log('OpenbimTestbed attached is called.'); } // called second.\r\n} //end-class-OpenbimTestbed.\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","OpenbimContainer","constructor","aggr","entityIdFinderService","api","ctx","dlg","OB","projectId","orgId2","fileId","revisionId","undefined","useMessagePack","BaseViewerCombined","useMPKFragments_Master","projectIdForMRP","viewerThreeDService","modeToolHandler","subscriptions","turnOnHoverHighlight","loadedRevisions","Map","isNewestPluginRevisionActive","console","log","this","fragmentLoader","factory_FragmentLoader","revisionIdChanged","n","o","loadModel","activate","params","warn","attached","setupSubscriptions","container","document","getElementById","comp","world","highlighter","initHighlighter","threeSel","mgr","get","loader","mpkLoader","setupTools","draggable","objectSelectionTool","Error","setupToolEventsWithoutAurelia","openBimViewerThreeDService","openbimViewerThreeDService","who","fragmentsGroup","getFragmentForRevision","userData","source","theModel","scene","three","add","child","children","meshes","onFragmentsLoaded","trigger","makeRevitIdMap","hasModelShowing","Array","from","values","find","r","isModelShowing","shouldLookAtModel","loadRevisionEventHandler","fileAndRevision","turnOnRevision3d","model","revision","fragmentModel","info","altUpload","allOK","rememberModelInformation","publish","fragModel","revisionInfo3d","openBim_model","set","group","makeRevitIdMapImpl","e","error","revitMap","tmpRevitMap","allProps","getLocalProperties","totalPropCount","Object","entries","length","expressId_","expressId","entityProps","revitTagValue","Tag","revitTag_","value","revitTag","Number","uniqueMap","revitIdCount","revitId_","revitId","expressIDs","uqExpressIDs","Set","turnOffRevision3d","has_loadedRevision","loadedRevision","remove","setIsNewestPlugin","isNewestPlugin","lookAtSelectedObjects","objectListMgr","objectIds","getSelectedObjectsAsObjectIdsIF","lookAtObjects","highlightSelectedObjects","selectObjects","highlightSimilarElements","itemsToBeSelected","allTypeIds","selectedItems","map","item","typeId","typeIds","shownItems","filter","forEach","selectedItem","delete","getAllSimilarInstancesAsObjectIdsIF","toggleSelectedElementsOn","of","isolateSelectedObjects","selectedObjectIds","transluteOthers","hideSelectedObjects","hideObjects","hideAllOtherObjects","hideOthers","resetColors","resetColorInstances","colorInstances","colorData","cropModel","direction","removeRevisionIdListFromLoadedRevisions","revisions","setupViewerBindings","turnOn3dRevisionEventHandler","parameter","success","isNewestPluginRevision","objectsIdNotDoneLoading","is2d","turnOff_Multiple","turnOff_3dRevision","nrOfTimesSubscribed","self","subscribe","async","tool","changeSelectedTool","hideAllObjects","revisionIds","instanceColorDataCollection","groupName","showColorGroup","transluteColorGroup","hideColorGroup","showAllObjects","shouldShowSpaces","handleSpaces","transluteAllObjects","transluteObjects","useFragmentsDto","useFragments","reload","groups","disposeGroup","dispose","unbind","subscription","FragmentSource","bindable","autoinject","EventAggregator","DialogService","selectionHighlightName","hoverName","openbim_highlightOnIDs","numIDsToSelect","keys","clear","highlightByID","collectIDsFromMap","selMap","os","fragmentId","expressIDs_for_Fragment","expressId_asNumber","has","TH_OB_Colors","background","selection","outline","hover","outline_w","CollabHighlightInitiator","setup","selectName","list","next","autoHighlightOnClick","ofCourseTrue","initPrimaryWorld","showFpsCounter","worlds","OBC_scene1","create","postProductionRenderer","logarithmicDepthBuffer","renderer","camera","init","grid","mat","material","sm_uniforms","uniforms","tryToExamineGrid_Issues","activateQOL_Grid","stats","showPanel","body","append","dom","style","left","display","fixIt","renderer2","onBeforeUpdate","begin","onAfterUpdate","end","addFPSCounter","init_OpenBimComponents","fancyExtras","FPS_Counter","addRedDemoBox","size","boxGeom","boxMat","color","boxMesh","position","add_a_default_fragment_on_startup","frag_url","components","file","fetch","arrayBuffer","FRAGMENT_buffer","Uint8Array","load","makeIfcLoader","fragmentIfcLoader","OpenbimTestbed","appContext","openBimHandles","orgIdForOB","fileId_forBind","revisionId_forBind","setProject","prj","getSelectedProject","ownerCompanyId","projects"],"sourceRoot":""}