@sapui5/sap.ui.vbm 1.84.6 → 1.84.9
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 +1 -1
- package/src/sap/ui/vbm/Adapter.js +46 -8
- package/src/sap/ui/vbm/Adapter3D.js +5 -2
- package/src/sap/ui/vbm/AnalyticMap.js +1 -1
- package/src/sap/ui/vbm/AnalyticMapRenderer.js +1 -1
- package/src/sap/ui/vbm/Area.js +1 -1
- package/src/sap/ui/vbm/Areas.js +1 -1
- package/src/sap/ui/vbm/Box.js +1 -1
- package/src/sap/ui/vbm/Boxes.js +1 -1
- package/src/sap/ui/vbm/Circle.js +1 -1
- package/src/sap/ui/vbm/Circles.js +1 -1
- package/src/sap/ui/vbm/Cluster.js +1 -1
- package/src/sap/ui/vbm/ClusterBase.js +3 -3
- package/src/sap/ui/vbm/ClusterContainer.js +1 -1
- package/src/sap/ui/vbm/ClusterDistance.js +1 -1
- package/src/sap/ui/vbm/ClusterGrid.js +1 -1
- package/src/sap/ui/vbm/ClusterRenderer.js +1 -1
- package/src/sap/ui/vbm/ClusterTree.js +1 -1
- package/src/sap/ui/vbm/Container.js +1 -1
- package/src/sap/ui/vbm/Containers.js +1 -1
- package/src/sap/ui/vbm/DragSource.js +1 -1
- package/src/sap/ui/vbm/DropTarget.js +1 -1
- package/src/sap/ui/vbm/Feature.js +1 -1
- package/src/sap/ui/vbm/FeatureCollection.js +1 -1
- package/src/sap/ui/vbm/GeoCircle.js +1 -1
- package/src/sap/ui/vbm/GeoCircles.js +1 -1
- package/src/sap/ui/vbm/GeoJsonLayer.js +1 -1
- package/src/sap/ui/vbm/GeoMap.js +16 -6
- package/src/sap/ui/vbm/GeoMapRenderer.js +1 -1
- package/src/sap/ui/vbm/HeatPoint.js +1 -1
- package/src/sap/ui/vbm/Heatmap.js +1 -1
- package/src/sap/ui/vbm/Legend.js +1 -1
- package/src/sap/ui/vbm/LegendItem.js +1 -1
- package/src/sap/ui/vbm/Pie.js +1 -1
- package/src/sap/ui/vbm/PieItem.js +1 -1
- package/src/sap/ui/vbm/Pies.js +1 -1
- package/src/sap/ui/vbm/Region.js +1 -1
- package/src/sap/ui/vbm/Resource.js +1 -1
- package/src/sap/ui/vbm/Route.js +1 -1
- package/src/sap/ui/vbm/Routes.js +1 -1
- package/src/sap/ui/vbm/Spot.js +1 -1
- package/src/sap/ui/vbm/Spots.js +1 -1
- package/src/sap/ui/vbm/VBI.js +1 -1
- package/src/sap/ui/vbm/VBIRenderer.js +1 -1
- package/src/sap/ui/vbm/Viewport.js +8 -3
- package/src/sap/ui/vbm/ViewportRenderer.js +1 -1
- package/src/sap/ui/vbm/VoAbstract.js +1 -1
- package/src/sap/ui/vbm/VoAggregation.js +1 -1
- package/src/sap/ui/vbm/VoBase.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +26 -15
- package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +2 -2
- package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +32 -26
- package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +30 -17
- package/src/sap/ui/vbm/adapter3d/Utilities.js +1 -1
- package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +2 -2
- package/src/sap/ui/vbm/lib/sapscene.js +18 -12
- package/src/sap/ui/vbm/lib/saputilities.js +7 -7
- package/src/sap/ui/vbm/lib/sapvbi.js +1 -1
- package/src/sap/ui/vbm/lib/sapvobase.js +1 -1
- package/src/sap/ui/vbm/library.js +3 -3
- package/src/sap/ui/vbm/themes/base/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_belize/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_belize_plus/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_bluecrystal/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_fiori_3/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_fiori_3_dark/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_fiori_3_hcb/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_fiori_3_hcw/library.source.less +1 -1
- package/src/sap/ui/vbm/themes/sap_hcb/library.source.less +1 -1
package/src/sap/ui/vbm/VoBase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ! SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides class sap.ui.vbm.adapter3d.ModelHandler
|
|
@@ -31,9 +31,9 @@ sap.ui.define([
|
|
|
31
31
|
*
|
|
32
32
|
* @private
|
|
33
33
|
* @author SAP SE
|
|
34
|
-
* @version 1.84.
|
|
34
|
+
* @version 1.84.9
|
|
35
35
|
* @alias sap.ui.vbm.adapter3d.ModelHandler
|
|
36
|
-
*/
|
|
36
|
+
*/
|
|
37
37
|
var ModelHandler = BaseObject.extend("sap.ui.vbm.adapter3d.ModelHandler", /** @lends sap.ui.vbm.adapter3d.ModelHandler.prototype */ {
|
|
38
38
|
|
|
39
39
|
constructor: function(resources, textures, scene, root) {
|
|
@@ -96,11 +96,14 @@ sap.ui.define([
|
|
|
96
96
|
this._textures = null;
|
|
97
97
|
this._scene = null;
|
|
98
98
|
this._root = null;
|
|
99
|
+
this._hotInstance = null;
|
|
99
100
|
|
|
100
101
|
// destroy 'meta' meshes
|
|
101
|
-
this._meshes.forEach(function(
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
this._meshes.forEach(function(array) {
|
|
103
|
+
array.forEach(function(item) {
|
|
104
|
+
item.objects3D.forEach(function(object) {
|
|
105
|
+
this._deleteObject3D(object);
|
|
106
|
+
}, this);
|
|
104
107
|
}, this);
|
|
105
108
|
}, this);
|
|
106
109
|
|
|
@@ -110,15 +113,23 @@ sap.ui.define([
|
|
|
110
113
|
subRef(instance.texture);
|
|
111
114
|
}
|
|
112
115
|
});
|
|
113
|
-
|
|
116
|
+
|
|
114
117
|
// destroy models
|
|
115
118
|
this._models.forEach(function(model, resource) {
|
|
116
119
|
this._deleteModel(model);
|
|
117
120
|
}, this);
|
|
118
121
|
|
|
119
122
|
this._meshes.clear();
|
|
123
|
+
this._meshes = null;
|
|
124
|
+
|
|
120
125
|
this._instances.clear();
|
|
126
|
+
this._instances = null;
|
|
127
|
+
|
|
121
128
|
this._models.clear();
|
|
129
|
+
this._models = null;
|
|
130
|
+
|
|
131
|
+
this._glTFLoader = null;
|
|
132
|
+
this._colladaLoader = null;
|
|
122
133
|
|
|
123
134
|
BaseObject.prototype.destroy.call(this);
|
|
124
135
|
};
|
|
@@ -148,7 +159,7 @@ sap.ui.define([
|
|
|
148
159
|
* @param {object} instance Model instance.
|
|
149
160
|
* @public
|
|
150
161
|
*/
|
|
151
|
-
ModelHandler.prototype.updateInstance = function(instance) {
|
|
162
|
+
ModelHandler.prototype.updateInstance = function(instance) {
|
|
152
163
|
var data = this._instances.get(instance), update = false, hot = this._hotInstance && this._hotInstance === instance;
|
|
153
164
|
if (data) {
|
|
154
165
|
var normalized = Utilities.toBoolean(instance.normalize);
|
|
@@ -187,7 +198,7 @@ sap.ui.define([
|
|
|
187
198
|
}
|
|
188
199
|
update = true;
|
|
189
200
|
}
|
|
190
|
-
|
|
201
|
+
|
|
191
202
|
// when model normalization changed -> update model properties -> reset instance model matrices
|
|
192
203
|
if (propertyChanged(instance, ["normalize", "model"])) {
|
|
193
204
|
this._updateModel(data.model, normalized);
|
|
@@ -219,9 +230,9 @@ sap.ui.define([
|
|
|
219
230
|
if (data.matrices.length === 0) {
|
|
220
231
|
var world = this._root.matrixWorld.clone(); // start from the _root
|
|
221
232
|
world.multiply(data.world); // apply instance world matrix
|
|
222
|
-
|
|
233
|
+
|
|
223
234
|
// if instance normalized -> apply normalized model root matrix as otherwise (non normalized case) model root has identity matrix
|
|
224
|
-
if (normalized) {
|
|
235
|
+
if (normalized) {
|
|
225
236
|
world.multiply(data.model.normalized.world);
|
|
226
237
|
}
|
|
227
238
|
// apply individual mesh matrices from the model at last
|
|
@@ -255,7 +266,7 @@ sap.ui.define([
|
|
|
255
266
|
this._instances.delete(instance);
|
|
256
267
|
this._removeInstanceFromMesh(data);
|
|
257
268
|
instance._last = {}; // reset all LRU variables at once
|
|
258
|
-
|
|
269
|
+
|
|
259
270
|
if (data.model) {
|
|
260
271
|
subRef(data.model); // model can be null if removing 'broken' instance
|
|
261
272
|
}
|
|
@@ -430,7 +441,7 @@ sap.ui.define([
|
|
|
430
441
|
ModelHandler.prototype._postprocess = function(model, content) {
|
|
431
442
|
// mirror on Z axis entire collada root which is effectively the same as collada processing with baking transformations and inverting Z coordinates in ActiveX
|
|
432
443
|
model.scene.scale.set(1,1,-1);
|
|
433
|
-
|
|
444
|
+
|
|
434
445
|
var meshes = [], materials = new Set(), marked = "_sapUsed";
|
|
435
446
|
// collect meshes only + calculate world matrix, mark used materials & maps
|
|
436
447
|
model.scene.traverse(function(object) {
|
|
@@ -560,7 +571,7 @@ sap.ui.define([
|
|
|
560
571
|
// remove instanced mesh from scene
|
|
561
572
|
if (object.parent) {
|
|
562
573
|
object.parent.remove(object);
|
|
563
|
-
}
|
|
574
|
+
}
|
|
564
575
|
// geometries are shared -> cannot dispose
|
|
565
576
|
Utilities.toArray(object.material).forEach(function(material) {
|
|
566
577
|
material.dispose(); // materials are cloned -> can be disposed, maps are shared -> don't touch, cannot be disposes
|
|
@@ -584,7 +595,7 @@ sap.ui.define([
|
|
|
584
595
|
// target has to be added to _root to mimic original model and must have same world matrix as original model
|
|
585
596
|
// so we calculate world matrix for target which will be under _root and not under _scene as instance mesh
|
|
586
597
|
var world = data.world.clone(); // use instance world as starting point
|
|
587
|
-
if (data.model.normalized) {
|
|
598
|
+
if (data.model.normalized) {
|
|
588
599
|
world.multiply(data.model.normalized.world);
|
|
589
600
|
}
|
|
590
601
|
world.multiply(data.model.root.children[0].matrixWorld);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides the base visual object.
|
|
@@ -378,7 +378,7 @@ sap.ui.define([
|
|
|
378
378
|
*
|
|
379
379
|
* @private
|
|
380
380
|
* @author SAP SE
|
|
381
|
-
* @version 1.84.
|
|
381
|
+
* @version 1.84.9
|
|
382
382
|
* @alias sap.ui.vbm.adapter3d.ObjectFactory
|
|
383
383
|
*/
|
|
384
384
|
var ObjectFactory = BaseObject.extend("sap.ui.vbm.adapter3d.ObjectFactory", /** @lends sap.ui.vbm.adapter3d.ObjectFactory.prototype */ {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ! SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides class sap.ui.vbm.adapter3d.PolygonHandler
|
|
@@ -34,9 +34,9 @@ sap.ui.define([
|
|
|
34
34
|
*
|
|
35
35
|
* @private
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.84.
|
|
37
|
+
* @version 1.84.9
|
|
38
38
|
* @alias sap.ui.vbm.adapter3d.PolygonHandler
|
|
39
|
-
*/
|
|
39
|
+
*/
|
|
40
40
|
var PolygonHandler = BaseObject.extend("sap.ui.vbm.adapter3d.PolygonHandler", /** @lends sap.ui.vbm.adapter3d.PolygonHandler.prototype */ {
|
|
41
41
|
|
|
42
42
|
constructor: function(root) {
|
|
@@ -99,7 +99,7 @@ sap.ui.define([
|
|
|
99
99
|
PolygonHandler.prototype.destroy = function() {
|
|
100
100
|
// Reset references to shared objects.
|
|
101
101
|
this._root = null;
|
|
102
|
-
this.
|
|
102
|
+
this._hotInstance = null;
|
|
103
103
|
|
|
104
104
|
// destroy 'meta' meshes
|
|
105
105
|
this._meshes.forEach(function(key, array) {
|
|
@@ -114,10 +114,16 @@ sap.ui.define([
|
|
|
114
114
|
this._deleteObject3D(border.object3D);
|
|
115
115
|
}, this);
|
|
116
116
|
}, this);
|
|
117
|
-
|
|
117
|
+
|
|
118
118
|
// clear
|
|
119
|
+
this._instances.clear();
|
|
120
|
+
this._instances = null;
|
|
121
|
+
|
|
119
122
|
this._meshes.clear();
|
|
123
|
+
this._meshes = null;
|
|
124
|
+
|
|
120
125
|
this._borders.clear();
|
|
126
|
+
this._borders = null;
|
|
121
127
|
|
|
122
128
|
BaseObject.prototype.destroy.call(this);
|
|
123
129
|
};
|
|
@@ -137,11 +143,11 @@ sap.ui.define([
|
|
|
137
143
|
|
|
138
144
|
/**
|
|
139
145
|
* Adds polygon instance to polygon handler.
|
|
140
|
-
*
|
|
146
|
+
*
|
|
141
147
|
* @param {object} instance Polygon instance.
|
|
142
148
|
* @public
|
|
143
149
|
*/
|
|
144
|
-
PolygonHandler.prototype.addInstance = function(instance) {
|
|
150
|
+
PolygonHandler.prototype.addInstance = function(instance) {
|
|
145
151
|
this._instances.set(instance, {
|
|
146
152
|
instance : instance,
|
|
147
153
|
indices: [],
|
|
@@ -161,11 +167,11 @@ sap.ui.define([
|
|
|
161
167
|
|
|
162
168
|
/**
|
|
163
169
|
* Updates polygon instance in polygon handler
|
|
164
|
-
*
|
|
170
|
+
*
|
|
165
171
|
* @param {object} instance Polygon instance.
|
|
166
172
|
* @public
|
|
167
173
|
*/
|
|
168
|
-
PolygonHandler.prototype.updateInstance = function(instance) {
|
|
174
|
+
PolygonHandler.prototype.updateInstance = function(instance) {
|
|
169
175
|
var data = this._instances.get(instance), updateMesh = false, updateBorder = false;
|
|
170
176
|
if (data) {
|
|
171
177
|
// position, rotation, scale [mandatory attributes] when change -> recalculate matrix
|
|
@@ -188,7 +194,7 @@ sap.ui.define([
|
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
// if any property which affects polygon color changed -> check if polygon color actually changed
|
|
191
|
-
// then update polygon color and remove polygon from current 'meta' mesh if it exists
|
|
197
|
+
// then update polygon color and remove polygon from current 'meta' mesh if it exists
|
|
192
198
|
// and put it into another 'meta' mesh according to polygon updated color
|
|
193
199
|
// color, selectColor, VB:s [mandatory attributes]
|
|
194
200
|
if (propertyChanged(instance, ["color", "selectColor", "VB:s"])) {
|
|
@@ -329,13 +335,13 @@ sap.ui.define([
|
|
|
329
335
|
// create 3 or 2 groups, depends on where hot instance geometry is within 'meta' mesh geometry
|
|
330
336
|
geometry.addGroup(range.start, data.indices.length, 1); // use hot material with index #1
|
|
331
337
|
|
|
332
|
-
if (range.start !== 0) {
|
|
338
|
+
if (range.start !== 0) {
|
|
333
339
|
geometry.addGroup(0, range.start, 0); // use original material with index #0
|
|
334
340
|
}
|
|
335
341
|
if (range.start + data.indices.length < geometry.index.count) {
|
|
336
342
|
geometry.addGroup(range.start + data.indices.length, geometry.index.count - range.start - data.indices.length, 0); // use original material with index #0
|
|
337
343
|
}
|
|
338
|
-
}
|
|
344
|
+
}
|
|
339
345
|
}
|
|
340
346
|
if (data.border) { // apply hover on polygon border geometry
|
|
341
347
|
material = data.border.material;
|
|
@@ -365,13 +371,13 @@ sap.ui.define([
|
|
|
365
371
|
var vertexCount = data.lines.length/3;
|
|
366
372
|
geometry.addGroup(range.start, vertexCount, 1); // use hot material with index #1
|
|
367
373
|
|
|
368
|
-
if (range.start !== 0) {
|
|
374
|
+
if (range.start !== 0) {
|
|
369
375
|
geometry.addGroup(0, range.start, 0); // use original material with index #0
|
|
370
376
|
}
|
|
371
377
|
if (range.start + vertexCount < positions.count) {
|
|
372
378
|
geometry.addGroup(range.start + vertexCount, positions.count - range.start - vertexCount, 0); // use original material with index #0
|
|
373
379
|
}
|
|
374
|
-
}
|
|
380
|
+
}
|
|
375
381
|
}
|
|
376
382
|
} else {
|
|
377
383
|
log.error("Unable to find polygon instance data", "", thisModule);
|
|
@@ -430,7 +436,7 @@ sap.ui.define([
|
|
|
430
436
|
|
|
431
437
|
/**
|
|
432
438
|
* Updates 'meta' meshes requested for rebuild by combining geometry of all instances with the same color into one mesh.
|
|
433
|
-
*
|
|
439
|
+
*
|
|
434
440
|
* @returns {boolean} True if hot instance 'meta' mesh has been recreated.
|
|
435
441
|
* @private
|
|
436
442
|
*/
|
|
@@ -441,11 +447,11 @@ sap.ui.define([
|
|
|
441
447
|
for (var i = 0; i < array.length;) {
|
|
442
448
|
if (array[i].dirty) {
|
|
443
449
|
var j, instance, base, indices = [], vertices = [], normals = [], data = array[i];
|
|
444
|
-
|
|
450
|
+
|
|
445
451
|
this._deleteObject3D(data.object3D);
|
|
446
452
|
data.object3D = null;
|
|
447
453
|
data.hitInfo.length = 0; // erase hitInfo
|
|
448
|
-
|
|
454
|
+
|
|
449
455
|
data.instances.forEach(function(range, key) {
|
|
450
456
|
instance = key; // to access instance outside forEach
|
|
451
457
|
|
|
@@ -481,24 +487,24 @@ sap.ui.define([
|
|
|
481
487
|
|
|
482
488
|
if (indices.length) {
|
|
483
489
|
var geometry = new THREE.BufferGeometry();
|
|
484
|
-
|
|
490
|
+
|
|
485
491
|
geometry.setIndex(indices);
|
|
486
492
|
geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
|
|
487
493
|
geometry.setAttribute("normal", new THREE.Float32BufferAttribute(normals, 3));
|
|
488
494
|
geometry.computeBoundingBox(); // needed for ray casting
|
|
489
495
|
geometry.computeBoundingSphere(); // needed for ray casting
|
|
490
|
-
|
|
496
|
+
|
|
491
497
|
var material = createMaterial(true);
|
|
492
498
|
material.color.copy(instance.color.rgb);
|
|
493
499
|
material.opacity = instance.color.opacity;
|
|
494
500
|
material.transparent = material.opacity < 1;
|
|
495
501
|
material.needsUpdate = true;
|
|
496
|
-
|
|
502
|
+
|
|
497
503
|
data.object3D = new THREE.Mesh(geometry, material);
|
|
498
504
|
data.object3D.matrixAutoUpdate = false;
|
|
499
505
|
data.object3D.layers.set(0); // put it to layer #0 to enable raycasting
|
|
500
506
|
this._root.add(data.object3D);
|
|
501
|
-
|
|
507
|
+
|
|
502
508
|
data.object3D._instanceHitTest = this._instanceHitTest.bind(data); // helper function to return instance based on hit test info
|
|
503
509
|
data.triangleCount = indices.length/3; // update triangle count on full rebuild
|
|
504
510
|
}
|
|
@@ -529,7 +535,7 @@ sap.ui.define([
|
|
|
529
535
|
|
|
530
536
|
/**
|
|
531
537
|
* Updates 'meta' borders requested for rebuild by combining geometry of all instances with the same color into one mesh.
|
|
532
|
-
*
|
|
538
|
+
*
|
|
533
539
|
* @returns {boolean} True if hot instance 'meta' border has been recreated.
|
|
534
540
|
* @private
|
|
535
541
|
*/
|
|
@@ -567,13 +573,13 @@ sap.ui.define([
|
|
|
567
573
|
var geometry = new THREE.BufferGeometry();
|
|
568
574
|
geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
|
|
569
575
|
geometry.computeBoundingBox();
|
|
570
|
-
|
|
576
|
+
|
|
571
577
|
var material = createLineMaterial();
|
|
572
578
|
material.color.copy(instance.colorBorder.rgb);
|
|
573
579
|
material.opacity = instance.colorBorder.opacity;
|
|
574
580
|
material.transparent = material.opacity < 1;
|
|
575
581
|
material.needsUpdate = true;
|
|
576
|
-
|
|
582
|
+
|
|
577
583
|
data.object3D = new THREE.LineSegments(geometry, material);
|
|
578
584
|
data.object3D.matrixAutoUpdate = false;
|
|
579
585
|
data.object3D.layers.set(1); // put it to layer #1 to disable hit test
|
|
@@ -741,10 +747,10 @@ sap.ui.define([
|
|
|
741
747
|
if (object) {
|
|
742
748
|
if (object.parent) {
|
|
743
749
|
object.parent.remove(object);
|
|
744
|
-
}
|
|
750
|
+
}
|
|
745
751
|
if (object.geometry) {
|
|
746
752
|
object.geometry.dispose();
|
|
747
|
-
}
|
|
753
|
+
}
|
|
748
754
|
Utilities.toArray(object.material).forEach(function(material) {
|
|
749
755
|
material.dispose(); // no maps to dispose
|
|
750
756
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides the base visual object.
|
|
@@ -9,7 +9,7 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/base/Object",
|
|
10
10
|
"./Utilities",
|
|
11
11
|
"./PolygonHandler",
|
|
12
|
-
"./ModelHandler",
|
|
12
|
+
"./ModelHandler",
|
|
13
13
|
"./thirdparty/three",
|
|
14
14
|
"./thirdparty/DecalGeometry",
|
|
15
15
|
"./thirdparty/html2canvas"],
|
|
@@ -50,7 +50,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
50
50
|
*
|
|
51
51
|
* @private
|
|
52
52
|
* @author SAP SE
|
|
53
|
-
* @version 1.84.
|
|
53
|
+
* @version 1.84.9
|
|
54
54
|
* @alias sap.ui.vbm.adapter3d.SceneBuilder
|
|
55
55
|
*/
|
|
56
56
|
var SceneBuilder = BaseObject.extend("sap.ui.vbm.adapter3d.SceneBuilder", /** @lends sap.ui.vbm.adapter3d.SceneBuilder.prototype */ {
|
|
@@ -107,9 +107,11 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
107
107
|
this._scene = null;
|
|
108
108
|
this._viewport = null;
|
|
109
109
|
this._context = null;
|
|
110
|
+
this._hotInstance = null;
|
|
111
|
+
|
|
110
112
|
|
|
111
113
|
if (this._box4) {
|
|
112
|
-
this.
|
|
114
|
+
this._box4.dispose();
|
|
113
115
|
}
|
|
114
116
|
if (this._box6) {
|
|
115
117
|
this._box6.dispose();
|
|
@@ -125,15 +127,22 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
125
127
|
this._decalHelper.material.dispose();
|
|
126
128
|
this._decalHelper.geometry.dispose();
|
|
127
129
|
this._scene.remove(this._decalHelper);
|
|
130
|
+
this._decalHelper = null;
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
this._polygonHandler.destroy();
|
|
134
|
+
this._polygonHandler = null;
|
|
135
|
+
|
|
131
136
|
this._modelHandler.destroy();
|
|
137
|
+
this._modelHandler = null;
|
|
132
138
|
|
|
133
139
|
this._textures.forEach(function(texture) {
|
|
134
140
|
texture.dispose();
|
|
135
141
|
});
|
|
136
142
|
|
|
143
|
+
this._targets.clear();
|
|
144
|
+
this._targets = null;
|
|
145
|
+
|
|
137
146
|
BaseObject.prototype.destroy.call(this);
|
|
138
147
|
};
|
|
139
148
|
|
|
@@ -194,7 +203,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
194
203
|
[].concat(toAdd, toUpdate).forEach(function(instance) {
|
|
195
204
|
if (instance.isModel) {
|
|
196
205
|
that._modelHandler.addModel(instance);
|
|
197
|
-
}
|
|
206
|
+
}
|
|
198
207
|
if (instance.texture && propertyChanged(instance, "texture")) {
|
|
199
208
|
addTexture(instance.texture);
|
|
200
209
|
}
|
|
@@ -313,7 +322,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
313
322
|
var state = {
|
|
314
323
|
zoom: 1.0,
|
|
315
324
|
// convert from left handed (DirectX) to right handed (OpenGL)
|
|
316
|
-
target: new Vector3(-camTarget.x, -camTarget.z, camTarget.y),
|
|
325
|
+
target: new Vector3(-camTarget.x, -camTarget.z, camTarget.y),
|
|
317
326
|
position: new Vector3(-pos.x, -pos.z, pos.y)
|
|
318
327
|
};
|
|
319
328
|
|
|
@@ -355,6 +364,8 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
355
364
|
|
|
356
365
|
var iframe = document.createElement("iframe");
|
|
357
366
|
iframe.style.visibility = "hidden";
|
|
367
|
+
// use sandbox attribute to disable script execution and all other suspicious activities in iframe as we cannot affectively escape input HTML.
|
|
368
|
+
iframe.sandbox = "allow-same-origin";
|
|
358
369
|
iframe.width = width;
|
|
359
370
|
iframe.height = height;
|
|
360
371
|
document.body.appendChild(iframe);
|
|
@@ -578,7 +589,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
578
589
|
// var timestamp = performance.now();
|
|
579
590
|
this._polygonHandler.updateHotInstance(instance);
|
|
580
591
|
this._modelHandler.updateHotInstance(instance);
|
|
581
|
-
|
|
592
|
+
|
|
582
593
|
// perform pending updates if any
|
|
583
594
|
this._polygonHandler.update();
|
|
584
595
|
this._modelHandler.update();
|
|
@@ -590,7 +601,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
590
601
|
if (instance) {
|
|
591
602
|
this._updateHotStatus(instance, true);
|
|
592
603
|
}
|
|
593
|
-
|
|
604
|
+
|
|
594
605
|
this._hotInstance = instance;
|
|
595
606
|
// DEBUG
|
|
596
607
|
// log.info("update hover took " + (performance.now() - timestamp) + " milliseconds", "", thisModule);
|
|
@@ -613,9 +624,9 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
613
624
|
box.layers.set(0); // put it to layer #0 to enable raycasting
|
|
614
625
|
box._sapInstance = instance; // keep reference to instance
|
|
615
626
|
instance.object3D.add(box);
|
|
616
|
-
}
|
|
627
|
+
}
|
|
617
628
|
}
|
|
618
|
-
|
|
629
|
+
|
|
619
630
|
// update properties after processing is done
|
|
620
631
|
updateProperty(instance, "texture6");
|
|
621
632
|
|
|
@@ -664,7 +675,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
664
675
|
cylinder.layers.set(0); // put it to layer #0 to enable raycasting
|
|
665
676
|
cylinder._sapInstance = instance; // keep reference to instance
|
|
666
677
|
instance.object3D.add(cylinder);
|
|
667
|
-
}
|
|
678
|
+
}
|
|
668
679
|
}
|
|
669
680
|
|
|
670
681
|
if (propertyChanged(instance, "textureCap") || updateTextureCap) {
|
|
@@ -687,12 +698,12 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
687
698
|
}
|
|
688
699
|
}
|
|
689
700
|
}
|
|
690
|
-
|
|
701
|
+
|
|
691
702
|
// update cylinder properties after processing is done
|
|
692
703
|
updateProperty(instance, ["isOpen", "testureCap"]);
|
|
693
704
|
|
|
694
705
|
// handle common properties
|
|
695
|
-
this._assignProperties(instance, hot);
|
|
706
|
+
this._assignProperties(instance, hot);
|
|
696
707
|
};
|
|
697
708
|
|
|
698
709
|
SceneBuilder.prototype._assignProperties = function(instance, hot) {
|
|
@@ -816,9 +827,9 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
816
827
|
Utilities.subRef(material.map); // release current texture in use
|
|
817
828
|
material.map = null;
|
|
818
829
|
}
|
|
819
|
-
|
|
830
|
+
|
|
820
831
|
material.map = this._textures.get(instance.text ? this._getDecalTextKey(instance) : instance.texture);
|
|
821
|
-
|
|
832
|
+
|
|
822
833
|
if (material.map) {
|
|
823
834
|
material.map.flipY = true;
|
|
824
835
|
material.needsUpdate = true; // required by threeJS
|
|
@@ -827,7 +838,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
827
838
|
log.error("Unable to apply texture, texture not found", instance.texture, thisModule);
|
|
828
839
|
}
|
|
829
840
|
}
|
|
830
|
-
|
|
841
|
+
|
|
831
842
|
// update properties after processing is done
|
|
832
843
|
updateProperty(instance, ["position", "direction", "size", "rotation", "target", "texture", "text", "planeOrigin", "planeNormal"]);
|
|
833
844
|
};
|
|
@@ -903,6 +914,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
903
914
|
material = material || new THREE.MeshPhongMaterial({
|
|
904
915
|
specular: 0x444444,
|
|
905
916
|
shininess: 0,
|
|
917
|
+
opacity: 0.99,
|
|
906
918
|
transparent: true,
|
|
907
919
|
depthTest: true,
|
|
908
920
|
depthWrite: false,
|
|
@@ -924,6 +936,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
924
936
|
// this._scene.add(cube);
|
|
925
937
|
|
|
926
938
|
instance.object3D = new THREE.Mesh(new THREE.DecalGeometry(target, origin, this._decalHelper.rotation, size), material)
|
|
939
|
+
instance.object3D.renderOrder = 100;
|
|
927
940
|
instance.object3D.matrixAutoUpdate = false;
|
|
928
941
|
instance.object3D.layers.set(1); // put it to layer #1 to disable hit test
|
|
929
942
|
this._scene.add(instance.object3D);
|
|
@@ -992,7 +1005,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
992
1005
|
|
|
993
1006
|
SceneBuilder.prototype._getDecalTarget = function(instance) {
|
|
994
1007
|
if (instance.target) {
|
|
995
|
-
var target = this._targets.get(instance.target);
|
|
1008
|
+
var target = this._targets.get(instance.target);
|
|
996
1009
|
if (target) {
|
|
997
1010
|
if (target.isBox || target.isCylinder) {
|
|
998
1011
|
return target.object3D.children[0]; // object3d is a group node, where its first child is actual mesh
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ! SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides class sap.ui.vbm.adapter3d.VBIJSONParser
|
|
@@ -58,7 +58,7 @@ sap.ui.define([
|
|
|
58
58
|
*
|
|
59
59
|
* @private
|
|
60
60
|
* @author SAP SE
|
|
61
|
-
* @version 1.84.
|
|
61
|
+
* @version 1.84.9
|
|
62
62
|
* @alias sap.ui.vbm.adapter3d.VBIJSONParser
|
|
63
63
|
*/
|
|
64
64
|
var VBIJSONParser = BaseObject.extend("sap.ui.vbm.adapter3d.VBIJSONParser", /** @lends sap.ui.vbm.adapter3d.VBIJSONParser.prototype */ {
|
|
@@ -673,18 +673,24 @@ VBI.Scene = function(target) {
|
|
|
673
673
|
}
|
|
674
674
|
// standard case - click on single object
|
|
675
675
|
if (event.hitTests.length > 0) {
|
|
676
|
-
event.hitCached = event.hitTests[0];
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
676
|
+
event.hitCached = event.hitTests[0]; // cache first hit test
|
|
677
|
+
delete event.hitTests; // has to be deleted to avoid collecting hits information again
|
|
678
|
+
// if there is a VO then pass event to it
|
|
679
|
+
if (event.hitCached.m_Vo) {
|
|
680
|
+
return event.hitCached.m_Vo["on" + eventType].call(event.hitCached.m_Vo, event);
|
|
681
|
+
} else {
|
|
682
|
+
delete event.hitCached; // remove it to keep things going "old" way
|
|
683
|
+
}
|
|
684
|
+
} else {
|
|
685
|
+
return false; // not handled
|
|
680
686
|
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
687
|
+
}
|
|
688
|
+
// "old" approach -> process from last to first which corresponds to the rendering order (from topmost to last)
|
|
689
|
+
for (var i = scene.m_VOS.length - 1; i >= 0; --i) {
|
|
690
|
+
if ((func = scene.m_VOS[i]["on" + eventType]) && typeof (func) == 'function') {
|
|
691
|
+
// call the handler with the context set to corresponded visual object
|
|
692
|
+
if (func.call(scene.m_VOS[i], event)) {
|
|
693
|
+
return true; // handled
|
|
688
694
|
}
|
|
689
695
|
}
|
|
690
696
|
}
|
|
@@ -3352,7 +3358,7 @@ VBI.GeoScene = function(target, mapmanager, maplayerstack) {
|
|
|
3352
3358
|
}
|
|
3353
3359
|
var sCopyright = scene.m_MapLayerStack.GetCopyright();
|
|
3354
3360
|
if (sCopyright) {
|
|
3355
|
-
scene.m_DivCopyright.innerHTML = sCopyright;
|
|
3361
|
+
scene.m_DivCopyright.innerHTML = jQuery.sap.encodeHTML(sCopyright);
|
|
3356
3362
|
} else {
|
|
3357
3363
|
scene.m_DivCopyright.style.paddingRight = 0;
|
|
3358
3364
|
scene.m_DivCopyright.style.paddingLeft = 0;
|