@@ -184,7 +184,30 @@ sap.ui.define([
184184 // masterid used as identifier, no any recursions
185185 this . geo_painter . HighlightMesh ( null , null , masterid , null , true ) ;
186186 } ,
187+ makeGLRepresentation : function ( elem )
188+ {
189+ var fname = elem . render_data . rnr_func ;
190+ var obj3d = this . creator [ fname ] ( elem , elem . render_data ) ;
191+ if ( obj3d ) {
192+ obj3d . _typename = "THREE.Mesh" ;
193+
194+ // SL: this is just identifier for highlight, required to show items on other places
195+ obj3d . geo_object = elem . fMasterId || elem . fElementId ;
187196
197+ //AMT: reference needed in MIR callback
198+ obj3d . eveId = elem . fElementId ;
199+
200+ obj3d . geo_name = elem . fName ; // used for highlight
201+ obj3d . hightlightLineWidth = 3 ;
202+ obj3d . normalLineWidth = 1 ;
203+ if ( elem . render_data . matrix ) {
204+ obj3d . matrixAutoUpdate = false ;
205+ obj3d . matrix . fromArray ( elem . render_data . matrix ) ;
206+ obj3d . updateMatrixWorld ( true ) ;
207+ }
208+ return obj3d ;
209+ }
210+ } ,
188211 createExtras : function ( arr , toplevel ) {
189212 if ( ! arr ) return ;
190213 for ( var k = 0 ; k < arr . length ; ++ k ) {
@@ -194,30 +217,11 @@ sap.ui.define([
194217 if ( ! this . creator [ fname ] ) {
195218 console . error ( "Function " + fname + " missing in creator" ) ;
196219 } else {
197- // console.log("creating ", fname);
198- obj3d = this . creator [ fname ] ( elem , elem . render_data ) ;
199- }
200- if ( obj3d ) {
201- obj3d . _typename = "THREE.Mesh" ;
202-
203- // SL: this is just identifier for highlight, required to show items on other places
204- obj3d . geo_object = elem . fMasterId || elem . fElementId ;
205-
206- //AMT: reference needed in MIR callback
207- // obj3d.geo_object = elem.fElementId;
208-
209- obj3d . geo_name = elem . fName ; // used for highlight
210- obj3d . hightlightLineWidth = 3 ;
211- obj3d . normalLineWidth = 1 ;
212- if ( elem . render_data . matrix ) {
213- obj3d . matrixAutoUpdate = false ;
214- obj3d . matrix . fromArray ( elem . render_data . matrix ) ;
215- obj3d . updateMatrixWorld ( true ) ;
216- }
217- this . geo_painter . addExtra ( obj3d ) ;
220+ var obj3d = this . makeGLRepresentation ( elem ) ;
221+ if ( obj3d )
222+ this . geo_painter . addExtra ( obj3d ) ;
218223 }
219224 }
220-
221225 this . createExtras ( elem . childs ) ;
222226 }
223227 } ,
@@ -254,27 +258,19 @@ sap.ui.define([
254258 }
255259 }
256260 this . geo_painter . getExtrasContainer ( ) . remove ( mesh ) ;
257-
258-
259- var fname = el . render_data . rnr_func , obj3d = null ;
260- var obj3d = this . creator [ fname ] ( el , el . render_data ) ;
261+ var obj3d = this . makeGLRepresentation ( el ) ;
261262 if ( obj3d ) {
262- obj3d . _typename = "THREE.Mesh" ;
263- obj3d . geo_object = el . fElementId ; //AMT reference needed in MIR callback
264- obj3d . geo_name = el . fName ; // used for highlight
265- obj3d . hightlightLineWidth = 3 ;
266- obj3d . normalLineWidth = 1 ;
267263 this . geo_painter . addExtra ( obj3d ) ;
268264 this . geo_painter . getExtrasContainer ( ) . add ( obj3d ) ;
269265 }
270266 this . geo_painter . Render3D ( - 1 ) ;
271267 } ,
272268
273269 getMesh : function ( elementId ) {
274- if ( this . geo_painter ) {
270+ if ( this . geo_painter && this . geo_painter . _extraObjects ) {
275271 var ex = this . geo_painter . _extraObjects ;
276- for ( var i = 0 ; i < ex ? ex . arr . length : 0 ; ++ i ) {
277- if ( ex . arr [ i ] . geo_object == elementId )
272+ for ( var i = 0 ; i < ex . arr . length ; ++ i ) {
273+ if ( ex . arr [ i ] . eveId == elementId )
278274 return ex . arr [ i ] ;
279275 }
280276 }
0 commit comments