@sapui5/sap.ui.vbm 1.142.0 → 1.143.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ui.vbm",
3
- "version": "1.142.0",
3
+ "version": "1.143.0",
4
4
  "description": "SAPUI5 Library sap.ui.vbm",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -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.142.0</version>
6
+ <version>1.143.0</version>
7
7
 
8
8
  <documentation>SAP UI library: sap.ui.vbm</documentation>
9
9
 
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @param {string} [sId] id for the new control, generated automatically if no id is given
25
25
  * @param {object} [mSettings] initial settings for the new object
26
26
  * @author SAP SE
27
- * @version 1.142.0
27
+ * @version 1.143.0
28
28
  * @extends sap.ui.core.Element
29
29
  * @constructor
30
30
  * @public
@@ -47,7 +47,7 @@ sap.ui.define([
47
47
  * @param {string} [sId] id for the new control, generated automatically if no id is given
48
48
  * @param {object} [mSettings] initial settings for the new object
49
49
  * @author SAP SE
50
- * @version 1.142.0
50
+ * @version 1.143.0
51
51
  * @extends sap.ui.core.Element
52
52
  * @constructor
53
53
  * @public
@@ -238,7 +238,7 @@ sap.ui.define([
238
238
 
239
239
  this._colladaBounds = null;
240
240
 
241
-
241
+
242
242
  // this._lassoTracker = null;
243
243
  };
244
244
 
@@ -330,7 +330,7 @@ sap.ui.define([
330
330
  this._rectangleTracker = new RectangleTracker(this);
331
331
  // // this._lassoTracker = new LassoTracker(this);
332
332
  // if(rectangleSelect)
333
-
333
+
334
334
  // if(lassoSelect && !rectangleSelect)
335
335
  // {
336
336
  // this._lassoSelect = "created";
@@ -348,7 +348,7 @@ sap.ui.define([
348
348
  this._dragDropHandler.destroy();
349
349
  this._dragDropHandler = null;
350
350
  this._colladaBounds = null;
351
- this._rectangleTracker = null;
351
+ this._rectangleTracker = null;
352
352
  // this._lassoTracker = null;
353
353
  this._viewport.removeEventDelegate(viewportEventDelegate);
354
354
  // onBeforeRendering unsubscribes from DOM events.
@@ -421,51 +421,51 @@ sap.ui.define([
421
421
  that._viewport.setBusy(true);
422
422
 
423
423
  that._update = that._update
424
- .then(function() {
425
- that._parser.loadVBIJSON(payload);
426
-
427
- return that._sceneBuilder.synchronize();
428
- })
429
- .then(function() {
430
- // further processing after scene(s) has been updated
431
- that._processAutomation(payload);
432
- that._processDetailWindow();
433
- // that._createCollada(payload);
434
- // check if last hover instance is still exist (it may be erased during update)
435
- that._context.voQueues.toRemove.forEach(function(instances) {
436
- instances.forEach(function(instance) {
437
- if (that._hoverInstance === instance) {
438
- that._hoverInstance = null;
439
- }
424
+ .then(function() {
425
+ that._parser.loadVBIJSON(payload);
426
+
427
+ return that._sceneBuilder.synchronize();
428
+ })
429
+ .then(function() {
430
+ // further processing after scene(s) has been updated
431
+ that._processAutomation(payload);
432
+ that._processDetailWindow();
433
+ // that._createCollada(payload);
434
+ // check if last hover instance is still exist (it may be erased during update)
435
+ that._context.voQueues.toRemove.forEach(function(instances) {
436
+ instances.forEach(function(instance) {
437
+ if (that._hoverInstance === instance) {
438
+ that._hoverInstance = null;
439
+ }
440
+ }, that);
440
441
  }, that);
441
- }, that);
442
442
 
443
443
 
444
- if (that._colladaBounds) {
445
- that._colladaBounds.initialize();
446
- }
444
+ if (that._colladaBounds) {
445
+ that._colladaBounds.initialize();
446
+ }
447
447
 
448
- // update drag and drop handler
449
- if (that._dragDropHandler) {
450
- that._dragDropHandler.update();
451
- }
452
-
453
- // scene has changed -> adjust camera clipping planes
454
- that._viewport._resetBBox();
455
- that._viewport._updateCamera();
448
+ // update drag and drop handler
449
+ if (that._dragDropHandler) {
450
+ that._dragDropHandler.update();
451
+ }
456
452
 
457
- // clear before next update
458
- that._context.voQueues.clear();
459
- that._context.sceneQueues.clear();
460
- that._context.windowQueues.clear();
453
+ // scene has changed -> adjust camera clipping planes
454
+ that._viewport._resetBBox();
455
+ that._viewport._updateCamera();
461
456
 
462
- that._viewport.setBusy(false);
463
- });
457
+ // clear before next update
458
+ that._context.voQueues.clear();
459
+ that._context.sceneQueues.clear();
460
+ that._context.windowQueues.clear();
461
+
462
+ that._viewport.setBusy(false);
463
+ });
464
464
  // return last promise in chain
465
-
465
+
466
466
  return that._update;
467
467
  };
468
-
468
+
469
469
  Adapter3D.prototype._processDetailWindow = function(payload) {
470
470
  // show first only detail window from toAdd queue
471
471
  // ignore all other detail windows as we can show only one at a time in compare to ActiveX implementation
@@ -791,12 +791,12 @@ sap.ui.define([
791
791
  };
792
792
 
793
793
  Adapter3D.prototype._genericEventHandler = function(name, event) {
794
-
794
+
795
795
  var homeButtonKey = Utilities.parseKeyboardShortcut(this._context.config.has("HOME_VIEW") ? this._context.config.get("HOME_VIEW") : "72");
796
-
796
+
797
797
  if (Utilities.matchKeyboardShortcut(event, homeButtonKey)) {
798
798
  this._viewport.applyCameraHome(false); // no fly-to animation needed here
799
- return;
799
+ return;
800
800
  }
801
801
 
802
802
  var instance = event.instance;
@@ -1167,9 +1167,9 @@ sap.ui.define([
1167
1167
  this._skipClick = false;
1168
1168
  this._handleHover(event);
1169
1169
  } else if (this._clickTimerId) {
1170
- clearTimeout(this._clickTimerId);
1171
- this._clickTimerId = null;
1172
- this._handleDoubleClick(event);
1170
+ clearTimeout(this._clickTimerId);
1171
+ this._clickTimerId = null;
1172
+ this._handleDoubleClick(event);
1173
1173
  } else {
1174
1174
  this._clickTimerId = setTimeout(function() {
1175
1175
  this._clickTimerId = null;
@@ -1193,6 +1193,14 @@ sap.ui.define([
1193
1193
  * @private
1194
1194
  */
1195
1195
  Adapter3D.prototype._extendEventWithSelection = function(event) {
1196
+
1197
+ // As we want to manintain the state of object(selected/not selected)
1198
+ // In case of drag and drop we will not calling further function
1199
+ if (this._dragDropHandler.isDragAndDrop) {
1200
+ this._dragDropHandler.isDragAndDrop = false;
1201
+ return;
1202
+ }
1203
+
1196
1204
  var instance = event.instance;
1197
1205
  if (instance) {
1198
1206
  if (event.originalEvent.type === "click") {
@@ -1210,10 +1218,19 @@ sap.ui.define([
1210
1218
  action = "select";
1211
1219
  exclusive = true;
1212
1220
  }
1213
- event.selectionChanges = this._changeSelection(instance, action, exclusive);
1221
+ if (instance.object3D) {
1222
+ event.selectionChanges = this._changeSelectionAddtvAndSubtv(instance, action, exclusive);
1223
+ } else {
1224
+ event.selectionChanges = this._changeSelection(instance, action, exclusive);
1225
+ }
1226
+
1214
1227
  }
1215
1228
  } else {
1216
- event.selectionChanges = this._changeSelection(instance, "toggle", false);
1229
+ if (instance.object3D) {
1230
+ event.selectionChanges = this._changeSelectionAddtvAndSubtv(instance, "toggle", false);
1231
+ } else {
1232
+ event.selectionChanges = this._changeSelection(instance, "toggle", false);
1233
+ }
1217
1234
  }
1218
1235
  }
1219
1236
  };
@@ -1252,7 +1269,7 @@ sap.ui.define([
1252
1269
  deselected = group.selected.splice(0);
1253
1270
  }
1254
1271
  group.selected.push(instance);
1255
- selected = [ instance ];
1272
+ selected = [instance];
1256
1273
  }
1257
1274
  }
1258
1275
  } else if (action === "toggle") {
@@ -1269,15 +1286,15 @@ sap.ui.define([
1269
1286
  }
1270
1287
  // Select instance
1271
1288
  group.selected.push(instance);
1272
- selected = [ instance ];
1289
+ selected = [instance];
1273
1290
  }
1274
1291
  }
1275
1292
 
1276
- selected.forEach(function(instance) {
1293
+ selected.forEach(function (instance) {
1277
1294
  instance["VB:s"] = "true";
1278
1295
  });
1279
1296
 
1280
- deselected.forEach(function(instance) {
1297
+ deselected.forEach(function (instance) {
1281
1298
  instance["VB:s"] = "false";
1282
1299
  });
1283
1300
 
@@ -1285,7 +1302,132 @@ sap.ui.define([
1285
1302
  selected: selected,
1286
1303
  deselected: deselected
1287
1304
  }
1288
- };
1305
+ };
1306
+
1307
+ Adapter3D.prototype._changeSelectionAddtvAndSubtv = function (instance, action, exclusive) {
1308
+ var selected = [];
1309
+ var deselected = [];
1310
+ var group = instance.voGroup;
1311
+ var wasSelected = toBoolean(instance["VB:s"]);
1312
+ var selectedIndex;
1313
+
1314
+ if (action === "select") {
1315
+ if (group.maxSel !== "0") {
1316
+ if (wasSelected) {
1317
+ if (exclusive) {
1318
+ // Deselect other selected instances in the group.
1319
+ selectedIndex = group.selected.indexOf(instance);
1320
+
1321
+ // it was manually selected
1322
+ if (selectedIndex >= 0) {
1323
+ deselected = group.selected.splice(selectedIndex + 1).concat(group.selected.splice(0, selectedIndex));
1324
+
1325
+ // deselect all elements from rect selection as well
1326
+ let found = [...this._rectangleTracker._selected];
1327
+ for (let i = 0; i < found.length; i++) {
1328
+ if (instance != found[i]._sapInstance) {
1329
+ deselected.push(found[i]._sapInstance);
1330
+ }
1331
+ }
1332
+
1333
+ // To remove any dups present
1334
+ deselected = [...new Map(deselected.map(item => [item.id, item])).values()];
1335
+
1336
+ this._rectangleTracker._selected.clear();
1337
+ } else {
1338
+ // considering it is from rect selection.
1339
+ let matchingInstance = [...this._rectangleTracker._selected].find(u => u.uuid === instance.object3D.uuid);
1340
+
1341
+ deselected = group.selected.splice(0);
1342
+
1343
+ // deselect all elements from rect selection as well
1344
+ let found = [...this._rectangleTracker._selected];
1345
+ for (let i = 0; i < found.length; i++) {
1346
+
1347
+ if (matchingInstance.uuid != found[i].uuid) {
1348
+ deselected.push(found[i]._sapInstance);
1349
+ this._rectangleTracker._selected.delete(found[i]);
1350
+ }
1351
+ }
1352
+
1353
+ // To remove any dups present
1354
+ deselected = [...new Map(deselected.map(item => [item.id, item])).values()];
1355
+
1356
+ }
1357
+
1358
+ }
1359
+ } else {
1360
+ if (exclusive || group.maxSel === "1") {
1361
+
1362
+ // Deselect other selected instances in the group.
1363
+ selectedIndex = group.selected.indexOf(instance);
1364
+
1365
+ if (selectedIndex >= 0) {
1366
+ deselected = group.selected.splice(selectedIndex + 1).concat(group.selected.splice(0, selectedIndex));
1367
+ } else {
1368
+ deselected = group.selected.splice(0);
1369
+ }
1370
+
1371
+ let found = [...this._rectangleTracker._selected];
1372
+ for (let i = 0; i < found.length; i++) {
1373
+ deselected.push(found[i]._sapInstance);
1374
+ }
1375
+
1376
+ // To remove any dups present
1377
+ deselected = [...new Map(deselected.map(item => [item.id, item])).values()];
1378
+
1379
+ this._rectangleTracker._selected.clear();
1380
+ }
1381
+ if (!selectedIndex || selectedIndex < 0) {
1382
+ group.selected.push(instance);
1383
+ }
1384
+ selected = [instance];
1385
+ }
1386
+ }
1387
+ } else if (action === "toggle") {
1388
+ if (wasSelected) {
1389
+ if (group.minSel === "0" || group.selected.length > 1) {
1390
+ // Deselect instance
1391
+ selectedIndex = group.selected.indexOf(instance);
1392
+ let found = [...this._rectangleTracker._selected].find(u => u.uuid === instance.object3D.uuid);
1393
+
1394
+ if (found) {
1395
+ this._rectangleTracker._selected.delete(found);
1396
+ }
1397
+
1398
+ // if the instance id previously selected and we are still not able to get it in data
1399
+ // we can still go ahead and that instance in deselected array to deselect it.
1400
+ if (selectedIndex < 0) {
1401
+ deselected.push(instance);
1402
+ } else {
1403
+ deselected = group.selected.splice(selectedIndex, 1);
1404
+ }
1405
+
1406
+ }
1407
+ } else if (group.maxSel !== "0") {
1408
+ if (group.maxSel === "1") {
1409
+ // Deselect all
1410
+ deselected = group.selected.splice(0);
1411
+ }
1412
+ // Select instance
1413
+ group.selected.push(instance);
1414
+ selected = [instance];
1415
+ }
1416
+ }
1417
+
1418
+ selected.forEach(function (instance) {
1419
+ instance["VB:s"] = "true";
1420
+ });
1421
+
1422
+ deselected.forEach(function (instance) {
1423
+ instance["VB:s"] = "false";
1424
+ });
1425
+
1426
+ return {
1427
+ selected: selected,
1428
+ deselected: deselected
1429
+ }
1430
+ };
1289
1431
 
1290
1432
 
1291
1433
  Adapter3D.prototype.enableRectangularSelection = function() {
@@ -117,12 +117,11 @@ sap.ui.define([
117
117
  "_sap_ui_vbm_shared_ChartDataPointBorderHoverSelectedColor",
118
118
  "_sap_ui_vbm_shared_ChartDataPointNotSelectedBackgroundOpacity"
119
119
  ] });
120
- const isValues= Object.keys(values || {}).length > 0;
121
-
122
- AnalyticMap.DefaultRegionColor = isValues?values["_sap_ui_vbm_shared_ChoroplethRegionBG"] : "rgb(213,218,221)";
123
- AnalyticMap.DefaultRegionColorBorder = isValues?values["_sap_ui_vbm_shared_ChoroplethRegionBorder"] : "rgb(255,255,255)";
124
- AnalyticMap.AltBorderColor = isValues?values["_sap_ui_vbm_shared_ChartDataPointBorderHoverSelectedColor"] : "#676767";
125
- nonSelectOpacity = isValues?values["_sap_ui_vbm_shared_ChartDataPointNotSelectedBackgroundOpacity"] : "0.6";
120
+
121
+ AnalyticMap.DefaultRegionColor = values?values["_sap_ui_vbm_shared_ChoroplethRegionBG"] : "rgb(213,218,221)";
122
+ AnalyticMap.DefaultRegionColorBorder = values?values["_sap_ui_vbm_shared_ChoroplethRegionBorder"] : "rgb(255,255,255)";
123
+ AnalyticMap.AltBorderColor = values?values["_sap_ui_vbm_shared_ChartDataPointBorderHoverSelectedColor"] : "#676767";
124
+ nonSelectOpacity = values?values["_sap_ui_vbm_shared_ChartDataPointNotSelectedBackgroundOpacity"] : "0.6";
126
125
 
127
126
  AnalyticMap.DefaultRegionNonSelectColor = "RHLSA(0;1;1;" + nonSelectOpacity + ")";
128
127
 
@@ -993,9 +992,8 @@ sap.ui.define([
993
992
  "_sap_ui_vbm_shared_ChoroplethRegionBG",
994
993
  "_sap_ui_vbm_shared_ChoroplethRegionBorder"
995
994
  ] });
996
- const isValues= Object.keys(oColValues || {}).length > 0;
997
- sColC = AnalyticMap.DefaultRegionColor = isValues? oColValues["_sap_ui_vbm_shared_ChoroplethRegionBG"] : AnalyticMap.DefaultRegionColor;
998
- sColCB = AnalyticMap.DefaultRegionColorBorder = isValues? oColValues["_sap_ui_vbm_shared_ChoroplethRegionBorder"] : AnalyticMap.DefaultRegionColorBorder;
995
+ sColC = AnalyticMap.DefaultRegionColor = oColValues? oColValues["_sap_ui_vbm_shared_ChoroplethRegionBG"] : AnalyticMap.DefaultRegionColor;
996
+ sColCB = AnalyticMap.DefaultRegionColorBorder = oColValues? oColValues["_sap_ui_vbm_shared_ChoroplethRegionBorder"] : AnalyticMap.DefaultRegionColorBorder;
999
997
  if (this.getPlugin()) { // plug-in mode -> make sure color format matches plugin requirements
1000
998
  sColC = window.VBI.Utilities.String2VBColor(sColC);
1001
999
  sColCB = window.VBI.Utilities.String2VBColor(sColCB);
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  *
24
24
  * @public
25
25
  * @author SAP SE
26
- * @version 1.142.0
26
+ * @version 1.143.0
27
27
  * @extends sap.ui.core.Control
28
28
  * @alias sap.ui.vbm.Viewport
29
29
  */
@@ -341,11 +341,10 @@ sap.ui.define([
341
341
  "_sap_ui_vbm_shared_ChartGood",
342
342
  "_sap_ui_vbm_shared_ChartNeutral"] });
343
343
 
344
- const isValues= Object.keys(colorParams || {}).length > 0;
345
- VoBase.prototype.DefaultColorBad = isValues? colorParams["_sap_ui_vbm_shared_ChartBad"] : "rgb(211, 32, 48)";
346
- VoBase.prototype.DefaultColorCritical = isValues? colorParams["_sap_ui_vbm_shared_ChartCritical"] : "rgb(225, 123, 36)";
347
- VoBase.prototype.DefaultColorGood = isValues? colorParams["_sap_ui_vbm_shared_ChartGood"] : "rgb(97, 166, 86)";
348
- VoBase.prototype.DefaultColorNeutral = isValues? colorParams["_sap_ui_vbm_shared_ChartNeutral"] : "rgb(132, 143, 148)";
344
+ VoBase.prototype.DefaultColorBad = colorParams? colorParams["_sap_ui_vbm_shared_ChartBad"] : "rgb(211, 32, 48)";
345
+ VoBase.prototype.DefaultColorCritical = colorParams? colorParams["_sap_ui_vbm_shared_ChartCritical"] : "rgb(225, 123, 36)";
346
+ VoBase.prototype.DefaultColorGood = colorParams? colorParams["_sap_ui_vbm_shared_ChartGood"] : "rgb(97, 166, 86)";
347
+ VoBase.prototype.DefaultColorNeutral = colorParams? colorParams["_sap_ui_vbm_shared_ChartNeutral"] : "rgb(132, 143, 148)";
349
348
 
350
349
  // VO Interface implementation ..............................................//
351
350
 
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @private
24
24
  * @author SAP SE
25
- * @version 1.142.0
25
+ * @version 1.143.0
26
26
  * @alias sap.ui.vbm.adapter3d.ColladaBounds
27
27
  */
28
28
  var ColladaBounds = BaseObject.extend("sap.ui.vbm.adapter3d.ColladaBounds", /** @lends sap.ui.vbm.adapter3d.ColladaBounds.prototype */ {
@@ -83,7 +83,7 @@ sap.ui.define([
83
83
  *
84
84
  * @private
85
85
  * @author SAP SE
86
- * @version 1.142.0
86
+ * @version 1.143.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 */ {
@@ -99,6 +99,9 @@ sap.ui.define([
99
99
  this._camera = this._viewport._camera;
100
100
  this._cameraControls = this._viewport._cameraController;
101
101
 
102
+ // to detect the dragAndDrop happened
103
+ this.isDragAndDrop = false;
104
+
102
105
  // current action state
103
106
  this._state = STATE.PICK;
104
107
 
@@ -612,6 +615,9 @@ sap.ui.define([
612
615
  var payload = {
613
616
  version : "2.0",
614
617
  "xmlns:VB" : "VB",
618
+ Action : {
619
+ name : "DRAG_DROP"
620
+ },
615
621
  Data: {
616
622
  Merge: {
617
623
  N: []
@@ -638,7 +644,16 @@ sap.ui.define([
638
644
  var posAlias = this._adapter._parser.getAttributeAlias(dataType, posAttr);
639
645
  var keyAlias = this._adapter._parser.getAttributeAlias(dataType, instance.voGroup.keyAttributeName);
640
646
  var pos = instance.object3D.position;
641
- var value = pos.x.toFixed(5) + ";" + pos.y.toFixed(5) + ";" + pos.z.toFixed(5);
647
+ var value = pos.x.toFixed(5) + ";" + pos.y.toFixed(5) + ";" + pos.z.toFixed(5); // new pos
648
+
649
+ var strInitialPos = instance.pos.split(";"); // prev pos
650
+ var vectorInitialPos = new Vector3(parseFloat(strInitialPos[0]), parseFloat(strInitialPos[1]), parseFloat(strInitialPos[2]));
651
+
652
+ if (vectorInitialPos.distanceTo(pos) > 0.5) { // fault tolerence
653
+ this.isDragAndDrop = true;
654
+ } else {
655
+ this.isDragAndDrop = false;
656
+ }
642
657
 
643
658
  // make sure position is updated in all 3 places:
644
659
  // evaluated instance
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  *
30
30
  * @private
31
31
  * @author SAP SE
32
- * @version 1.142.0
32
+ * @version 1.143.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 */ {
@@ -377,7 +377,7 @@ sap.ui.define([
377
377
  *
378
378
  * @private
379
379
  * @author SAP SE
380
- * @version 1.142.0
380
+ * @version 1.143.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.142.0
35
+ * @version 1.143.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 */ {
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  *
40
40
  * @private
41
41
  * @author SAP SE
42
- * @version 1.142.0
42
+ * @version 1.143.0
43
43
  * @alias sap.ui.vbm.adapter3d.RectangleTracker
44
44
  */
45
45
  var RectangleTracker = BaseObject.extend("sap.ui.vbm.adapter3d.RectangleTracker", /** @lends sap.ui.vbm.adapter3d.RectangleTracker.prototype */ {
@@ -53,6 +53,8 @@ sap.ui.define([
53
53
  this._camera = this._viewport._camera;
54
54
  this._cameraControls = this._viewport._cameraController;
55
55
  this._selected = new Set();
56
+ this._previousSelected = new Set();
57
+ this.disableRect = false;
56
58
  this._renderer = this._renderer;
57
59
  this.init();
58
60
  if (!this._adapter._cameraHelper) {
@@ -154,7 +156,16 @@ sap.ui.define([
154
156
  return; // Don't start selection if it's not the left button
155
157
  }
156
158
  this._updateController(true);
157
- this.onSelectStart(event);
159
+ // To start the selection if our arrow is on white space or
160
+ // not particulary on selectable object.
161
+ if (window.getComputedStyle(event.target).cursor == "auto") {
162
+ this._cameraControls.setEnabled(false);
163
+ this.onSelectStart(event);
164
+ this.disableRect = true;
165
+ } else {
166
+ this.disableRect = false;
167
+ return;
168
+ }
158
169
  event.cursor = event.cursor || this._getXY(event);
159
170
  this._mouseDown = true;
160
171
  var rect = this._viewport.getDomRef().getBoundingClientRect();
@@ -247,6 +258,9 @@ sap.ui.define([
247
258
  this._updateController(true);
248
259
  if (this._mouseDown) return;
249
260
 
261
+ // case we are restricting rect selection to achieve drag drop, camera movement and additive single as well
262
+ if (!this.disableRect) return;
263
+
250
264
  event.cursor = event.cursor || this._getXY(event);
251
265
  var rect = this._viewport.getDomRef().getBoundingClientRect();
252
266
  endPoint.x = (event.cursor.x / rect.width) * 2 - 1;
@@ -254,23 +268,48 @@ sap.ui.define([
254
268
  endPoint.z = 0.5
255
269
 
256
270
  const inside = this.selecting(_frustum); // all objects in rectangle
257
- if (inside.length === 0) {
271
+ if (!inside || inside.length === 0) {
258
272
  this._mouseDown = false;
273
+ this._cameraControls.setEnabled(true);
259
274
  this._dom.style.cursor = this._hovered ? "pointer" : "auto";
260
275
  this.onSelectOver();
261
276
  return;
262
277
  }
263
278
  // build new selection set
264
279
  const newSelected = new Set(inside);
280
+
281
+ // clearing all selected item
282
+ // do not worry as we are having selected item stored in _previousSelected set
283
+ // and newly selected are in newSelected set
284
+ this._selected.clear();
285
+
286
+ var deselected = [];
287
+
288
+ if (!event.ctrlKey && !event.shiftKey) {
289
+ // deselect items not in rectangle anymore
290
+ deselected = [...this._previousSelected].filter(i => !newSelected.has(i));
291
+ let instance = newSelected?.values()?.next()?.value?._sapInstance; // get 1st instance;
265
292
 
266
- // deselect items not in rectangle anymore
267
- var deselected = [...this._previousSelected].filter(i => !newSelected.has(i));
293
+ if (instance) {
294
+ var group = instance.voGroup;
295
+ const removeSelected = group.selected.reduceRight((acc, i, idx) => {
296
+ if (!newSelected.has(i.object3D)) {
297
+ acc.push(...group.selected.splice(idx, 1));
298
+ }
299
+ return acc;
300
+ }, []);
268
301
 
269
- // select items newly in rectangle
270
- //const newlySelected = [...newSelected].filter(i => !this._previousSelected.has(i));
302
+ deselected = [...deselected, ...removeSelected.map(item => ({ _sapInstance: item }))]; // to deselect manually selected objects.
303
+
304
+ }
305
+
306
+ } else {
307
+ // additive selection
308
+ // so maintain prevselected item as well.
309
+ [...this._previousSelected].forEach(i => this._selected.add(i));
310
+ }
271
311
 
272
312
  // update your internal set
273
- this._selected.clear();
274
313
  newSelected.forEach(i => this._selected.add(i));
275
314
 
276
315
  // build a single dataMap for deselection + selection
@@ -297,6 +336,7 @@ sap.ui.define([
297
336
 
298
337
  this._mouseDown = false;
299
338
  this._dom.style.cursor = this._hovered ? "pointer" : "auto";
339
+ this._cameraControls.setEnabled(true);
300
340
  this._updateController(true);
301
341
  this.onSelectOver();
302
342
  };
@@ -306,6 +346,9 @@ sap.ui.define([
306
346
  var payload = {
307
347
  version: "2.0",
308
348
  "xmlns:VB": "VB",
349
+ Action : {
350
+ name : "RECTANGULAR_SELECTION"
351
+ },
309
352
  Data: {
310
353
  Merge: {
311
354
  N: []
@@ -579,7 +622,7 @@ sap.ui.define([
579
622
  this._camera = null;
580
623
  this._cameraControls = null;
581
624
  this._raycaster = null;
582
- this._selected = null;
625
+ // this._selected = null;
583
626
  this._renderer = null;
584
627
  this._element = null;
585
628
  this._snapBox = null;
@@ -47,7 +47,7 @@ sap.ui.define([
47
47
  *
48
48
  * @private
49
49
  * @author SAP SE
50
- * @version 1.142.0
50
+ * @version 1.143.0
51
51
  * @alias sap.ui.vbm.adapter3d.SceneBuilder
52
52
  */
53
53
  var SceneBuilder = BaseObject.extend("sap.ui.vbm.adapter3d.SceneBuilder", /** @lends sap.ui.vbm.adapter3d.SceneBuilder.prototype */ {
@@ -56,7 +56,7 @@ sap.ui.define([
56
56
  *
57
57
  * @private
58
58
  * @author SAP SE
59
- * @version 1.142.0
59
+ * @version 1.143.0
60
60
  * @alias sap.ui.vbm.adapter3d.VBIJSONParser
61
61
  */
62
62
  var VBIJSONParser = BaseObject.extend("sap.ui.vbm.adapter3d.VBIJSONParser", /** @lends sap.ui.vbm.adapter3d.VBIJSONParser.prototype */ {
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @namespace
21
21
  * @alias sap.ui.vbm
22
22
  * @author SAP SE
23
- * @version 1.142.0
23
+ * @version 1.143.0
24
24
  * @public
25
25
  */
26
26
 
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  "sap.ui.vbm.ClusterBase", "sap.ui.vbm.ClusterTree", "sap.ui.vbm.ClusterGrid", "sap.ui.vbm.ClusterDistance", "sap.ui.vbm.Heatmap",
47
47
  "sap.ui.vbm.HeatPoint", "sap.ui.vbm.ClusterContainer", "sap.ui.vbm.Adapter", "sap.ui.vbm.Adapter3D"
48
48
  ],
49
- version: "1.142.0"
49
+ version: "1.143.0"
50
50
  });
51
51
 
52
52
  sap.ui.loader.config({
@@ -12,7 +12,7 @@ sap.ui.define([
12
12
  *
13
13
  * @private
14
14
  * @author SAP SE
15
- * @version 1.142.0
15
+ * @version 1.143.0
16
16
  * @alias sap.ui.vbm.vector.PayloadGenerator
17
17
  */
18
18
  var adapter = {};
@@ -12,7 +12,7 @@ sap.ui.define([
12
12
  *
13
13
  * @private
14
14
  * @author SAP SE
15
- * @version 1.142.0
15
+ * @version 1.143.0
16
16
  * @alias sap.ui.vbm.vector.RectangularSelection
17
17
  */
18
18