@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
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/base/Object",
|
|
3
|
+
"./thirdparty/three"
|
|
4
|
+
], function (BaseObject, THREE) {
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
var Vector2 = THREE.Vector2;
|
|
8
|
+
var _frustum = new THREE.Frustum;
|
|
9
|
+
var _center = new THREE.Vector3;
|
|
10
|
+
var _tmpPoint = new THREE.Vector3;
|
|
11
|
+
var _vecNear = new THREE.Vector3;
|
|
12
|
+
var _vecTopLeft = new THREE.Vector3;
|
|
13
|
+
var _vecTopRight = new THREE.Vector3;
|
|
14
|
+
var _vecDownRight = new THREE.Vector3;
|
|
15
|
+
var _vecDownLeft = new THREE.Vector3;
|
|
16
|
+
var _vectemp1 = new THREE.Vector3;
|
|
17
|
+
var _vectemp2 = new THREE.Vector3;
|
|
18
|
+
var _vectemp3 = new THREE.Vector3;
|
|
19
|
+
var _vectemp4 = new THREE.Vector3;
|
|
20
|
+
var startPoint = new THREE.Vector3;
|
|
21
|
+
var endPoint = new THREE.Vector3;
|
|
22
|
+
var _raycaster = new THREE.Raycaster();
|
|
23
|
+
var _pointer = new Vector2();
|
|
24
|
+
|
|
25
|
+
var viewportEventDelegate = {
|
|
26
|
+
onBeforeRendering: function (event) {
|
|
27
|
+
this._unsubscribe();
|
|
28
|
+
},
|
|
29
|
+
onAfterRendering: function (event) {
|
|
30
|
+
this._subscribe();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
|
|
39
|
+
*
|
|
40
|
+
* @private
|
|
41
|
+
* @author SAP SE
|
|
42
|
+
* @version 1.126.0
|
|
43
|
+
* @alias sap.ui.vbm.adapter3d.RectangleTracker
|
|
44
|
+
*/
|
|
45
|
+
var RectangleTracker = BaseObject.extend("sap.ui.vbm.adapter3d.RectangleTracker", /** @lends sap.ui.vbm.adapter3d.RectangleTracker.prototype */ {
|
|
46
|
+
constructor: function (adapter) {
|
|
47
|
+
BaseObject.call(this);
|
|
48
|
+
this._adapter = adapter;
|
|
49
|
+
this._context = adapter._context;
|
|
50
|
+
this._viewport = adapter._viewport;
|
|
51
|
+
this._root = this._viewport._root;
|
|
52
|
+
this._scene = this._viewport._scene;
|
|
53
|
+
this._camera = this._viewport._camera;
|
|
54
|
+
this._cameraControls = this._viewport._cameraController;
|
|
55
|
+
this._selected = new Set();
|
|
56
|
+
this._renderer = this._renderer;
|
|
57
|
+
this.init();
|
|
58
|
+
var helper = new THREE.CameraHelper(this._camera);
|
|
59
|
+
helper.geometry.setDrawRange(0, 0);
|
|
60
|
+
this._addToScene(helper, this._scene, true, 1);
|
|
61
|
+
this._snapBox = new THREE.BoxHelper(undefined, 0x00ffff);
|
|
62
|
+
// invisible, layer #1 (disable hit test)
|
|
63
|
+
this._addToScene(this._snapBox, this._scene, false, 1);
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
RectangleTracker.prototype.init = function () {
|
|
71
|
+
this._mouseDown = false;
|
|
72
|
+
var element1 = document.createElement("div");
|
|
73
|
+
element1.classList.add("selectBox");
|
|
74
|
+
this._element = element1;
|
|
75
|
+
this._element.style.pointerEvents = 'none';
|
|
76
|
+
this._renderer = this._viewport._renderer;
|
|
77
|
+
this._startPoint = new Vector2();
|
|
78
|
+
this.pointTopLeft = new Vector2();
|
|
79
|
+
this.pointBottomRight = new Vector2();
|
|
80
|
+
this.deep = 50;
|
|
81
|
+
this.instances = [];
|
|
82
|
+
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
RectangleTracker.prototype._getXY = function (event) {
|
|
86
|
+
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
87
|
+
return {
|
|
88
|
+
x: (event.pageX || event.originalEvent.pageX) - window.pageXOffset - rect.left,
|
|
89
|
+
y: (event.pageY || event.originalEvent.pageY) - window.pageYOffset - rect.top
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
RectangleTracker.prototype._updatePointer = function (event, out) {
|
|
94
|
+
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
95
|
+
out.x = (event.cursor ? event.cursor.x : event.pageX - window.pageXOffset - rect.left) / rect.width * 2 - 1;
|
|
96
|
+
out.y = -(event.cursor ? event.cursor.y : event.pageY - window.pageYOffset - rect.top) / rect.height * 2 + 1;
|
|
97
|
+
return out;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
RectangleTracker.prototype._addListener = function (source, event, handler) {
|
|
103
|
+
var proxy1 = handler.bind(this);
|
|
104
|
+
this[event + "Proxy"] = proxy1;
|
|
105
|
+
source.addEventListener(event, proxy1);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
RectangleTracker.prototype._removeListener = function (source, event) {
|
|
109
|
+
source.removeEventListener(event, this[event + "Proxy"]);
|
|
110
|
+
delete this[event + "Proxy"];
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
RectangleTracker.prototype._subscribe = function () {
|
|
114
|
+
var ref = this._viewport.getDomRef();
|
|
115
|
+
if (ref) {
|
|
116
|
+
this._dom = ref;
|
|
117
|
+
this._addListener(ref, "pointerup", this._onPointerCancel);
|
|
118
|
+
this._addListener(ref, "pointerdown", this._onPointerDown);
|
|
119
|
+
this._addListener(ref, "pointermove", this._onPointerMove);
|
|
120
|
+
this._addListener(ref, "pointerleave", this._onPointerCancel);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
RectangleTracker.prototype._unsubscribe = function () {
|
|
125
|
+
var ref = this._viewport.getDomRef();
|
|
126
|
+
if (ref) {
|
|
127
|
+
this._dom = null;
|
|
128
|
+
this._removeListener(ref, "pointerup");
|
|
129
|
+
this._removeListener(ref, "pointerdown");
|
|
130
|
+
this._removeListener(ref, "pointermove");
|
|
131
|
+
this._removeListener(ref, "pointerleave");
|
|
132
|
+
}
|
|
133
|
+
this._removeListener(this._cameraControls, "change");
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
RectangleTracker.prototype._addToScene = function (obj, parent, visible, layer, order) {
|
|
137
|
+
if (visible !== undefined) {
|
|
138
|
+
obj.visible = visible;
|
|
139
|
+
}
|
|
140
|
+
if (layer !== undefined) {
|
|
141
|
+
obj.layers.set(layer);
|
|
142
|
+
}
|
|
143
|
+
if (order !== undefined) {
|
|
144
|
+
obj.renderOrder = order;
|
|
145
|
+
}
|
|
146
|
+
parent.add(obj);
|
|
147
|
+
obj.matrixAutoUpdate = false;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
RectangleTracker.prototype._onPointerDown = function (event) {
|
|
151
|
+
this._updateController(true);
|
|
152
|
+
this.onSelectStart(event);
|
|
153
|
+
var that = this;
|
|
154
|
+
event.cursor = event.cursor || this._getXY(event);
|
|
155
|
+
this._mouseDown = true;
|
|
156
|
+
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
157
|
+
startPoint.x = (event.cursor.x / rect.width) * 2 - 1;
|
|
158
|
+
startPoint.y = -(event.cursor.y / rect.height) * 2 + 1;
|
|
159
|
+
var dataMap = new Map();
|
|
160
|
+
var dataType;
|
|
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
|
+
});
|
|
192
|
+
|
|
193
|
+
if (existingEntry) {
|
|
194
|
+
// If an entry exists for this dataType, push the new object to its E array if it's not already present
|
|
195
|
+
var existingObject = existingEntry.E.find(function (e) {
|
|
196
|
+
if (item._sapInstance != undefined)
|
|
197
|
+
return e[keyAlias] === item._sapInstance.id
|
|
198
|
+
else
|
|
199
|
+
return e[keyAlias] === item.userData.id;
|
|
200
|
+
});
|
|
201
|
+
if (!existingObject && JSON.stringify(obj) !== '{}' ) {
|
|
202
|
+
// If the object doesn't exist, push it to the E array
|
|
203
|
+
existingEntry.E.push(obj);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
// If no data exists for this dataType, create a new array and add the object
|
|
208
|
+
dataMap.set(dataType, [{
|
|
209
|
+
name: dataType,
|
|
210
|
+
E: [obj]
|
|
211
|
+
}]);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
if (dataMap != undefined) {
|
|
217
|
+
var payload = that._constructPayload(dataMap);
|
|
218
|
+
if (payload.Data.Merge.N.length > 0) {
|
|
219
|
+
this._adapter.fireSubmit({
|
|
220
|
+
data: JSON.stringify(payload)
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
this._selected.clear();
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
RectangleTracker.prototype._onPointerMove = function (event) {
|
|
230
|
+
event.preventDefault();
|
|
231
|
+
|
|
232
|
+
if (!this._mouseDown) {
|
|
233
|
+
this._updatePointer(event, _pointer);
|
|
234
|
+
this._handleHover(_pointer);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (this._mouseDown) {
|
|
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
|
+
|
|
287
|
+
|
|
288
|
+
var existingData = dataMap.get(dataType);
|
|
289
|
+
if (existingData != undefined) {
|
|
290
|
+
// Check if there's already an entry for this dataType
|
|
291
|
+
var existingEntry = existingData.find(function (entry) {
|
|
292
|
+
return entry.name === dataType;
|
|
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
|
+
}]);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
}
|
|
319
|
+
if (dataMap != undefined) {
|
|
320
|
+
var payload = that._constructPayload(dataMap);
|
|
321
|
+
if (payload.Data.Merge.N.length > 0) {
|
|
322
|
+
this._adapter.fireSubmit({
|
|
323
|
+
data: JSON.stringify(payload)
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
RectangleTracker.prototype._constructPayload = function (dataMap) {
|
|
331
|
+
var payload = {
|
|
332
|
+
version: "2.0",
|
|
333
|
+
"xmlns:VB": "VB",
|
|
334
|
+
Data: {
|
|
335
|
+
Merge: {
|
|
336
|
+
N: []
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
payload.Data.Merge.N = [];
|
|
342
|
+
|
|
343
|
+
// Populate payload with data from dataMap
|
|
344
|
+
dataMap.forEach(function (data) {
|
|
345
|
+
data.forEach(function (entry) {
|
|
346
|
+
payload.Data.Merge.N.push(entry);
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
return payload;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
RectangleTracker.prototype._onPointerCancel = function (event) {
|
|
354
|
+
event.preventDefault();
|
|
355
|
+
this._mouseDown = false;
|
|
356
|
+
this._dom.style.cursor = this._hovered ? "pointer" : "auto";
|
|
357
|
+
this._updateController(true);
|
|
358
|
+
this.onSelectOver();
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
RectangleTracker.prototype.onSelectStart = function (event) {
|
|
362
|
+
|
|
363
|
+
this._element.style.display = 'none';
|
|
364
|
+
this._renderer.domElement.parentElement.appendChild(this._element);
|
|
365
|
+
this._element.style.left = event.clientX + 'px';
|
|
366
|
+
this._element.style.top = event.clientY + 'px';
|
|
367
|
+
this._element.style.width = '0px';
|
|
368
|
+
this._element.style.height = '0px';
|
|
369
|
+
this._startPoint.x = event.clientX;
|
|
370
|
+
this._startPoint.y = event.clientY;
|
|
371
|
+
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
RectangleTracker.prototype.onSelectMove = function (event) {
|
|
375
|
+
|
|
376
|
+
this._element.style.display = 'block';
|
|
377
|
+
this.pointBottomRight.x = Math.max(this._startPoint.x, event.clientX);
|
|
378
|
+
this.pointBottomRight.y = Math.max(this._startPoint.y, event.clientY);
|
|
379
|
+
this.pointTopLeft.x = Math.min(this._startPoint.x, event.clientX);
|
|
380
|
+
this.pointTopLeft.y = Math.min(this._startPoint.y, event.clientY);
|
|
381
|
+
this._element.style.left = this.pointTopLeft.x + 'px';
|
|
382
|
+
this._element.style.top = this.pointTopLeft.y + 'px';
|
|
383
|
+
this._element.style.width = (this.pointBottomRight.x - this.pointTopLeft.x) + 'px';
|
|
384
|
+
this._element.style.height = (this.pointBottomRight.y - this.pointTopLeft.y) + 'px';
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
RectangleTracker.prototype.onSelectOver = function (event) {
|
|
390
|
+
var center = new THREE.Vector3(((this.pointBottomRight.x + this.pointTopLeft.x) / 2), ((this.pointBottomRight.y + this.pointTopLeft.y) / 2), 0);
|
|
391
|
+
this._centerOfBox = center;
|
|
392
|
+
var size = new THREE.Vector3(this.pointBottomRight.x - this.pointTopLeft.x) * (this.pointBottomRight.y - this.pointTopLeft.y);
|
|
393
|
+
this._size = size;
|
|
394
|
+
var distance = Math.max(size.x, size.y, size.z) * 2;
|
|
395
|
+
this._distance = distance;
|
|
396
|
+
if (this._element && this._element.parentElement)
|
|
397
|
+
this._element.parentElement.removeChild(this._element);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
RectangleTracker.prototype._updateController = function (value) {
|
|
402
|
+
if (value) {
|
|
403
|
+
this._cameraControls.enableRotate = true;
|
|
404
|
+
this._mouseDown = false;
|
|
405
|
+
} else {
|
|
406
|
+
this._cameraControls.enableRotate = false;
|
|
407
|
+
this._mouseDown = true;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
RectangleTracker.prototype.selecting = function (_frustum) {
|
|
412
|
+
this.startPoint = startPoint || this.startPoint;
|
|
413
|
+
this.endPoint = endPoint || this.endPoint;
|
|
414
|
+
this.collection = [];
|
|
415
|
+
this.updateFrustum(this.startPoint, this.endPoint);
|
|
416
|
+
this.searchChildInFrustum(_frustum, this._scene);
|
|
417
|
+
this._scene.remove(this._planeMesh);
|
|
418
|
+
return this.collection;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
RectangleTracker.prototype.updateFrustum = function (startPoint, endPoint) {
|
|
422
|
+
startPoint = startPoint || this.startPoint;
|
|
423
|
+
endPoint = endPoint || this.endPoint;
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
// Avoid invalid frustum
|
|
427
|
+
|
|
428
|
+
if (startPoint.x === endPoint.x) {
|
|
429
|
+
|
|
430
|
+
endPoint.x += Number.EPSILON;
|
|
431
|
+
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (startPoint.y === endPoint.y) {
|
|
435
|
+
|
|
436
|
+
endPoint.y += Number.EPSILON;
|
|
437
|
+
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (this._camera.isPerspectiveCamera) {
|
|
441
|
+
|
|
442
|
+
_tmpPoint = startPoint;
|
|
443
|
+
_tmpPoint.x = Math.min(startPoint.x, endPoint.x);
|
|
444
|
+
_tmpPoint.y = Math.max(startPoint.y, endPoint.y);
|
|
445
|
+
endPoint.x = Math.max(startPoint.x, endPoint.x);
|
|
446
|
+
endPoint.y = Math.min(startPoint.y, endPoint.y);
|
|
447
|
+
|
|
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
|
+
|
|
454
|
+
_vecTopLeft.unproject(this._camera);
|
|
455
|
+
_vecTopRight.unproject(this._camera);
|
|
456
|
+
_vecDownRight.unproject(this._camera);
|
|
457
|
+
_vecDownLeft.unproject(this._camera);
|
|
458
|
+
|
|
459
|
+
_vectemp1.copy(_vecTopLeft).sub(_vecNear);
|
|
460
|
+
_vectemp2.copy(_vecTopRight).sub(_vecNear);
|
|
461
|
+
_vectemp3.copy(_vecDownRight).sub(_vecNear);
|
|
462
|
+
_vectemp1.normalize();
|
|
463
|
+
_vectemp2.normalize();
|
|
464
|
+
_vectemp3.normalize();
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
_vectemp1.multiplyScalar(this.deep);
|
|
468
|
+
_vectemp2.multiplyScalar(this.deep);
|
|
469
|
+
_vectemp3.multiplyScalar(this.deep);
|
|
470
|
+
_vectemp4.multiplyScalar(this.deep);
|
|
471
|
+
_vectemp1.sub(_vecNear);
|
|
472
|
+
_vectemp2.sub(_vecNear);
|
|
473
|
+
_vectemp3.sub(_vecNear);
|
|
474
|
+
|
|
475
|
+
var planes = _frustum.planes;
|
|
476
|
+
|
|
477
|
+
planes[0].setFromCoplanarPoints(_vecNear, _vecTopLeft, _vecTopRight);
|
|
478
|
+
planes[1].setFromCoplanarPoints(_vecNear, _vecTopRight, _vecDownRight);
|
|
479
|
+
planes[2].setFromCoplanarPoints(_vecDownRight, _vecDownLeft, _vecNear);
|
|
480
|
+
planes[3].setFromCoplanarPoints(_vecDownLeft, _vecTopLeft, _vecNear);
|
|
481
|
+
planes[4].setFromCoplanarPoints(_vecTopRight, _vecDownRight, _vecDownLeft);
|
|
482
|
+
planes[5].setFromCoplanarPoints(_vectemp3, _vectemp2, _vectemp1);
|
|
483
|
+
planes[5].normal.multiplyScalar(-1);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
RectangleTracker.prototype.searchChildInFrustum = function (frustum, object) {
|
|
490
|
+
var count = 0;
|
|
491
|
+
if (object._sapInstance != undefined && !object.geomtry) {
|
|
492
|
+
var box1 = new THREE.BoxHelper(object, 0x000000);
|
|
493
|
+
var vertices = box1.geometry.attributes.position.array;
|
|
494
|
+
for (var i = 0, l = vertices.length; i < l; i += 3) {
|
|
495
|
+
_center.set(vertices[i], vertices[i + 1], vertices[i + 2]);
|
|
496
|
+
if (frustum.containsPoint(_center)) {
|
|
497
|
+
count++;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (count === vertices.length / 3) {
|
|
501
|
+
this.collection.push(object);
|
|
502
|
+
}
|
|
503
|
+
} else if (object.userData.name == "ColladaBounds") {
|
|
504
|
+
var box1 = new THREE.BoxHelper(object, 0x000000);
|
|
505
|
+
var vertices = box1.geometry.attributes.position.array;
|
|
506
|
+
for (var i = 0, l = vertices.length; i < l; i += 3) {
|
|
507
|
+
_center.set(vertices[i], vertices[i + 1], vertices[i + 2]);
|
|
508
|
+
if (frustum.containsPoint(_center)) {
|
|
509
|
+
count++;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (count === vertices.length / 3) {
|
|
513
|
+
this.collection.push(object);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (object.children.length > 0) {
|
|
518
|
+
for (var x = 0; x < object.children.length; x++) {
|
|
519
|
+
this.searchChildInFrustum(frustum, object.children[x]);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
RectangleTracker.prototype._handleHover = function (pointer) {
|
|
525
|
+
var intersections = [];
|
|
526
|
+
var totalMesh = this._adapter._colladaBoundingBoxMesh;
|
|
527
|
+
var that = this;
|
|
528
|
+
_raycaster.layers.set(0);
|
|
529
|
+
_raycaster.setFromCamera(pointer, this._camera);
|
|
530
|
+
_raycaster.intersectObjects(this._adapter._colladaBoundingBoxMesh, false, intersections);
|
|
531
|
+
if (intersections.length > 0) {
|
|
532
|
+
for (var i = 0; i < intersections.length; i++) {
|
|
533
|
+
this._hoverOff();
|
|
534
|
+
var objA = intersections[i].object;
|
|
535
|
+
if (objA.isMesh && objA.userData.name == "ColladaBounds") {
|
|
536
|
+
var id = objA.userData.id;
|
|
537
|
+
var count = objA.userData.count;
|
|
538
|
+
if (count > 1) {
|
|
539
|
+
totalMesh.forEach(function (value) {
|
|
540
|
+
if (value.userData.id == id)
|
|
541
|
+
that._hoverOn(value);
|
|
542
|
+
});
|
|
543
|
+
} else
|
|
544
|
+
this._hoverOn(objA);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
} else {
|
|
548
|
+
this._hoverOff();
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
RectangleTracker.prototype._hoverOn = function (obj) {
|
|
554
|
+
|
|
555
|
+
var snapBox = new THREE.BoxHelper(undefined, 0x00ffff);
|
|
556
|
+
snapBox.setFromObject(obj);
|
|
557
|
+
this._adapter._snapBox.push(snapBox);
|
|
558
|
+
|
|
559
|
+
// invisible, layer #1 (disable hit test)
|
|
560
|
+
this._addToScene(snapBox, this._scene, true, 1);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
RectangleTracker.prototype._hoverOff = function () {
|
|
564
|
+
var that = this;
|
|
565
|
+
var snapBox = this._adapter._snapBox;
|
|
566
|
+
if (snapBox != undefined)
|
|
567
|
+
snapBox.forEach(function (value) {
|
|
568
|
+
that._scene.remove(value);
|
|
569
|
+
});
|
|
570
|
+
this._adapter._snapBox = [];
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
RectangleTracker.prototype._createEvent = function () {
|
|
575
|
+
this._viewport.addEventDelegate(viewportEventDelegate, this);
|
|
576
|
+
this._subscribe();
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
RectangleTracker.prototype._destroy = function () {
|
|
580
|
+
if (this._viewport) {
|
|
581
|
+
this._viewport.removeEventDelegate(viewportEventDelegate);
|
|
582
|
+
this._unsubscribe();
|
|
583
|
+
|
|
584
|
+
// reset all
|
|
585
|
+
this._adapter = null;
|
|
586
|
+
this._context = null;
|
|
587
|
+
this._viewport = null;
|
|
588
|
+
this._root = null;
|
|
589
|
+
this._scene = null;
|
|
590
|
+
this._camera = null;
|
|
591
|
+
this._cameraControls = null;
|
|
592
|
+
this._raycaster = null;
|
|
593
|
+
this._selected = null;
|
|
594
|
+
this._renderer = null;
|
|
595
|
+
this._element = null;
|
|
596
|
+
this._snapBox = null;
|
|
597
|
+
BaseObject.prototype.destroy.call(this);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
return RectangleTracker;
|
|
605
|
+
}
|
|
606
|
+
);
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
*
|
|
48
48
|
* @private
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.126.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.
|
|
59
|
+
* @version 1.126.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 */ {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
NAVCTL_TITLE_MOVE=Dvaput kliknite da se vratite na po\u010Detnu poziciju
|
|
3
3
|
NAVCTL_TITLE_ZOOM=Uve\u0107aj {0}
|
|
4
|
-
NAVCTL_TITLE_MOVE_UP=
|
|
5
|
-
NAVCTL_TITLE_MOVE_DOWN=
|
|
6
|
-
NAVCTL_TITLE_MOVE_LEFT=
|
|
7
|
-
NAVCTL_TITLE_MOVE_RIGHT=
|
|
4
|
+
NAVCTL_TITLE_MOVE_UP=Pomeri gore
|
|
5
|
+
NAVCTL_TITLE_MOVE_DOWN=Pomeri dole
|
|
6
|
+
NAVCTL_TITLE_MOVE_LEFT=Pomeri levo
|
|
7
|
+
NAVCTL_TITLE_MOVE_RIGHT=Pomeri desno
|
|
8
8
|
WINDOW_CLOSE=Zatvori
|
|
9
9
|
LEGEND_COLLAPSE=Sa\u017Emi
|
|
10
10
|
LEGEND_EXPAND=Pro\u0161iri
|
|
@@ -13,7 +13,7 @@ CAPTION_LEGEND=Legenda
|
|
|
13
13
|
GEOMAP_INVALID_CENTER_POSITION=Navedena je neva\u017Ee\u0107a centralna pozicija
|
|
14
14
|
GEOMAP_INVALID_ZOOM_LEVEL=Naveden je neva\u017Ee\u0107i nivo uveli\u010Davanja
|
|
15
15
|
|
|
16
|
-
CONTAINERBASE_FULLSCREEN=
|
|
16
|
+
CONTAINERBASE_FULLSCREEN=Ceo ekran
|
|
17
17
|
CONTAINERBASE_SETTINGS=Pode\u0161avanja
|
|
18
18
|
CONTAINERBASE_MENU=Meni
|
|
19
19
|
CONTAINERBASE_SELECTION=Na\u010Din odabira
|
|
@@ -59,14 +59,7 @@ VBI.Resources = function() {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
resources.GetImageBits = function(name, rhls1, rhls2, lcb) {
|
|
62
|
-
var ri
|
|
63
|
-
if (rhls1) {
|
|
64
|
-
nname += rhls1;
|
|
65
|
-
}
|
|
66
|
-
if (rhls2) {
|
|
67
|
-
nname += rhls2;
|
|
68
|
-
}
|
|
69
|
-
|
|
62
|
+
var ri;
|
|
70
63
|
ri = resources.m_resourceinstance[name];
|
|
71
64
|
if (ri && ri.m_Bits) {
|
|
72
65
|
return ([
|
|
@@ -884,14 +884,14 @@ VBI.Scene3D = function(target) {
|
|
|
884
884
|
};
|
|
885
885
|
|
|
886
886
|
scene.Render = function() {
|
|
887
|
-
var vo = null;
|
|
888
|
-
var cnt = 0;
|
|
887
|
+
// var vo = null;
|
|
888
|
+
// var cnt = 0;
|
|
889
889
|
|
|
890
|
-
for (var i = scene.m_VOS.length; i--;) {
|
|
891
|
-
|
|
890
|
+
// for (var i = scene.m_VOS.length; i--;) {
|
|
891
|
+
// vo = scene.m_VOS[i];
|
|
892
892
|
|
|
893
|
-
|
|
894
|
-
}
|
|
893
|
+
// cnt += vo.Render(scene.m_Canvas[0]);
|
|
894
|
+
// }
|
|
895
895
|
|
|
896
896
|
};
|
|
897
897
|
|
|
@@ -1444,7 +1444,6 @@ VBI.Utilities.GetClippedPolygons = function(pointarray, offset, rcviewport) {
|
|
|
1444
1444
|
var currentISList = LI;
|
|
1445
1445
|
var otherISList = EI;
|
|
1446
1446
|
outputpolygon.push(pointlist[EI[nJK]], pointlist[EI[nJK] + 1]);
|
|
1447
|
-
var swapcount = 0;
|
|
1448
1447
|
var bContinueLoop = true;
|
|
1449
1448
|
while (bContinueLoop) {
|
|
1450
1449
|
currentIdx++;
|
|
@@ -1459,9 +1458,6 @@ VBI.Utilities.GetClippedPolygons = function(pointarray, offset, rcviewport) {
|
|
|
1459
1458
|
outputpolygon.push(pointlist[currentChainlist[currentIdx]], pointlist[currentChainlist[currentIdx] + 1]);
|
|
1460
1459
|
var I2 = currentISList.indexOf(currentChainlist[currentIdx]);
|
|
1461
1460
|
if (I2 > -1) {
|
|
1462
|
-
swapcount++;
|
|
1463
|
-
// if ( swapcount > 20 )
|
|
1464
|
-
// console.log("swapcount!! = " + swapcount);
|
|
1465
1461
|
currentIdx = otherChainlist.indexOf(currentChainlist[currentIdx]);
|
|
1466
1462
|
// intersectionpoint reached -> swap lists
|
|
1467
1463
|
var tmp = currentChainlist;
|