@sapui5/sap.ui.vbm 1.124.0 → 1.126.0
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/package.json +1 -1
- package/src/sap/ui/vbm/.library +8 -1
- package/src/sap/ui/vbm/Adapter.js +1 -1
- package/src/sap/ui/vbm/Adapter3D.js +65 -15
- package/src/sap/ui/vbm/AnalyticMap.js +14 -6
- package/src/sap/ui/vbm/GeoMap.js +15 -1
- package/src/sap/ui/vbm/Viewport.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ColladaBounds.js +123 -0
- package/src/sap/ui/vbm/adapter3d/DragDropHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +38 -2
- package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +1 -1
- package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/RectangleTracker.js +606 -0
- package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +1 -1
- package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +1 -1
- package/src/sap/ui/vbm/i18n/messagebundle_sh.properties +5 -5
- package/src/sap/ui/vbm/lib/sapresources.js +1 -8
- package/src/sap/ui/vbm/lib/sapscene.js +6 -6
- package/src/sap/ui/vbm/lib/saputilities.js +0 -4
- package/src/sap/ui/vbm/lib/sapvobase.js +0 -2
- package/src/sap/ui/vbm/library.js +2 -4
- package/src/sap/ui/vbm/themes/sap_belize/library.source.less +10 -1
- package/src/sap/ui/vbm/themes/sap_belize_base/AnalyticMap.less +8 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/Cluster.less +136 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/ContainerBase.less +45 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/ContainerLegendItem.less +46 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/DetailWindow.less +42 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/GeoMap.less +8 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/ListPanel.less +43 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/ListPanelStack.less +30 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/MapContainer.less +210 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/VBI.less +829 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/Viewport.less +17 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/library.source.less +18 -0
- package/src/sap/ui/vbm/themes/sap_belize_base/shared.less +9 -0
- package/src/sap/ui/vbm/themes/sap_belize_hcb/library.source.less +10 -1
- package/src/sap/ui/vbm/themes/sap_belize_hcw/library.source.less +10 -1
- package/src/sap/ui/vbm/themes/sap_hcb/base_AnalyticMap.less +8 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_Cluster.less +136 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_ContainerBase.less +45 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_ContainerLegendItem.less +46 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_DetailWindow.less +42 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_GeoMap.less +8 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_ListPanel.less +43 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_ListPanelStack.less +30 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_MapContainer.less +210 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_VBI.less +829 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_Viewport.less +17 -0
- package/src/sap/ui/vbm/themes/sap_hcb/base_shared.less +9 -0
- package/src/sap/ui/vbm/themes/sap_hcb/library.source.less +24 -1
package/package.json
CHANGED
package/src/sap/ui/vbm/.library
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<name>sap.ui.vbm</name>
|
|
4
4
|
<vendor>SAP SE</vendor>
|
|
5
5
|
<copyright>SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved</copyright>
|
|
6
|
-
<version>1.
|
|
6
|
+
<version>1.126.0</version>
|
|
7
7
|
|
|
8
8
|
<documentation>SAP UI library: sap.ui.vbm</documentation>
|
|
9
9
|
|
|
@@ -22,6 +22,13 @@
|
|
|
22
22
|
</dependencies>
|
|
23
23
|
|
|
24
24
|
<appData>
|
|
25
|
+
<manifest xmlns="http://www.sap.com/ui5/buildext/manifest">
|
|
26
|
+
<sap.ui5>
|
|
27
|
+
<library>
|
|
28
|
+
<i18n>i18n/messagebundle.properties</i18n>
|
|
29
|
+
</library>
|
|
30
|
+
</sap.ui5>
|
|
31
|
+
</manifest>
|
|
25
32
|
<!-- package name for selenium -->
|
|
26
33
|
<selenium xmlns="http://www.sap.com/ui5/buildext/selenium"
|
|
27
34
|
package="com.sap.ui5.selenium.vbm"
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
23
23
|
* @param {object} [mSettings] initial settings for the new object
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.126.0
|
|
26
26
|
* @extends sap.ui.core.Element
|
|
27
27
|
* @constructor
|
|
28
28
|
* @public
|
|
@@ -15,6 +15,8 @@ sap.ui.define([
|
|
|
15
15
|
"./adapter3d/SceneBuilder",
|
|
16
16
|
"./adapter3d/Utilities",
|
|
17
17
|
"./adapter3d/DragDropHandler",
|
|
18
|
+
"./adapter3d/RectangleTracker",
|
|
19
|
+
"./adapter3d/ColladaBounds",
|
|
18
20
|
"sap/m/HBox",
|
|
19
21
|
"sap/m/VBox",
|
|
20
22
|
"sap/m/Link",
|
|
@@ -25,7 +27,7 @@ sap.ui.define([
|
|
|
25
27
|
"sap/base/Log",
|
|
26
28
|
"jquery.sap.global",
|
|
27
29
|
"./library"
|
|
28
|
-
], function(Element, Observer, Menu, MenuItem, Popover, Viewport, ObjectFactory, Parser, SceneBuilder, Utilities, DragDropHandler, HBox, VBox, Link, Button, Text, Image, THREE, Log, jQuery, library) {
|
|
30
|
+
], function(Element, Observer, Menu, MenuItem, Popover, Viewport, ObjectFactory, Parser, SceneBuilder, Utilities, DragDropHandler, RectangleTracker,ColladaBounds, HBox, VBox, Link, Button, Text, Image, THREE, Log, jQuery, library) {
|
|
29
31
|
"use strict";
|
|
30
32
|
|
|
31
33
|
var Vector2 = THREE.Vector2;
|
|
@@ -45,7 +47,7 @@ sap.ui.define([
|
|
|
45
47
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
46
48
|
* @param {object} [mSettings] initial settings for the new object
|
|
47
49
|
* @author SAP SE
|
|
48
|
-
* @version 1.
|
|
50
|
+
* @version 1.126.0
|
|
49
51
|
* @extends sap.ui.core.Element
|
|
50
52
|
* @constructor
|
|
51
53
|
* @public
|
|
@@ -231,6 +233,13 @@ sap.ui.define([
|
|
|
231
233
|
|
|
232
234
|
// Drag and drop handler
|
|
233
235
|
this._dragDropHandler = null;
|
|
236
|
+
|
|
237
|
+
this._rectangleTracker = null;
|
|
238
|
+
|
|
239
|
+
this._colladaBounds = null;
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
// this._lassoTracker = null;
|
|
234
243
|
};
|
|
235
244
|
|
|
236
245
|
Adapter3D.prototype.exit = function() {
|
|
@@ -255,6 +264,15 @@ sap.ui.define([
|
|
|
255
264
|
this._dragDropHandler = null;
|
|
256
265
|
}
|
|
257
266
|
|
|
267
|
+
if (this._rectangleTracker) {
|
|
268
|
+
this._rectangleTracker = null;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (this._colladaBounds) {
|
|
272
|
+
this._colladaBounds.destroy();
|
|
273
|
+
this._colladaBounds = null;
|
|
274
|
+
}
|
|
275
|
+
|
|
258
276
|
if (this._sceneBuilder) {
|
|
259
277
|
this._sceneBuilder.destroy();
|
|
260
278
|
this._sceneBuilder = null;
|
|
@@ -308,6 +326,16 @@ sap.ui.define([
|
|
|
308
326
|
this._viewportObserver.observe(this._viewport, { destroy: true });
|
|
309
327
|
this._viewport.addEventDelegate(viewportEventDelegate, this);
|
|
310
328
|
this._dragDropHandler = new DragDropHandler(this);
|
|
329
|
+
this._colladaBounds = new ColladaBounds(this);
|
|
330
|
+
this._rectangleTracker = new RectangleTracker(this);
|
|
331
|
+
// // this._lassoTracker = new LassoTracker(this);
|
|
332
|
+
// if(rectangleSelect)
|
|
333
|
+
|
|
334
|
+
// if(lassoSelect && !rectangleSelect)
|
|
335
|
+
// {
|
|
336
|
+
// this._lassoSelect = "created";
|
|
337
|
+
// console.log(this._lassoSelect);
|
|
338
|
+
// }
|
|
311
339
|
}
|
|
312
340
|
};
|
|
313
341
|
|
|
@@ -319,7 +347,9 @@ sap.ui.define([
|
|
|
319
347
|
if (this._viewport) {
|
|
320
348
|
this._dragDropHandler.destroy();
|
|
321
349
|
this._dragDropHandler = null;
|
|
322
|
-
|
|
350
|
+
this._colladaBounds = null;
|
|
351
|
+
this._rectangleTracker = null;
|
|
352
|
+
// this._lassoTracker = null;
|
|
323
353
|
this._viewport.removeEventDelegate(viewportEventDelegate);
|
|
324
354
|
// onBeforeRendering unsubscribes from DOM events.
|
|
325
355
|
viewportEventDelegate.onBeforeRendering.call(this);
|
|
@@ -393,13 +423,14 @@ sap.ui.define([
|
|
|
393
423
|
that._update = that._update
|
|
394
424
|
.then(function() {
|
|
395
425
|
that._parser.loadVBIJSON(payload);
|
|
426
|
+
|
|
396
427
|
return that._sceneBuilder.synchronize();
|
|
397
428
|
})
|
|
398
429
|
.then(function() {
|
|
399
430
|
// further processing after scene(s) has been updated
|
|
400
431
|
that._processAutomation(payload);
|
|
401
432
|
that._processDetailWindow();
|
|
402
|
-
|
|
433
|
+
// that._createCollada(payload);
|
|
403
434
|
// check if last hover instance is still exist (it may be erased during update)
|
|
404
435
|
that._context.voQueues.toRemove.forEach(function(instances) {
|
|
405
436
|
instances.forEach(function(instance) {
|
|
@@ -409,11 +440,16 @@ sap.ui.define([
|
|
|
409
440
|
}, that);
|
|
410
441
|
}, that);
|
|
411
442
|
|
|
443
|
+
|
|
444
|
+
if (that._colladaBounds) {
|
|
445
|
+
that._colladaBounds.initialize();
|
|
446
|
+
}
|
|
447
|
+
|
|
412
448
|
// update drag and drop handler
|
|
413
449
|
if (that._dragDropHandler) {
|
|
414
450
|
that._dragDropHandler.update();
|
|
415
451
|
}
|
|
416
|
-
|
|
452
|
+
|
|
417
453
|
// scene has changed -> adjust camera clipping planes
|
|
418
454
|
that._viewport._resetBBox();
|
|
419
455
|
that._viewport._updateCamera();
|
|
@@ -426,9 +462,10 @@ sap.ui.define([
|
|
|
426
462
|
that._viewport.setBusy(false);
|
|
427
463
|
});
|
|
428
464
|
// return last promise in chain
|
|
465
|
+
|
|
429
466
|
return that._update;
|
|
430
467
|
};
|
|
431
|
-
|
|
468
|
+
|
|
432
469
|
Adapter3D.prototype._processDetailWindow = function(payload) {
|
|
433
470
|
// show first only detail window from toAdd queue
|
|
434
471
|
// ignore all other detail windows as we can show only one at a time in compare to ActiveX implementation
|
|
@@ -935,14 +972,14 @@ sap.ui.define([
|
|
|
935
972
|
|
|
936
973
|
Adapter3D.prototype._handleHover = function(event) {
|
|
937
974
|
var tooltip;
|
|
938
|
-
var instance = event
|
|
939
|
-
Log.trace("hover", "x: " + event.cursor.x + ", y: " + event.cursor.y + ", instance: " + (instance ? instance.id : "") + ", tooltip: " + (instance ? instance.tooltip : ""), thisModule);
|
|
940
|
-
if (instance) {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
975
|
+
var instance = event || null;
|
|
976
|
+
// Log.trace("hover", "x: " + event.cursor.x + ", y: " + event.cursor.y + ", instance: " + (instance ? instance.id : "") + ", tooltip: " + (instance ? instance.tooltip : ""), thisModule);
|
|
977
|
+
// if (instance) {
|
|
978
|
+
// tooltip = instance.tooltip;
|
|
979
|
+
// if (!tooltip) {
|
|
980
|
+
// tooltip = instance.text;
|
|
981
|
+
// }
|
|
982
|
+
// }
|
|
946
983
|
var domRef = this._viewport.getDomRef();
|
|
947
984
|
if (domRef) {
|
|
948
985
|
if (tooltip) {
|
|
@@ -961,7 +998,9 @@ sap.ui.define([
|
|
|
961
998
|
}.bind(this), 500);
|
|
962
999
|
|
|
963
1000
|
this._hoverInstance = instance;
|
|
964
|
-
this._sceneBuilder
|
|
1001
|
+
if (this._sceneBuilder) {
|
|
1002
|
+
this._sceneBuilder.updateHotInstance(this._hoverInstance);
|
|
1003
|
+
}
|
|
965
1004
|
}
|
|
966
1005
|
};
|
|
967
1006
|
|
|
@@ -1245,7 +1284,18 @@ sap.ui.define([
|
|
|
1245
1284
|
return {
|
|
1246
1285
|
selected: selected,
|
|
1247
1286
|
deselected: deselected
|
|
1287
|
+
}
|
|
1248
1288
|
};
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
Adapter3D.prototype.enableRectangularSelection = function() {
|
|
1292
|
+
this._rectangleTracker = new RectangleTracker(this);
|
|
1293
|
+
this._rectangleTracker._createEvent();
|
|
1294
|
+
|
|
1295
|
+
};
|
|
1296
|
+
|
|
1297
|
+
Adapter3D.prototype.disableRectangularSelection = function() {
|
|
1298
|
+
this._rectangleTracker._destroy();
|
|
1249
1299
|
};
|
|
1250
1300
|
|
|
1251
1301
|
return Adapter3D;
|
|
@@ -271,7 +271,7 @@ sap.ui.define([
|
|
|
271
271
|
// load the geojson trying different location.............................//
|
|
272
272
|
// first the explicit path, second abap third the default.................//
|
|
273
273
|
|
|
274
|
-
var oData = null, aPathGeoJSON = [],
|
|
274
|
+
var oData = null, aPathGeoJSON = [], sPathGeoJSON = "";
|
|
275
275
|
|
|
276
276
|
// build array of URLs to check for source JSON in the prioritized order
|
|
277
277
|
aPathGeoJSON[0] = AnalyticMap.GeoJSONURL; // explicit specified
|
|
@@ -284,11 +284,19 @@ sap.ui.define([
|
|
|
284
284
|
for (var mI = 0; mI < 3; ++mI) {
|
|
285
285
|
sPathGeoJSON = aPathGeoJSON[mI];
|
|
286
286
|
if (!oData && sPathGeoJSON) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
287
|
+
|
|
288
|
+
var xhr = new XMLHttpRequest();
|
|
289
|
+
|
|
290
|
+
xhr.open("GET", sPathGeoJSON, false); // set 'false' to make it synchronous
|
|
291
|
+
xhr.send();
|
|
292
|
+
|
|
293
|
+
if (xhr.status === 200) {
|
|
294
|
+
oData = JSON.parse(xhr.responseText);
|
|
295
|
+
} else {
|
|
296
|
+
// Handle error
|
|
297
|
+
console.error('An error occurred:', xhr.status, xhr.statusText);
|
|
298
|
+
}
|
|
299
|
+
|
|
292
300
|
// else: JSON not found under current URL -> try next
|
|
293
301
|
}
|
|
294
302
|
}
|
package/src/sap/ui/vbm/GeoMap.js
CHANGED
|
@@ -2132,7 +2132,21 @@ sap.ui.define([
|
|
|
2132
2132
|
}
|
|
2133
2133
|
if (GeoMap.bEncodedSpotImagesAvailable == false) {
|
|
2134
2134
|
var aPathImgJSON = sap.ui.require.toUrl("sap/ui/vbm/themes/base/img/Pin_images.json");
|
|
2135
|
-
var oResponse = jQuery.sap.syncGetJSON(aPathImgJSON);
|
|
2135
|
+
//var oResponse = jQuery.sap.syncGetJSON(aPathImgJSON);
|
|
2136
|
+
var xhr = new XMLHttpRequest();
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
xhr.open("GET", aPathImgJSON, false); // set 'false' to make it synchronous
|
|
2140
|
+
xhr.send();
|
|
2141
|
+
|
|
2142
|
+
if (xhr.status === 200) {
|
|
2143
|
+
var oResponse = JSON.parse(xhr.responseText);
|
|
2144
|
+
//oData = oResponse.data;
|
|
2145
|
+
} else {
|
|
2146
|
+
// Handle error
|
|
2147
|
+
console.error('An error occurred:', xhr.status, xhr.statusText);
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2136
2150
|
GeoMap.bEncodedSpotImageData = oResponse.data;
|
|
2137
2151
|
GeoMap.bEncodedSpotImagesAvailable = true;
|
|
2138
2152
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Provides class sap.ui.vbm.adapter3d.DragDropHandler
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/ui/base/Object",
|
|
8
|
+
"./Utilities",
|
|
9
|
+
"./thirdparty/three",
|
|
10
|
+
"sap/base/Log"
|
|
11
|
+
], function (BaseObject, Utilities, THREE, Log) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
var instances = {}, objects = {};
|
|
15
|
+
var count = 0;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Constructor for a new ColladaBounds.
|
|
19
|
+
*
|
|
20
|
+
* @class
|
|
21
|
+
* Provides a class for creating Bounding Box for Collada Objects.
|
|
22
|
+
*
|
|
23
|
+
* @private
|
|
24
|
+
* @author SAP SE
|
|
25
|
+
* @version 1.126.0
|
|
26
|
+
* @alias sap.ui.vbm.adapter3d.ColladaBounds
|
|
27
|
+
*/
|
|
28
|
+
var ColladaBounds = BaseObject.extend("sap.ui.vbm.adapter3d.ColladaBounds", /** @lends sap.ui.vbm.adapter3d.ColladaBounds.prototype */ {
|
|
29
|
+
|
|
30
|
+
constructor: function (adapter) {
|
|
31
|
+
BaseObject.call(this);
|
|
32
|
+
|
|
33
|
+
this._adapter = adapter; // fire submit event
|
|
34
|
+
this._context = adapter._context; // access evaluated data
|
|
35
|
+
this._viewport = adapter._viewport; // events
|
|
36
|
+
this._root = this._viewport._root;
|
|
37
|
+
this._scene = this._viewport._scene;
|
|
38
|
+
this._camera = this._viewport._camera;
|
|
39
|
+
this._cameraControls = this._viewport._cameraController;
|
|
40
|
+
this._bbox = new THREE.Box3();
|
|
41
|
+
this._colladaBoundingBoxes = [];
|
|
42
|
+
this._adapter._colladaBoundingBoxMesh = [];
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
ColladaBounds.prototype.initialize = function () {
|
|
50
|
+
var that = this;
|
|
51
|
+
this._scene._cm.forEach(function (array, key) {
|
|
52
|
+
for (var i = 0; i < array.length; i++) {
|
|
53
|
+
var a = array[i];
|
|
54
|
+
instances = Array.from(a.instances);
|
|
55
|
+
objects = Array.from(a.objects3D);
|
|
56
|
+
count = a.hitInfo[0].matrices.length;
|
|
57
|
+
that.transform(instances, objects, count);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
ColladaBounds.prototype.transform = function (instances, objects, count) {
|
|
63
|
+
var i, j, id;
|
|
64
|
+
var _matrix = new THREE.Matrix4();
|
|
65
|
+
|
|
66
|
+
for (j = 0; j < instances.length; j++) {
|
|
67
|
+
for (i = 0; i < objects.length; i++) {
|
|
68
|
+
var object = objects[i];
|
|
69
|
+
var geometry = object.geometry;
|
|
70
|
+
object.updateMatrixWorld(false, false);
|
|
71
|
+
if (object.visible && geometry) {
|
|
72
|
+
if (!geometry.boundingBox) {
|
|
73
|
+
geometry.computeBoundingBox();
|
|
74
|
+
}
|
|
75
|
+
// if instanced mesh -> take all instances into account
|
|
76
|
+
if (object.isInstancedMesh) {
|
|
77
|
+
geometry = object.geometry.clone();
|
|
78
|
+
object.getMatrixAt(j, _matrix);
|
|
79
|
+
id = instances[j].instance;
|
|
80
|
+
geometry.applyMatrix4(_matrix);
|
|
81
|
+
this.createBBoxMeshes(geometry, object, count, id);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
ColladaBounds.prototype.createBBoxMeshes = function (geometry, object, count, id) {
|
|
89
|
+
if (id["VB:c"] == "true" && object.userData._sapInstance != undefined) {
|
|
90
|
+
var _sapInstance = id;
|
|
91
|
+
var material = new THREE.MeshBasicMaterial({ color: 0x808080, transparent: true, wireframe: true, opacity: 1, visible: false });
|
|
92
|
+
|
|
93
|
+
// Create the mesh using the geometry and material
|
|
94
|
+
var boundingBoxMesh = new THREE.Mesh(geometry, material);
|
|
95
|
+
var world = this._root.matrixWorld.clone();
|
|
96
|
+
boundingBoxMesh.applyMatrix4(world);
|
|
97
|
+
boundingBoxMesh.scale.set(1, 1, 1);
|
|
98
|
+
boundingBoxMesh.rotation.set(0, 0, 0);
|
|
99
|
+
boundingBoxMesh.updateMatrixWorld();
|
|
100
|
+
boundingBoxMesh.userData = { name: "ColladaBounds", _sapInstance: _sapInstance, id: _sapInstance.id, count: count };
|
|
101
|
+
this._adapter._colladaBoundingBoxMesh.push(boundingBoxMesh);
|
|
102
|
+
// Add the bounding box mesh to the scene
|
|
103
|
+
this._scene.add(boundingBoxMesh);
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
ColladaBounds.prototype._destroy = function () {
|
|
109
|
+
this._adapter = null; // fire submit event
|
|
110
|
+
this._context = null; // access evaluated data
|
|
111
|
+
this._viewport = null; // events
|
|
112
|
+
this._root = null;
|
|
113
|
+
this._scene = null;
|
|
114
|
+
this._camera = null;
|
|
115
|
+
this._cameraControls =null;
|
|
116
|
+
this._bbox = null;
|
|
117
|
+
this._colladaBoundingBoxes = null;
|
|
118
|
+
this._adapter._colladaBoundingBoxMesh = null;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return ColladaBounds;
|
|
122
|
+
})
|
|
123
|
+
|
|
@@ -83,7 +83,7 @@ sap.ui.define([
|
|
|
83
83
|
*
|
|
84
84
|
* @private
|
|
85
85
|
* @author SAP SE
|
|
86
|
-
* @version 1.
|
|
86
|
+
* @version 1.126.0
|
|
87
87
|
* @alias sap.ui.vbm.adapter3d.DragDropHandler
|
|
88
88
|
*/
|
|
89
89
|
var DragDropHandler = BaseObject.extend("sap.ui.vbm.adapter3d.DragDropHandler", /** @lends sap.ui.vbm.adapter3d.DragDropHandler.prototype */ {
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
*
|
|
30
30
|
* @private
|
|
31
31
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.126.0
|
|
33
33
|
* @alias sap.ui.vbm.adapter3d.ModelHandler
|
|
34
34
|
*/
|
|
35
35
|
var ModelHandler = BaseObject.extend("sap.ui.vbm.adapter3d.ModelHandler", /** @lends sap.ui.vbm.adapter3d.ModelHandler.prototype */ {
|
|
@@ -76,6 +76,8 @@ sap.ui.define([
|
|
|
76
76
|
// key(instance resource + instance color) -> 'meta' mesh data
|
|
77
77
|
this._meshes = new Map();
|
|
78
78
|
|
|
79
|
+
this._scene._cm = new Map();
|
|
80
|
+
|
|
79
81
|
// These objects are created on first use
|
|
80
82
|
this._colladaLoader = null;
|
|
81
83
|
this._glTFLoader = null;
|
|
@@ -286,7 +288,8 @@ sap.ui.define([
|
|
|
286
288
|
for (var i = 0; i < array.length;) {
|
|
287
289
|
if (array[i].dirty) {
|
|
288
290
|
var j, instance, index = 0, data = array[i];
|
|
289
|
-
|
|
291
|
+
// var _matrix = new THREE.Matrix4();
|
|
292
|
+
var _matrix = [];
|
|
290
293
|
// delete current instanced meshes from scene
|
|
291
294
|
data.objects3D.forEach(function(object) {
|
|
292
295
|
this._deleteObject3D(object);
|
|
@@ -301,10 +304,43 @@ sap.ui.define([
|
|
|
301
304
|
mesh.matrixAutoUpdate = false;
|
|
302
305
|
mesh.layers.set(0); // put it to layer #0 to enable raycasting
|
|
303
306
|
mesh._instanceHitTest = this._instanceHitTest.bind(data); // helper function to return instance based on hit test info
|
|
307
|
+
// mesh.userData = {_sapInstance : data.instance};
|
|
304
308
|
this._scene.add(mesh);
|
|
305
309
|
data.objects3D.push(mesh);
|
|
306
310
|
}, this);
|
|
307
311
|
|
|
312
|
+
|
|
313
|
+
var val = this._meshes.get(key);
|
|
314
|
+
delete val.model;
|
|
315
|
+
this._scene._cm.set(key,val);
|
|
316
|
+
|
|
317
|
+
var _sapInstance = [], matrix = [];
|
|
318
|
+
data.instances.forEach(function(value) {
|
|
319
|
+
instance = value.instance;
|
|
320
|
+
// _matrix = value.world;
|
|
321
|
+
_matrix = value.matrices.length
|
|
322
|
+
_sapInstance.push(instance);
|
|
323
|
+
matrix.push(_matrix);
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
//commmented earlier
|
|
327
|
+
// data.instances.forEach(function(value){
|
|
328
|
+
// data.objects3D[0].userData = {_sapInstance : _sapInstance ,
|
|
329
|
+
// matrix : matrix};
|
|
330
|
+
// })
|
|
331
|
+
|
|
332
|
+
data.objects3D.forEach(function(value) {
|
|
333
|
+
value.userData = {_sapInstance : _sapInstance,
|
|
334
|
+
matrix : matrix
|
|
335
|
+
};
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
// data.objects3D.forEach(function(value){
|
|
339
|
+
|
|
340
|
+
// value.userData = {_sapInstance : _sapInstance,
|
|
341
|
+
// matrix : matrix};
|
|
342
|
+
// })
|
|
343
|
+
|
|
308
344
|
data.instances.forEach(function(value) {
|
|
309
345
|
instance = value;
|
|
310
346
|
data.hitInfo.push(instance);
|
|
@@ -377,7 +377,7 @@ sap.ui.define([
|
|
|
377
377
|
*
|
|
378
378
|
* @private
|
|
379
379
|
* @author SAP SE
|
|
380
|
-
* @version 1.
|
|
380
|
+
* @version 1.126.0
|
|
381
381
|
* @alias sap.ui.vbm.adapter3d.ObjectFactory
|
|
382
382
|
*/
|
|
383
383
|
var ObjectFactory = BaseObject.extend("sap.ui.vbm.adapter3d.ObjectFactory", /** @lends sap.ui.vbm.adapter3d.ObjectFactory.prototype */ {});
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
*
|
|
33
33
|
* @private
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.126.0
|
|
36
36
|
* @alias sap.ui.vbm.adapter3d.PolygonHandler
|
|
37
37
|
*/
|
|
38
38
|
var PolygonHandler = BaseObject.extend("sap.ui.vbm.adapter3d.PolygonHandler", /** @lends sap.ui.vbm.adapter3d.PolygonHandler.prototype */ {
|