@sapui5/sap.ui.vbm 1.136.0 → 1.136.2
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 +2 -2
- package/src/sap/ui/vbm/Adapter.js +1 -1
- package/src/sap/ui/vbm/Adapter3D.js +195 -53
- package/src/sap/ui/vbm/AnalyticMap.js +10 -8
- package/src/sap/ui/vbm/ClusterRenderer.js +28 -4
- package/src/sap/ui/vbm/ContainerBase.js +4 -4
- package/src/sap/ui/vbm/MapContainer.js +3 -2
- package/src/sap/ui/vbm/MapContainerButtonType.js +1 -0
- package/src/sap/ui/vbm/Viewport.js +1 -1
- package/src/sap/ui/vbm/VoBase.js +5 -4
- package/src/sap/ui/vbm/adapter3d/ColladaBounds.js +1 -1
- package/src/sap/ui/vbm/adapter3d/DragDropHandler.js +14 -2
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +1 -1
- 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 +199 -170
- 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/library.js +11 -7
- package/src/sap/ui/vbm/vector/MapRenderer.js +204 -30
- package/src/sap/ui/vbm/vector/PayloadGenerator.js +1 -1
- package/src/sap/ui/vbm/vector/RectangularSelection.js +1 -1
- package/src/sap/ui/vbm/vector/VBITransformer.js +64 -17
- package/src/sap/ui/vbm/vector/VectorUtils.js +124 -13
- package/ui5.yaml +1 -1
|
@@ -7,7 +7,7 @@ sap.ui.define([
|
|
|
7
7
|
var Vector2 = THREE.Vector2;
|
|
8
8
|
var _frustum = new THREE.Frustum;
|
|
9
9
|
var _center = new THREE.Vector3;
|
|
10
|
-
var _tmpPoint = new THREE.Vector3;
|
|
10
|
+
//var _tmpPoint = new THREE.Vector3;
|
|
11
11
|
var _vecNear = new THREE.Vector3;
|
|
12
12
|
var _vecTopLeft = new THREE.Vector3;
|
|
13
13
|
var _vecTopRight = new THREE.Vector3;
|
|
@@ -39,7 +39,7 @@ sap.ui.define([
|
|
|
39
39
|
*
|
|
40
40
|
* @private
|
|
41
41
|
* @author SAP SE
|
|
42
|
-
* @version 1.136.
|
|
42
|
+
* @version 1.136.2
|
|
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,11 +53,15 @@ 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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
if (!this._adapter._cameraHelper) {
|
|
61
|
+
this._adapter._cameraHelper = new THREE.CameraHelper(this._camera);
|
|
62
|
+
this._adapter._cameraHelper.geometry.setDrawRange(0, 0);
|
|
63
|
+
this._addToScene(this._adapter._cameraHelper, this._scene, true, 1);
|
|
64
|
+
}
|
|
61
65
|
this._snapBox = new THREE.BoxHelper(undefined, 0x00ffff);
|
|
62
66
|
// invisible, layer #1 (disable hit test)
|
|
63
67
|
this._addToScene(this._snapBox, this._scene, false, 1);
|
|
@@ -114,7 +118,7 @@ sap.ui.define([
|
|
|
114
118
|
var ref = this._viewport.getDomRef();
|
|
115
119
|
if (ref) {
|
|
116
120
|
this._dom = ref;
|
|
117
|
-
this._addListener(ref, "pointerup", this.
|
|
121
|
+
this._addListener(ref, "pointerup", this._onPointerUp);
|
|
118
122
|
this._addListener(ref, "pointerdown", this._onPointerDown);
|
|
119
123
|
this._addListener(ref, "pointermove", this._onPointerMove);
|
|
120
124
|
this._addListener(ref, "pointerleave", this._onPointerCancel);
|
|
@@ -148,185 +152,196 @@ sap.ui.define([
|
|
|
148
152
|
};
|
|
149
153
|
|
|
150
154
|
RectangleTracker.prototype._onPointerDown = function (event) {
|
|
155
|
+
if (event.button !== 0) {
|
|
156
|
+
return; // Don't start selection if it's not the left button
|
|
157
|
+
}
|
|
151
158
|
this._updateController(true);
|
|
152
|
-
|
|
153
|
-
|
|
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
|
+
}
|
|
154
169
|
event.cursor = event.cursor || this._getXY(event);
|
|
155
170
|
this._mouseDown = true;
|
|
156
171
|
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
157
172
|
startPoint.x = (event.cursor.x / rect.width) * 2 - 1;
|
|
158
173
|
startPoint.y = -(event.cursor.y / rect.height) * 2 + 1;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
var keyAlias;
|
|
162
|
-
if (!event.ctrlKey) {
|
|
163
|
-
this._selected.forEach(function (item) {
|
|
164
|
-
if (item.type != 'InstancedMesh' || item.type != 'PlaneGeometry') {
|
|
165
|
-
var obj = {};
|
|
166
|
-
if (item._sapInstance != undefined) {
|
|
167
|
-
var val = item._sapInstance;
|
|
168
|
-
item._sapInstance["VB:s"] = "false";
|
|
169
|
-
that._adapter._sceneBuilder.updateHotInstance(val);
|
|
170
|
-
dataType = item._sapInstance.voGroup.datasource; // VO group data source linked to a DataType by name
|
|
171
|
-
keyAlias = that._adapter._parser.getAttributeAlias(dataType, item._sapInstance.voGroup.keyAttributeName);
|
|
172
|
-
obj[keyAlias] = item._sapInstance.id;
|
|
173
|
-
obj["VB:s"] = "false";
|
|
174
|
-
} else if (item.userData.name == "ColladaBounds") {
|
|
175
|
-
if (item.userData._sapInstance["VB:s"] == "true") {
|
|
176
|
-
var instance = item.userData._sapInstance;
|
|
177
|
-
var selectionChanges = that._adapter._changeSelection(instance, "toggle", false);
|
|
178
|
-
that._adapter._sceneBuilder.updateSelection(selectionChanges.selected, selectionChanges.deselected);
|
|
179
|
-
dataType = item.userData._sapInstance.voGroup.datasource; // VO group data source linked to a DataType by name
|
|
180
|
-
keyAlias = that._adapter._parser.getAttributeAlias(dataType, item.userData._sapInstance.voGroup.keyAttributeName);
|
|
181
|
-
obj[keyAlias] = item.userData.id;
|
|
182
|
-
obj["VB:s"] = "false";
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
var existingData = dataMap.get(dataType);
|
|
187
|
-
if (existingData != undefined ) {
|
|
188
|
-
// Check if there's already an entry for this dataType
|
|
189
|
-
var existingEntry = existingData.find(function (entry) {
|
|
190
|
-
return entry.name === dataType;
|
|
191
|
-
});
|
|
174
|
+
this._previousSelected = new Set(this._selected);
|
|
175
|
+
};
|
|
192
176
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
177
|
+
RectangleTracker.prototype._onPointerMove = function (event) {
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
//this._updateController(false);
|
|
180
|
+
if (this._mouseDown) {
|
|
181
|
+
this._cameraControls.enableRotate = false;
|
|
182
|
+
this.onSelectMove(event);
|
|
183
|
+
this._updatePointer(event, _pointer);
|
|
184
|
+
this._handleHover(_pointer);
|
|
185
|
+
}
|
|
186
|
+
// else if (!this._mouseDown) {
|
|
187
|
+
// this._cameraControls.enableRotate = false;
|
|
188
|
+
// }
|
|
189
|
+
}
|
|
190
|
+
RectangleTracker.prototype.buildEntry = function (item, selected, items) {
|
|
191
|
+
let dataType, keyAlias;
|
|
192
|
+
let obj = {};
|
|
193
|
+
|
|
194
|
+
if (item._sapInstance != undefined) {
|
|
195
|
+
const val = item._sapInstance;
|
|
196
|
+
item._sapInstance["VB:s"] = selected ? "true" : "false";
|
|
197
|
+
// maybe updateHotInstance only for selected?
|
|
198
|
+
this._adapter._sceneBuilder.updateHotInstance(val);
|
|
199
|
+
dataType = item._sapInstance.voGroup.datasource;
|
|
200
|
+
keyAlias = this._adapter._parser.getAttributeAlias(dataType, item._sapInstance.voGroup.keyAttributeName);
|
|
201
|
+
obj[keyAlias] = item._sapInstance.id;
|
|
202
|
+
obj["VB:s"] = selected ? "true" : "false";
|
|
203
|
+
} else if (item.userData.name === "ColladaBounds") {
|
|
204
|
+
if (selected === true) {
|
|
205
|
+
var id = item.userData.id;
|
|
206
|
+
var meshCount = item.userData.count;
|
|
207
|
+
var count = 0;
|
|
208
|
+
items.forEach(function (itemA) {
|
|
209
|
+
if (itemA.userData.id == id)
|
|
210
|
+
count++;
|
|
211
|
+
});
|
|
212
|
+
if (count == meshCount) {
|
|
213
|
+
var instance = item.userData._sapInstance;
|
|
214
|
+
var selectionChanges = this._adapter._changeSelection(instance, "select", false);
|
|
215
|
+
this._adapter._sceneBuilder.updateSelection(selectionChanges.selected, selectionChanges.deselected);
|
|
216
|
+
dataType = item.userData._sapInstance.voGroup.datasource; // VO group data source linked to a DataType by name
|
|
217
|
+
keyAlias = this._adapter._parser.getAttributeAlias(dataType, item.userData._sapInstance.voGroup.keyAttributeName);
|
|
218
|
+
obj[keyAlias] = item.userData.id;
|
|
219
|
+
obj["VB:s"] = "true";
|
|
213
220
|
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
} else {
|
|
222
|
+
if (item.userData._sapInstance["VB:s"] == "true") {
|
|
223
|
+
var instance = item.userData._sapInstance;
|
|
224
|
+
var selectionChanges = this._adapter._changeSelection(instance, "toggle", false);
|
|
225
|
+
this._adapter._sceneBuilder.updateSelection(selectionChanges.selected, selectionChanges.deselected);
|
|
226
|
+
// your ColladaBounds logic with selected/deselected
|
|
227
|
+
dataType = item.userData._sapInstance.voGroup.datasource;
|
|
228
|
+
keyAlias = this._adapter._parser.getAttributeAlias(dataType, item.userData._sapInstance.voGroup.keyAttributeName);
|
|
229
|
+
obj[keyAlias] = item.userData.id;
|
|
230
|
+
obj["VB:s"] = selected ? "true" : "false";
|
|
222
231
|
}
|
|
223
232
|
}
|
|
224
233
|
}
|
|
225
234
|
|
|
226
|
-
|
|
235
|
+
return { dataType, keyAlias, obj };
|
|
227
236
|
};
|
|
228
237
|
|
|
229
|
-
RectangleTracker.prototype.
|
|
230
|
-
|
|
238
|
+
RectangleTracker.prototype.addToDataMap = function (dataMap, dataType, obj, keyAlias, item) {
|
|
239
|
+
if (!dataType || !obj) return;
|
|
240
|
+
const existingData = dataMap.get(dataType);
|
|
241
|
+
if (existingData) {
|
|
242
|
+
const existingEntry = existingData.find(entry => entry.name === dataType);
|
|
243
|
+
if (existingEntry) {
|
|
244
|
+
const existingObject = existingEntry.E.find(e => {
|
|
245
|
+
if (item._sapInstance != undefined)
|
|
246
|
+
return e[keyAlias] === item._sapInstance.id;
|
|
247
|
+
else
|
|
248
|
+
return e[keyAlias] === item.userData.id;
|
|
249
|
+
});
|
|
250
|
+
if (!existingObject && JSON.stringify(obj) !== '{}') existingEntry.E.push(obj);
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
dataMap.set(dataType, [{ name: dataType, E: [obj] }]);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
231
256
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
257
|
+
RectangleTracker.prototype._onPointerUp = function (event) {
|
|
258
|
+
this._updateController(true);
|
|
259
|
+
if (this._mouseDown) return;
|
|
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
|
+
|
|
264
|
+
event.cursor = event.cursor || this._getXY(event);
|
|
265
|
+
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
266
|
+
endPoint.x = (event.cursor.x / rect.width) * 2 - 1;
|
|
267
|
+
endPoint.y = -(event.cursor.y / rect.height) * 2 + 1;
|
|
268
|
+
endPoint.z = 0.5
|
|
269
|
+
|
|
270
|
+
const inside = this.selecting(_frustum); // all objects in rectangle
|
|
271
|
+
if (!inside || inside.length === 0) {
|
|
272
|
+
this._mouseDown = false;
|
|
273
|
+
this._cameraControls.setEnabled(true);
|
|
274
|
+
this._dom.style.cursor = this._hovered ? "pointer" : "auto";
|
|
275
|
+
this.onSelectOver();
|
|
276
|
+
return;
|
|
235
277
|
}
|
|
278
|
+
// build new selection set
|
|
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();
|
|
236
285
|
|
|
237
|
-
|
|
238
|
-
this._updateController(false);
|
|
239
|
-
this.onSelectMove(event);
|
|
240
|
-
var that = this;
|
|
241
|
-
event.cursor = event.cursor || this._getXY(event);
|
|
242
|
-
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
243
|
-
endPoint.x = (event.cursor.x / rect.width) * 2 - 1;
|
|
244
|
-
endPoint.y = -(event.cursor.y / rect.height) * 2 + 1;
|
|
245
|
-
endPoint.z = 0.5
|
|
246
|
-
var isSelected = this.selecting(_frustum);
|
|
247
|
-
var dataMap = new Map();
|
|
248
|
-
var dataType;
|
|
249
|
-
var keyAlias;
|
|
250
|
-
var obj = {};
|
|
251
|
-
if (isSelected.length > 0) {
|
|
252
|
-
for (var i = 0; i < isSelected.length; i++) {
|
|
253
|
-
this._selected.add(isSelected[i]);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
this._selected.forEach(function (item) {
|
|
257
|
-
obj = {};
|
|
258
|
-
if (item.type != 'InstancedMesh' || item.type != 'PlaneGeometry') {
|
|
259
|
-
if (item._sapInstance != undefined) {
|
|
260
|
-
var val = item._sapInstance;
|
|
261
|
-
item._sapInstance["VB:s"] = "true";
|
|
262
|
-
that._adapter._sceneBuilder.updateHotInstance(val);
|
|
263
|
-
dataType = item._sapInstance.voGroup.datasource; // VO group data source linked to a DataType by name
|
|
264
|
-
keyAlias = that._adapter._parser.getAttributeAlias(dataType, item._sapInstance.voGroup.keyAttributeName);
|
|
265
|
-
obj[keyAlias] = item._sapInstance.id;
|
|
266
|
-
obj["VB:s"] = "true";
|
|
267
|
-
// that._adapter._handleHover(val);
|
|
268
|
-
} else if (item.userData.name == "ColladaBounds") {
|
|
269
|
-
var id = item.userData.id;
|
|
270
|
-
var meshCount = item.userData.count;
|
|
271
|
-
var count = 0;
|
|
272
|
-
that._selected.forEach(function (itemA) {
|
|
273
|
-
if (itemA.userData.id == id)
|
|
274
|
-
count++;
|
|
275
|
-
});
|
|
276
|
-
if (count == meshCount) {
|
|
277
|
-
var instance = item.userData._sapInstance;
|
|
278
|
-
var selectionChanges = that._adapter._changeSelection(instance, "select", false);
|
|
279
|
-
that._adapter._sceneBuilder.updateSelection(selectionChanges.selected, selectionChanges.deselected);
|
|
280
|
-
dataType = item.userData._sapInstance.voGroup.datasource; // VO group data source linked to a DataType by name
|
|
281
|
-
keyAlias = that._adapter._parser.getAttributeAlias(dataType, item.userData._sapInstance.voGroup.keyAttributeName);
|
|
282
|
-
obj[keyAlias] = item.userData.id;
|
|
283
|
-
obj["VB:s"] = "true";
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
+
var deselected = [];
|
|
286
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;
|
|
287
292
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
294
|
-
if (existingEntry) {
|
|
295
|
-
// If an entry exists for this dataType, push the new object to its E array if it's not already present
|
|
296
|
-
var existingObject = existingEntry.E.find(function (e) {
|
|
297
|
-
if (item._sapInstance != undefined)
|
|
298
|
-
return e[keyAlias] === item._sapInstance.id
|
|
299
|
-
else
|
|
300
|
-
return e[keyAlias] === item.userData.id;
|
|
301
|
-
});
|
|
302
|
-
if (!existingObject && JSON.stringify(obj) !== '{}') {
|
|
303
|
-
// If the object doesn't exist, push it to the E array
|
|
304
|
-
existingEntry.E.push(obj);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
} else {
|
|
308
|
-
// If no data exists for this dataType, create a new array and add the object
|
|
309
|
-
dataMap.set(dataType, [{
|
|
310
|
-
name: dataType,
|
|
311
|
-
E: [obj]
|
|
312
|
-
}]);
|
|
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));
|
|
313
298
|
}
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
299
|
+
return acc;
|
|
300
|
+
}, []);
|
|
301
|
+
|
|
302
|
+
deselected = [...deselected, ...removeSelected.map(item => ({ _sapInstance: item }))]; // to deselect manually selected objects.
|
|
303
|
+
|
|
304
|
+
}
|
|
317
305
|
|
|
306
|
+
} else {
|
|
307
|
+
// additive selection
|
|
308
|
+
// so maintain prevselected item as well.
|
|
309
|
+
[...this._previousSelected].forEach(i => this._selected.add(i));
|
|
318
310
|
}
|
|
319
|
-
|
|
320
|
-
|
|
311
|
+
|
|
312
|
+
// update your internal set
|
|
313
|
+
newSelected.forEach(i => this._selected.add(i));
|
|
314
|
+
|
|
315
|
+
// build a single dataMap for deselection + selection
|
|
316
|
+
const dataMap = new Map();
|
|
317
|
+
|
|
318
|
+
// handle deselection
|
|
319
|
+
deselected.forEach(item => {
|
|
320
|
+
const { dataType, keyAlias, obj } = this.buildEntry(item, false, deselected); // VB:s false
|
|
321
|
+
this.addToDataMap(dataMap, dataType, obj, keyAlias, item);
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// handle selection
|
|
325
|
+
inside.forEach(item => {
|
|
326
|
+
const { dataType, keyAlias, obj } = this.buildEntry(item, true, inside); // VB:s true
|
|
327
|
+
this.addToDataMap(dataMap, dataType, obj, keyAlias, item);
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
if (dataMap.size > 0) {
|
|
331
|
+
const payload = this._constructPayload(dataMap);
|
|
321
332
|
if (payload.Data.Merge.N.length > 0) {
|
|
322
|
-
this._adapter.fireSubmit({
|
|
323
|
-
data: JSON.stringify(payload)
|
|
324
|
-
});
|
|
333
|
+
this._adapter.fireSubmit({ data: JSON.stringify(payload) });
|
|
325
334
|
}
|
|
326
335
|
}
|
|
327
336
|
|
|
337
|
+
this._mouseDown = false;
|
|
338
|
+
this._dom.style.cursor = this._hovered ? "pointer" : "auto";
|
|
339
|
+
this._cameraControls.setEnabled(true);
|
|
340
|
+
this._updateController(true);
|
|
341
|
+
this.onSelectOver();
|
|
328
342
|
};
|
|
329
343
|
|
|
344
|
+
|
|
330
345
|
RectangleTracker.prototype._constructPayload = function (dataMap) {
|
|
331
346
|
var payload = {
|
|
332
347
|
version: "2.0",
|
|
@@ -412,6 +427,14 @@ sap.ui.define([
|
|
|
412
427
|
this.startPoint = startPoint || this.startPoint;
|
|
413
428
|
this.endPoint = endPoint || this.endPoint;
|
|
414
429
|
this.collection = [];
|
|
430
|
+
const dx = Math.abs(endPoint.x - startPoint.x);
|
|
431
|
+
const dy = Math.abs(endPoint.y - startPoint.y);
|
|
432
|
+
|
|
433
|
+
// if less than 2-3 pixels movement => treat as click, skip updateFrustum
|
|
434
|
+
if (dx < 0.002 && dy < 0.002) {
|
|
435
|
+
// 👉 handle as simple click (use raycaster for single object select)
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
415
438
|
this.updateFrustum(this.startPoint, this.endPoint);
|
|
416
439
|
this.searchChildInFrustum(_frustum, this._scene);
|
|
417
440
|
this._scene.remove(this._planeMesh);
|
|
@@ -439,18 +462,20 @@ sap.ui.define([
|
|
|
439
462
|
|
|
440
463
|
if (this._camera.isPerspectiveCamera) {
|
|
441
464
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
465
|
+
// Normalize rectangle regardless of drag direction
|
|
466
|
+
var minX = Math.min(startPoint.x, endPoint.x);
|
|
467
|
+
var maxX = Math.max(startPoint.x, endPoint.x);
|
|
468
|
+
var minY = Math.min(startPoint.y, endPoint.y);
|
|
469
|
+
var maxY = Math.max(startPoint.y, endPoint.y);
|
|
447
470
|
|
|
448
|
-
_vecNear.setFromMatrixPosition(this._camera.matrixWorld);
|
|
449
|
-
_vecTopLeft.copy(_tmpPoint);
|
|
450
|
-
_vecTopRight.set(endPoint.x, _tmpPoint.y, 0);
|
|
451
|
-
_vecDownRight.copy(endPoint);
|
|
452
|
-
_vecDownLeft.set(_tmpPoint.x, endPoint.y, 0);
|
|
453
471
|
|
|
472
|
+
_vecNear.setFromMatrixPosition(this._camera.matrixWorld);
|
|
473
|
+
// Define corners in NDC (normalized device coordinates)
|
|
474
|
+
_vecTopLeft.set(minX, maxY, 0);
|
|
475
|
+
_vecTopRight.set(maxX, maxY, 0);
|
|
476
|
+
_vecDownRight.set(maxX, minY, 0);
|
|
477
|
+
_vecDownLeft.set(minX, minY, 0);
|
|
478
|
+
|
|
454
479
|
_vecTopLeft.unproject(this._camera);
|
|
455
480
|
_vecTopRight.unproject(this._camera);
|
|
456
481
|
_vecDownRight.unproject(this._camera);
|
|
@@ -459,9 +484,12 @@ sap.ui.define([
|
|
|
459
484
|
_vectemp1.copy(_vecTopLeft).sub(_vecNear);
|
|
460
485
|
_vectemp2.copy(_vecTopRight).sub(_vecNear);
|
|
461
486
|
_vectemp3.copy(_vecDownRight).sub(_vecNear);
|
|
487
|
+
_vectemp4.copy(_vecDownLeft).sub(_vecNear)
|
|
488
|
+
|
|
462
489
|
_vectemp1.normalize();
|
|
463
490
|
_vectemp2.normalize();
|
|
464
491
|
_vectemp3.normalize();
|
|
492
|
+
_vectemp4.normalize();
|
|
465
493
|
|
|
466
494
|
|
|
467
495
|
_vectemp1.multiplyScalar(this.deep);
|
|
@@ -471,6 +499,7 @@ sap.ui.define([
|
|
|
471
499
|
_vectemp1.sub(_vecNear);
|
|
472
500
|
_vectemp2.sub(_vecNear);
|
|
473
501
|
_vectemp3.sub(_vecNear);
|
|
502
|
+
_vectemp4.sub(_vecNear);
|
|
474
503
|
|
|
475
504
|
var planes = _frustum.planes;
|
|
476
505
|
|
|
@@ -484,11 +513,11 @@ sap.ui.define([
|
|
|
484
513
|
}
|
|
485
514
|
|
|
486
515
|
|
|
487
|
-
}
|
|
516
|
+
};
|
|
488
517
|
|
|
489
518
|
RectangleTracker.prototype.searchChildInFrustum = function (frustum, object) {
|
|
490
519
|
var count = 0;
|
|
491
|
-
if (object._sapInstance != undefined && !object.
|
|
520
|
+
if (object._sapInstance != undefined && ((object._sapInstance["VB:c"] == 'true' ) || !(object._sapInstance["VB:c"]) )) {
|
|
492
521
|
var box1 = new THREE.BoxHelper(object, 0x000000);
|
|
493
522
|
var vertices = box1.geometry.attributes.position.array;
|
|
494
523
|
for (var i = 0, l = vertices.length; i < l; i += 3) {
|
|
@@ -590,7 +619,7 @@ sap.ui.define([
|
|
|
590
619
|
this._camera = null;
|
|
591
620
|
this._cameraControls = null;
|
|
592
621
|
this._raycaster = null;
|
|
593
|
-
this._selected = null;
|
|
622
|
+
// this._selected = null;
|
|
594
623
|
this._renderer = null;
|
|
595
624
|
this._element = null;
|
|
596
625
|
this._snapBox = null;
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
*
|
|
48
48
|
* @private
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.136.
|
|
50
|
+
* @version 1.136.2
|
|
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.136.
|
|
59
|
+
* @version 1.136.2
|
|
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 */ {
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* Initialization Code and shared classes of library sap.ui.vbm.
|
|
7
7
|
*/
|
|
8
8
|
sap.ui.define([
|
|
9
|
-
"sap/ui/
|
|
9
|
+
"sap/ui/base/DataType",
|
|
10
|
+
"sap/ui/core/Lib",
|
|
10
11
|
"sap/m/library",
|
|
11
12
|
"sap/ui/core/library",
|
|
12
|
-
"sap/ui/unified/library"
|
|
13
|
-
|
|
14
|
-
], function(Core,mlibrary,clibrary,ulibrary,Lib) {
|
|
13
|
+
"sap/ui/unified/library"
|
|
14
|
+
], function(DataType,Lib,_mlibrary,_clibrary,_ulibrary) {
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
* @namespace
|
|
21
21
|
* @alias sap.ui.vbm
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.136.
|
|
23
|
+
* @version 1.136.2
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -29,8 +29,9 @@ sap.ui.define([
|
|
|
29
29
|
|
|
30
30
|
var vbmLibrary = Lib.init({
|
|
31
31
|
name: "sap.ui.vbm",
|
|
32
|
+
apiVersion: 2,
|
|
32
33
|
types: [
|
|
33
|
-
"sap.ui.vbm.ClusterInfoType", "sap.ui.vbm.SemanticType"
|
|
34
|
+
"sap.ui.vbm.ClusterInfoType", "sap.ui.vbm.SemanticType", "sap.ui.vbm.RouteType"
|
|
34
35
|
],
|
|
35
36
|
controls: [
|
|
36
37
|
"sap.ui.vbm.AnalyticMap", "sap.ui.vbm.GeoMap", "sap.ui.vbm.VBI", "sap.ui.vbm.Cluster", "sap.ui.vbm.Viewport","sap.ui.vbm.ContainerLegendItem",
|
|
@@ -45,7 +46,7 @@ sap.ui.define([
|
|
|
45
46
|
"sap.ui.vbm.ClusterBase", "sap.ui.vbm.ClusterTree", "sap.ui.vbm.ClusterGrid", "sap.ui.vbm.ClusterDistance", "sap.ui.vbm.Heatmap",
|
|
46
47
|
"sap.ui.vbm.HeatPoint", "sap.ui.vbm.ClusterContainer", "sap.ui.vbm.Adapter", "sap.ui.vbm.Adapter3D"
|
|
47
48
|
],
|
|
48
|
-
version: "1.136.
|
|
49
|
+
version: "1.136.2"
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
sap.ui.loader.config({
|
|
@@ -132,6 +133,7 @@ sap.ui.define([
|
|
|
132
133
|
Hidden: "Hidden"
|
|
133
134
|
|
|
134
135
|
};
|
|
136
|
+
DataType.registerEnum("sap.ui.vbm.SemanticType", vbmLibrary.SemanticType);
|
|
135
137
|
|
|
136
138
|
/**
|
|
137
139
|
* Cluster Info Type
|
|
@@ -179,6 +181,7 @@ sap.ui.define([
|
|
|
179
181
|
Edges: 11
|
|
180
182
|
|
|
181
183
|
};
|
|
184
|
+
// As of 2025-05-23, this enum is not used in managed properties and therefore not registered
|
|
182
185
|
|
|
183
186
|
/**
|
|
184
187
|
* Route type, determining how line between start and endpoint should be drawn.
|
|
@@ -204,6 +207,7 @@ sap.ui.define([
|
|
|
204
207
|
Geodesic: "Geodesic"
|
|
205
208
|
|
|
206
209
|
};
|
|
210
|
+
DataType.registerEnum("sap.ui.vbm.RouteType", vbmLibrary.RouteType);
|
|
207
211
|
|
|
208
212
|
vbmLibrary.getResourceBundle = function() {
|
|
209
213
|
var oResourceBundle = Lib.getResourceBundleFor("sap.ui.vbm")
|