|
@@ -94330,11 +94330,11 @@ var AbstractViewer = (function () {
|
|
AbstractViewer.prototype.initModel = function (modelConfig, clearScene) {
|
|
AbstractViewer.prototype.initModel = function (modelConfig, clearScene) {
|
|
var _this = this;
|
|
var _this = this;
|
|
if (clearScene === void 0) { clearScene = true; }
|
|
if (clearScene === void 0) { clearScene = true; }
|
|
- var model = this.modelLoader.load(modelConfig);
|
|
|
|
if (clearScene) {
|
|
if (clearScene) {
|
|
this.models.forEach(function (m) { return m.dispose(); });
|
|
this.models.forEach(function (m) { return m.dispose(); });
|
|
this.models.length = 0;
|
|
this.models.length = 0;
|
|
}
|
|
}
|
|
|
|
+ var model = this.modelLoader.load(modelConfig);
|
|
this.lastUsedLoader = model.loader;
|
|
this.lastUsedLoader = model.loader;
|
|
model.onLoadErrorObservable.add(function (errorObject) {
|
|
model.onLoadErrorObservable.add(function (errorObject) {
|
|
_this.onModelLoadErrorObservable.notifyObserversWithPromise(errorObject);
|
|
_this.onModelLoadErrorObservable.notifyObserversWithPromise(errorObject);
|
|
@@ -95112,9 +95112,9 @@ var TemplateManager = (function () {
|
|
function TemplateManager(containerElement) {
|
|
function TemplateManager(containerElement) {
|
|
this.containerElement = containerElement;
|
|
this.containerElement = containerElement;
|
|
this.templates = {};
|
|
this.templates = {};
|
|
- this.onInit = new babylonjs_1.Observable();
|
|
|
|
- this.onLoaded = new babylonjs_1.Observable();
|
|
|
|
- this.onStateChange = new babylonjs_1.Observable();
|
|
|
|
|
|
+ this.onTemplateInit = new babylonjs_1.Observable();
|
|
|
|
+ this.onTemplateLoaded = new babylonjs_1.Observable();
|
|
|
|
+ this.onTemplateStateChange = new babylonjs_1.Observable();
|
|
this.onAllLoaded = new babylonjs_1.Observable();
|
|
this.onAllLoaded = new babylonjs_1.Observable();
|
|
this.onEventTriggered = new babylonjs_1.Observable();
|
|
this.onEventTriggered = new babylonjs_1.Observable();
|
|
this.eventManager = new eventManager_1.EventManager(this);
|
|
this.eventManager = new eventManager_1.EventManager(this);
|
|
@@ -95157,6 +95157,13 @@ var TemplateManager = (function () {
|
|
if (!templates[name])
|
|
if (!templates[name])
|
|
return Promise.resolve(false);
|
|
return Promise.resolve(false);
|
|
var template = new Template(name, templates[name]);
|
|
var template = new Template(name, templates[name]);
|
|
|
|
+ template.onLoaded.add(function () {
|
|
|
|
+ _this.onTemplateLoaded.notifyObservers(template);
|
|
|
|
+ });
|
|
|
|
+ template.onStateChange.add(function () {
|
|
|
|
+ _this.onTemplateStateChange.notifyObservers(template);
|
|
|
|
+ });
|
|
|
|
+ _this.onTemplateInit.notifyObservers(template);
|
|
template.onEventTriggered.add(function (eventData) { return _this.onEventTriggered.notifyObservers(eventData); });
|
|
template.onEventTriggered.add(function (eventData) { return _this.onEventTriggered.notifyObservers(eventData); });
|
|
_this.templates[name] = template;
|
|
_this.templates[name] = template;
|
|
return template.initPromise;
|
|
return template.initPromise;
|
|
@@ -95199,11 +95206,11 @@ var TemplateManager = (function () {
|
|
});
|
|
});
|
|
this.templates = {};
|
|
this.templates = {};
|
|
this.eventManager.dispose();
|
|
this.eventManager.dispose();
|
|
- this.onInit.clear();
|
|
|
|
|
|
+ this.onTemplateInit.clear();
|
|
this.onAllLoaded.clear();
|
|
this.onAllLoaded.clear();
|
|
this.onEventTriggered.clear();
|
|
this.onEventTriggered.clear();
|
|
- this.onLoaded.clear();
|
|
|
|
- this.onStateChange.clear();
|
|
|
|
|
|
+ this.onTemplateLoaded.clear();
|
|
|
|
+ this.onTemplateStateChange.clear();
|
|
};
|
|
};
|
|
return TemplateManager;
|
|
return TemplateManager;
|
|
}());
|
|
}());
|
|
@@ -95229,7 +95236,6 @@ var Template = (function () {
|
|
var _this = this;
|
|
var _this = this;
|
|
this.name = name;
|
|
this.name = name;
|
|
this._configuration = _configuration;
|
|
this._configuration = _configuration;
|
|
- this.onInit = new babylonjs_1.Observable();
|
|
|
|
this.onLoaded = new babylonjs_1.Observable();
|
|
this.onLoaded = new babylonjs_1.Observable();
|
|
this.onAppended = new babylonjs_1.Observable();
|
|
this.onAppended = new babylonjs_1.Observable();
|
|
this.onStateChange = new babylonjs_1.Observable();
|
|
this.onStateChange = new babylonjs_1.Observable();
|
|
@@ -95238,7 +95244,6 @@ var Template = (function () {
|
|
this.isLoaded = false;
|
|
this.isLoaded = false;
|
|
this.isShown = false;
|
|
this.isShown = false;
|
|
this.isInHtmlTree = false;
|
|
this.isInHtmlTree = false;
|
|
- this.onInit.notifyObservers(this);
|
|
|
|
var htmlContentPromise = this._getTemplateAsHtml(_configuration);
|
|
var htmlContentPromise = this._getTemplateAsHtml(_configuration);
|
|
this.initPromise = htmlContentPromise.then(function (htmlTemplate) {
|
|
this.initPromise = htmlContentPromise.then(function (htmlTemplate) {
|
|
if (htmlTemplate) {
|
|
if (htmlTemplate) {
|
|
@@ -95348,7 +95353,6 @@ var Template = (function () {
|
|
Template.prototype.dispose = function () {
|
|
Template.prototype.dispose = function () {
|
|
this.onAppended.clear();
|
|
this.onAppended.clear();
|
|
this.onEventTriggered.clear();
|
|
this.onEventTriggered.clear();
|
|
- this.onInit.clear();
|
|
|
|
this.onLoaded.clear();
|
|
this.onLoaded.clear();
|
|
this.onStateChange.clear();
|
|
this.onStateChange.clear();
|
|
this.isLoaded = false;
|
|
this.isLoaded = false;
|
|
@@ -95376,7 +95380,7 @@ var Template = (function () {
|
|
return Promise.resolve(templateConfig.html);
|
|
return Promise.resolve(templateConfig.html);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- var location_1 = getTemplateLocation(templateConfig);
|
|
|
|
|
|
+ var location_1 = this._getTemplateLocation(templateConfig);
|
|
if (helper_1.isUrl(location_1)) {
|
|
if (helper_1.isUrl(location_1)) {
|
|
return new Promise(function (resolve, reject) {
|
|
return new Promise(function (resolve, reject) {
|
|
var fileRequest = babylonjs_1.Tools.LoadFile(location_1, function (data) {
|
|
var fileRequest = babylonjs_1.Tools.LoadFile(location_1, function (data) {
|
|
@@ -95449,18 +95453,17 @@ var Template = (function () {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ Template.prototype._getTemplateLocation = function (templateConfig) {
|
|
|
|
+ if (!templateConfig || typeof templateConfig === 'string') {
|
|
|
|
+ return templateConfig;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ return templateConfig.location;
|
|
|
|
+ }
|
|
|
|
+ };
|
|
return Template;
|
|
return Template;
|
|
}());
|
|
}());
|
|
exports.Template = Template;
|
|
exports.Template = Template;
|
|
-function getTemplateLocation(templateConfig) {
|
|
|
|
- if (!templateConfig || typeof templateConfig === 'string') {
|
|
|
|
- return templateConfig;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- return templateConfig.location;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-exports.getTemplateLocation = getTemplateLocation;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|