@xeokit/xeokit-sdk 2.4.2-beta-6 → 2.4.2-beta-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/xeokit-sdk.cjs.js +43 -32
- package/dist/xeokit-sdk.es.js +43 -32
- package/dist/xeokit-sdk.es5.js +22 -29
- package/dist/xeokit-sdk.min.cjs.js +2 -2
- package/dist/xeokit-sdk.min.es.js +2 -2
- package/dist/xeokit-sdk.min.es5.js +2 -2
- package/package.json +1 -1
- package/src/viewer/metadata/MetaModel.js +16 -10
- package/src/viewer/metadata/MetaObject.js +26 -21
- package/src/viewer/scene/scene/Scene.js +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -26579,7 +26579,7 @@ function getEntityIDMap(scene, entityIds) {
|
|
|
26579
26579
|
let entity;
|
|
26580
26580
|
for (let i = 0, len = entityIds.length; i < len; i++) {
|
|
26581
26581
|
entityId = entityIds[i];
|
|
26582
|
-
entity = scene.
|
|
26582
|
+
entity = scene.components[entityId];
|
|
26583
26583
|
if (!entity) {
|
|
26584
26584
|
scene.warn("pick(): Component not found: " + entityId);
|
|
26585
26585
|
continue;
|
|
@@ -89400,15 +89400,6 @@ class MetaObject {
|
|
|
89400
89400
|
*/
|
|
89401
89401
|
constructor(params) {
|
|
89402
89402
|
|
|
89403
|
-
/**
|
|
89404
|
-
* Model metadata.
|
|
89405
|
-
*
|
|
89406
|
-
* @property metaModel
|
|
89407
|
-
* @type {MetaModel}
|
|
89408
|
-
* @deprecated
|
|
89409
|
-
*/
|
|
89410
|
-
this.metaModel = null;
|
|
89411
|
-
|
|
89412
89403
|
/**
|
|
89413
89404
|
* The MetaModels that share this MetaObject.
|
|
89414
89405
|
* @type {MetaModel[]}
|
|
@@ -89481,18 +89472,32 @@ class MetaObject {
|
|
|
89481
89472
|
*/
|
|
89482
89473
|
this.attributes = params.attributes || {};
|
|
89483
89474
|
|
|
89484
|
-
|
|
89485
|
-
|
|
89486
|
-
|
|
89487
|
-
|
|
89488
|
-
|
|
89489
|
-
|
|
89490
|
-
|
|
89491
|
-
|
|
89492
|
-
|
|
89493
|
-
|
|
89494
|
-
|
|
89495
|
-
|
|
89475
|
+
if (params.external !== undefined && params.external !== null) {
|
|
89476
|
+
|
|
89477
|
+
/**
|
|
89478
|
+
* External application-specific metadata
|
|
89479
|
+
*
|
|
89480
|
+
* Undefined when there are is no external application-specific metadata.
|
|
89481
|
+
*
|
|
89482
|
+
* @property external
|
|
89483
|
+
* @type {*}
|
|
89484
|
+
*/
|
|
89485
|
+
this.external = params.external;
|
|
89486
|
+
}
|
|
89487
|
+
}
|
|
89488
|
+
|
|
89489
|
+
/**
|
|
89490
|
+
* Backwards compatibility with the object belonging to a single MetaModel.
|
|
89491
|
+
*
|
|
89492
|
+
* @property metaModel
|
|
89493
|
+
* @type {MetaModel|null}
|
|
89494
|
+
**/
|
|
89495
|
+
get metaModel() {
|
|
89496
|
+
if (this.metaModels.length == 1) {
|
|
89497
|
+
return this.metaModels[0];
|
|
89498
|
+
}
|
|
89499
|
+
|
|
89500
|
+
return null;
|
|
89496
89501
|
}
|
|
89497
89502
|
|
|
89498
89503
|
/**
|
|
@@ -89706,15 +89711,6 @@ class MetaModel {
|
|
|
89706
89711
|
*/
|
|
89707
89712
|
this.propertySets = [];
|
|
89708
89713
|
|
|
89709
|
-
/**
|
|
89710
|
-
* The root {@link MetaObject} in this MetaModel's composition structure hierarchy.
|
|
89711
|
-
*
|
|
89712
|
-
* @property rootMetaObject
|
|
89713
|
-
* @type {MetaObject}
|
|
89714
|
-
* @deprecated
|
|
89715
|
-
*/
|
|
89716
|
-
this.rootMetaObject = null;
|
|
89717
|
-
|
|
89718
89714
|
/**
|
|
89719
89715
|
* The root {@link MetaObject}s in this MetaModel's composition structure hierarchy.
|
|
89720
89716
|
*
|
|
@@ -89746,6 +89742,20 @@ class MetaModel {
|
|
|
89746
89742
|
this.finalized = false;
|
|
89747
89743
|
}
|
|
89748
89744
|
|
|
89745
|
+
/**
|
|
89746
|
+
* Backwards compatibility with the model having a single root MetaObject.
|
|
89747
|
+
*
|
|
89748
|
+
* @property rootMetaObject
|
|
89749
|
+
* @type {MetaObject|null}
|
|
89750
|
+
*/
|
|
89751
|
+
get rootMetaObject()
|
|
89752
|
+
{
|
|
89753
|
+
if (this.rootMetaObjects.length == 1) {
|
|
89754
|
+
return this.rootMetaObjects[0];
|
|
89755
|
+
}
|
|
89756
|
+
return null;
|
|
89757
|
+
}
|
|
89758
|
+
|
|
89749
89759
|
/**
|
|
89750
89760
|
* Load metamodel data into this MetaModel.
|
|
89751
89761
|
* @param metaModelData
|
|
@@ -89797,7 +89807,8 @@ class MetaModel {
|
|
|
89797
89807
|
type,
|
|
89798
89808
|
name: metaObjectData.name,
|
|
89799
89809
|
attributes: metaObjectData.attributes,
|
|
89800
|
-
propertySetIds
|
|
89810
|
+
propertySetIds,
|
|
89811
|
+
external: metaObjectData.external,
|
|
89801
89812
|
});
|
|
89802
89813
|
this.metaScene.metaObjects[id] = metaObject;
|
|
89803
89814
|
}
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -26575,7 +26575,7 @@ function getEntityIDMap(scene, entityIds) {
|
|
|
26575
26575
|
let entity;
|
|
26576
26576
|
for (let i = 0, len = entityIds.length; i < len; i++) {
|
|
26577
26577
|
entityId = entityIds[i];
|
|
26578
|
-
entity = scene.
|
|
26578
|
+
entity = scene.components[entityId];
|
|
26579
26579
|
if (!entity) {
|
|
26580
26580
|
scene.warn("pick(): Component not found: " + entityId);
|
|
26581
26581
|
continue;
|
|
@@ -89396,15 +89396,6 @@ class MetaObject {
|
|
|
89396
89396
|
*/
|
|
89397
89397
|
constructor(params) {
|
|
89398
89398
|
|
|
89399
|
-
/**
|
|
89400
|
-
* Model metadata.
|
|
89401
|
-
*
|
|
89402
|
-
* @property metaModel
|
|
89403
|
-
* @type {MetaModel}
|
|
89404
|
-
* @deprecated
|
|
89405
|
-
*/
|
|
89406
|
-
this.metaModel = null;
|
|
89407
|
-
|
|
89408
89399
|
/**
|
|
89409
89400
|
* The MetaModels that share this MetaObject.
|
|
89410
89401
|
* @type {MetaModel[]}
|
|
@@ -89477,18 +89468,32 @@ class MetaObject {
|
|
|
89477
89468
|
*/
|
|
89478
89469
|
this.attributes = params.attributes || {};
|
|
89479
89470
|
|
|
89480
|
-
|
|
89481
|
-
|
|
89482
|
-
|
|
89483
|
-
|
|
89484
|
-
|
|
89485
|
-
|
|
89486
|
-
|
|
89487
|
-
|
|
89488
|
-
|
|
89489
|
-
|
|
89490
|
-
|
|
89491
|
-
|
|
89471
|
+
if (params.external !== undefined && params.external !== null) {
|
|
89472
|
+
|
|
89473
|
+
/**
|
|
89474
|
+
* External application-specific metadata
|
|
89475
|
+
*
|
|
89476
|
+
* Undefined when there are is no external application-specific metadata.
|
|
89477
|
+
*
|
|
89478
|
+
* @property external
|
|
89479
|
+
* @type {*}
|
|
89480
|
+
*/
|
|
89481
|
+
this.external = params.external;
|
|
89482
|
+
}
|
|
89483
|
+
}
|
|
89484
|
+
|
|
89485
|
+
/**
|
|
89486
|
+
* Backwards compatibility with the object belonging to a single MetaModel.
|
|
89487
|
+
*
|
|
89488
|
+
* @property metaModel
|
|
89489
|
+
* @type {MetaModel|null}
|
|
89490
|
+
**/
|
|
89491
|
+
get metaModel() {
|
|
89492
|
+
if (this.metaModels.length == 1) {
|
|
89493
|
+
return this.metaModels[0];
|
|
89494
|
+
}
|
|
89495
|
+
|
|
89496
|
+
return null;
|
|
89492
89497
|
}
|
|
89493
89498
|
|
|
89494
89499
|
/**
|
|
@@ -89702,15 +89707,6 @@ class MetaModel {
|
|
|
89702
89707
|
*/
|
|
89703
89708
|
this.propertySets = [];
|
|
89704
89709
|
|
|
89705
|
-
/**
|
|
89706
|
-
* The root {@link MetaObject} in this MetaModel's composition structure hierarchy.
|
|
89707
|
-
*
|
|
89708
|
-
* @property rootMetaObject
|
|
89709
|
-
* @type {MetaObject}
|
|
89710
|
-
* @deprecated
|
|
89711
|
-
*/
|
|
89712
|
-
this.rootMetaObject = null;
|
|
89713
|
-
|
|
89714
89710
|
/**
|
|
89715
89711
|
* The root {@link MetaObject}s in this MetaModel's composition structure hierarchy.
|
|
89716
89712
|
*
|
|
@@ -89742,6 +89738,20 @@ class MetaModel {
|
|
|
89742
89738
|
this.finalized = false;
|
|
89743
89739
|
}
|
|
89744
89740
|
|
|
89741
|
+
/**
|
|
89742
|
+
* Backwards compatibility with the model having a single root MetaObject.
|
|
89743
|
+
*
|
|
89744
|
+
* @property rootMetaObject
|
|
89745
|
+
* @type {MetaObject|null}
|
|
89746
|
+
*/
|
|
89747
|
+
get rootMetaObject()
|
|
89748
|
+
{
|
|
89749
|
+
if (this.rootMetaObjects.length == 1) {
|
|
89750
|
+
return this.rootMetaObjects[0];
|
|
89751
|
+
}
|
|
89752
|
+
return null;
|
|
89753
|
+
}
|
|
89754
|
+
|
|
89745
89755
|
/**
|
|
89746
89756
|
* Load metamodel data into this MetaModel.
|
|
89747
89757
|
* @param metaModelData
|
|
@@ -89793,7 +89803,8 @@ class MetaModel {
|
|
|
89793
89803
|
type,
|
|
89794
89804
|
name: metaObjectData.name,
|
|
89795
89805
|
attributes: metaObjectData.attributes,
|
|
89796
|
-
propertySetIds
|
|
89806
|
+
propertySetIds,
|
|
89807
|
+
external: metaObjectData.external,
|
|
89797
89808
|
});
|
|
89798
89809
|
this.metaScene.metaObjects[id] = metaObject;
|
|
89799
89810
|
}
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -8105,7 +8105,7 @@ _this47.preset=cfg.preset;if(cfg.lineWidth!==undefined){_this47.lineWidth=cfg.li
|
|
|
8105
8105
|
*/,set:function set(value){value=value||"default";if(this._preset===value){return;}var preset=PRESETS[value];if(!preset){this.error("unsupported preset: '"+value+"' - supported values are "+Object.keys(PRESETS).join(", "));return;}this.lineWidth=preset.lineWidth;this._preset=value;}},{key:"hash",get:function get(){return[""+this.lineWidth].join(";");}/**
|
|
8106
8106
|
* Destroys this LinesMaterial.
|
|
8107
8107
|
*/},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(LinesMaterial.prototype),"destroy",this).call(this);this._state.destroy();}}]);return LinesMaterial;}(Material);// Cached vars to avoid garbage collection
|
|
8108
|
-
function getEntityIDMap(scene,entityIds){var map={};var entityId;var entity;for(var _i76=0,len=entityIds.length;_i76<len;_i76++){entityId=entityIds[_i76];entity=scene.
|
|
8108
|
+
function getEntityIDMap(scene,entityIds){var map={};var entityId;var entity;for(var _i76=0,len=entityIds.length;_i76<len;_i76++){entityId=entityIds[_i76];entity=scene.components[entityId];if(!entity){scene.warn("pick(): Component not found: "+entityId);continue;}if(!entity.isEntity){scene.warn("pick(): Component is not an Entity: "+entityId);continue;}map[entityId]=true;}return map;}/**
|
|
8109
8109
|
* Fired whenever a debug message is logged on a component within this Scene.
|
|
8110
8110
|
* @event log
|
|
8111
8111
|
* @param {String} value The debug message
|
|
@@ -21742,12 +21742,6 @@ value=value||"qwerty";if(value!=="qwerty"&&value!=="azerty"){this.error("Unsuppo
|
|
|
21742
21742
|
*/var MetaObject=/*#__PURE__*/function(){/**
|
|
21743
21743
|
* @private
|
|
21744
21744
|
*/function MetaObject(params){_classCallCheck(this,MetaObject);/**
|
|
21745
|
-
* Model metadata.
|
|
21746
|
-
*
|
|
21747
|
-
* @property metaModel
|
|
21748
|
-
* @type {MetaModel}
|
|
21749
|
-
* @deprecated
|
|
21750
|
-
*/this.metaModel=null;/**
|
|
21751
21745
|
* The MetaModels that share this MetaObject.
|
|
21752
21746
|
* @type {MetaModel[]}
|
|
21753
21747
|
*/this.metaModels=[];/**
|
|
@@ -21789,23 +21783,23 @@ value=value||"qwerty";if(value!=="qwerty"&&value!=="azerty"){this.error("Unsuppo
|
|
|
21789
21783
|
*/this.propertySets=[];/**
|
|
21790
21784
|
* The attributes of this MetaObject.
|
|
21791
21785
|
* @type {{}}
|
|
21792
|
-
*/this.attributes=params.attributes||{}
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
}/**
|
|
21786
|
+
*/this.attributes=params.attributes||{};if(params.external!==undefined&¶ms.external!==null){/**
|
|
21787
|
+
* External application-specific metadata
|
|
21788
|
+
*
|
|
21789
|
+
* Undefined when there are is no external application-specific metadata.
|
|
21790
|
+
*
|
|
21791
|
+
* @property external
|
|
21792
|
+
* @type {*}
|
|
21793
|
+
*/this.external=params.external;}}/**
|
|
21794
|
+
* Backwards compatibility with the object belonging to a single MetaModel.
|
|
21795
|
+
*
|
|
21796
|
+
* @property metaModel
|
|
21797
|
+
* @type {MetaModel|null}
|
|
21798
|
+
**/_createClass(MetaObject,[{key:"metaModel",get:function get(){if(this.metaModels.length==1){return this.metaModels[0];}return null;}/**
|
|
21805
21799
|
* Gets the {@link MetaObject#id}s of the {@link MetaObject}s within the subtree.
|
|
21806
21800
|
*
|
|
21807
21801
|
* @returns {String[]} Array of {@link MetaObject#id}s.
|
|
21808
|
-
*/
|
|
21802
|
+
*/},{key:"getObjectIDsInSubtree",value:function getObjectIDsInSubtree(){var objectIds=[];function visit(metaObject){if(!metaObject){return;}objectIds.push(metaObject.id);var children=metaObject.children;if(children){for(var i=0,len=children.length;i<len;i++){visit(children[i]);}}}visit(this);return objectIds;}/**
|
|
21809
21803
|
* Iterates over the {@link MetaObject}s within the subtree.
|
|
21810
21804
|
*
|
|
21811
21805
|
* @param {Function} callback Callback fired at each {@link MetaObject}.
|
|
@@ -21898,12 +21892,6 @@ value=value||"qwerty";if(value!=="qwerty"&&value!=="azerty"){this.error("Unsuppo
|
|
|
21898
21892
|
* @property propertySets
|
|
21899
21893
|
* @type {PropertySet[]}
|
|
21900
21894
|
*/this.propertySets=[];/**
|
|
21901
|
-
* The root {@link MetaObject} in this MetaModel's composition structure hierarchy.
|
|
21902
|
-
*
|
|
21903
|
-
* @property rootMetaObject
|
|
21904
|
-
* @type {MetaObject}
|
|
21905
|
-
* @deprecated
|
|
21906
|
-
*/this.rootMetaObject=null;/**
|
|
21907
21895
|
* The root {@link MetaObject}s in this MetaModel's composition structure hierarchy.
|
|
21908
21896
|
*
|
|
21909
21897
|
* @property rootMetaObject
|
|
@@ -21920,10 +21908,15 @@ value=value||"qwerty";if(value!=="qwerty"&&value!=="azerty"){this.error("Unsuppo
|
|
|
21920
21908
|
* True when this MetaModel has been finalized.
|
|
21921
21909
|
* @type {boolean}
|
|
21922
21910
|
*/this.finalized=false;}/**
|
|
21911
|
+
* Backwards compatibility with the model having a single root MetaObject.
|
|
21912
|
+
*
|
|
21913
|
+
* @property rootMetaObject
|
|
21914
|
+
* @type {MetaObject|null}
|
|
21915
|
+
*/_createClass(MetaModel,[{key:"rootMetaObject",get:function get(){if(this.rootMetaObjects.length==1){return this.rootMetaObjects[0];}return null;}/**
|
|
21923
21916
|
* Load metamodel data into this MetaModel.
|
|
21924
21917
|
* @param metaModelData
|
|
21925
|
-
*/
|
|
21926
|
-
if(metaModelData.propertySets){for(var _i437=0,len=metaModelData.propertySets.length;_i437<len;_i437++){var propertySetData=metaModelData.propertySets[_i437];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 _i438=0,_len96=metaModelData.metaObjects.length;_i438<_len96;_i438++){var metaObjectData=metaModelData.metaObjects[_i438];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});this.metaScene.metaObjects[id]=metaObject;}metaObject.metaModels.push(this);if(!metaObjectData.parent){this.rootMetaObjects.push(metaObject);metaScene.rootMetaObjects[id]=metaObject;}this.metaObjects.push(metaObject);}}}},{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
|
|
21918
|
+
*/},{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;// Create global Property Sets
|
|
21919
|
+
if(metaModelData.propertySets){for(var _i437=0,len=metaModelData.propertySets.length;_i437<len;_i437++){var propertySetData=metaModelData.propertySets[_i437];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 _i438=0,_len96=metaModelData.metaObjects.length;_i438<_len96;_i438++){var metaObjectData=metaModelData.metaObjects[_i438];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.push(this);if(!metaObjectData.parent){this.rootMetaObjects.push(metaObject);metaScene.rootMetaObjects[id]=metaObject;}this.metaObjects.push(metaObject);}}}},{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
|
|
21927
21920
|
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
|
|
21928
21921
|
if(metaObject.propertySets){metaObject.propertySets=[];}if(metaObject.propertySetIds){for(var _i439=0,len=metaObject.propertySetIds.length;_i439<len;_i439++){var propertySetId=metaObject.propertySetIds[_i439];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);}}}// Rebuild MetaScene's MetaObjects-by-type lookup
|
|
21929
21922
|
metaScene.metaObjectsByType={};for(var _objectId2 in metaScene.metaObjects){var _metaObject4=metaScene.metaObjects[_objectId2];var type=_metaObject4.type;(metaScene.metaObjectsByType[type]||(metaScene.metaObjectsByType[type]={}))[_objectId2]=_metaObject4;}this.finalized=true;this.metaScene.fire("metaModelCreated",this.id);}/**
|