Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Mar 13, 2024
1 parent 91beedf commit 2e943fd
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 171 deletions.
81 changes: 23 additions & 58 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -127606,9 +127606,9 @@ parsers[ParserV10.version] = ParserV10;
* }
*
* // Gets the contents of the given .XKT file in an arraybuffer
* getXKT(xKTSrc, ok, error) {
* getXKT(src, ok, error) {
* console.log("MyDataSource#getXKT(" + xKTSrc + ", ... )");
* utils.loadArraybuffer(xKTSrc,
* utils.loadArraybuffer(src,
* (arraybuffer) => {
* ok(arraybuffer);
* },
Expand Down Expand Up @@ -128292,13 +128292,28 @@ class XKTLoaderPlugin extends Plugin {
globalizeObjectIds: options.globalizeObjectIds
});
i++;
this.scheduleTask( loadNext, 100);
this.scheduleTask(loadNext, 100);
}, error);
}
};
loadNext();
};
const loadXKTs = (xktFiles, done, error) => {
const loadXKTs_excludeTheirMetaModels = (xktFiles, done, error) => { // Load XKTs, ignore metamodels in the XKT
let i = 0;
const loadNext = () => {
if (i >= xktFiles.length) {
done();
} else {
this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
this._parseModel(arrayBuffer, params, options, sceneModel, null /* Ignore metamodel in XKT */, manifestCtx);
i++;
this.scheduleTask(loadNext, 100);
}, error);
}
};
loadNext();
};
const loadXKTs_includeTheirMetaModels = (xktFiles, done, error) => { // Load XKTs, parse metamodels from the XKT
let i = 0;
const loadNext = () => {
if (i >= xktFiles.length) {
Expand All @@ -128323,10 +128338,10 @@ class XKTLoaderPlugin extends Plugin {
const metaModelFiles = manifestData.metaModelFiles;
if (metaModelFiles) {
loadJSONs(metaModelFiles, () => {
loadXKTs(xktFiles, finish, error);
loadXKTs_excludeTheirMetaModels(xktFiles, finish, error);
}, error);
} else {
loadXKTs(xktFiles, finish, error);
loadXKTs_includeTheirMetaModels(xktFiles, finish, error);
}
} else {
this._dataSource.getManifest(params.manifestSrc, (manifestData) => {
Expand All @@ -128341,10 +128356,10 @@ class XKTLoaderPlugin extends Plugin {
const metaModelFiles = manifestData.metaModelFiles;
if (metaModelFiles) {
loadJSONs(metaModelFiles, () => {
loadXKTs(xktFiles, finish, error);
loadXKTs_excludeTheirMetaModels(xktFiles, finish, error);
}, error);
} else {
loadXKTs(xktFiles, finish, error);
loadXKTs_includeTheirMetaModels(xktFiles, finish, error);
}
}, error);
}
Expand Down Expand Up @@ -128384,56 +128399,6 @@ class XKTLoaderPlugin extends Plugin {
}
parser.parse(this.viewer, options, elements, sceneModel, metaModel, manifestCtx);
}

// _createDefaultMetaModelIfNeeded(sceneModel, params, options) {
//
// const metaModelId = sceneModel.id;
//
// if (!this.viewer.metaScene.metaModels[metaModelId]) {
//
// const metaModelData = {
// metaObjects: []
// };
//
// metaModelData.metaObjects.push({
// id: metaModelId,
// type: "default",
// name: metaModelId,
// parent: null
// });
//
// const entityList = sceneModel.entityList;
//
// for (let i = 0, len = entityList.length; i < len; i++) {
// const entity = entityList[i];
// if (entity.isObject) {
// metaModelData.metaObjects.push({
// id: entity.id,
// type: "default",
// name: entity.id,
// parent: metaModelId
// });
// }
// }
//
// const src = params.src;
//
// this.viewer.metaScene.createMetaModel(metaModelId, metaModelData, {
//
// includeTypes: options.includeTypes,
// excludeTypes: options.excludeTypes,
// globalizeObjectIds: options.globalizeObjectIds,
//
// getProperties: async (propertiesId) => {
// return await this._dataSource.getProperties(src, propertiesId);
// }
// });
//
// sceneModel.once("destroyed", () => {
// this.viewer.metaScene.destroyMetaModel(metaModelId);
// });
// }
// }
}

function getBaseDirectory(filePath) {
Expand Down
81 changes: 23 additions & 58 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -127602,9 +127602,9 @@ parsers[ParserV10.version] = ParserV10;
* }
*
* // Gets the contents of the given .XKT file in an arraybuffer
* getXKT(xKTSrc, ok, error) {
* getXKT(src, ok, error) {
* console.log("MyDataSource#getXKT(" + xKTSrc + ", ... )");
* utils.loadArraybuffer(xKTSrc,
* utils.loadArraybuffer(src,
* (arraybuffer) => {
* ok(arraybuffer);
* },
Expand Down Expand Up @@ -128288,13 +128288,28 @@ class XKTLoaderPlugin extends Plugin {
globalizeObjectIds: options.globalizeObjectIds
});
i++;
this.scheduleTask( loadNext, 100);
this.scheduleTask(loadNext, 100);
}, error);
}
};
loadNext();
};
const loadXKTs = (xktFiles, done, error) => {
const loadXKTs_excludeTheirMetaModels = (xktFiles, done, error) => { // Load XKTs, ignore metamodels in the XKT
let i = 0;
const loadNext = () => {
if (i >= xktFiles.length) {
done();
} else {
this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
this._parseModel(arrayBuffer, params, options, sceneModel, null /* Ignore metamodel in XKT */, manifestCtx);
i++;
this.scheduleTask(loadNext, 100);
}, error);
}
};
loadNext();
};
const loadXKTs_includeTheirMetaModels = (xktFiles, done, error) => { // Load XKTs, parse metamodels from the XKT
let i = 0;
const loadNext = () => {
if (i >= xktFiles.length) {
Expand All @@ -128319,10 +128334,10 @@ class XKTLoaderPlugin extends Plugin {
const metaModelFiles = manifestData.metaModelFiles;
if (metaModelFiles) {
loadJSONs(metaModelFiles, () => {
loadXKTs(xktFiles, finish, error);
loadXKTs_excludeTheirMetaModels(xktFiles, finish, error);
}, error);
} else {
loadXKTs(xktFiles, finish, error);
loadXKTs_includeTheirMetaModels(xktFiles, finish, error);
}
} else {
this._dataSource.getManifest(params.manifestSrc, (manifestData) => {
Expand All @@ -128337,10 +128352,10 @@ class XKTLoaderPlugin extends Plugin {
const metaModelFiles = manifestData.metaModelFiles;
if (metaModelFiles) {
loadJSONs(metaModelFiles, () => {
loadXKTs(xktFiles, finish, error);
loadXKTs_excludeTheirMetaModels(xktFiles, finish, error);
}, error);
} else {
loadXKTs(xktFiles, finish, error);
loadXKTs_includeTheirMetaModels(xktFiles, finish, error);
}
}, error);
}
Expand Down Expand Up @@ -128380,56 +128395,6 @@ class XKTLoaderPlugin extends Plugin {
}
parser.parse(this.viewer, options, elements, sceneModel, metaModel, manifestCtx);
}

// _createDefaultMetaModelIfNeeded(sceneModel, params, options) {
//
// const metaModelId = sceneModel.id;
//
// if (!this.viewer.metaScene.metaModels[metaModelId]) {
//
// const metaModelData = {
// metaObjects: []
// };
//
// metaModelData.metaObjects.push({
// id: metaModelId,
// type: "default",
// name: metaModelId,
// parent: null
// });
//
// const entityList = sceneModel.entityList;
//
// for (let i = 0, len = entityList.length; i < len; i++) {
// const entity = entityList[i];
// if (entity.isObject) {
// metaModelData.metaObjects.push({
// id: entity.id,
// type: "default",
// name: entity.id,
// parent: metaModelId
// });
// }
// }
//
// const src = params.src;
//
// this.viewer.metaScene.createMetaModel(metaModelId, metaModelData, {
//
// includeTypes: options.includeTypes,
// excludeTypes: options.excludeTypes,
// globalizeObjectIds: options.globalizeObjectIds,
//
// getProperties: async (propertiesId) => {
// return await this._dataSource.getProperties(src, propertiesId);
// }
// });
//
// sceneModel.once("destroyed", () => {
// this.viewer.metaScene.destroyMetaModel(metaModelId);
// });
// }
// }
}

function getBaseDirectory(filePath) {
Expand Down
Loading

0 comments on commit 2e943fd

Please sign in to comment.