IFCLoader.js 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431
  1. import {
  2. IFCRELAGGREGATES,
  3. IFCRELCONTAINEDINSPATIALSTRUCTURE,
  4. IFCRELDEFINESBYPROPERTIES,
  5. IFCRELASSOCIATESMATERIAL,
  6. IFCRELDEFINESBYTYPE,
  7. IFCPROJECT,
  8. IfcAPI
  9. } from './ifc/web-ifc-api.js';
  10. import {
  11. BufferAttribute,
  12. Mesh,
  13. Matrix4,
  14. BufferGeometry,
  15. Color,
  16. MeshLambertMaterial,
  17. DoubleSide,
  18. Loader,
  19. FileLoader
  20. } from '../../../build/three.module.js';
  21. import { mergeBufferGeometries } from '../utils/BufferGeometryUtils.js';
  22. const IdAttrName = 'expressID';
  23. const merge = ( geoms, createGroups = false ) => {
  24. return mergeBufferGeometries( geoms, createGroups );
  25. };
  26. const newFloatAttr = ( data, size ) => {
  27. return new BufferAttribute( new Float32Array( data ), size );
  28. };
  29. const newIntAttr = ( data, size ) => {
  30. return new BufferAttribute( new Uint32Array( data ), size );
  31. };
  32. const DEFAULT = 'default';
  33. const PropsNames = {
  34. aggregates: {
  35. name: IFCRELAGGREGATES,
  36. relating: 'RelatingObject',
  37. related: 'RelatedObjects',
  38. key: 'children'
  39. },
  40. spatial: {
  41. name: IFCRELCONTAINEDINSPATIALSTRUCTURE,
  42. relating: 'RelatingStructure',
  43. related: 'RelatedElements',
  44. key: 'children'
  45. },
  46. psets: {
  47. name: IFCRELDEFINESBYPROPERTIES,
  48. relating: 'RelatingPropertyDefinition',
  49. related: 'RelatedObjects',
  50. key: 'hasPsets'
  51. },
  52. materials: {
  53. name: IFCRELASSOCIATESMATERIAL,
  54. relating: 'RelatingMaterial',
  55. related: 'RelatedObjects',
  56. key: 'hasMaterial'
  57. },
  58. type: {
  59. name: IFCRELDEFINESBYTYPE,
  60. relating: 'RelatingType',
  61. related: 'RelatedObjects',
  62. key: 'hasType'
  63. }
  64. };
  65. class IFCParser {
  66. constructor( state, BVH ) {
  67. this.state = state;
  68. this.BVH = BVH;
  69. this.loadedModels = 0;
  70. this.currentWebIfcID = - 1;
  71. this.currentModelID = - 1;
  72. }
  73. async parse( buffer ) {
  74. if ( this.state.api.wasmModule === undefined )
  75. await this.state.api.Init();
  76. this.newIfcModel( buffer );
  77. this.loadedModels ++;
  78. return this.loadAllGeometry();
  79. }
  80. newIfcModel( buffer ) {
  81. const data = new Uint8Array( buffer );
  82. this.currentWebIfcID = this.state.api.OpenModel( data, this.state.webIfcSettings );
  83. this.currentModelID = this.state.useJSON ? this.loadedModels : this.currentWebIfcID;
  84. this.state.models[ this.currentModelID ] = {
  85. modelID: this.currentModelID,
  86. mesh: {},
  87. items: {},
  88. types: {},
  89. jsonData: {}
  90. };
  91. }
  92. loadAllGeometry() {
  93. this.saveAllPlacedGeometriesByMaterial();
  94. return this.generateAllGeometriesByMaterial();
  95. }
  96. generateAllGeometriesByMaterial() {
  97. const { geometry, materials } = this.getGeometryAndMaterials();
  98. this.BVH.applyThreeMeshBVH( geometry );
  99. const mesh = new Mesh( geometry, materials );
  100. mesh.modelID = this.currentModelID;
  101. this.state.models[ this.currentModelID ].mesh = mesh;
  102. return mesh;
  103. }
  104. getGeometryAndMaterials() {
  105. const items = this.state.models[ this.currentModelID ].items;
  106. const mergedByMaterial = [];
  107. const materials = [];
  108. for ( const materialID in items ) {
  109. materials.push( items[ materialID ].material );
  110. const geometries = Object.values( items[ materialID ].geometries );
  111. mergedByMaterial.push( merge( geometries ) );
  112. }
  113. const geometry = merge( mergedByMaterial, true );
  114. return {
  115. geometry,
  116. materials
  117. };
  118. }
  119. saveAllPlacedGeometriesByMaterial() {
  120. const flatMeshes = this.state.api.LoadAllGeometry( this.currentWebIfcID );
  121. for ( let i = 0; i < flatMeshes.size(); i ++ ) {
  122. const flatMesh = flatMeshes.get( i );
  123. const placedGeom = flatMesh.geometries;
  124. for ( let j = 0; j < placedGeom.size(); j ++ ) {
  125. this.savePlacedGeometry( placedGeom.get( j ), flatMesh.expressID );
  126. }
  127. }
  128. }
  129. savePlacedGeometry( placedGeometry, id ) {
  130. const geometry = this.getBufferGeometry( placedGeometry );
  131. geometry.computeVertexNormals();
  132. const matrix = this.getMeshMatrix( placedGeometry.flatTransformation );
  133. geometry.applyMatrix4( matrix );
  134. this.saveGeometryByMaterial( geometry, placedGeometry, id );
  135. }
  136. getBufferGeometry( placed ) {
  137. const geometry = this.state.api.GetGeometry( this.currentWebIfcID, placed.geometryExpressID );
  138. const vertexData = this.getVertices( geometry );
  139. const indices = this.getIndices( geometry );
  140. const { vertices, normals } = this.extractVertexData( vertexData );
  141. return this.ifcGeomToBufferGeom( vertices, normals, indices );
  142. }
  143. getVertices( geometry ) {
  144. const vData = geometry.GetVertexData();
  145. const vDataSize = geometry.GetVertexDataSize();
  146. return this.state.api.GetVertexArray( vData, vDataSize );
  147. }
  148. getIndices( geometry ) {
  149. const iData = geometry.GetIndexData();
  150. const iDataSize = geometry.GetIndexDataSize();
  151. return this.state.api.GetIndexArray( iData, iDataSize );
  152. }
  153. getMeshMatrix( matrix ) {
  154. const mat = new Matrix4();
  155. mat.fromArray( matrix );
  156. return mat;
  157. }
  158. ifcGeomToBufferGeom( vertices, normals, indexData ) {
  159. const geometry = new BufferGeometry();
  160. geometry.setAttribute( 'position', newFloatAttr( vertices, 3 ) );
  161. geometry.setAttribute( 'normal', newFloatAttr( normals, 3 ) );
  162. geometry.setIndex( new BufferAttribute( indexData, 1 ) );
  163. return geometry;
  164. }
  165. extractVertexData( vertexData ) {
  166. const vertices = [];
  167. const normals = [];
  168. let isNormalData = false;
  169. for ( let i = 0; i < vertexData.length; i ++ ) {
  170. isNormalData ? normals.push( vertexData[ i ] ) : vertices.push( vertexData[ i ] );
  171. if ( ( i + 1 ) % 3 == 0 )
  172. isNormalData = ! isNormalData;
  173. }
  174. return {
  175. vertices,
  176. normals
  177. };
  178. }
  179. saveGeometryByMaterial( geom, placedGeom, id ) {
  180. const color = placedGeom.color;
  181. const colorID = `${color.x}${color.y}${color.z}${color.w}`;
  182. this.storeGeometryAttribute( id, geom );
  183. this.createMaterial( colorID, color );
  184. const item = this.state.models[ this.currentModelID ].items[ colorID ];
  185. const currentGeom = item.geometries[ id ];
  186. if ( ! currentGeom )
  187. return ( item.geometries[ id ] = geom );
  188. const merged = merge( [ currentGeom, geom ] );
  189. item.geometries[ id ] = merged;
  190. }
  191. storeGeometryAttribute( id, geometry ) {
  192. const size = geometry.attributes.position.count;
  193. const idAttribute = new Array( size ).fill( id );
  194. geometry.setAttribute( IdAttrName, newIntAttr( idAttribute, 1 ) );
  195. }
  196. createMaterial( colorID, color ) {
  197. const items = this.state.models[ this.currentModelID ].items;
  198. if ( items[ colorID ] )
  199. return;
  200. const col = new Color( color.x, color.y, color.z );
  201. const newMaterial = new MeshLambertMaterial( {
  202. color: col,
  203. side: DoubleSide
  204. } );
  205. newMaterial.transparent = color.w !== 1;
  206. if ( newMaterial.transparent )
  207. newMaterial.opacity = color.w;
  208. items[ colorID ] = {
  209. material: newMaterial,
  210. geometries: {}
  211. };
  212. }
  213. }
  214. class SubsetManager {
  215. constructor( state, BVH ) {
  216. this.selected = {};
  217. this.state = state;
  218. this.BVH = BVH;
  219. }
  220. getSubset( modelID, material ) {
  221. const currentMat = this.matIDNoConfig( modelID, material );
  222. if ( ! this.selected[ currentMat ] )
  223. return null;
  224. return this.selected[ currentMat ].mesh;
  225. }
  226. removeSubset( modelID, parent, material ) {
  227. const currentMat = this.matIDNoConfig( modelID, material );
  228. if ( ! this.selected[ currentMat ] )
  229. return;
  230. if ( parent )
  231. parent.remove( this.selected[ currentMat ].mesh );
  232. delete this.selected[ currentMat ];
  233. }
  234. createSubset( config ) {
  235. if ( ! this.isConfigValid( config ) )
  236. return;
  237. if ( this.isPreviousSelection( config ) )
  238. return;
  239. if ( this.isEasySelection( config ) )
  240. return this.addToPreviousSelection( config );
  241. this.updatePreviousSelection( config.scene, config );
  242. return this.createSelectionInScene( config );
  243. }
  244. createSelectionInScene( config ) {
  245. const filtered = this.filter( config );
  246. const { geomsByMaterial, materials } = this.getGeomAndMat( filtered );
  247. const isDefMaterial = this.isDefaultMat( config );
  248. const geometry = this.getMergedGeometry( geomsByMaterial, isDefMaterial );
  249. const mats = isDefMaterial ? materials : config.material;
  250. this.BVH.applyThreeMeshBVH( geometry );
  251. const mesh = new Mesh( geometry, mats );
  252. this.selected[ this.matID( config ) ].mesh = mesh;
  253. mesh.modelID = config.modelID;
  254. config.scene.add( mesh );
  255. return mesh;
  256. }
  257. getMergedGeometry( geomsByMaterial, hasDefaultMaterial ) {
  258. return geomsByMaterial.length > 0
  259. ? merge( geomsByMaterial, hasDefaultMaterial )
  260. : new BufferGeometry();
  261. }
  262. isConfigValid( config ) {
  263. return ( this.isValid( config.scene ) &&
  264. this.isValid( config.modelID ) &&
  265. this.isValid( config.ids ) &&
  266. this.isValid( config.removePrevious ) );
  267. }
  268. isValid( item ) {
  269. return item != undefined && item != null;
  270. }
  271. getGeomAndMat( filtered ) {
  272. const geomsByMaterial = [];
  273. const materials = [];
  274. for ( const matID in filtered ) {
  275. const geoms = Object.values( filtered[ matID ].geometries );
  276. if ( ! geoms.length )
  277. continue;
  278. materials.push( filtered[ matID ].material );
  279. if ( geoms.length > 1 )
  280. geomsByMaterial.push( merge( geoms ) );
  281. else
  282. geomsByMaterial.push( ...geoms );
  283. }
  284. return {
  285. geomsByMaterial,
  286. materials
  287. };
  288. }
  289. updatePreviousSelection( parent, config ) {
  290. const previous = this.selected[ this.matID( config ) ];
  291. if ( ! previous )
  292. return this.newSelectionGroup( config );
  293. parent.remove( previous.mesh );
  294. config.removePrevious
  295. ? ( previous.ids = new Set( config.ids ) )
  296. : config.ids.forEach( ( id ) => previous.ids.add( id ) );
  297. }
  298. newSelectionGroup( config ) {
  299. this.selected[ this.matID( config ) ] = {
  300. ids: new Set( config.ids ),
  301. mesh: {}
  302. };
  303. }
  304. isPreviousSelection( config ) {
  305. if ( ! this.selected[ this.matID( config ) ] )
  306. return false;
  307. if ( this.containsIds( config ) )
  308. return true;
  309. const previousIds = this.selected[ this.matID( config ) ].ids;
  310. return JSON.stringify( config.ids ) === JSON.stringify( previousIds );
  311. }
  312. containsIds( config ) {
  313. const newIds = config.ids;
  314. const previous = Array.from( this.selected[ this.matID( config ) ].ids );
  315. return newIds.every( ( i => v => ( i = previous.indexOf( v, i ) + 1 ) )( 0 ) );
  316. }
  317. addToPreviousSelection( config ) {
  318. const previous = this.selected[ this.matID( config ) ];
  319. const filtered = this.filter( config );
  320. const geometries = Object.values( filtered ).map( ( i ) => Object.values( i.geometries ) ).flat();
  321. const previousGeom = previous.mesh.geometry;
  322. previous.mesh.geometry = merge( [ previousGeom, ...geometries ] );
  323. config.ids.forEach( ( id ) => previous.ids.add( id ) );
  324. }
  325. filter( config ) {
  326. const ids = this.selected[ this.matID( config ) ].ids;
  327. const items = this.state.models[ config.modelID ].items;
  328. const filtered = {};
  329. for ( const matID in items ) {
  330. filtered[ matID ] = {
  331. material: items[ matID ].material,
  332. geometries: this.filterGeometries( ids, items[ matID ].geometries )
  333. };
  334. }
  335. return filtered;
  336. }
  337. filterGeometries( selectedIDs, geometries ) {
  338. const ids = Array.from( selectedIDs );
  339. return Object.keys( geometries )
  340. .filter( ( key ) => ids.includes( parseInt( key, 10 ) ) )
  341. .reduce( ( obj, key ) => {
  342. return {
  343. ...obj,
  344. [ key ]: geometries[ key ]
  345. };
  346. }, {} );
  347. }
  348. isEasySelection( config ) {
  349. const matID = this.matID( config );
  350. if ( ! config.removePrevious && ! this.isDefaultMat( config ) && this.selected[ matID ] )
  351. return true;
  352. }
  353. isDefaultMat( config ) {
  354. return this.matIDNoConfig( config.modelID ) === this.matID( config );
  355. }
  356. matID( config ) {
  357. let name;
  358. if ( ! config.material )
  359. name = DEFAULT;
  360. else
  361. name = config.material.uuid || DEFAULT;
  362. return name.concat( ' - ' ).concat( config.modelID.toString() );
  363. }
  364. matIDNoConfig( modelID, material ) {
  365. let name = DEFAULT;
  366. if ( material )
  367. name = material.uuid;
  368. return name.concat( ' - ' ).concat( modelID.toString() );
  369. }
  370. }
  371. const IfcElements = {
  372. 103090709: 'IFCPROJECT',
  373. 4097777520: 'IFCSITE',
  374. 4031249490: 'IFCBUILDING',
  375. 3124254112: 'IFCBUILDINGSTOREY',
  376. 3856911033: 'IFCSPACE',
  377. 1674181508: 'IFCANNOTATION',
  378. 25142252: 'IFCCONTROLLER',
  379. 32344328: 'IFCBOILER',
  380. 76236018: 'IFCLAMP',
  381. 90941305: 'IFCPUMP',
  382. 177149247: 'IFCAIRTERMINALBOX',
  383. 182646315: 'IFCFLOWINSTRUMENT',
  384. 263784265: 'IFCFURNISHINGELEMENT',
  385. 264262732: 'IFCELECTRICGENERATOR',
  386. 277319702: 'IFCAUDIOVISUALAPPLIANCE',
  387. 310824031: 'IFCPIPEFITTING',
  388. 331165859: 'IFCSTAIR',
  389. 342316401: 'IFCDUCTFITTING',
  390. 377706215: 'IFCMECHANICALFASTENER',
  391. 395920057: 'IFCDOOR',
  392. 402227799: 'IFCELECTRICMOTOR',
  393. 413509423: 'IFCSYSTEMFURNITUREELEMENT',
  394. 484807127: 'IFCEVAPORATOR',
  395. 486154966: 'IFCWINDOWSTANDARDCASE',
  396. 629592764: 'IFCLIGHTFIXTURE',
  397. 630975310: 'IFCUNITARYCONTROLELEMENT',
  398. 635142910: 'IFCCABLECARRIERFITTING',
  399. 639361253: 'IFCCOIL',
  400. 647756555: 'IFCFASTENER',
  401. 707683696: 'IFCFLOWSTORAGEDEVICE',
  402. 738039164: 'IFCPROTECTIVEDEVICE',
  403. 753842376: 'IFCBEAM',
  404. 812556717: 'IFCTANK',
  405. 819412036: 'IFCFILTER',
  406. 843113511: 'IFCCOLUMN',
  407. 862014818: 'IFCELECTRICDISTRIBUTIONBOARD',
  408. 900683007: 'IFCFOOTING',
  409. 905975707: 'IFCCOLUMNSTANDARDCASE',
  410. 926996030: 'IFCVOIDINGFEATURE',
  411. 979691226: 'IFCREINFORCINGBAR',
  412. 987401354: 'IFCFLOWSEGMENT',
  413. 1003880860: 'IFCELECTRICTIMECONTROL',
  414. 1051757585: 'IFCCABLEFITTING',
  415. 1052013943: 'IFCDISTRIBUTIONCHAMBERELEMENT',
  416. 1062813311: 'IFCDISTRIBUTIONCONTROLELEMENT',
  417. 1073191201: 'IFCMEMBER',
  418. 1095909175: 'IFCBUILDINGELEMENTPROXY',
  419. 1156407060: 'IFCPLATESTANDARDCASE',
  420. 1162798199: 'IFCSWITCHINGDEVICE',
  421. 1329646415: 'IFCSHADINGDEVICE',
  422. 1335981549: 'IFCDISCRETEACCESSORY',
  423. 1360408905: 'IFCDUCTSILENCER',
  424. 1404847402: 'IFCSTACKTERMINAL',
  425. 1426591983: 'IFCFIRESUPPRESSIONTERMINAL',
  426. 1437502449: 'IFCMEDICALDEVICE',
  427. 1509553395: 'IFCFURNITURE',
  428. 1529196076: 'IFCSLAB',
  429. 1620046519: 'IFCTRANSPORTELEMENT',
  430. 1634111441: 'IFCAIRTERMINAL',
  431. 1658829314: 'IFCENERGYCONVERSIONDEVICE',
  432. 1677625105: 'IFCCIVILELEMENT',
  433. 1687234759: 'IFCPILE',
  434. 1904799276: 'IFCELECTRICAPPLIANCE',
  435. 1911478936: 'IFCMEMBERSTANDARDCASE',
  436. 1945004755: 'IFCDISTRIBUTIONELEMENT',
  437. 1973544240: 'IFCCOVERING',
  438. 1999602285: 'IFCSPACEHEATER',
  439. 2016517767: 'IFCROOF',
  440. 2056796094: 'IFCAIRTOAIRHEATRECOVERY',
  441. 2058353004: 'IFCFLOWCONTROLLER',
  442. 2068733104: 'IFCHUMIDIFIER',
  443. 2176052936: 'IFCJUNCTIONBOX',
  444. 2188021234: 'IFCFLOWMETER',
  445. 2223149337: 'IFCFLOWTERMINAL',
  446. 2262370178: 'IFCRAILING',
  447. 2272882330: 'IFCCONDENSER',
  448. 2295281155: 'IFCPROTECTIVEDEVICETRIPPINGUNIT',
  449. 2320036040: 'IFCREINFORCINGMESH',
  450. 2347447852: 'IFCTENDONANCHOR',
  451. 2391383451: 'IFCVIBRATIONISOLATOR',
  452. 2391406946: 'IFCWALL',
  453. 2474470126: 'IFCMOTORCONNECTION',
  454. 2769231204: 'IFCVIRTUALELEMENT',
  455. 2814081492: 'IFCENGINE',
  456. 2906023776: 'IFCBEAMSTANDARDCASE',
  457. 2938176219: 'IFCBURNER',
  458. 2979338954: 'IFCBUILDINGELEMENTPART',
  459. 3024970846: 'IFCRAMP',
  460. 3026737570: 'IFCTUBEBUNDLE',
  461. 3027962421: 'IFCSLABSTANDARDCASE',
  462. 3040386961: 'IFCDISTRIBUTIONFLOWELEMENT',
  463. 3053780830: 'IFCSANITARYTERMINAL',
  464. 3079942009: 'IFCOPENINGSTANDARDCASE',
  465. 3087945054: 'IFCALARM',
  466. 3101698114: 'IFCSURFACEFEATURE',
  467. 3127900445: 'IFCSLABELEMENTEDCASE',
  468. 3132237377: 'IFCFLOWMOVINGDEVICE',
  469. 3171933400: 'IFCPLATE',
  470. 3221913625: 'IFCCOMMUNICATIONSAPPLIANCE',
  471. 3242481149: 'IFCDOORSTANDARDCASE',
  472. 3283111854: 'IFCRAMPFLIGHT',
  473. 3296154744: 'IFCCHIMNEY',
  474. 3304561284: 'IFCWINDOW',
  475. 3310460725: 'IFCELECTRICFLOWSTORAGEDEVICE',
  476. 3319311131: 'IFCHEATEXCHANGER',
  477. 3415622556: 'IFCFAN',
  478. 3420628829: 'IFCSOLARDEVICE',
  479. 3493046030: 'IFCGEOGRAPHICELEMENT',
  480. 3495092785: 'IFCCURTAINWALL',
  481. 3508470533: 'IFCFLOWTREATMENTDEVICE',
  482. 3512223829: 'IFCWALLSTANDARDCASE',
  483. 3518393246: 'IFCDUCTSEGMENT',
  484. 3571504051: 'IFCCOMPRESSOR',
  485. 3588315303: 'IFCOPENINGELEMENT',
  486. 3612865200: 'IFCPIPESEGMENT',
  487. 3640358203: 'IFCCOOLINGTOWER',
  488. 3651124850: 'IFCPROJECTIONELEMENT',
  489. 3694346114: 'IFCOUTLET',
  490. 3747195512: 'IFCEVAPORATIVECOOLER',
  491. 3758799889: 'IFCCABLECARRIERSEGMENT',
  492. 3824725483: 'IFCTENDON',
  493. 3825984169: 'IFCTRANSFORMER',
  494. 3902619387: 'IFCCHILLER',
  495. 4074379575: 'IFCDAMPER',
  496. 4086658281: 'IFCSENSOR',
  497. 4123344466: 'IFCELEMENTASSEMBLY',
  498. 4136498852: 'IFCCOOLEDBEAM',
  499. 4156078855: 'IFCWALLELEMENTEDCASE',
  500. 4175244083: 'IFCINTERCEPTOR',
  501. 4207607924: 'IFCVALVE',
  502. 4217484030: 'IFCCABLESEGMENT',
  503. 4237592921: 'IFCWASTETERMINAL',
  504. 4252922144: 'IFCSTAIRFLIGHT',
  505. 4278956645: 'IFCFLOWFITTING',
  506. 4288193352: 'IFCACTUATOR',
  507. 4292641817: 'IFCUNITARYEQUIPMENT',
  508. 3009204131: 'IFCGRID'
  509. };
  510. const IfcTypesMap = {
  511. 3821786052: 'IFCACTIONREQUEST',
  512. 2296667514: 'IFCACTOR',
  513. 3630933823: 'IFCACTORROLE',
  514. 4288193352: 'IFCACTUATOR',
  515. 2874132201: 'IFCACTUATORTYPE',
  516. 618182010: 'IFCADDRESS',
  517. 1635779807: 'IFCADVANCEDBREP',
  518. 2603310189: 'IFCADVANCEDBREPWITHVOIDS',
  519. 3406155212: 'IFCADVANCEDFACE',
  520. 1634111441: 'IFCAIRTERMINAL',
  521. 177149247: 'IFCAIRTERMINALBOX',
  522. 1411407467: 'IFCAIRTERMINALBOXTYPE',
  523. 3352864051: 'IFCAIRTERMINALTYPE',
  524. 2056796094: 'IFCAIRTOAIRHEATRECOVERY',
  525. 1871374353: 'IFCAIRTOAIRHEATRECOVERYTYPE',
  526. 3087945054: 'IFCALARM',
  527. 3001207471: 'IFCALARMTYPE',
  528. 325726236: 'IFCALIGNMENT',
  529. 749761778: 'IFCALIGNMENT2DHORIZONTAL',
  530. 3199563722: 'IFCALIGNMENT2DHORIZONTALSEGMENT',
  531. 2483840362: 'IFCALIGNMENT2DSEGMENT',
  532. 3379348081: 'IFCALIGNMENT2DVERSEGCIRCULARARC',
  533. 3239324667: 'IFCALIGNMENT2DVERSEGLINE',
  534. 4263986512: 'IFCALIGNMENT2DVERSEGPARABOLICARC',
  535. 53199957: 'IFCALIGNMENT2DVERTICAL',
  536. 2029264950: 'IFCALIGNMENT2DVERTICALSEGMENT',
  537. 3512275521: 'IFCALIGNMENTCURVE',
  538. 1674181508: 'IFCANNOTATION',
  539. 669184980: 'IFCANNOTATIONFILLAREA',
  540. 639542469: 'IFCAPPLICATION',
  541. 411424972: 'IFCAPPLIEDVALUE',
  542. 130549933: 'IFCAPPROVAL',
  543. 3869604511: 'IFCAPPROVALRELATIONSHIP',
  544. 3798115385: 'IFCARBITRARYCLOSEDPROFILEDEF',
  545. 1310608509: 'IFCARBITRARYOPENPROFILEDEF',
  546. 2705031697: 'IFCARBITRARYPROFILEDEFWITHVOIDS',
  547. 3460190687: 'IFCASSET',
  548. 3207858831: 'IFCASYMMETRICISHAPEPROFILEDEF',
  549. 277319702: 'IFCAUDIOVISUALAPPLIANCE',
  550. 1532957894: 'IFCAUDIOVISUALAPPLIANCETYPE',
  551. 4261334040: 'IFCAXIS1PLACEMENT',
  552. 3125803723: 'IFCAXIS2PLACEMENT2D',
  553. 2740243338: 'IFCAXIS2PLACEMENT3D',
  554. 1967976161: 'IFCBSPLINECURVE',
  555. 2461110595: 'IFCBSPLINECURVEWITHKNOTS',
  556. 2887950389: 'IFCBSPLINESURFACE',
  557. 167062518: 'IFCBSPLINESURFACEWITHKNOTS',
  558. 753842376: 'IFCBEAM',
  559. 2906023776: 'IFCBEAMSTANDARDCASE',
  560. 819618141: 'IFCBEAMTYPE',
  561. 4196446775: 'IFCBEARING',
  562. 3649138523: 'IFCBEARINGTYPE',
  563. 616511568: 'IFCBLOBTEXTURE',
  564. 1334484129: 'IFCBLOCK',
  565. 32344328: 'IFCBOILER',
  566. 231477066: 'IFCBOILERTYPE',
  567. 3649129432: 'IFCBOOLEANCLIPPINGRESULT',
  568. 2736907675: 'IFCBOOLEANRESULT',
  569. 4037036970: 'IFCBOUNDARYCONDITION',
  570. 1136057603: 'IFCBOUNDARYCURVE',
  571. 1560379544: 'IFCBOUNDARYEDGECONDITION',
  572. 3367102660: 'IFCBOUNDARYFACECONDITION',
  573. 1387855156: 'IFCBOUNDARYNODECONDITION',
  574. 2069777674: 'IFCBOUNDARYNODECONDITIONWARPING',
  575. 1260505505: 'IFCBOUNDEDCURVE',
  576. 4182860854: 'IFCBOUNDEDSURFACE',
  577. 2581212453: 'IFCBOUNDINGBOX',
  578. 2713105998: 'IFCBOXEDHALFSPACE',
  579. 644574406: 'IFCBRIDGE',
  580. 963979645: 'IFCBRIDGEPART',
  581. 4031249490: 'IFCBUILDING',
  582. 3299480353: 'IFCBUILDINGELEMENT',
  583. 2979338954: 'IFCBUILDINGELEMENTPART',
  584. 39481116: 'IFCBUILDINGELEMENTPARTTYPE',
  585. 1095909175: 'IFCBUILDINGELEMENTPROXY',
  586. 1909888760: 'IFCBUILDINGELEMENTPROXYTYPE',
  587. 1950629157: 'IFCBUILDINGELEMENTTYPE',
  588. 3124254112: 'IFCBUILDINGSTOREY',
  589. 1177604601: 'IFCBUILDINGSYSTEM',
  590. 2938176219: 'IFCBURNER',
  591. 2188180465: 'IFCBURNERTYPE',
  592. 2898889636: 'IFCCSHAPEPROFILEDEF',
  593. 635142910: 'IFCCABLECARRIERFITTING',
  594. 395041908: 'IFCCABLECARRIERFITTINGTYPE',
  595. 3758799889: 'IFCCABLECARRIERSEGMENT',
  596. 3293546465: 'IFCCABLECARRIERSEGMENTTYPE',
  597. 1051757585: 'IFCCABLEFITTING',
  598. 2674252688: 'IFCCABLEFITTINGTYPE',
  599. 4217484030: 'IFCCABLESEGMENT',
  600. 1285652485: 'IFCCABLESEGMENTTYPE',
  601. 3999819293: 'IFCCAISSONFOUNDATION',
  602. 3203706013: 'IFCCAISSONFOUNDATIONTYPE',
  603. 1123145078: 'IFCCARTESIANPOINT',
  604. 574549367: 'IFCCARTESIANPOINTLIST',
  605. 1675464909: 'IFCCARTESIANPOINTLIST2D',
  606. 2059837836: 'IFCCARTESIANPOINTLIST3D',
  607. 59481748: 'IFCCARTESIANTRANSFORMATIONOPERATOR',
  608. 3749851601: 'IFCCARTESIANTRANSFORMATIONOPERATOR2D',
  609. 3486308946: 'IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM',
  610. 3331915920: 'IFCCARTESIANTRANSFORMATIONOPERATOR3D',
  611. 1416205885: 'IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM',
  612. 3150382593: 'IFCCENTERLINEPROFILEDEF',
  613. 3902619387: 'IFCCHILLER',
  614. 2951183804: 'IFCCHILLERTYPE',
  615. 3296154744: 'IFCCHIMNEY',
  616. 2197970202: 'IFCCHIMNEYTYPE',
  617. 2611217952: 'IFCCIRCLE',
  618. 2937912522: 'IFCCIRCLEHOLLOWPROFILEDEF',
  619. 1383045692: 'IFCCIRCLEPROFILEDEF',
  620. 1062206242: 'IFCCIRCULARARCSEGMENT2D',
  621. 1677625105: 'IFCCIVILELEMENT',
  622. 3893394355: 'IFCCIVILELEMENTTYPE',
  623. 747523909: 'IFCCLASSIFICATION',
  624. 647927063: 'IFCCLASSIFICATIONREFERENCE',
  625. 2205249479: 'IFCCLOSEDSHELL',
  626. 639361253: 'IFCCOIL',
  627. 2301859152: 'IFCCOILTYPE',
  628. 776857604: 'IFCCOLOURRGB',
  629. 3285139300: 'IFCCOLOURRGBLIST',
  630. 3264961684: 'IFCCOLOURSPECIFICATION',
  631. 843113511: 'IFCCOLUMN',
  632. 905975707: 'IFCCOLUMNSTANDARDCASE',
  633. 300633059: 'IFCCOLUMNTYPE',
  634. 3221913625: 'IFCCOMMUNICATIONSAPPLIANCE',
  635. 400855858: 'IFCCOMMUNICATIONSAPPLIANCETYPE',
  636. 2542286263: 'IFCCOMPLEXPROPERTY',
  637. 3875453745: 'IFCCOMPLEXPROPERTYTEMPLATE',
  638. 3732776249: 'IFCCOMPOSITECURVE',
  639. 15328376: 'IFCCOMPOSITECURVEONSURFACE',
  640. 2485617015: 'IFCCOMPOSITECURVESEGMENT',
  641. 1485152156: 'IFCCOMPOSITEPROFILEDEF',
  642. 3571504051: 'IFCCOMPRESSOR',
  643. 3850581409: 'IFCCOMPRESSORTYPE',
  644. 2272882330: 'IFCCONDENSER',
  645. 2816379211: 'IFCCONDENSERTYPE',
  646. 2510884976: 'IFCCONIC',
  647. 370225590: 'IFCCONNECTEDFACESET',
  648. 1981873012: 'IFCCONNECTIONCURVEGEOMETRY',
  649. 2859738748: 'IFCCONNECTIONGEOMETRY',
  650. 45288368: 'IFCCONNECTIONPOINTECCENTRICITY',
  651. 2614616156: 'IFCCONNECTIONPOINTGEOMETRY',
  652. 2732653382: 'IFCCONNECTIONSURFACEGEOMETRY',
  653. 775493141: 'IFCCONNECTIONVOLUMEGEOMETRY',
  654. 1959218052: 'IFCCONSTRAINT',
  655. 3898045240: 'IFCCONSTRUCTIONEQUIPMENTRESOURCE',
  656. 2185764099: 'IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE',
  657. 1060000209: 'IFCCONSTRUCTIONMATERIALRESOURCE',
  658. 4105962743: 'IFCCONSTRUCTIONMATERIALRESOURCETYPE',
  659. 488727124: 'IFCCONSTRUCTIONPRODUCTRESOURCE',
  660. 1525564444: 'IFCCONSTRUCTIONPRODUCTRESOURCETYPE',
  661. 2559216714: 'IFCCONSTRUCTIONRESOURCE',
  662. 2574617495: 'IFCCONSTRUCTIONRESOURCETYPE',
  663. 3419103109: 'IFCCONTEXT',
  664. 3050246964: 'IFCCONTEXTDEPENDENTUNIT',
  665. 3293443760: 'IFCCONTROL',
  666. 25142252: 'IFCCONTROLLER',
  667. 578613899: 'IFCCONTROLLERTYPE',
  668. 2889183280: 'IFCCONVERSIONBASEDUNIT',
  669. 2713554722: 'IFCCONVERSIONBASEDUNITWITHOFFSET',
  670. 4136498852: 'IFCCOOLEDBEAM',
  671. 335055490: 'IFCCOOLEDBEAMTYPE',
  672. 3640358203: 'IFCCOOLINGTOWER',
  673. 2954562838: 'IFCCOOLINGTOWERTYPE',
  674. 1785450214: 'IFCCOORDINATEOPERATION',
  675. 1466758467: 'IFCCOORDINATEREFERENCESYSTEM',
  676. 3895139033: 'IFCCOSTITEM',
  677. 1419761937: 'IFCCOSTSCHEDULE',
  678. 602808272: 'IFCCOSTVALUE',
  679. 1973544240: 'IFCCOVERING',
  680. 1916426348: 'IFCCOVERINGTYPE',
  681. 3295246426: 'IFCCREWRESOURCE',
  682. 1815067380: 'IFCCREWRESOURCETYPE',
  683. 2506170314: 'IFCCSGPRIMITIVE3D',
  684. 2147822146: 'IFCCSGSOLID',
  685. 539742890: 'IFCCURRENCYRELATIONSHIP',
  686. 3495092785: 'IFCCURTAINWALL',
  687. 1457835157: 'IFCCURTAINWALLTYPE',
  688. 2601014836: 'IFCCURVE',
  689. 2827736869: 'IFCCURVEBOUNDEDPLANE',
  690. 2629017746: 'IFCCURVEBOUNDEDSURFACE',
  691. 1186437898: 'IFCCURVESEGMENT2D',
  692. 3800577675: 'IFCCURVESTYLE',
  693. 1105321065: 'IFCCURVESTYLEFONT',
  694. 2367409068: 'IFCCURVESTYLEFONTANDSCALING',
  695. 3510044353: 'IFCCURVESTYLEFONTPATTERN',
  696. 1213902940: 'IFCCYLINDRICALSURFACE',
  697. 4074379575: 'IFCDAMPER',
  698. 3961806047: 'IFCDAMPERTYPE',
  699. 3426335179: 'IFCDEEPFOUNDATION',
  700. 1306400036: 'IFCDEEPFOUNDATIONTYPE',
  701. 3632507154: 'IFCDERIVEDPROFILEDEF',
  702. 1765591967: 'IFCDERIVEDUNIT',
  703. 1045800335: 'IFCDERIVEDUNITELEMENT',
  704. 2949456006: 'IFCDIMENSIONALEXPONENTS',
  705. 32440307: 'IFCDIRECTION',
  706. 1335981549: 'IFCDISCRETEACCESSORY',
  707. 2635815018: 'IFCDISCRETEACCESSORYTYPE',
  708. 1945343521: 'IFCDISTANCEEXPRESSION',
  709. 1052013943: 'IFCDISTRIBUTIONCHAMBERELEMENT',
  710. 1599208980: 'IFCDISTRIBUTIONCHAMBERELEMENTTYPE',
  711. 562808652: 'IFCDISTRIBUTIONCIRCUIT',
  712. 1062813311: 'IFCDISTRIBUTIONCONTROLELEMENT',
  713. 2063403501: 'IFCDISTRIBUTIONCONTROLELEMENTTYPE',
  714. 1945004755: 'IFCDISTRIBUTIONELEMENT',
  715. 3256556792: 'IFCDISTRIBUTIONELEMENTTYPE',
  716. 3040386961: 'IFCDISTRIBUTIONFLOWELEMENT',
  717. 3849074793: 'IFCDISTRIBUTIONFLOWELEMENTTYPE',
  718. 3041715199: 'IFCDISTRIBUTIONPORT',
  719. 3205830791: 'IFCDISTRIBUTIONSYSTEM',
  720. 1154170062: 'IFCDOCUMENTINFORMATION',
  721. 770865208: 'IFCDOCUMENTINFORMATIONRELATIONSHIP',
  722. 3732053477: 'IFCDOCUMENTREFERENCE',
  723. 395920057: 'IFCDOOR',
  724. 2963535650: 'IFCDOORLININGPROPERTIES',
  725. 1714330368: 'IFCDOORPANELPROPERTIES',
  726. 3242481149: 'IFCDOORSTANDARDCASE',
  727. 526551008: 'IFCDOORSTYLE',
  728. 2323601079: 'IFCDOORTYPE',
  729. 445594917: 'IFCDRAUGHTINGPREDEFINEDCOLOUR',
  730. 4006246654: 'IFCDRAUGHTINGPREDEFINEDCURVEFONT',
  731. 342316401: 'IFCDUCTFITTING',
  732. 869906466: 'IFCDUCTFITTINGTYPE',
  733. 3518393246: 'IFCDUCTSEGMENT',
  734. 3760055223: 'IFCDUCTSEGMENTTYPE',
  735. 1360408905: 'IFCDUCTSILENCER',
  736. 2030761528: 'IFCDUCTSILENCERTYPE',
  737. 3900360178: 'IFCEDGE',
  738. 476780140: 'IFCEDGECURVE',
  739. 1472233963: 'IFCEDGELOOP',
  740. 1904799276: 'IFCELECTRICAPPLIANCE',
  741. 663422040: 'IFCELECTRICAPPLIANCETYPE',
  742. 862014818: 'IFCELECTRICDISTRIBUTIONBOARD',
  743. 2417008758: 'IFCELECTRICDISTRIBUTIONBOARDTYPE',
  744. 3310460725: 'IFCELECTRICFLOWSTORAGEDEVICE',
  745. 3277789161: 'IFCELECTRICFLOWSTORAGEDEVICETYPE',
  746. 264262732: 'IFCELECTRICGENERATOR',
  747. 1534661035: 'IFCELECTRICGENERATORTYPE',
  748. 402227799: 'IFCELECTRICMOTOR',
  749. 1217240411: 'IFCELECTRICMOTORTYPE',
  750. 1003880860: 'IFCELECTRICTIMECONTROL',
  751. 712377611: 'IFCELECTRICTIMECONTROLTYPE',
  752. 1758889154: 'IFCELEMENT',
  753. 4123344466: 'IFCELEMENTASSEMBLY',
  754. 2397081782: 'IFCELEMENTASSEMBLYTYPE',
  755. 1623761950: 'IFCELEMENTCOMPONENT',
  756. 2590856083: 'IFCELEMENTCOMPONENTTYPE',
  757. 1883228015: 'IFCELEMENTQUANTITY',
  758. 339256511: 'IFCELEMENTTYPE',
  759. 2777663545: 'IFCELEMENTARYSURFACE',
  760. 1704287377: 'IFCELLIPSE',
  761. 2835456948: 'IFCELLIPSEPROFILEDEF',
  762. 1658829314: 'IFCENERGYCONVERSIONDEVICE',
  763. 2107101300: 'IFCENERGYCONVERSIONDEVICETYPE',
  764. 2814081492: 'IFCENGINE',
  765. 132023988: 'IFCENGINETYPE',
  766. 3747195512: 'IFCEVAPORATIVECOOLER',
  767. 3174744832: 'IFCEVAPORATIVECOOLERTYPE',
  768. 484807127: 'IFCEVAPORATOR',
  769. 3390157468: 'IFCEVAPORATORTYPE',
  770. 4148101412: 'IFCEVENT',
  771. 211053100: 'IFCEVENTTIME',
  772. 4024345920: 'IFCEVENTTYPE',
  773. 297599258: 'IFCEXTENDEDPROPERTIES',
  774. 4294318154: 'IFCEXTERNALINFORMATION',
  775. 3200245327: 'IFCEXTERNALREFERENCE',
  776. 1437805879: 'IFCEXTERNALREFERENCERELATIONSHIP',
  777. 1209101575: 'IFCEXTERNALSPATIALELEMENT',
  778. 2853485674: 'IFCEXTERNALSPATIALSTRUCTUREELEMENT',
  779. 2242383968: 'IFCEXTERNALLYDEFINEDHATCHSTYLE',
  780. 1040185647: 'IFCEXTERNALLYDEFINEDSURFACESTYLE',
  781. 3548104201: 'IFCEXTERNALLYDEFINEDTEXTFONT',
  782. 477187591: 'IFCEXTRUDEDAREASOLID',
  783. 2804161546: 'IFCEXTRUDEDAREASOLIDTAPERED',
  784. 2556980723: 'IFCFACE',
  785. 2047409740: 'IFCFACEBASEDSURFACEMODEL',
  786. 1809719519: 'IFCFACEBOUND',
  787. 803316827: 'IFCFACEOUTERBOUND',
  788. 3008276851: 'IFCFACESURFACE',
  789. 807026263: 'IFCFACETEDBREP',
  790. 3737207727: 'IFCFACETEDBREPWITHVOIDS',
  791. 24185140: 'IFCFACILITY',
  792. 1310830890: 'IFCFACILITYPART',
  793. 4219587988: 'IFCFAILURECONNECTIONCONDITION',
  794. 3415622556: 'IFCFAN',
  795. 346874300: 'IFCFANTYPE',
  796. 647756555: 'IFCFASTENER',
  797. 2489546625: 'IFCFASTENERTYPE',
  798. 2827207264: 'IFCFEATUREELEMENT',
  799. 2143335405: 'IFCFEATUREELEMENTADDITION',
  800. 1287392070: 'IFCFEATUREELEMENTSUBTRACTION',
  801. 738692330: 'IFCFILLAREASTYLE',
  802. 374418227: 'IFCFILLAREASTYLEHATCHING',
  803. 315944413: 'IFCFILLAREASTYLETILES',
  804. 819412036: 'IFCFILTER',
  805. 1810631287: 'IFCFILTERTYPE',
  806. 1426591983: 'IFCFIRESUPPRESSIONTERMINAL',
  807. 4222183408: 'IFCFIRESUPPRESSIONTERMINALTYPE',
  808. 2652556860: 'IFCFIXEDREFERENCESWEPTAREASOLID',
  809. 2058353004: 'IFCFLOWCONTROLLER',
  810. 3907093117: 'IFCFLOWCONTROLLERTYPE',
  811. 4278956645: 'IFCFLOWFITTING',
  812. 3198132628: 'IFCFLOWFITTINGTYPE',
  813. 182646315: 'IFCFLOWINSTRUMENT',
  814. 4037862832: 'IFCFLOWINSTRUMENTTYPE',
  815. 2188021234: 'IFCFLOWMETER',
  816. 3815607619: 'IFCFLOWMETERTYPE',
  817. 3132237377: 'IFCFLOWMOVINGDEVICE',
  818. 1482959167: 'IFCFLOWMOVINGDEVICETYPE',
  819. 987401354: 'IFCFLOWSEGMENT',
  820. 1834744321: 'IFCFLOWSEGMENTTYPE',
  821. 707683696: 'IFCFLOWSTORAGEDEVICE',
  822. 1339347760: 'IFCFLOWSTORAGEDEVICETYPE',
  823. 2223149337: 'IFCFLOWTERMINAL',
  824. 2297155007: 'IFCFLOWTERMINALTYPE',
  825. 3508470533: 'IFCFLOWTREATMENTDEVICE',
  826. 3009222698: 'IFCFLOWTREATMENTDEVICETYPE',
  827. 900683007: 'IFCFOOTING',
  828. 1893162501: 'IFCFOOTINGTYPE',
  829. 263784265: 'IFCFURNISHINGELEMENT',
  830. 4238390223: 'IFCFURNISHINGELEMENTTYPE',
  831. 1509553395: 'IFCFURNITURE',
  832. 1268542332: 'IFCFURNITURETYPE',
  833. 3493046030: 'IFCGEOGRAPHICELEMENT',
  834. 4095422895: 'IFCGEOGRAPHICELEMENTTYPE',
  835. 987898635: 'IFCGEOMETRICCURVESET',
  836. 3448662350: 'IFCGEOMETRICREPRESENTATIONCONTEXT',
  837. 2453401579: 'IFCGEOMETRICREPRESENTATIONITEM',
  838. 4142052618: 'IFCGEOMETRICREPRESENTATIONSUBCONTEXT',
  839. 3590301190: 'IFCGEOMETRICSET',
  840. 3009204131: 'IFCGRID',
  841. 852622518: 'IFCGRIDAXIS',
  842. 178086475: 'IFCGRIDPLACEMENT',
  843. 2706460486: 'IFCGROUP',
  844. 812098782: 'IFCHALFSPACESOLID',
  845. 3319311131: 'IFCHEATEXCHANGER',
  846. 1251058090: 'IFCHEATEXCHANGERTYPE',
  847. 2068733104: 'IFCHUMIDIFIER',
  848. 1806887404: 'IFCHUMIDIFIERTYPE',
  849. 1484403080: 'IFCISHAPEPROFILEDEF',
  850. 3905492369: 'IFCIMAGETEXTURE',
  851. 3570813810: 'IFCINDEXEDCOLOURMAP',
  852. 2571569899: 'IFCINDEXEDPOLYCURVE',
  853. 178912537: 'IFCINDEXEDPOLYGONALFACE',
  854. 2294589976: 'IFCINDEXEDPOLYGONALFACEWITHVOIDS',
  855. 1437953363: 'IFCINDEXEDTEXTUREMAP',
  856. 2133299955: 'IFCINDEXEDTRIANGLETEXTUREMAP',
  857. 4175244083: 'IFCINTERCEPTOR',
  858. 3946677679: 'IFCINTERCEPTORTYPE',
  859. 3113134337: 'IFCINTERSECTIONCURVE',
  860. 2391368822: 'IFCINVENTORY',
  861. 3741457305: 'IFCIRREGULARTIMESERIES',
  862. 3020489413: 'IFCIRREGULARTIMESERIESVALUE',
  863. 2176052936: 'IFCJUNCTIONBOX',
  864. 4288270099: 'IFCJUNCTIONBOXTYPE',
  865. 572779678: 'IFCLSHAPEPROFILEDEF',
  866. 3827777499: 'IFCLABORRESOURCE',
  867. 428585644: 'IFCLABORRESOURCETYPE',
  868. 1585845231: 'IFCLAGTIME',
  869. 76236018: 'IFCLAMP',
  870. 1051575348: 'IFCLAMPTYPE',
  871. 2655187982: 'IFCLIBRARYINFORMATION',
  872. 3452421091: 'IFCLIBRARYREFERENCE',
  873. 4162380809: 'IFCLIGHTDISTRIBUTIONDATA',
  874. 629592764: 'IFCLIGHTFIXTURE',
  875. 1161773419: 'IFCLIGHTFIXTURETYPE',
  876. 1566485204: 'IFCLIGHTINTENSITYDISTRIBUTION',
  877. 1402838566: 'IFCLIGHTSOURCE',
  878. 125510826: 'IFCLIGHTSOURCEAMBIENT',
  879. 2604431987: 'IFCLIGHTSOURCEDIRECTIONAL',
  880. 4266656042: 'IFCLIGHTSOURCEGONIOMETRIC',
  881. 1520743889: 'IFCLIGHTSOURCEPOSITIONAL',
  882. 3422422726: 'IFCLIGHTSOURCESPOT',
  883. 1281925730: 'IFCLINE',
  884. 3092502836: 'IFCLINESEGMENT2D',
  885. 388784114: 'IFCLINEARPLACEMENT',
  886. 1154579445: 'IFCLINEARPOSITIONINGELEMENT',
  887. 2624227202: 'IFCLOCALPLACEMENT',
  888. 1008929658: 'IFCLOOP',
  889. 1425443689: 'IFCMANIFOLDSOLIDBREP',
  890. 3057273783: 'IFCMAPCONVERSION',
  891. 2347385850: 'IFCMAPPEDITEM',
  892. 1838606355: 'IFCMATERIAL',
  893. 1847130766: 'IFCMATERIALCLASSIFICATIONRELATIONSHIP',
  894. 3708119000: 'IFCMATERIALCONSTITUENT',
  895. 2852063980: 'IFCMATERIALCONSTITUENTSET',
  896. 760658860: 'IFCMATERIALDEFINITION',
  897. 2022407955: 'IFCMATERIALDEFINITIONREPRESENTATION',
  898. 248100487: 'IFCMATERIALLAYER',
  899. 3303938423: 'IFCMATERIALLAYERSET',
  900. 1303795690: 'IFCMATERIALLAYERSETUSAGE',
  901. 1847252529: 'IFCMATERIALLAYERWITHOFFSETS',
  902. 2199411900: 'IFCMATERIALLIST',
  903. 2235152071: 'IFCMATERIALPROFILE',
  904. 164193824: 'IFCMATERIALPROFILESET',
  905. 3079605661: 'IFCMATERIALPROFILESETUSAGE',
  906. 3404854881: 'IFCMATERIALPROFILESETUSAGETAPERING',
  907. 552965576: 'IFCMATERIALPROFILEWITHOFFSETS',
  908. 3265635763: 'IFCMATERIALPROPERTIES',
  909. 853536259: 'IFCMATERIALRELATIONSHIP',
  910. 1507914824: 'IFCMATERIALUSAGEDEFINITION',
  911. 2597039031: 'IFCMEASUREWITHUNIT',
  912. 377706215: 'IFCMECHANICALFASTENER',
  913. 2108223431: 'IFCMECHANICALFASTENERTYPE',
  914. 1437502449: 'IFCMEDICALDEVICE',
  915. 1114901282: 'IFCMEDICALDEVICETYPE',
  916. 1073191201: 'IFCMEMBER',
  917. 1911478936: 'IFCMEMBERSTANDARDCASE',
  918. 3181161470: 'IFCMEMBERTYPE',
  919. 3368373690: 'IFCMETRIC',
  920. 2998442950: 'IFCMIRROREDPROFILEDEF',
  921. 2706619895: 'IFCMONETARYUNIT',
  922. 2474470126: 'IFCMOTORCONNECTION',
  923. 977012517: 'IFCMOTORCONNECTIONTYPE',
  924. 1918398963: 'IFCNAMEDUNIT',
  925. 3888040117: 'IFCOBJECT',
  926. 219451334: 'IFCOBJECTDEFINITION',
  927. 3701648758: 'IFCOBJECTPLACEMENT',
  928. 2251480897: 'IFCOBJECTIVE',
  929. 4143007308: 'IFCOCCUPANT',
  930. 590820931: 'IFCOFFSETCURVE',
  931. 3388369263: 'IFCOFFSETCURVE2D',
  932. 3505215534: 'IFCOFFSETCURVE3D',
  933. 2485787929: 'IFCOFFSETCURVEBYDISTANCES',
  934. 2665983363: 'IFCOPENSHELL',
  935. 3588315303: 'IFCOPENINGELEMENT',
  936. 3079942009: 'IFCOPENINGSTANDARDCASE',
  937. 4251960020: 'IFCORGANIZATION',
  938. 1411181986: 'IFCORGANIZATIONRELATIONSHIP',
  939. 643959842: 'IFCORIENTATIONEXPRESSION',
  940. 1029017970: 'IFCORIENTEDEDGE',
  941. 144952367: 'IFCOUTERBOUNDARYCURVE',
  942. 3694346114: 'IFCOUTLET',
  943. 2837617999: 'IFCOUTLETTYPE',
  944. 1207048766: 'IFCOWNERHISTORY',
  945. 2529465313: 'IFCPARAMETERIZEDPROFILEDEF',
  946. 2519244187: 'IFCPATH',
  947. 1682466193: 'IFCPCURVE',
  948. 2382730787: 'IFCPERFORMANCEHISTORY',
  949. 3566463478: 'IFCPERMEABLECOVERINGPROPERTIES',
  950. 3327091369: 'IFCPERMIT',
  951. 2077209135: 'IFCPERSON',
  952. 101040310: 'IFCPERSONANDORGANIZATION',
  953. 3021840470: 'IFCPHYSICALCOMPLEXQUANTITY',
  954. 2483315170: 'IFCPHYSICALQUANTITY',
  955. 2226359599: 'IFCPHYSICALSIMPLEQUANTITY',
  956. 1687234759: 'IFCPILE',
  957. 1158309216: 'IFCPILETYPE',
  958. 310824031: 'IFCPIPEFITTING',
  959. 804291784: 'IFCPIPEFITTINGTYPE',
  960. 3612865200: 'IFCPIPESEGMENT',
  961. 4231323485: 'IFCPIPESEGMENTTYPE',
  962. 597895409: 'IFCPIXELTEXTURE',
  963. 2004835150: 'IFCPLACEMENT',
  964. 603570806: 'IFCPLANARBOX',
  965. 1663979128: 'IFCPLANAREXTENT',
  966. 220341763: 'IFCPLANE',
  967. 3171933400: 'IFCPLATE',
  968. 1156407060: 'IFCPLATESTANDARDCASE',
  969. 4017108033: 'IFCPLATETYPE',
  970. 2067069095: 'IFCPOINT',
  971. 4022376103: 'IFCPOINTONCURVE',
  972. 1423911732: 'IFCPOINTONSURFACE',
  973. 2924175390: 'IFCPOLYLOOP',
  974. 2775532180: 'IFCPOLYGONALBOUNDEDHALFSPACE',
  975. 2839578677: 'IFCPOLYGONALFACESET',
  976. 3724593414: 'IFCPOLYLINE',
  977. 3740093272: 'IFCPORT',
  978. 1946335990: 'IFCPOSITIONINGELEMENT',
  979. 3355820592: 'IFCPOSTALADDRESS',
  980. 759155922: 'IFCPREDEFINEDCOLOUR',
  981. 2559016684: 'IFCPREDEFINEDCURVEFONT',
  982. 3727388367: 'IFCPREDEFINEDITEM',
  983. 3778827333: 'IFCPREDEFINEDPROPERTIES',
  984. 3967405729: 'IFCPREDEFINEDPROPERTYSET',
  985. 1775413392: 'IFCPREDEFINEDTEXTFONT',
  986. 677532197: 'IFCPRESENTATIONITEM',
  987. 2022622350: 'IFCPRESENTATIONLAYERASSIGNMENT',
  988. 1304840413: 'IFCPRESENTATIONLAYERWITHSTYLE',
  989. 3119450353: 'IFCPRESENTATIONSTYLE',
  990. 2417041796: 'IFCPRESENTATIONSTYLEASSIGNMENT',
  991. 2744685151: 'IFCPROCEDURE',
  992. 569719735: 'IFCPROCEDURETYPE',
  993. 2945172077: 'IFCPROCESS',
  994. 4208778838: 'IFCPRODUCT',
  995. 673634403: 'IFCPRODUCTDEFINITIONSHAPE',
  996. 2095639259: 'IFCPRODUCTREPRESENTATION',
  997. 3958567839: 'IFCPROFILEDEF',
  998. 2802850158: 'IFCPROFILEPROPERTIES',
  999. 103090709: 'IFCPROJECT',
  1000. 653396225: 'IFCPROJECTLIBRARY',
  1001. 2904328755: 'IFCPROJECTORDER',
  1002. 3843373140: 'IFCPROJECTEDCRS',
  1003. 3651124850: 'IFCPROJECTIONELEMENT',
  1004. 2598011224: 'IFCPROPERTY',
  1005. 986844984: 'IFCPROPERTYABSTRACTION',
  1006. 871118103: 'IFCPROPERTYBOUNDEDVALUE',
  1007. 1680319473: 'IFCPROPERTYDEFINITION',
  1008. 148025276: 'IFCPROPERTYDEPENDENCYRELATIONSHIP',
  1009. 4166981789: 'IFCPROPERTYENUMERATEDVALUE',
  1010. 3710013099: 'IFCPROPERTYENUMERATION',
  1011. 2752243245: 'IFCPROPERTYLISTVALUE',
  1012. 941946838: 'IFCPROPERTYREFERENCEVALUE',
  1013. 1451395588: 'IFCPROPERTYSET',
  1014. 3357820518: 'IFCPROPERTYSETDEFINITION',
  1015. 492091185: 'IFCPROPERTYSETTEMPLATE',
  1016. 3650150729: 'IFCPROPERTYSINGLEVALUE',
  1017. 110355661: 'IFCPROPERTYTABLEVALUE',
  1018. 3521284610: 'IFCPROPERTYTEMPLATE',
  1019. 1482703590: 'IFCPROPERTYTEMPLATEDEFINITION',
  1020. 738039164: 'IFCPROTECTIVEDEVICE',
  1021. 2295281155: 'IFCPROTECTIVEDEVICETRIPPINGUNIT',
  1022. 655969474: 'IFCPROTECTIVEDEVICETRIPPINGUNITTYPE',
  1023. 1842657554: 'IFCPROTECTIVEDEVICETYPE',
  1024. 3219374653: 'IFCPROXY',
  1025. 90941305: 'IFCPUMP',
  1026. 2250791053: 'IFCPUMPTYPE',
  1027. 2044713172: 'IFCQUANTITYAREA',
  1028. 2093928680: 'IFCQUANTITYCOUNT',
  1029. 931644368: 'IFCQUANTITYLENGTH',
  1030. 2090586900: 'IFCQUANTITYSET',
  1031. 3252649465: 'IFCQUANTITYTIME',
  1032. 2405470396: 'IFCQUANTITYVOLUME',
  1033. 825690147: 'IFCQUANTITYWEIGHT',
  1034. 2262370178: 'IFCRAILING',
  1035. 2893384427: 'IFCRAILINGTYPE',
  1036. 3024970846: 'IFCRAMP',
  1037. 3283111854: 'IFCRAMPFLIGHT',
  1038. 2324767716: 'IFCRAMPFLIGHTTYPE',
  1039. 1469900589: 'IFCRAMPTYPE',
  1040. 1232101972: 'IFCRATIONALBSPLINECURVEWITHKNOTS',
  1041. 683857671: 'IFCRATIONALBSPLINESURFACEWITHKNOTS',
  1042. 2770003689: 'IFCRECTANGLEHOLLOWPROFILEDEF',
  1043. 3615266464: 'IFCRECTANGLEPROFILEDEF',
  1044. 2798486643: 'IFCRECTANGULARPYRAMID',
  1045. 3454111270: 'IFCRECTANGULARTRIMMEDSURFACE',
  1046. 3915482550: 'IFCRECURRENCEPATTERN',
  1047. 2433181523: 'IFCREFERENCE',
  1048. 4021432810: 'IFCREFERENT',
  1049. 3413951693: 'IFCREGULARTIMESERIES',
  1050. 1580146022: 'IFCREINFORCEMENTBARPROPERTIES',
  1051. 3765753017: 'IFCREINFORCEMENTDEFINITIONPROPERTIES',
  1052. 979691226: 'IFCREINFORCINGBAR',
  1053. 2572171363: 'IFCREINFORCINGBARTYPE',
  1054. 3027567501: 'IFCREINFORCINGELEMENT',
  1055. 964333572: 'IFCREINFORCINGELEMENTTYPE',
  1056. 2320036040: 'IFCREINFORCINGMESH',
  1057. 2310774935: 'IFCREINFORCINGMESHTYPE',
  1058. 160246688: 'IFCRELAGGREGATES',
  1059. 3939117080: 'IFCRELASSIGNS',
  1060. 1683148259: 'IFCRELASSIGNSTOACTOR',
  1061. 2495723537: 'IFCRELASSIGNSTOCONTROL',
  1062. 1307041759: 'IFCRELASSIGNSTOGROUP',
  1063. 1027710054: 'IFCRELASSIGNSTOGROUPBYFACTOR',
  1064. 4278684876: 'IFCRELASSIGNSTOPROCESS',
  1065. 2857406711: 'IFCRELASSIGNSTOPRODUCT',
  1066. 205026976: 'IFCRELASSIGNSTORESOURCE',
  1067. 1865459582: 'IFCRELASSOCIATES',
  1068. 4095574036: 'IFCRELASSOCIATESAPPROVAL',
  1069. 919958153: 'IFCRELASSOCIATESCLASSIFICATION',
  1070. 2728634034: 'IFCRELASSOCIATESCONSTRAINT',
  1071. 982818633: 'IFCRELASSOCIATESDOCUMENT',
  1072. 3840914261: 'IFCRELASSOCIATESLIBRARY',
  1073. 2655215786: 'IFCRELASSOCIATESMATERIAL',
  1074. 826625072: 'IFCRELCONNECTS',
  1075. 1204542856: 'IFCRELCONNECTSELEMENTS',
  1076. 3945020480: 'IFCRELCONNECTSPATHELEMENTS',
  1077. 4201705270: 'IFCRELCONNECTSPORTTOELEMENT',
  1078. 3190031847: 'IFCRELCONNECTSPORTS',
  1079. 2127690289: 'IFCRELCONNECTSSTRUCTURALACTIVITY',
  1080. 1638771189: 'IFCRELCONNECTSSTRUCTURALMEMBER',
  1081. 504942748: 'IFCRELCONNECTSWITHECCENTRICITY',
  1082. 3678494232: 'IFCRELCONNECTSWITHREALIZINGELEMENTS',
  1083. 3242617779: 'IFCRELCONTAINEDINSPATIALSTRUCTURE',
  1084. 886880790: 'IFCRELCOVERSBLDGELEMENTS',
  1085. 2802773753: 'IFCRELCOVERSSPACES',
  1086. 2565941209: 'IFCRELDECLARES',
  1087. 2551354335: 'IFCRELDECOMPOSES',
  1088. 693640335: 'IFCRELDEFINES',
  1089. 1462361463: 'IFCRELDEFINESBYOBJECT',
  1090. 4186316022: 'IFCRELDEFINESBYPROPERTIES',
  1091. 307848117: 'IFCRELDEFINESBYTEMPLATE',
  1092. 781010003: 'IFCRELDEFINESBYTYPE',
  1093. 3940055652: 'IFCRELFILLSELEMENT',
  1094. 279856033: 'IFCRELFLOWCONTROLELEMENTS',
  1095. 427948657: 'IFCRELINTERFERESELEMENTS',
  1096. 3268803585: 'IFCRELNESTS',
  1097. 1441486842: 'IFCRELPOSITIONS',
  1098. 750771296: 'IFCRELPROJECTSELEMENT',
  1099. 1245217292: 'IFCRELREFERENCEDINSPATIALSTRUCTURE',
  1100. 4122056220: 'IFCRELSEQUENCE',
  1101. 366585022: 'IFCRELSERVICESBUILDINGS',
  1102. 3451746338: 'IFCRELSPACEBOUNDARY',
  1103. 3523091289: 'IFCRELSPACEBOUNDARY1STLEVEL',
  1104. 1521410863: 'IFCRELSPACEBOUNDARY2NDLEVEL',
  1105. 1401173127: 'IFCRELVOIDSELEMENT',
  1106. 478536968: 'IFCRELATIONSHIP',
  1107. 816062949: 'IFCREPARAMETRISEDCOMPOSITECURVESEGMENT',
  1108. 1076942058: 'IFCREPRESENTATION',
  1109. 3377609919: 'IFCREPRESENTATIONCONTEXT',
  1110. 3008791417: 'IFCREPRESENTATIONITEM',
  1111. 1660063152: 'IFCREPRESENTATIONMAP',
  1112. 2914609552: 'IFCRESOURCE',
  1113. 2943643501: 'IFCRESOURCEAPPROVALRELATIONSHIP',
  1114. 1608871552: 'IFCRESOURCECONSTRAINTRELATIONSHIP',
  1115. 2439245199: 'IFCRESOURCELEVELRELATIONSHIP',
  1116. 1042787934: 'IFCRESOURCETIME',
  1117. 1856042241: 'IFCREVOLVEDAREASOLID',
  1118. 3243963512: 'IFCREVOLVEDAREASOLIDTAPERED',
  1119. 4158566097: 'IFCRIGHTCIRCULARCONE',
  1120. 3626867408: 'IFCRIGHTCIRCULARCYLINDER',
  1121. 2016517767: 'IFCROOF',
  1122. 2781568857: 'IFCROOFTYPE',
  1123. 2341007311: 'IFCROOT',
  1124. 2778083089: 'IFCROUNDEDRECTANGLEPROFILEDEF',
  1125. 448429030: 'IFCSIUNIT',
  1126. 3053780830: 'IFCSANITARYTERMINAL',
  1127. 1768891740: 'IFCSANITARYTERMINALTYPE',
  1128. 1054537805: 'IFCSCHEDULINGTIME',
  1129. 2157484638: 'IFCSEAMCURVE',
  1130. 2042790032: 'IFCSECTIONPROPERTIES',
  1131. 4165799628: 'IFCSECTIONREINFORCEMENTPROPERTIES',
  1132. 1862484736: 'IFCSECTIONEDSOLID',
  1133. 1290935644: 'IFCSECTIONEDSOLIDHORIZONTAL',
  1134. 1509187699: 'IFCSECTIONEDSPINE',
  1135. 4086658281: 'IFCSENSOR',
  1136. 1783015770: 'IFCSENSORTYPE',
  1137. 1329646415: 'IFCSHADINGDEVICE',
  1138. 4074543187: 'IFCSHADINGDEVICETYPE',
  1139. 867548509: 'IFCSHAPEASPECT',
  1140. 3982875396: 'IFCSHAPEMODEL',
  1141. 4240577450: 'IFCSHAPEREPRESENTATION',
  1142. 4124623270: 'IFCSHELLBASEDSURFACEMODEL',
  1143. 3692461612: 'IFCSIMPLEPROPERTY',
  1144. 3663146110: 'IFCSIMPLEPROPERTYTEMPLATE',
  1145. 4097777520: 'IFCSITE',
  1146. 1529196076: 'IFCSLAB',
  1147. 3127900445: 'IFCSLABELEMENTEDCASE',
  1148. 3027962421: 'IFCSLABSTANDARDCASE',
  1149. 2533589738: 'IFCSLABTYPE',
  1150. 2609359061: 'IFCSLIPPAGECONNECTIONCONDITION',
  1151. 3420628829: 'IFCSOLARDEVICE',
  1152. 1072016465: 'IFCSOLARDEVICETYPE',
  1153. 723233188: 'IFCSOLIDMODEL',
  1154. 3856911033: 'IFCSPACE',
  1155. 1999602285: 'IFCSPACEHEATER',
  1156. 1305183839: 'IFCSPACEHEATERTYPE',
  1157. 3812236995: 'IFCSPACETYPE',
  1158. 1412071761: 'IFCSPATIALELEMENT',
  1159. 710998568: 'IFCSPATIALELEMENTTYPE',
  1160. 2706606064: 'IFCSPATIALSTRUCTUREELEMENT',
  1161. 3893378262: 'IFCSPATIALSTRUCTUREELEMENTTYPE',
  1162. 463610769: 'IFCSPATIALZONE',
  1163. 2481509218: 'IFCSPATIALZONETYPE',
  1164. 451544542: 'IFCSPHERE',
  1165. 4015995234: 'IFCSPHERICALSURFACE',
  1166. 1404847402: 'IFCSTACKTERMINAL',
  1167. 3112655638: 'IFCSTACKTERMINALTYPE',
  1168. 331165859: 'IFCSTAIR',
  1169. 4252922144: 'IFCSTAIRFLIGHT',
  1170. 1039846685: 'IFCSTAIRFLIGHTTYPE',
  1171. 338393293: 'IFCSTAIRTYPE',
  1172. 682877961: 'IFCSTRUCTURALACTION',
  1173. 3544373492: 'IFCSTRUCTURALACTIVITY',
  1174. 2515109513: 'IFCSTRUCTURALANALYSISMODEL',
  1175. 1179482911: 'IFCSTRUCTURALCONNECTION',
  1176. 2273995522: 'IFCSTRUCTURALCONNECTIONCONDITION',
  1177. 1004757350: 'IFCSTRUCTURALCURVEACTION',
  1178. 4243806635: 'IFCSTRUCTURALCURVECONNECTION',
  1179. 214636428: 'IFCSTRUCTURALCURVEMEMBER',
  1180. 2445595289: 'IFCSTRUCTURALCURVEMEMBERVARYING',
  1181. 2757150158: 'IFCSTRUCTURALCURVEREACTION',
  1182. 3136571912: 'IFCSTRUCTURALITEM',
  1183. 1807405624: 'IFCSTRUCTURALLINEARACTION',
  1184. 2162789131: 'IFCSTRUCTURALLOAD',
  1185. 385403989: 'IFCSTRUCTURALLOADCASE',
  1186. 3478079324: 'IFCSTRUCTURALLOADCONFIGURATION',
  1187. 1252848954: 'IFCSTRUCTURALLOADGROUP',
  1188. 1595516126: 'IFCSTRUCTURALLOADLINEARFORCE',
  1189. 609421318: 'IFCSTRUCTURALLOADORRESULT',
  1190. 2668620305: 'IFCSTRUCTURALLOADPLANARFORCE',
  1191. 2473145415: 'IFCSTRUCTURALLOADSINGLEDISPLACEMENT',
  1192. 1973038258: 'IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION',
  1193. 1597423693: 'IFCSTRUCTURALLOADSINGLEFORCE',
  1194. 1190533807: 'IFCSTRUCTURALLOADSINGLEFORCEWARPING',
  1195. 2525727697: 'IFCSTRUCTURALLOADSTATIC',
  1196. 3408363356: 'IFCSTRUCTURALLOADTEMPERATURE',
  1197. 530289379: 'IFCSTRUCTURALMEMBER',
  1198. 1621171031: 'IFCSTRUCTURALPLANARACTION',
  1199. 2082059205: 'IFCSTRUCTURALPOINTACTION',
  1200. 734778138: 'IFCSTRUCTURALPOINTCONNECTION',
  1201. 1235345126: 'IFCSTRUCTURALPOINTREACTION',
  1202. 3689010777: 'IFCSTRUCTURALREACTION',
  1203. 2986769608: 'IFCSTRUCTURALRESULTGROUP',
  1204. 3657597509: 'IFCSTRUCTURALSURFACEACTION',
  1205. 1975003073: 'IFCSTRUCTURALSURFACECONNECTION',
  1206. 3979015343: 'IFCSTRUCTURALSURFACEMEMBER',
  1207. 2218152070: 'IFCSTRUCTURALSURFACEMEMBERVARYING',
  1208. 603775116: 'IFCSTRUCTURALSURFACEREACTION',
  1209. 2830218821: 'IFCSTYLEMODEL',
  1210. 3958052878: 'IFCSTYLEDITEM',
  1211. 3049322572: 'IFCSTYLEDREPRESENTATION',
  1212. 148013059: 'IFCSUBCONTRACTRESOURCE',
  1213. 4095615324: 'IFCSUBCONTRACTRESOURCETYPE',
  1214. 2233826070: 'IFCSUBEDGE',
  1215. 2513912981: 'IFCSURFACE',
  1216. 699246055: 'IFCSURFACECURVE',
  1217. 2028607225: 'IFCSURFACECURVESWEPTAREASOLID',
  1218. 3101698114: 'IFCSURFACEFEATURE',
  1219. 2809605785: 'IFCSURFACEOFLINEAREXTRUSION',
  1220. 4124788165: 'IFCSURFACEOFREVOLUTION',
  1221. 2934153892: 'IFCSURFACEREINFORCEMENTAREA',
  1222. 1300840506: 'IFCSURFACESTYLE',
  1223. 3303107099: 'IFCSURFACESTYLELIGHTING',
  1224. 1607154358: 'IFCSURFACESTYLEREFRACTION',
  1225. 1878645084: 'IFCSURFACESTYLERENDERING',
  1226. 846575682: 'IFCSURFACESTYLESHADING',
  1227. 1351298697: 'IFCSURFACESTYLEWITHTEXTURES',
  1228. 626085974: 'IFCSURFACETEXTURE',
  1229. 2247615214: 'IFCSWEPTAREASOLID',
  1230. 1260650574: 'IFCSWEPTDISKSOLID',
  1231. 1096409881: 'IFCSWEPTDISKSOLIDPOLYGONAL',
  1232. 230924584: 'IFCSWEPTSURFACE',
  1233. 1162798199: 'IFCSWITCHINGDEVICE',
  1234. 2315554128: 'IFCSWITCHINGDEVICETYPE',
  1235. 2254336722: 'IFCSYSTEM',
  1236. 413509423: 'IFCSYSTEMFURNITUREELEMENT',
  1237. 1580310250: 'IFCSYSTEMFURNITUREELEMENTTYPE',
  1238. 3071757647: 'IFCTSHAPEPROFILEDEF',
  1239. 985171141: 'IFCTABLE',
  1240. 2043862942: 'IFCTABLECOLUMN',
  1241. 531007025: 'IFCTABLEROW',
  1242. 812556717: 'IFCTANK',
  1243. 5716631: 'IFCTANKTYPE',
  1244. 3473067441: 'IFCTASK',
  1245. 1549132990: 'IFCTASKTIME',
  1246. 2771591690: 'IFCTASKTIMERECURRING',
  1247. 3206491090: 'IFCTASKTYPE',
  1248. 912023232: 'IFCTELECOMADDRESS',
  1249. 3824725483: 'IFCTENDON',
  1250. 2347447852: 'IFCTENDONANCHOR',
  1251. 3081323446: 'IFCTENDONANCHORTYPE',
  1252. 3663046924: 'IFCTENDONCONDUIT',
  1253. 2281632017: 'IFCTENDONCONDUITTYPE',
  1254. 2415094496: 'IFCTENDONTYPE',
  1255. 2387106220: 'IFCTESSELLATEDFACESET',
  1256. 901063453: 'IFCTESSELLATEDITEM',
  1257. 4282788508: 'IFCTEXTLITERAL',
  1258. 3124975700: 'IFCTEXTLITERALWITHEXTENT',
  1259. 1447204868: 'IFCTEXTSTYLE',
  1260. 1983826977: 'IFCTEXTSTYLEFONTMODEL',
  1261. 2636378356: 'IFCTEXTSTYLEFORDEFINEDFONT',
  1262. 1640371178: 'IFCTEXTSTYLETEXTMODEL',
  1263. 280115917: 'IFCTEXTURECOORDINATE',
  1264. 1742049831: 'IFCTEXTURECOORDINATEGENERATOR',
  1265. 2552916305: 'IFCTEXTUREMAP',
  1266. 1210645708: 'IFCTEXTUREVERTEX',
  1267. 3611470254: 'IFCTEXTUREVERTEXLIST',
  1268. 1199560280: 'IFCTIMEPERIOD',
  1269. 3101149627: 'IFCTIMESERIES',
  1270. 581633288: 'IFCTIMESERIESVALUE',
  1271. 1377556343: 'IFCTOPOLOGICALREPRESENTATIONITEM',
  1272. 1735638870: 'IFCTOPOLOGYREPRESENTATION',
  1273. 1935646853: 'IFCTOROIDALSURFACE',
  1274. 3825984169: 'IFCTRANSFORMER',
  1275. 1692211062: 'IFCTRANSFORMERTYPE',
  1276. 2595432518: 'IFCTRANSITIONCURVESEGMENT2D',
  1277. 1620046519: 'IFCTRANSPORTELEMENT',
  1278. 2097647324: 'IFCTRANSPORTELEMENTTYPE',
  1279. 2715220739: 'IFCTRAPEZIUMPROFILEDEF',
  1280. 2916149573: 'IFCTRIANGULATEDFACESET',
  1281. 1229763772: 'IFCTRIANGULATEDIRREGULARNETWORK',
  1282. 3593883385: 'IFCTRIMMEDCURVE',
  1283. 3026737570: 'IFCTUBEBUNDLE',
  1284. 1600972822: 'IFCTUBEBUNDLETYPE',
  1285. 1628702193: 'IFCTYPEOBJECT',
  1286. 3736923433: 'IFCTYPEPROCESS',
  1287. 2347495698: 'IFCTYPEPRODUCT',
  1288. 3698973494: 'IFCTYPERESOURCE',
  1289. 427810014: 'IFCUSHAPEPROFILEDEF',
  1290. 180925521: 'IFCUNITASSIGNMENT',
  1291. 630975310: 'IFCUNITARYCONTROLELEMENT',
  1292. 3179687236: 'IFCUNITARYCONTROLELEMENTTYPE',
  1293. 4292641817: 'IFCUNITARYEQUIPMENT',
  1294. 1911125066: 'IFCUNITARYEQUIPMENTTYPE',
  1295. 4207607924: 'IFCVALVE',
  1296. 728799441: 'IFCVALVETYPE',
  1297. 1417489154: 'IFCVECTOR',
  1298. 2799835756: 'IFCVERTEX',
  1299. 2759199220: 'IFCVERTEXLOOP',
  1300. 1907098498: 'IFCVERTEXPOINT',
  1301. 1530820697: 'IFCVIBRATIONDAMPER',
  1302. 3956297820: 'IFCVIBRATIONDAMPERTYPE',
  1303. 2391383451: 'IFCVIBRATIONISOLATOR',
  1304. 3313531582: 'IFCVIBRATIONISOLATORTYPE',
  1305. 2769231204: 'IFCVIRTUALELEMENT',
  1306. 891718957: 'IFCVIRTUALGRIDINTERSECTION',
  1307. 926996030: 'IFCVOIDINGFEATURE',
  1308. 2391406946: 'IFCWALL',
  1309. 4156078855: 'IFCWALLELEMENTEDCASE',
  1310. 3512223829: 'IFCWALLSTANDARDCASE',
  1311. 1898987631: 'IFCWALLTYPE',
  1312. 4237592921: 'IFCWASTETERMINAL',
  1313. 1133259667: 'IFCWASTETERMINALTYPE',
  1314. 3304561284: 'IFCWINDOW',
  1315. 336235671: 'IFCWINDOWLININGPROPERTIES',
  1316. 512836454: 'IFCWINDOWPANELPROPERTIES',
  1317. 486154966: 'IFCWINDOWSTANDARDCASE',
  1318. 1299126871: 'IFCWINDOWSTYLE',
  1319. 4009809668: 'IFCWINDOWTYPE',
  1320. 4088093105: 'IFCWORKCALENDAR',
  1321. 1028945134: 'IFCWORKCONTROL',
  1322. 4218914973: 'IFCWORKPLAN',
  1323. 3342526732: 'IFCWORKSCHEDULE',
  1324. 1236880293: 'IFCWORKTIME',
  1325. 2543172580: 'IFCZSHAPEPROFILEDEF',
  1326. 1033361043: 'IFCZONE',
  1327. };
  1328. class PropertyManager {
  1329. constructor( state ) {
  1330. this.state = state;
  1331. }
  1332. getExpressId( geometry, faceIndex ) {
  1333. if ( ! geometry.index )
  1334. return;
  1335. const geoIndex = geometry.index.array;
  1336. return geometry.attributes[ IdAttrName ].getX( geoIndex[ 3 * faceIndex ] );
  1337. }
  1338. getItemProperties( modelID, id, recursive = false ) {
  1339. return this.state.useJSON ?
  1340. {
  1341. ...this.state.models[ modelID ].jsonData[ id ]
  1342. } :
  1343. this.state.api.GetLine( modelID, id, recursive );
  1344. }
  1345. getAllItemsOfType( modelID, type, verbose ) {
  1346. return this.state.useJSON ?
  1347. this.getAllItemsOfTypeJSON( modelID, type, verbose ) :
  1348. this.getAllItemsOfTypeWebIfcAPI( modelID, type, verbose );
  1349. }
  1350. getPropertySets( modelID, elementID, recursive = false ) {
  1351. return this.state.useJSON ?
  1352. this.getPropertyJSON( modelID, elementID, recursive, PropsNames.psets ) :
  1353. this.getPropertyWebIfcAPI( modelID, elementID, recursive, PropsNames.psets );
  1354. }
  1355. getTypeProperties( modelID, elementID, recursive = false ) {
  1356. return this.state.useJSON ?
  1357. this.getPropertyJSON( modelID, elementID, recursive, PropsNames.type ) :
  1358. this.getPropertyWebIfcAPI( modelID, elementID, recursive, PropsNames.type );
  1359. }
  1360. getMaterialsProperties( modelID, elementID, recursive = false ) {
  1361. return this.state.useJSON ?
  1362. this.getPropertyJSON( modelID, elementID, recursive, PropsNames.materials ) :
  1363. this.getPropertyWebIfcAPI( modelID, elementID, recursive, PropsNames.materials );
  1364. }
  1365. getSpatialStructure( modelID ) {
  1366. return this.state.useJSON ?
  1367. this.getSpatialStructureJSON( modelID ) :
  1368. this.getSpatialStructureWebIfcAPI( modelID );
  1369. }
  1370. getSpatialStructureJSON( modelID ) {
  1371. const chunks = this.getSpatialTreeChunks( modelID );
  1372. const projectID = this.getAllItemsOfTypeJSON( modelID, IFCPROJECT, false )[ 0 ];
  1373. const project = this.newIfcProject( projectID );
  1374. this.getSpatialNode( modelID, project, chunks );
  1375. return {
  1376. ...project
  1377. };
  1378. }
  1379. getSpatialStructureWebIfcAPI( modelID ) {
  1380. const chunks = this.getSpatialTreeChunks( modelID );
  1381. const projectID = this.state.api.GetLineIDsWithType( modelID, IFCPROJECT ).get( 0 );
  1382. const project = this.newIfcProject( projectID );
  1383. this.getSpatialNode( modelID, project, chunks );
  1384. return project;
  1385. }
  1386. getAllItemsOfTypeJSON( modelID, type, verbose ) {
  1387. const data = this.state.models[ modelID ].jsonData;
  1388. const typeName = IfcTypesMap[ type ];
  1389. if ( ! typeName ) {
  1390. throw new Error( `Type not found: ${type}` );
  1391. }
  1392. return this.filterJSONItemsByType( data, typeName, verbose );
  1393. }
  1394. filterJSONItemsByType( data, typeName, verbose ) {
  1395. const result = [];
  1396. Object.keys( data ).forEach( key => {
  1397. const numKey = parseInt( key );
  1398. if ( data[ numKey ].type.toUpperCase() === typeName ) {
  1399. result.push( verbose ? {
  1400. ...data[ numKey ]
  1401. } : numKey );
  1402. }
  1403. } );
  1404. return result;
  1405. }
  1406. getItemsByIDJSON( modelID, ids ) {
  1407. const data = this.state.models[ modelID ].jsonData;
  1408. const result = [];
  1409. ids.forEach( id => result.push( {
  1410. ...data[ id ]
  1411. } ) );
  1412. return result;
  1413. }
  1414. getPropertyJSON( modelID, elementID, recursive = false, propName ) {
  1415. const resultIDs = this.getAllRelatedItemsOfTypeJSON( modelID, elementID, propName );
  1416. const result = this.getItemsByIDJSON( modelID, resultIDs );
  1417. if ( recursive ) {
  1418. result.forEach( result => this.getJSONReferencesRecursively( modelID, result ) );
  1419. }
  1420. return result;
  1421. }
  1422. getJSONReferencesRecursively( modelID, jsonObject ) {
  1423. if ( jsonObject == undefined )
  1424. return;
  1425. const keys = Object.keys( jsonObject );
  1426. for ( let i = 0; i < keys.length; i ++ ) {
  1427. const key = keys[ i ];
  1428. this.getJSONItem( modelID, jsonObject, key );
  1429. }
  1430. }
  1431. getJSONItem( modelID, jsonObject, key ) {
  1432. if ( Array.isArray( jsonObject[ key ] ) ) {
  1433. return this.getMultipleJSONItems( modelID, jsonObject, key );
  1434. }
  1435. if ( jsonObject[ key ] && jsonObject[ key ].type === 5 ) {
  1436. jsonObject[ key ] = this.getItemsByIDJSON( modelID, [ jsonObject[ key ].value ] )[ 0 ];
  1437. this.getJSONReferencesRecursively( modelID, jsonObject[ key ] );
  1438. }
  1439. }
  1440. getMultipleJSONItems( modelID, jsonObject, key ) {
  1441. jsonObject[ key ] = jsonObject[ key ].map( ( item ) => {
  1442. if ( item.type === 5 ) {
  1443. item = this.getItemsByIDJSON( modelID, [ item.value ] )[ 0 ];
  1444. this.getJSONReferencesRecursively( modelID, item );
  1445. }
  1446. return item;
  1447. } );
  1448. }
  1449. getPropertyWebIfcAPI( modelID, elementID, recursive = false, propName ) {
  1450. const propSetIds = this.getAllRelatedItemsOfTypeWebIfcAPI( modelID, elementID, propName );
  1451. return propSetIds.map( ( id ) => this.state.api.GetLine( modelID, id, recursive ) );
  1452. }
  1453. getAllItemsOfTypeWebIfcAPI( modelID, type, verbose ) {
  1454. const items = [];
  1455. const lines = this.state.api.GetLineIDsWithType( modelID, type );
  1456. for ( let i = 0; i < lines.size(); i ++ )
  1457. items.push( lines.get( i ) );
  1458. if ( verbose )
  1459. return items.map( ( id ) => this.state.api.GetLine( modelID, id ) );
  1460. return items;
  1461. }
  1462. newIfcProject( id ) {
  1463. return {
  1464. expressID: id,
  1465. type: 'IFCPROJECT',
  1466. children: []
  1467. };
  1468. }
  1469. getSpatialTreeChunks( modelID ) {
  1470. const treeChunks = {};
  1471. const json = this.state.useJSON;
  1472. if ( json ) {
  1473. this.getChunksJSON( modelID, treeChunks, PropsNames.aggregates );
  1474. this.getChunksJSON( modelID, treeChunks, PropsNames.spatial );
  1475. } else {
  1476. this.getChunksWebIfcAPI( modelID, treeChunks, PropsNames.aggregates );
  1477. this.getChunksWebIfcAPI( modelID, treeChunks, PropsNames.spatial );
  1478. }
  1479. return treeChunks;
  1480. }
  1481. getChunksJSON( modelID, chunks, propNames ) {
  1482. const relation = this.getAllItemsOfTypeJSON( modelID, propNames.name, true );
  1483. relation.forEach( rel => {
  1484. this.saveChunk( chunks, propNames, rel );
  1485. } );
  1486. }
  1487. getChunksWebIfcAPI( modelID, chunks, propNames ) {
  1488. const relation = this.state.api.GetLineIDsWithType( modelID, propNames.name );
  1489. for ( let i = 0; i < relation.size(); i ++ ) {
  1490. const rel = this.state.api.GetLine( modelID, relation.get( i ), false );
  1491. this.saveChunk( chunks, propNames, rel );
  1492. }
  1493. }
  1494. saveChunk( chunks, propNames, rel ) {
  1495. const relating = rel[ propNames.relating ].value;
  1496. const related = rel[ propNames.related ].map( ( r ) => r.value );
  1497. if ( chunks[ relating ] == undefined ) {
  1498. chunks[ relating ] = related;
  1499. } else {
  1500. chunks[ relating ] = chunks[ relating ].concat( related );
  1501. }
  1502. }
  1503. getSpatialNode( modelID, node, treeChunks ) {
  1504. this.getChildren( modelID, node, treeChunks, PropsNames.aggregates );
  1505. this.getChildren( modelID, node, treeChunks, PropsNames.spatial );
  1506. }
  1507. getChildren( modelID, node, treeChunks, propNames ) {
  1508. const children = treeChunks[ node.expressID ];
  1509. if ( children == undefined )
  1510. return;
  1511. const prop = propNames.key;
  1512. node[ prop ] = children.map( ( child ) => {
  1513. const node = this.newNode( modelID, child );
  1514. this.getSpatialNode( modelID, node, treeChunks );
  1515. return node;
  1516. } );
  1517. }
  1518. newNode( modelID, id ) {
  1519. const typeName = this.getNodeType( modelID, id );
  1520. return {
  1521. expressID: id,
  1522. type: typeName,
  1523. children: []
  1524. };
  1525. }
  1526. getNodeType( modelID, id ) {
  1527. if ( this.state.useJSON )
  1528. return this.state.models[ modelID ].jsonData[ id ].type;
  1529. const typeID = this.state.models[ modelID ].types[ id ];
  1530. return IfcElements[ typeID ];
  1531. }
  1532. getAllRelatedItemsOfTypeJSON( modelID, id, propNames ) {
  1533. const lines = this.getAllItemsOfTypeJSON( modelID, propNames.name, true );
  1534. const IDs = [];
  1535. lines.forEach( line => {
  1536. const isRelated = this.isRelated( id, line, propNames );
  1537. if ( isRelated )
  1538. this.getRelated( line, propNames, IDs );
  1539. } );
  1540. return IDs;
  1541. }
  1542. getAllRelatedItemsOfTypeWebIfcAPI( modelID, id, propNames ) {
  1543. const lines = this.state.api.GetLineIDsWithType( modelID, propNames.name );
  1544. const IDs = [];
  1545. for ( let i = 0; i < lines.size(); i ++ ) {
  1546. const rel = this.state.api.GetLine( modelID, lines.get( i ) );
  1547. const isRelated = this.isRelated( id, rel, propNames );
  1548. if ( isRelated )
  1549. this.getRelated( rel, propNames, IDs );
  1550. }
  1551. return IDs;
  1552. }
  1553. getRelated( rel, propNames, IDs ) {
  1554. const element = rel[ propNames.relating ];
  1555. if ( ! Array.isArray( element ) )
  1556. IDs.push( element.value );
  1557. else
  1558. element.forEach( ( ele ) => IDs.push( ele.value ) );
  1559. }
  1560. isRelated( id, rel, propNames ) {
  1561. const relatedItems = rel[ propNames.related ];
  1562. if ( Array.isArray( relatedItems ) ) {
  1563. const values = relatedItems.map( ( item ) => item.value );
  1564. return values.includes( id );
  1565. }
  1566. return relatedItems.value === id;
  1567. }
  1568. }
  1569. class TypeManager {
  1570. constructor( state ) {
  1571. this.state = state;
  1572. }
  1573. getAllTypes() {
  1574. for ( const modelID in this.state.models ) {
  1575. const types = this.state.models[ modelID ].types;
  1576. if ( Object.keys( types ).length == 0 )
  1577. this.getAllTypesOfModel( parseInt( modelID ) );
  1578. }
  1579. }
  1580. getAllTypesOfModel( modelID ) {
  1581. this.state.models[ modelID ].types;
  1582. const elements = Object.keys( IfcElements ).map( ( e ) => parseInt( e ) );
  1583. const types = this.state.models[ modelID ].types;
  1584. elements.forEach( ( type ) => {
  1585. const lines = this.state.api.GetLineIDsWithType( modelID, type );
  1586. for ( let i = 0; i < lines.size(); i ++ )
  1587. types[ lines.get( i ) ] = type;
  1588. } );
  1589. }
  1590. }
  1591. let modelIdCounter = 0;
  1592. const nullIfcManagerErrorMessage = 'IfcManager is null!';
  1593. class IFCModel extends Mesh {
  1594. constructor() {
  1595. super( ...arguments );
  1596. this.modelID = modelIdCounter ++;
  1597. this.ifcManager = null;
  1598. this.mesh = this;
  1599. }
  1600. setIFCManager( manager ) {
  1601. this.ifcManager = manager;
  1602. }
  1603. setWasmPath( path ) {
  1604. if ( this.ifcManager === null )
  1605. throw new Error( nullIfcManagerErrorMessage );
  1606. this.ifcManager.setWasmPath( path );
  1607. }
  1608. close( scene ) {
  1609. if ( this.ifcManager === null )
  1610. throw new Error( nullIfcManagerErrorMessage );
  1611. this.ifcManager.close( this.modelID, scene );
  1612. }
  1613. getExpressId( geometry, faceIndex ) {
  1614. if ( this.ifcManager === null )
  1615. throw new Error( nullIfcManagerErrorMessage );
  1616. return this.ifcManager.getExpressId( geometry, faceIndex );
  1617. }
  1618. getAllItemsOfType( type, verbose ) {
  1619. if ( this.ifcManager === null )
  1620. throw new Error( nullIfcManagerErrorMessage );
  1621. return this.ifcManager.getAllItemsOfType( this.modelID, type, verbose );
  1622. }
  1623. getItemProperties( id, recursive = false ) {
  1624. if ( this.ifcManager === null )
  1625. throw new Error( nullIfcManagerErrorMessage );
  1626. return this.ifcManager.getItemProperties( this.modelID, id, recursive );
  1627. }
  1628. getPropertySets( id, recursive = false ) {
  1629. if ( this.ifcManager === null )
  1630. throw new Error( nullIfcManagerErrorMessage );
  1631. return this.ifcManager.getPropertySets( this.modelID, id, recursive );
  1632. }
  1633. getTypeProperties( id, recursive = false ) {
  1634. if ( this.ifcManager === null )
  1635. throw new Error( nullIfcManagerErrorMessage );
  1636. return this.ifcManager.getTypeProperties( this.modelID, id, recursive );
  1637. }
  1638. getIfcType( id ) {
  1639. if ( this.ifcManager === null )
  1640. throw new Error( nullIfcManagerErrorMessage );
  1641. return this.ifcManager.getIfcType( this.modelID, id );
  1642. }
  1643. getSpatialStructure() {
  1644. if ( this.ifcManager === null )
  1645. throw new Error( nullIfcManagerErrorMessage );
  1646. return this.ifcManager.getSpatialStructure( this.modelID );
  1647. }
  1648. getSubset( material ) {
  1649. if ( this.ifcManager === null )
  1650. throw new Error( nullIfcManagerErrorMessage );
  1651. return this.ifcManager.getSubset( this.modelID, material );
  1652. }
  1653. removeSubset( parent, material ) {
  1654. if ( this.ifcManager === null )
  1655. throw new Error( nullIfcManagerErrorMessage );
  1656. this.ifcManager.removeSubset( this.modelID, parent, material );
  1657. }
  1658. createSubset( config ) {
  1659. if ( this.ifcManager === null )
  1660. throw new Error( nullIfcManagerErrorMessage );
  1661. const modelConfig = {
  1662. ...config,
  1663. modelID: this.modelID
  1664. };
  1665. return this.ifcManager.createSubset( modelConfig );
  1666. }
  1667. hideItems( ids ) {
  1668. if ( this.ifcManager === null )
  1669. throw new Error( nullIfcManagerErrorMessage );
  1670. this.ifcManager.hideItems( this.modelID, ids );
  1671. }
  1672. hideAllItems() {
  1673. if ( this.ifcManager === null )
  1674. throw new Error( nullIfcManagerErrorMessage );
  1675. this.ifcManager.hideAllItems( this.modelID );
  1676. }
  1677. showItems( ids ) {
  1678. if ( this.ifcManager === null )
  1679. throw new Error( nullIfcManagerErrorMessage );
  1680. this.ifcManager.showItems( this.modelID, ids );
  1681. }
  1682. showAllItems() {
  1683. if ( this.ifcManager === null )
  1684. throw new Error( nullIfcManagerErrorMessage );
  1685. this.ifcManager.showAllItems( this.modelID );
  1686. }
  1687. }
  1688. class BvhManager {
  1689. initializeMeshBVH( computeBoundsTree, disposeBoundsTree, acceleratedRaycast ) {
  1690. this.computeBoundsTree = computeBoundsTree;
  1691. this.disposeBoundsTree = disposeBoundsTree;
  1692. this.acceleratedRaycast = acceleratedRaycast;
  1693. this.setupThreeMeshBVH();
  1694. }
  1695. applyThreeMeshBVH( geometry ) {
  1696. if ( this.computeBoundsTree )
  1697. geometry.computeBoundsTree();
  1698. }
  1699. setupThreeMeshBVH() {
  1700. if ( ! this.computeBoundsTree || ! this.disposeBoundsTree || ! this.acceleratedRaycast )
  1701. return;
  1702. BufferGeometry.prototype.computeBoundsTree = this.computeBoundsTree;
  1703. BufferGeometry.prototype.disposeBoundsTree = this.disposeBoundsTree;
  1704. Mesh.prototype.raycast = this.acceleratedRaycast;
  1705. }
  1706. }
  1707. class ItemsHider {
  1708. constructor( state ) {
  1709. this.modelCoordinates = {};
  1710. this.expressIDCoordinatesMap = {};
  1711. this.state = state;
  1712. }
  1713. processCoordinates( modelID ) {
  1714. const attributes = this.getAttributes( modelID );
  1715. const ids = Array.from( attributes.expressID.array );
  1716. this.expressIDCoordinatesMap[ modelID ] = {};
  1717. for ( let i = 0; i < ids.length; i ++ ) {
  1718. if ( ! this.expressIDCoordinatesMap[ modelID ][ ids[ i ] ] ) {
  1719. this.expressIDCoordinatesMap[ modelID ][ ids[ i ] ] = [];
  1720. }
  1721. const current = this.expressIDCoordinatesMap[ modelID ];
  1722. current[ ids[ i ] ].push( 3 * i );
  1723. }
  1724. this.initializeCoordinates( modelID );
  1725. }
  1726. hideItems( modelID, ids ) {
  1727. this.editCoordinates( modelID, ids, true );
  1728. }
  1729. showItems( modelID, ids ) {
  1730. this.editCoordinates( modelID, ids, false );
  1731. }
  1732. editCoordinates( modelID, ids, hide ) {
  1733. const current = this.expressIDCoordinatesMap[ modelID ];
  1734. const indices = [];
  1735. ids.forEach( ( id ) => {
  1736. if ( current[ id ] )
  1737. indices.push( ...current[ id ] );
  1738. } );
  1739. const coords = this.getCoordinates( modelID );
  1740. const initial = this.modelCoordinates[ modelID ];
  1741. if ( hide )
  1742. indices.forEach( i => coords.set( [ 0, 0, 0 ], i ) );
  1743. else
  1744. indices.forEach( i => coords.set( [ initial[ i ], initial[ i + 1 ], initial[ i + 2 ] ], i ) );
  1745. this.getAttributes( modelID ).position.needsUpdate = true;
  1746. }
  1747. showAllItems( modelID ) {
  1748. if ( this.modelCoordinates[ modelID ] ) {
  1749. this.resetCoordinates( modelID );
  1750. this.getAttributes( modelID ).position.needsUpdate = true;
  1751. }
  1752. }
  1753. hideAllItems( modelID ) {
  1754. this.getCoordinates( modelID ).fill( 0 );
  1755. this.getAttributes( modelID ).position.needsUpdate = true;
  1756. }
  1757. initializeCoordinates( modelID ) {
  1758. const coordinates = this.getCoordinates( modelID );
  1759. if ( ! this.modelCoordinates[ modelID ] ) {
  1760. this.modelCoordinates[ modelID ] = new Float32Array( coordinates );
  1761. }
  1762. }
  1763. resetCoordinates( modelID ) {
  1764. const initial = this.modelCoordinates[ modelID ];
  1765. this.getCoordinates( modelID ).set( initial );
  1766. }
  1767. getCoordinates( modelID ) {
  1768. return this.getAttributes( modelID ).position.array;
  1769. }
  1770. getAttributes( modelID ) {
  1771. return this.state.models[ modelID ].mesh.geometry.attributes;
  1772. }
  1773. }
  1774. class IFCManager {
  1775. constructor() {
  1776. this.state = {
  1777. models: [],
  1778. api: new IfcAPI(),
  1779. useJSON: false
  1780. };
  1781. this.BVH = new BvhManager();
  1782. this.parser = new IFCParser( this.state, this.BVH );
  1783. this.subsets = new SubsetManager( this.state, this.BVH );
  1784. this.properties = new PropertyManager( this.state );
  1785. this.types = new TypeManager( this.state );
  1786. this.hider = new ItemsHider( this.state );
  1787. }
  1788. async parse( buffer ) {
  1789. const mesh = await this.parser.parse( buffer );
  1790. this.state.useJSON ? this.disposeMemory() : this.types.getAllTypes();
  1791. this.hider.processCoordinates( mesh.modelID );
  1792. const model = new IFCModel( mesh.geometry, mesh.material );
  1793. model.setIFCManager( this );
  1794. return model;
  1795. }
  1796. setWasmPath( path ) {
  1797. this.state.api.SetWasmPath( path );
  1798. }
  1799. applyWebIfcConfig( settings ) {
  1800. this.state.webIfcSettings = settings;
  1801. }
  1802. useJSONData( useJSON = true ) {
  1803. this.state.useJSON = useJSON;
  1804. this.disposeMemory();
  1805. }
  1806. addModelJSONData( modelID, data ) {
  1807. const model = this.state.models[ modelID ];
  1808. if ( model ) {
  1809. model.jsonData = data;
  1810. }
  1811. }
  1812. disposeMemory() {
  1813. this.state.api = null;
  1814. this.state.api = new IfcAPI();
  1815. }
  1816. setupThreeMeshBVH( computeBoundsTree, disposeBoundsTree, acceleratedRaycast ) {
  1817. this.BVH.initializeMeshBVH( computeBoundsTree, disposeBoundsTree, acceleratedRaycast );
  1818. }
  1819. close( modelID, scene ) {
  1820. this.state.api.CloseModel( modelID );
  1821. if ( scene ) {
  1822. scene.remove( this.state.models[ modelID ].mesh );
  1823. }
  1824. delete this.state.models[ modelID ];
  1825. }
  1826. getExpressId( geometry, faceIndex ) {
  1827. return this.properties.getExpressId( geometry, faceIndex );
  1828. }
  1829. getAllItemsOfType( modelID, type, verbose ) {
  1830. return this.properties.getAllItemsOfType( modelID, type, verbose );
  1831. }
  1832. getItemProperties( modelID, id, recursive = false ) {
  1833. return this.properties.getItemProperties( modelID, id, recursive );
  1834. }
  1835. getPropertySets( modelID, id, recursive = false ) {
  1836. return this.properties.getPropertySets( modelID, id, recursive );
  1837. }
  1838. getTypeProperties( modelID, id, recursive = false ) {
  1839. return this.properties.getTypeProperties( modelID, id, recursive );
  1840. }
  1841. getMaterialsProperties( modelID, id, recursive = false ) {
  1842. return this.properties.getMaterialsProperties( modelID, id, recursive );
  1843. }
  1844. getIfcType( modelID, id ) {
  1845. const typeID = this.state.models[ modelID ].types[ id ];
  1846. return IfcElements[ typeID ];
  1847. }
  1848. getSpatialStructure( modelID ) {
  1849. return this.properties.getSpatialStructure( modelID );
  1850. }
  1851. getSubset( modelID, material ) {
  1852. return this.subsets.getSubset( modelID, material );
  1853. }
  1854. removeSubset( modelID, parent, material ) {
  1855. this.subsets.removeSubset( modelID, parent, material );
  1856. }
  1857. createSubset( config ) {
  1858. return this.subsets.createSubset( config );
  1859. }
  1860. hideItems( modelID, ids ) {
  1861. this.hider.hideItems( modelID, ids );
  1862. }
  1863. hideAllItems( modelID ) {
  1864. this.hider.hideAllItems( modelID );
  1865. }
  1866. showItems( modelID, ids ) {
  1867. this.hider.showItems( modelID, ids );
  1868. }
  1869. showAllItems( modelID ) {
  1870. this.hider.showAllItems( modelID );
  1871. }
  1872. }
  1873. class IFCLoader extends Loader {
  1874. constructor( manager ) {
  1875. super( manager );
  1876. this.ifcManager = new IFCManager();
  1877. }
  1878. load( url, onLoad, onProgress, onError ) {
  1879. const scope = this;
  1880. const loader = new FileLoader( scope.manager );
  1881. loader.setPath( scope.path );
  1882. loader.setResponseType( 'arraybuffer' );
  1883. loader.setRequestHeader( scope.requestHeader );
  1884. loader.setWithCredentials( scope.withCredentials );
  1885. loader.load( url, async function ( buffer ) {
  1886. try {
  1887. if ( typeof buffer == 'string' ) {
  1888. throw new Error( 'IFC files must be given as a buffer!' );
  1889. }
  1890. onLoad( await scope.parse( buffer ) );
  1891. } catch ( e ) {
  1892. if ( onError ) {
  1893. onError( e );
  1894. } else {
  1895. console.error( e );
  1896. }
  1897. scope.manager.itemError( url );
  1898. }
  1899. }, onProgress, onError );
  1900. }
  1901. parse( buffer ) {
  1902. return this.ifcManager.parse( buffer );
  1903. }
  1904. }
  1905. export { IFCLoader };
  1906. //# sourceMappingURL=IFCLoader.js.map