Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Dec 3, 2024
1 parent cf38a3b commit f4e1048
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
6 changes: 4 additions & 2 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -101442,6 +101442,7 @@ class MetaModel {
this.rootMetaObjects.push(metaObject);
metaScene.rootMetaObjects[id] = metaObject;
}
metaObject.metaModels.push(this);
}
}
}
Expand Down Expand Up @@ -101847,13 +101848,14 @@ class MetaScene {
if (metaModel.metaObjects) {
for (let i = 0, len = metaModel.metaObjects.length; i < len; i++) {
const metaObject = metaModel.metaObjects[i];
metaObject.type;
const id = metaObject.id;
if (metaObject.metaModels.length === 1&& metaObject.metaModels[0].id === metaModelId) { // MetaObject owned only by this model, delete
if (metaObject.metaModels.length === 1 && metaObject.metaModels[0].id === metaModelId) { // MetaObject owned only by this model, delete
delete this.metaObjects[id];
if (!metaObject.parent) {
delete this.rootMetaObjects[id];
}
} else {
metaObject.metaModels = metaObject.metaModels.filter(metaModel => metaModel.id !== metaModelId);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -101438,6 +101438,7 @@ class MetaModel {
this.rootMetaObjects.push(metaObject);
metaScene.rootMetaObjects[id] = metaObject;
}
metaObject.metaModels.push(this);
}
}
}
Expand Down Expand Up @@ -101843,13 +101844,14 @@ class MetaScene {
if (metaModel.metaObjects) {
for (let i = 0, len = metaModel.metaObjects.length; i < len; i++) {
const metaObject = metaModel.metaObjects[i];
metaObject.type;
const id = metaObject.id;
if (metaObject.metaModels.length === 1&& metaObject.metaModels[0].id === metaModelId) { // MetaObject owned only by this model, delete
if (metaObject.metaModels.length === 1 && metaObject.metaModels[0].id === metaModelId) { // MetaObject owned only by this model, delete
delete this.metaObjects[id];
if (!metaObject.parent) {
delete this.rootMetaObjects[id];
}
} else {
metaObject.metaModels = metaObject.metaModels.filter(metaModel => metaModel.id !== metaModelId);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions dist/xeokit-sdk.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -24520,7 +24520,7 @@ this.properties.push(property);}else{this.properties.push(new Property(property.
* @param metaModelData
*/},{key:"loadData",value:function loadData(metaModelData){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.finalized){throw"MetaScene already finalized - can't add more data";}this._globalizeIDs(metaModelData,options);var metaScene=this.metaScene;var propertyLookup=metaModelData.properties;if(propertyLookup){for(var _i490=0,len=propertyLookup.length;_i490<len;_i490++){this._propertyLookup.push(propertyLookup[_i490]);}}// Create global Property Sets
if(metaModelData.propertySets){for(var _i491=0,_len94=metaModelData.propertySets.length;_i491<_len94;_i491++){var propertySetData=metaModelData.propertySets[_i491];if(!propertySetData.properties){// HACK: https://github.com/Creoox/creoox-ifc2gltfcxconverter/issues/8
propertySetData.properties=[];}var propertySet=metaScene.propertySets[propertySetData.id];if(!propertySet){propertySet=new PropertySet({id:propertySetData.id,originalSystemId:propertySetData.originalSystemId||propertySetData.id,type:propertySetData.type,name:propertySetData.name,properties:propertySetData.properties});metaScene.propertySets[propertySet.id]=propertySet;}propertySet.metaModels.push(this);this.propertySets.push(propertySet);}}if(metaModelData.metaObjects){for(var _i492=0,_len95=metaModelData.metaObjects.length;_i492<_len95;_i492++){var metaObjectData=metaModelData.metaObjects[_i492];var id=metaObjectData.id;var metaObject=metaScene.metaObjects[id];if(!metaObject){var type=metaObjectData.type;var originalSystemId=metaObjectData.originalSystemId;var propertySetIds=metaObjectData.propertySets||metaObjectData.propertySetIds;metaObject=new MetaObject({id:id,originalSystemId:originalSystemId,parentId:metaObjectData.parent,type:type,name:metaObjectData.name,attributes:metaObjectData.attributes,propertySetIds:propertySetIds,external:metaObjectData.external});this.metaScene.metaObjects[id]=metaObject;metaObject.metaModels=[];}this.metaObjects[id]=metaObject;if(!metaObjectData.parent){this.rootMetaObjects.push(metaObject);metaScene.rootMetaObjects[id]=metaObject;}}}}},{key:"_decompressProperties",value:function _decompressProperties(propertyLookup,properties){var propsNotFound=[];for(var _i493=0,len=properties.length;_i493<len;_i493++){var property=properties[_i493];if(Number.isInteger(property)){var lookupProperty=propertyLookup[property];if(lookupProperty){properties[_i493]=lookupProperty;}else{propsNotFound.push(property);}}}if(propsNotFound.length>0){console.error("[MetaModel._decompressProperties] Properties not found: ".concat(propsNotFound));}}},{key:"finalize",value:function finalize(){if(this.finalized){throw"MetaScene already finalized - can't re-finalize";}// Re-link MetaScene's entire MetaObject parent/child hierarchy
propertySetData.properties=[];}var propertySet=metaScene.propertySets[propertySetData.id];if(!propertySet){propertySet=new PropertySet({id:propertySetData.id,originalSystemId:propertySetData.originalSystemId||propertySetData.id,type:propertySetData.type,name:propertySetData.name,properties:propertySetData.properties});metaScene.propertySets[propertySet.id]=propertySet;}propertySet.metaModels.push(this);this.propertySets.push(propertySet);}}if(metaModelData.metaObjects){for(var _i492=0,_len95=metaModelData.metaObjects.length;_i492<_len95;_i492++){var metaObjectData=metaModelData.metaObjects[_i492];var id=metaObjectData.id;var metaObject=metaScene.metaObjects[id];if(!metaObject){var type=metaObjectData.type;var originalSystemId=metaObjectData.originalSystemId;var propertySetIds=metaObjectData.propertySets||metaObjectData.propertySetIds;metaObject=new MetaObject({id:id,originalSystemId:originalSystemId,parentId:metaObjectData.parent,type:type,name:metaObjectData.name,attributes:metaObjectData.attributes,propertySetIds:propertySetIds,external:metaObjectData.external});this.metaScene.metaObjects[id]=metaObject;metaObject.metaModels=[];}this.metaObjects[id]=metaObject;if(!metaObjectData.parent){this.rootMetaObjects.push(metaObject);metaScene.rootMetaObjects[id]=metaObject;}metaObject.metaModels.push(this);}}}},{key:"_decompressProperties",value:function _decompressProperties(propertyLookup,properties){var propsNotFound=[];for(var _i493=0,len=properties.length;_i493<len;_i493++){var property=properties[_i493];if(Number.isInteger(property)){var lookupProperty=propertyLookup[property];if(lookupProperty){properties[_i493]=lookupProperty;}else{propsNotFound.push(property);}}}if(propsNotFound.length>0){console.error("[MetaModel._decompressProperties] Properties not found: ".concat(propsNotFound));}}},{key:"finalize",value:function finalize(){if(this.finalized){throw"MetaScene already finalized - can't re-finalize";}// Re-link MetaScene's entire MetaObject parent/child hierarchy
var metaScene=this.metaScene;for(var objectId in metaScene.metaObjects){var metaObject=metaScene.metaObjects[objectId];if(metaObject.children){metaObject.children=[];}// Re-link each MetaObject's property sets
if(metaObject.propertySets){metaObject.propertySets=[];}if(metaObject.propertySetIds){for(var _i494=0,len=metaObject.propertySetIds.length;_i494<len;_i494++){var propertySetId=metaObject.propertySetIds[_i494];var propertySet=metaScene.propertySets[propertySetId];metaObject.propertySets.push(propertySet);}}}for(var _objectId in metaScene.metaObjects){var _metaObject3=metaScene.metaObjects[_objectId];if(_metaObject3.parentId){var parentMetaObject=metaScene.metaObjects[_metaObject3.parentId];if(parentMetaObject){_metaObject3.parent=parentMetaObject;(parentMetaObject.children||(parentMetaObject.children=[])).push(_metaObject3);}}}// Relink MetaObjects to their MetaModels
for(var _objectId2 in metaScene.metaObjects){var _metaObject4=metaScene.metaObjects[_objectId2];_metaObject4.metaModels=[];}for(var modelId in metaScene.metaModels){var metaModel=metaScene.metaModels[modelId];for(var _objectId3 in metaModel.metaObjects){var _metaObject5=metaModel.metaObjects[_objectId3];_metaObject5.metaModels.push(metaModel);}}// Rebuild MetaScene's MetaObjects-by-type lookup
Expand Down Expand Up @@ -24611,8 +24611,8 @@ metaScene:this,id:modelId,projectId:metaModelData.projectId||"none",revisionId:m
*/},{key:"destroyMetaModel",value:function destroyMetaModel(metaModelId){var metaModel=this.metaModels[metaModelId];if(!metaModel){return;}// Remove global PropertySets
if(metaModel.propertySets){for(var _i501=0,len=metaModel.propertySets.length;_i501<len;_i501++){var propertySet=metaModel.propertySets[_i501];if(propertySet.metaModels.length===1&&propertySet.metaModels[0].id===metaModelId){// Property set owned only by this model, delete
delete this.propertySets[propertySet.id];}else{var newMetaModels=[];for(var j=0,lenj=propertySet.metaModels.length;j<lenj;j++){if(propertySet.metaModels[j].id!==metaModelId){newMetaModels.push(propertySet.metaModels[j]);}}propertySet.metaModels=newMetaModels;}}}// Remove MetaObjects
if(metaModel.metaObjects){for(var _i502=0,_len99=metaModel.metaObjects.length;_i502<_len99;_i502++){var metaObject=metaModel.metaObjects[_i502];metaObject.type;var id=metaObject.id;if(metaObject.metaModels.length===1&&metaObject.metaModels[0].id===metaModelId){// MetaObject owned only by this model, delete
delete this.metaObjects[id];if(!metaObject.parent){delete this.rootMetaObjects[id];}}}}// Re-link entire MetaObject parent/child hierarchy
if(metaModel.metaObjects){for(var _i502=0,_len99=metaModel.metaObjects.length;_i502<_len99;_i502++){var metaObject=metaModel.metaObjects[_i502];var id=metaObject.id;if(metaObject.metaModels.length===1&&metaObject.metaModels[0].id===metaModelId){// MetaObject owned only by this model, delete
delete this.metaObjects[id];if(!metaObject.parent){delete this.rootMetaObjects[id];}}else{metaObject.metaModels=metaObject.metaModels.filter(function(metaModel){return metaModel.id!==metaModelId;});}}}// Re-link entire MetaObject parent/child hierarchy
for(var objectId in this.metaObjects){var _metaObject7=this.metaObjects[objectId];if(_metaObject7.children){_metaObject7.children=[];}// Re-link each MetaObject's property sets
if(_metaObject7.propertySets){_metaObject7.propertySets=[];}if(_metaObject7.propertySetIds){for(var _i503=0,_len100=_metaObject7.propertySetIds.length;_i503<_len100;_i503++){var propertySetId=_metaObject7.propertySetIds[_i503];var _propertySet2=this.propertySets[propertySetId];_metaObject7.propertySets.push(_propertySet2);}}}this.metaObjectsByType={};for(var _objectId5 in this.metaObjects){var _metaObject8=this.metaObjects[_objectId5];var type=_metaObject8.type;if(_metaObject8.children){_metaObject8.children=null;}(this.metaObjectsByType[type]||(this.metaObjectsByType[type]={}))[_objectId5]=_metaObject8;}for(var _objectId6 in this.metaObjects){var _metaObject9=this.metaObjects[_objectId6];if(_metaObject9.parentId){var parentMetaObject=this.metaObjects[_metaObject9.parentId];if(parentMetaObject){_metaObject9.parent=parentMetaObject;(parentMetaObject.children||(parentMetaObject.children=[])).push(_metaObject9);}}}delete this.metaModels[metaModelId];// Relink MetaObjects to their MetaModels
for(var _objectId7 in this.metaObjects){var _metaObject10=this.metaObjects[_objectId7];_metaObject10.metaModels=[];}for(var modelId in this.metaModels){var _metaModel=this.metaModels[modelId];for(var _i504=0,_len101=_metaModel.metaObjects.length;_i504<_len101;_i504++){var _metaObject11=_metaModel.metaObjects[_i504];_metaObject11.metaModels.push(_metaModel);}}this.fire("metaModelDestroyed",metaModelId);}/**
Expand Down
2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.es5.js

Large diffs are not rendered by default.

0 comments on commit f4e1048

Please sign in to comment.