Skip to content
Snippets Groups Projects
Commit 2428e403 authored by alja's avatar alja Committed by Sergey Linev
Browse files

Put makeGLRepresentation and replaceElement in try/catch block

parent ef8f62ff
No related branches found
No related tags found
No related merge requests found
......@@ -31,34 +31,36 @@ sap.ui.define(['rootui5/eve7/lib/EveManager'], function(EveManager) {
// Render object creation / management
//==============================================================================
EveScene.prototype.makeGLRepresentation = function(elem)
{
if ( ! elem.render_data) return null;
EveScene.prototype.makeGLRepresentation = function (elem) {
if (!elem.render_data) return null;
let fname = elem.render_data.rnr_func;
let obj3d = this.creator[fname](elem, elem.render_data);
try {
let fname = elem.render_data.rnr_func;
let obj3d = this.creator[fname](elem, elem.render_data);
if (obj3d)
{
// MT ??? why?, it can really be anything, even just container Object3D
obj3d._typename = "THREE.Mesh";
if (obj3d) {
// MT ??? why?, it can really be anything, even just container Object3D
obj3d._typename = "THREE.Mesh";
// add reference to a streamed eve element to obj3d
obj3d.eve_el = elem;
// add reference to a streamed eve element to obj3d
obj3d.eve_el = elem;
// SL: this is just identifier for highlight, required to show items on other places, set in creator
obj3d.geo_object = elem.fMasterId || elem.fElementId;
obj3d.geo_name = elem.fName; // used for highlight
obj3d.scene = this; // required for get changes when highlight/selection is changed
// SL: this is just identifier for highlight, required to show items on other places, set in creator
obj3d.geo_object = elem.fMasterId || elem.fElementId;
obj3d.geo_name = elem.fName; // used for highlight
obj3d.scene = this; // required for get changes when highlight/selection is changed
if (elem.render_data.matrix)
{
obj3d.matrixAutoUpdate = false;
obj3d.matrix.fromArray( elem.render_data.matrix );
obj3d.updateMatrixWorld(true);
}
if (elem.render_data.matrix) {
obj3d.matrixAutoUpdate = false;
obj3d.matrix.fromArray(elem.render_data.matrix);
obj3d.updateMatrixWorld(true);
}
return obj3d;
return obj3d;
}
}
catch (e) {
console.error("makeGLRepresentation", e);
}
}
......@@ -197,28 +199,32 @@ sap.ui.define(['rootui5/eve7/lib/EveManager'], function(EveManager) {
if (el.fMasterId) this.mid2obj_map.set(el.fMasterId, obj3d);
}
EveScene.prototype.replaceElement = function(el)
{
if ( ! this.glctrl) return;
EveScene.prototype.replaceElement = function (el) {
if (!this.glctrl) return;
let obj3d = this.getObj3D(el.fElementId);
let all_ancestor_children_visible = obj3d.all_ancestor_children_visible;
let visible = obj3d.visible;
try {
let obj3d = this.getObj3D(el.fElementId);
let all_ancestor_children_visible = obj3d.all_ancestor_children_visible;
let visible = obj3d.visible;
let container = this.glctrl.getSceneContainer("scene" + this.id);
let container = this.glctrl.getSceneContainer("scene" + this.id);
container.remove(obj3d);
container.remove(obj3d);
obj3d = this.makeGLRepresentation(el);
obj3d.all_ancestor_children_visible = all_ancestor_children_visible;
obj3d.visible = visible;
container.add(obj3d);
obj3d = this.makeGLRepresentation(el);
obj3d.all_ancestor_children_visible = all_ancestor_children_visible;
obj3d.visible = visible;
container.add(obj3d);
this.id2obj_map.set(el.fElementId, obj3d);
if (el.fMasterId) this.mid2obj_map.set(el.fMasterId, obj3d);
this.id2obj_map.set(el.fElementId, obj3d);
if (el.fMasterId) this.mid2obj_map.set(el.fMasterId, obj3d);
this.glctrl.viewer.render();
this.glctrl.viewer.render();
}
catch (e) {
console.error("replace element", e);
}
}
EveScene.prototype.elementRemoved = function()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment