@crystaldesign/real-time-viewer 24.15.0-beta.9 → 24.16.0-beta.1
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/build/esm/index.js +113 -319
- package/build/types/real-time-viewer/src/SelectionHandler/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/caching/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/context.d.ts +1 -0
- package/build/types/real-time-viewer/src/context.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/index.d.ts +3 -3
- package/build/types/real-time-viewer/src/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/parser/createCams/index.d.ts +2 -2
- package/build/types/real-time-viewer/src/parser/createCams/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/parser/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/parser/types.d.ts +1 -1
- package/build/types/real-time-viewer/src/parser/types.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/SceneStore.d.ts +2 -2
- package/build/types/real-time-viewer/src/store/SceneStore.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/UIStore.d.ts +4 -1
- package/build/types/real-time-viewer/src/store/UIStore.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/UtilStore.d.ts +1 -1
- package/build/types/real-time-viewer/src/useRealTimeRenderData.d.ts +1 -16
- package/build/types/real-time-viewer/src/useRealTimeRenderData.d.ts.map +1 -1
- package/build/umd/real-time-viewer.umd.min.js +1 -1
- package/build/umd/report.html +1 -1
- package/package.json +2 -2
package/build/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useRef,
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
|
+
import { useRef, useEffect, memo } from 'react';
|
|
3
2
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
4
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
3
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
4
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
7
5
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
8
6
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
9
8
|
import { Tags } from '@babylonjs/core/Misc/tags';
|
|
10
9
|
import { Vector3, Matrix } from '@babylonjs/core/Maths/math.vector';
|
|
10
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
11
|
import { MeshBuilder } from '@babylonjs/core/Meshes/meshBuilder';
|
|
12
12
|
import { ActionManager } from '@babylonjs/core/Actions/actionManager';
|
|
13
13
|
import { ExecuteCodeAction } from '@babylonjs/core/Actions/directActions';
|
|
@@ -26,7 +26,7 @@ import { Tools, Observable, WebRequest } from '@babylonjs/core/Misc';
|
|
|
26
26
|
import { SceneOptimizerOptions, ShadowsOptimization, RenderTargetsOptimization, SceneOptimizer } from '@babylonjs/core/Misc/sceneOptimizer';
|
|
27
27
|
import { getLogger, DivaError } from '@crystaldesign/diva-core';
|
|
28
28
|
import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
|
|
29
|
-
import { Ellipse, Rectangle, Button,
|
|
29
|
+
import { Ellipse, Rectangle, Button, AdvancedDynamicTexture, TextBlock, Image } from '@babylonjs/gui';
|
|
30
30
|
import { Matrix as Matrix$1, Vector3 as Vector3$1 } from '@babylonjs/core/Maths/math';
|
|
31
31
|
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
32
32
|
import { Scene } from '@babylonjs/core/scene';
|
|
@@ -35,7 +35,7 @@ import { SceneLoader } from '@babylonjs/core/Loading/sceneLoader';
|
|
|
35
35
|
import { PBRMetallicRoughnessMaterial } from '@babylonjs/core/Materials/PBR/pbrMetallicRoughnessMaterial';
|
|
36
36
|
import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight';
|
|
37
37
|
import '@babylonjs/loaders/glTF/2.0/';
|
|
38
|
-
import {
|
|
38
|
+
import { jsx } from 'react/jsx-runtime';
|
|
39
39
|
|
|
40
40
|
(function() {
|
|
41
41
|
const env = {"STAGE":"production"};
|
|
@@ -871,9 +871,9 @@ var lightning = function lightning(diva3durl, scene, cams, isMobile, sceneStore)
|
|
|
871
871
|
sceneStore.ssao = ssao;
|
|
872
872
|
};
|
|
873
873
|
|
|
874
|
-
function ownKeys
|
|
875
|
-
function _objectSpread
|
|
876
|
-
function createCams(scene,
|
|
874
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
875
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
876
|
+
function createCams(scene, viewpoint) {
|
|
877
877
|
var _useUtilStoreContext = useUtilStoreContext(),
|
|
878
878
|
vector3ToBVector3 = _useUtilStoreContext.vector3ToBVector3,
|
|
879
879
|
degreesToRadians = _useUtilStoreContext.degreesToRadians;
|
|
@@ -912,14 +912,13 @@ function createCams(scene, activeViewpoint, viewPoints) {
|
|
|
912
912
|
parent: undefined
|
|
913
913
|
})];
|
|
914
914
|
}
|
|
915
|
-
|
|
916
|
-
if (!a) return createDefaultCam();
|
|
915
|
+
if (!viewpoint) return createDefaultCam();
|
|
917
916
|
return [createCam({
|
|
918
917
|
name: 'defaultCam',
|
|
919
918
|
isEnabled: true,
|
|
920
|
-
pos: vector3ToBVector3(
|
|
921
|
-
rot: vector3ToBVector3(_objectSpread
|
|
922
|
-
x: -
|
|
919
|
+
pos: vector3ToBVector3(viewpoint.pos).multiply(new Vector3(-0.01, 0.01, 0.01)),
|
|
920
|
+
rot: vector3ToBVector3(_objectSpread(_objectSpread({}, viewpoint.rot), {}, {
|
|
921
|
+
x: -viewpoint.rot.x
|
|
923
922
|
})),
|
|
924
923
|
parent: undefined
|
|
925
924
|
})];
|
|
@@ -930,10 +929,11 @@ function updateCam(camera, scene) {
|
|
|
930
929
|
var utilStore = useUtilStoreContext();
|
|
931
930
|
var sceneStore = useSceneStoreContext();
|
|
932
931
|
var cam = scene.getCameraByName('defaultCam');
|
|
932
|
+
if (!cam) return;
|
|
933
933
|
if (camera.pos.x == cam.position.x && camera.pos.y == cam.position.y && camera.pos.z == camera.pos.z) return;
|
|
934
934
|
var newPos = utilStore.vector3ToBVector3(camera.pos).multiply(new Vector3(-0.01, 0.01, 0.01));
|
|
935
935
|
cam.position = newPos;
|
|
936
|
-
cam.rotation = utilStore.degreesToRadians(utilStore.vector3ToBVector3(_objectSpread
|
|
936
|
+
cam.rotation = utilStore.degreesToRadians(utilStore.vector3ToBVector3(_objectSpread(_objectSpread({}, camera.rot), {}, {
|
|
937
937
|
x: -camera.rot.x
|
|
938
938
|
})));
|
|
939
939
|
cam.target = utilStore.vector3ToBVector3(camera.targetPos).multiply(new Vector3(-0.01, 0.01, 0.01));
|
|
@@ -1359,9 +1359,9 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
}, {
|
|
1361
1361
|
key: "setResolution",
|
|
1362
|
-
value: function setResolution(
|
|
1363
|
-
if (!resolution || !
|
|
1364
|
-
var boundingClientRect =
|
|
1362
|
+
value: function setResolution(gameCanvas, resolution) {
|
|
1363
|
+
if (!resolution || !gameCanvas) return;
|
|
1364
|
+
var boundingClientRect = gameCanvas.getBoundingClientRect();
|
|
1365
1365
|
var maxX = boundingClientRect.right - boundingClientRect.left;
|
|
1366
1366
|
var maxY = boundingClientRect.bottom - boundingClientRect.top;
|
|
1367
1367
|
var ratio = Math.min(maxX / resolution.x, maxY / resolution.y);
|
|
@@ -1376,10 +1376,10 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1376
1376
|
}
|
|
1377
1377
|
}, {
|
|
1378
1378
|
key: "init",
|
|
1379
|
-
value: function init(diva3durl,
|
|
1379
|
+
value: function init(diva3durl, gameCanvas, viewpoint, resolution) {
|
|
1380
1380
|
Tools.fallbackTexture = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; // blank white image
|
|
1381
|
-
this.setResolution(
|
|
1382
|
-
var cams = createCams(this._scene,
|
|
1381
|
+
this.setResolution(gameCanvas, resolution);
|
|
1382
|
+
var cams = createCams(this._scene, viewpoint);
|
|
1383
1383
|
this._targetCameraPosition = cams[0].position;
|
|
1384
1384
|
lightning(diva3durl, this._scene, cams, this._utilStore.isMobile, this);
|
|
1385
1385
|
}
|
|
@@ -1536,10 +1536,10 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1536
1536
|
var radius = Vector3.Distance(bbox.min, bbox.max) / 2;
|
|
1537
1537
|
if (radius == Infinity) return;
|
|
1538
1538
|
var aspectRatio = engine.getRenderHeight() / engine.getRenderWidth();
|
|
1539
|
-
var distance = radius / Math.tan(cam.fov
|
|
1539
|
+
var distance = radius / Math.tan(cam.fov);
|
|
1540
1540
|
var direction = cam.getDirection(Vector3.Backward());
|
|
1541
1541
|
if (aspectRatio > 1) distance *= aspectRatio;
|
|
1542
|
-
var newPosition = center.add(direction.scale(distance));
|
|
1542
|
+
var newPosition = center.add(direction.scale(distance * 1.7));
|
|
1543
1543
|
if (newPosition.x == 0 && newPosition.y == 0 && newPosition.z == 0) return;
|
|
1544
1544
|
this.cameraTargetPosition = center;
|
|
1545
1545
|
this.targetCameraPosition = newPosition;
|
|
@@ -1644,6 +1644,9 @@ function SelHandler (_ref) {
|
|
|
1644
1644
|
} else if (((_sceneStore$focusedEl = sceneStore.focusedElement) === null || _sceneStore$focusedEl === void 0 || (_sceneStore$focusedEl = _sceneStore$focusedEl.name) === null || _sceneStore$focusedEl === void 0 || (_sceneStore$focusedEl2 = _sceneStore$focusedEl.slice) === null || _sceneStore$focusedEl2 === void 0 ? void 0 : _sceneStore$focusedEl2.call(_sceneStore$focusedEl, -1)) != elemName && (doubleClick || sceneStore.selectedElement == elemName)) {
|
|
1645
1645
|
sceneStore.focusElement(elem);
|
|
1646
1646
|
}
|
|
1647
|
+
|
|
1648
|
+
// is already selected
|
|
1649
|
+
if (sceneStore.selectedElement == elemName) return;
|
|
1647
1650
|
sceneStore.selectedElement = elemName;
|
|
1648
1651
|
uiStore.selectElem(elemName);
|
|
1649
1652
|
onElSelected === null || onElSelected === void 0 || onElSelected(elem.parent.name, Number(elemName));
|
|
@@ -1683,6 +1686,7 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1683
1686
|
});
|
|
1684
1687
|
_defineProperty(this, "_gridGui", void 0);
|
|
1685
1688
|
_defineProperty(this, "_isStaticBg", void 0);
|
|
1689
|
+
_defineProperty(this, "_elementsInfo", void 0);
|
|
1686
1690
|
_defineProperty(this, "updateOverlayImage", function (overlayImage) {
|
|
1687
1691
|
var _this$_overlayImage;
|
|
1688
1692
|
if (!overlayImage || !_this._scene || ((_this$_overlayImage = _this._overlayImage) === null || _this$_overlayImage === void 0 ? void 0 : _this$_overlayImage.source) == overlayImage.base64) return;
|
|
@@ -1796,19 +1800,32 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1796
1800
|
(_this$_gridGui = this._gridGui) === null || _this$_gridGui === void 0 || _this$_gridGui.gui.dispose();
|
|
1797
1801
|
(_this$_gridGui2 = this._gridGui) === null || _this$_gridGui2 === void 0 || _this$_gridGui2.node.dispose();
|
|
1798
1802
|
}
|
|
1803
|
+
}, {
|
|
1804
|
+
key: "resize",
|
|
1805
|
+
value: function resize() {
|
|
1806
|
+
this._gui = AdvancedDynamicTexture.CreateFullscreenUI('UI');
|
|
1807
|
+
this._gui.renderScale = 1;
|
|
1808
|
+
if (this._overlayImage) this._overlayImage.isVisible = false;
|
|
1809
|
+
if (this._latestViewpoint) this._latestViewpoint.isOutdated = true;
|
|
1810
|
+
}
|
|
1811
|
+
}, {
|
|
1812
|
+
key: "addElementsInfo",
|
|
1813
|
+
value: function addElementsInfo(elementsInfo) {
|
|
1814
|
+
this._elementsInfo = elementsInfo;
|
|
1815
|
+
}
|
|
1799
1816
|
}, {
|
|
1800
1817
|
key: "initGui",
|
|
1801
|
-
value: function initGui(onElSelected, elements
|
|
1818
|
+
value: function initGui(onElSelected, elements) {
|
|
1802
1819
|
var _this4 = this;
|
|
1803
1820
|
if (!this._selectionHandler) this.initSelectionHandler(onElSelected);
|
|
1804
1821
|
if (!this._scene) return;
|
|
1805
|
-
if (!
|
|
1806
|
-
if (
|
|
1822
|
+
if (!this._elementsInfo) return;
|
|
1823
|
+
if (this._elementsInfo.filter(function (e) {
|
|
1807
1824
|
return !!e.posNr;
|
|
1808
1825
|
}).length > elements.length) return; // elementinfo update before unity -- return and wait for after buildscene
|
|
1809
1826
|
this.clearGui();
|
|
1810
1827
|
var _loop = function _loop() {
|
|
1811
|
-
var elementInfo =
|
|
1828
|
+
var elementInfo = _this4._elementsInfo[idx];
|
|
1812
1829
|
var emnt = elements.find(function (el) {
|
|
1813
1830
|
return Number(el.bbn.name.slice(el.bbn.name.lastIndexOf('E') + 1, el.bbn.name.length)) == elementInfo.elementId;
|
|
1814
1831
|
});
|
|
@@ -1817,7 +1834,7 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1817
1834
|
if (!element) return 0; // continue
|
|
1818
1835
|
var guiElemLeftBack = new TransformNode('guiElem_' + elementInfo.elementId, _this4._scene);
|
|
1819
1836
|
var bbox = element.getHierarchyBoundingVectors();
|
|
1820
|
-
guiElemLeftBack.position = new Vector3(
|
|
1837
|
+
guiElemLeftBack.position = element.absolutePosition.add(new Vector3(0, bbox.max.y, 0));
|
|
1821
1838
|
guiElemRightBack = undefined;
|
|
1822
1839
|
if (_this4._uiConfig.posTrashIcon == 'TOP_RIGHT_BACK') {
|
|
1823
1840
|
guiElemRightBack = new TransformNode('guiElem_' + elementInfo.elementId, _this4._scene);
|
|
@@ -1828,7 +1845,7 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1828
1845
|
},
|
|
1829
1846
|
guiElemRightBack,
|
|
1830
1847
|
_ret;
|
|
1831
|
-
for (var idx =
|
|
1848
|
+
for (var idx = this._elementsInfo.length - 1; idx >= 0; idx--) {
|
|
1832
1849
|
_ret = _loop();
|
|
1833
1850
|
if (_ret === 0) continue;
|
|
1834
1851
|
}
|
|
@@ -1951,19 +1968,23 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1951
1968
|
setId = set === null || set === void 0 ? void 0 : set.replace('planning_', '');
|
|
1952
1969
|
}
|
|
1953
1970
|
clearTimeout(this._timeoutId);
|
|
1954
|
-
this.
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1971
|
+
if (!this._latestViewpoint || this._latestViewpoint.isOutdated || Math.abs(this._latestViewpoint.pos.x - viewpoint.pos.x) > 0.05 || Math.abs(this._latestViewpoint.pos.y - viewpoint.pos.y) > 0.05 || Math.abs(this._latestViewpoint.pos.z - viewpoint.pos.z) > 0.05 || Math.abs(this._latestViewpoint.rot.x - viewpoint.rot.x) > 0.05 || Math.abs(this._latestViewpoint.rot.y - viewpoint.rot.y) > 0.05 || Math.abs(this._latestViewpoint.rot.z - viewpoint.rot.z) > 0.05) {
|
|
1972
|
+
this._timeoutId = setTimeout(function () {
|
|
1973
|
+
var _this7$_requestNewOve;
|
|
1974
|
+
_this7._utilStore.addOutstandingImage();
|
|
1975
|
+
_this7._latestViewpoint = viewpoint;
|
|
1976
|
+
(_this7$_requestNewOve = _this7._requestNewOverlayImage) === null || _this7$_requestNewOve === void 0 || _this7$_requestNewOve.call(_this7, viewpoint, {
|
|
1977
|
+
adjustZoomInUnity: false,
|
|
1978
|
+
onlyAdjustZoomBBChanged: false,
|
|
1979
|
+
rotationCenter: viewpoint.targetPos,
|
|
1980
|
+
elementId: elementId,
|
|
1981
|
+
setId: setId
|
|
1982
|
+
});
|
|
1983
|
+
_this7._utilStore.updateCam = true;
|
|
1984
|
+
}, 200);
|
|
1985
|
+
} else {
|
|
1986
|
+
this._overlayImage.isVisible = true;
|
|
1987
|
+
}
|
|
1967
1988
|
}
|
|
1968
1989
|
}]);
|
|
1969
1990
|
}();
|
|
@@ -2223,6 +2244,7 @@ function caching () {
|
|
|
2223
2244
|
cache = _useSceneStoreContext.cache,
|
|
2224
2245
|
hqRenderScript = _useSceneStoreContext.hqRenderScript,
|
|
2225
2246
|
previousHQRenderScript = _useSceneStoreContext.previousHQRenderScript;
|
|
2247
|
+
_useSceneStoreContext.scene;
|
|
2226
2248
|
var elements = undefined;
|
|
2227
2249
|
var chaching = function chaching() {
|
|
2228
2250
|
var _hqRenderScript$scene, _scene$nodes, _curElementRoot$nodes, _curElementRoot$nodes2, _prevElementRoot$node;
|
|
@@ -3170,14 +3192,14 @@ function shadow() {
|
|
|
3170
3192
|
var parser = /*#__PURE__*/function () {
|
|
3171
3193
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3172
3194
|
var _changedElements$upda;
|
|
3173
|
-
var sceneStore, hasRendered, hqRenderScript, scene, cache, changedElements, utilStore,
|
|
3195
|
+
var sceneStore, hasRendered, hqRenderScript, scene, cache, changedElements, utilStore, _yield$findAssets, cacheGroup, newCache, _changedElements$upda2;
|
|
3174
3196
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3175
3197
|
while (1) switch (_context.prev = _context.next) {
|
|
3176
3198
|
case 0:
|
|
3177
3199
|
sceneStore = useSceneStoreContext();
|
|
3178
3200
|
hasRendered = sceneStore.hasRendered, hqRenderScript = sceneStore.hqRenderScript, scene = sceneStore.scene, cache = sceneStore.cache, changedElements = sceneStore.changedElements;
|
|
3179
3201
|
utilStore = useUtilStoreContext();
|
|
3180
|
-
|
|
3202
|
+
useUIStoreContext(); //disable elementrows from old cache
|
|
3181
3203
|
changedElements === null || changedElements === void 0 || (_changedElements$upda = changedElements.updatedElements) === null || _changedElements$upda === void 0 || _changedElements$upda.forEach(function (el) {
|
|
3182
3204
|
return utilStore.disableElementRows(el.name, cache);
|
|
3183
3205
|
});
|
|
@@ -3220,8 +3242,7 @@ var parser = /*#__PURE__*/function () {
|
|
|
3220
3242
|
}
|
|
3221
3243
|
utilStore.setRTVAnalyzeData();
|
|
3222
3244
|
deacCache(cacheGroup);
|
|
3223
|
-
|
|
3224
|
-
case 15:
|
|
3245
|
+
case 14:
|
|
3225
3246
|
case "end":
|
|
3226
3247
|
return _context.stop();
|
|
3227
3248
|
}
|
|
@@ -3232,21 +3253,18 @@ var parser = /*#__PURE__*/function () {
|
|
|
3232
3253
|
};
|
|
3233
3254
|
}();
|
|
3234
3255
|
|
|
3235
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3236
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3237
3256
|
var LOG = getLogger('ARViewer', 'RealTimeRenderData');
|
|
3238
3257
|
function useRealTimeRenderData (_ref) {
|
|
3239
|
-
var
|
|
3258
|
+
var _sceneStore3;
|
|
3240
3259
|
var jwt = _ref.jwt,
|
|
3241
3260
|
actions = _ref.actions,
|
|
3242
3261
|
apiConfig = _ref.apiConfig,
|
|
3243
3262
|
renderjob = _ref.renderjob,
|
|
3244
|
-
|
|
3263
|
+
viewpoint = _ref.viewpoint,
|
|
3245
3264
|
resolution = _ref.resolution,
|
|
3246
3265
|
viewHandler = _ref.viewHandler,
|
|
3247
3266
|
inBackground = _ref.inBackground,
|
|
3248
3267
|
elementsInfo = _ref.elementsInfo,
|
|
3249
|
-
initViewpoint = _ref.initViewpoint,
|
|
3250
3268
|
overlayImage = _ref.overlayImage,
|
|
3251
3269
|
freePlacesOnGrids = _ref.freePlacesOnGrids,
|
|
3252
3270
|
plannedPlacesOnGrids = _ref.plannedPlacesOnGrids,
|
|
@@ -3254,17 +3272,6 @@ function useRealTimeRenderData (_ref) {
|
|
|
3254
3272
|
uiConfig = _ref.uiConfig,
|
|
3255
3273
|
renderInBackground = _ref.renderInBackground;
|
|
3256
3274
|
var gameCanvas = useRef(null);
|
|
3257
|
-
var resolutionDiv = useRef(null);
|
|
3258
|
-
var _useState = useState({
|
|
3259
|
-
activeViewpoint: {
|
|
3260
|
-
current: initViewpoint ? viewpoints === null || viewpoints === void 0 ? void 0 : viewpoints.indexOf(initViewpoint) : 0,
|
|
3261
|
-
name: (_initViewpoint$name = initViewpoint === null || initViewpoint === void 0 ? void 0 : initViewpoint.name) !== null && _initViewpoint$name !== void 0 ? _initViewpoint$name : 'defaultCam'
|
|
3262
|
-
},
|
|
3263
|
-
allViewpoints: viewpoints
|
|
3264
|
-
}),
|
|
3265
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
3266
|
-
viewpointState = _useState2[0],
|
|
3267
|
-
setViewpointState = _useState2[1];
|
|
3268
3275
|
var sceneStore = useSceneStoreContext();
|
|
3269
3276
|
var utilStore = useUtilStoreContext();
|
|
3270
3277
|
var gridStore = useGridStoreContext();
|
|
@@ -3295,7 +3302,6 @@ function useRealTimeRenderData (_ref) {
|
|
|
3295
3302
|
}
|
|
3296
3303
|
function _onSceneReady() {
|
|
3297
3304
|
_onSceneReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
3298
|
-
var _sceneStore$hqRenderS, getEnableUnityRtvKombi, cams, filteredCustomViewpoints, activeViewpoint, activeViewpointIdx, activeElement, _activeElement;
|
|
3299
3305
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
3300
3306
|
while (1) switch (_context2.prev = _context2.next) {
|
|
3301
3307
|
case 0:
|
|
@@ -3308,79 +3314,46 @@ function useRealTimeRenderData (_ref) {
|
|
|
3308
3314
|
sceneStore.isInitializing = true;
|
|
3309
3315
|
if (!overlayImage) actions.toggleLoading('buildScene', false, true);
|
|
3310
3316
|
if (sceneStore.hasRendered) {
|
|
3311
|
-
_context2.next =
|
|
3317
|
+
_context2.next = 9;
|
|
3312
3318
|
break;
|
|
3313
3319
|
}
|
|
3314
|
-
getEnableUnityRtvKombi = viewHandler === null || viewHandler === void 0 ? void 0 : viewHandler.divaWebPlanner.getEnableUnityRtvKombi();
|
|
3315
3320
|
if (inBackground) sceneStore.scene.getEngine().setHardwareScalingLevel(5);
|
|
3316
|
-
sceneStore.init(apiConfig.diva3darchive + '/',
|
|
3317
|
-
|
|
3318
|
-
cams = createCams(sceneStore.scene, initViewpoint);
|
|
3319
|
-
filteredCustomViewpoints = viewpoints.filter(function (vp) {
|
|
3320
|
-
return cams.find(function (cam) {
|
|
3321
|
-
return cam.name == vp.name;
|
|
3322
|
-
}) != undefined;
|
|
3323
|
-
});
|
|
3324
|
-
activeViewpoint = filteredCustomViewpoints.find(function (vp) {
|
|
3325
|
-
return vp.name == sceneStore.activeCamera.name;
|
|
3326
|
-
});
|
|
3327
|
-
activeViewpointIdx = filteredCustomViewpoints.indexOf(activeViewpoint);
|
|
3328
|
-
setViewpointState(_objectSpread(_objectSpread({}, viewpointState), {}, {
|
|
3329
|
-
activeViewpoint: {
|
|
3330
|
-
current: activeViewpointIdx,
|
|
3331
|
-
name: sceneStore.activeCamera.name
|
|
3332
|
-
},
|
|
3333
|
-
allViewpoints: filteredCustomViewpoints
|
|
3334
|
-
}));
|
|
3335
|
-
}
|
|
3336
|
-
_context2.next = 17;
|
|
3321
|
+
sceneStore.init(apiConfig.diva3darchive + '/', gameCanvas.current, viewpoint, resolution);
|
|
3322
|
+
_context2.next = 14;
|
|
3337
3323
|
break;
|
|
3338
|
-
case
|
|
3324
|
+
case 9:
|
|
3339
3325
|
sceneStore.hqRenderScript = JSON.parse(renderjob);
|
|
3340
3326
|
if (checkCachedData()) {
|
|
3341
|
-
_context2.next =
|
|
3327
|
+
_context2.next = 14;
|
|
3342
3328
|
break;
|
|
3343
3329
|
}
|
|
3344
|
-
if (elementsInfo) {
|
|
3345
|
-
activeElement = elementsInfo.find(function (e) {
|
|
3346
|
-
return e.active;
|
|
3347
|
-
});
|
|
3348
|
-
if (activeElement) sceneStore.selectedElement = activeElement.elementId.toString();
|
|
3349
|
-
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements, elementsInfo);
|
|
3350
|
-
}
|
|
3351
3330
|
if (!overlayImage) actions.toggleLoading('buildScene', false, false);
|
|
3352
3331
|
sceneStore.isInitializing = false;
|
|
3353
3332
|
return _context2.abrupt("return");
|
|
3354
|
-
case
|
|
3333
|
+
case 14:
|
|
3355
3334
|
LOG.startTransaction({
|
|
3356
3335
|
event: 'buildScene',
|
|
3357
3336
|
message: 'Start Building Realtime Scene',
|
|
3358
3337
|
eventId: 'BUILD_SCENE'
|
|
3359
3338
|
});
|
|
3360
|
-
_context2.prev =
|
|
3361
|
-
_context2.next =
|
|
3339
|
+
_context2.prev = 15;
|
|
3340
|
+
_context2.next = 18;
|
|
3362
3341
|
return parser();
|
|
3363
|
-
case
|
|
3364
|
-
|
|
3365
|
-
_activeElement = elementsInfo.find(function (e) {
|
|
3366
|
-
return e.active;
|
|
3367
|
-
});
|
|
3368
|
-
if (_activeElement) sceneStore.selectedElement = _activeElement.elementId.toString();
|
|
3369
|
-
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements, elementsInfo);
|
|
3370
|
-
}
|
|
3342
|
+
case 18:
|
|
3343
|
+
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements);
|
|
3371
3344
|
if (freePlacesOnGrids || plannedPlacesOnGrids) gridStore.getGrids(freePlacesOnGrids, plannedPlacesOnGrids);
|
|
3372
|
-
_context2.next =
|
|
3345
|
+
_context2.next = 27;
|
|
3373
3346
|
break;
|
|
3374
|
-
case
|
|
3375
|
-
_context2.prev =
|
|
3376
|
-
_context2.t0 = _context2["catch"](
|
|
3347
|
+
case 22:
|
|
3348
|
+
_context2.prev = 22;
|
|
3349
|
+
_context2.t0 = _context2["catch"](15);
|
|
3377
3350
|
LOG.errorTransaction('BUILD_SCENE', 'RTS_0001', _context2.t0.message);
|
|
3378
3351
|
LOG.error(new DivaError('Error building scene', {
|
|
3379
3352
|
cause: _context2.t0,
|
|
3380
3353
|
code: 'RTS_0001'
|
|
3381
3354
|
}));
|
|
3382
3355
|
sceneStore.isInitializing = false;
|
|
3383
|
-
case
|
|
3356
|
+
case 27:
|
|
3384
3357
|
if (callbacks.setGlb) {
|
|
3385
3358
|
sceneStore.exportScene().then(function (res) {
|
|
3386
3359
|
var _callbacks$setGlb;
|
|
@@ -3395,11 +3368,11 @@ function useRealTimeRenderData (_ref) {
|
|
|
3395
3368
|
}
|
|
3396
3369
|
sceneStore.scene.onAfterRenderObservable.add(onFirstFrame);
|
|
3397
3370
|
LOG.successTransaction('BUILD_SCENE');
|
|
3398
|
-
case
|
|
3371
|
+
case 31:
|
|
3399
3372
|
case "end":
|
|
3400
3373
|
return _context2.stop();
|
|
3401
3374
|
}
|
|
3402
|
-
}, _callee2, null, [[
|
|
3375
|
+
}, _callee2, null, [[15, 22]]);
|
|
3403
3376
|
}));
|
|
3404
3377
|
return _onSceneReady.apply(this, arguments);
|
|
3405
3378
|
}
|
|
@@ -3474,7 +3447,12 @@ function useRealTimeRenderData (_ref) {
|
|
|
3474
3447
|
resize = function resize() {
|
|
3475
3448
|
if (inBackground || !scene || !scene.getEngine()) return;
|
|
3476
3449
|
if (sceneStore.hasPlanned) sceneStore.doRenderControlLoop = true;
|
|
3477
|
-
|
|
3450
|
+
scene.getEngine().resize();
|
|
3451
|
+
if (uiStore) {
|
|
3452
|
+
uiStore.onMove();
|
|
3453
|
+
uiStore.resize();
|
|
3454
|
+
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements);
|
|
3455
|
+
}
|
|
3478
3456
|
};
|
|
3479
3457
|
if (window) {
|
|
3480
3458
|
window.addEventListener('resize', resize);
|
|
@@ -3500,9 +3478,24 @@ function useRealTimeRenderData (_ref) {
|
|
|
3500
3478
|
asyncUseEffect();
|
|
3501
3479
|
}, []);
|
|
3502
3480
|
useEffect(function () {
|
|
3503
|
-
if (!utilStore.updateWithUnityData) return;
|
|
3504
3481
|
if (overlayImage && uiStore) uiStore.updateOverlayImage(overlayImage);
|
|
3482
|
+
// update cam pos for start viewpoints (hqr) could be the same, since it doesn't change when rotating
|
|
3505
3483
|
}, [overlayImage]);
|
|
3484
|
+
useEffect(function () {
|
|
3485
|
+
if (utilStore && viewpoint) {
|
|
3486
|
+
updateCam(viewpoint, sceneStore.scene);
|
|
3487
|
+
}
|
|
3488
|
+
}, [viewpoint]);
|
|
3489
|
+
useEffect(function () {
|
|
3490
|
+
if (sceneStore && elementsInfo) {
|
|
3491
|
+
var activeElement = elementsInfo.find(function (e) {
|
|
3492
|
+
return e.active;
|
|
3493
|
+
});
|
|
3494
|
+
if (activeElement) sceneStore.selectedElement = activeElement.elementId.toString();
|
|
3495
|
+
uiStore.addElementsInfo(elementsInfo);
|
|
3496
|
+
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements);
|
|
3497
|
+
}
|
|
3498
|
+
}, [elementsInfo, (_sceneStore3 = sceneStore) === null || _sceneStore3 === void 0 ? void 0 : _sceneStore3.elements]);
|
|
3506
3499
|
useEffect(function () {
|
|
3507
3500
|
if (inBackground) {
|
|
3508
3501
|
sceneStore.scene.getEngine().stopRenderLoop();
|
|
@@ -3510,66 +3503,8 @@ function useRealTimeRenderData (_ref) {
|
|
|
3510
3503
|
sceneStore.scene.getEngine().runRenderLoop(renderLoop);
|
|
3511
3504
|
}
|
|
3512
3505
|
}, [inBackground]);
|
|
3513
|
-
var createViewpoint = function createViewpoint(name, global) {
|
|
3514
|
-
if (!callbacks.viewpointCreated) return;
|
|
3515
|
-
var cam = sceneStore.scene.activeCamera;
|
|
3516
|
-
var parent = cam.parent;
|
|
3517
|
-
var camRotation = utilStore.radiansToDegrees(cam.rotation);
|
|
3518
|
-
var parentRotation = utilStore.radiansToDegrees(parent.rotation);
|
|
3519
|
-
callbacks.viewpointCreated(name, global, {
|
|
3520
|
-
position: utilStore.bvector3ToVector3(new Vector3(cam.position.x * -100, cam.position.y * 100, cam.position.z * 100)),
|
|
3521
|
-
rotation: utilStore.bvector3ToVector3(new Vector3(camRotation.x - 180, camRotation.y, parentRotation.z))
|
|
3522
|
-
}, {
|
|
3523
|
-
position: utilStore.bvector3ToVector3(new Vector3(parent.position.x * -100, parent.position.y * 100, parent.position.z * 100)),
|
|
3524
|
-
rotation: utilStore.bvector3ToVector3(new Vector3(parentRotation.x - 90, parentRotation.y + 180, parentRotation.z))
|
|
3525
|
-
});
|
|
3526
|
-
};
|
|
3527
|
-
function nextViewpoint(forward) {
|
|
3528
|
-
var _sceneStore$scene;
|
|
3529
|
-
if (!sceneStore) return;
|
|
3530
|
-
if (!viewpointState || !viewpointState.allViewpoints) return;
|
|
3531
|
-
var scene = sceneStore.scene;
|
|
3532
|
-
|
|
3533
|
-
//deactivate old viewpoint
|
|
3534
|
-
var oldViewpoint = scene.cameras.find(function (cam) {
|
|
3535
|
-
return cam.name == viewpointState.allViewpoints[viewpointState.activeViewpoint.current].name;
|
|
3536
|
-
});
|
|
3537
|
-
oldViewpoint.detachControl();
|
|
3538
|
-
var nextViewpointIdx = 0;
|
|
3539
|
-
if (forward) {
|
|
3540
|
-
nextViewpointIdx = 1;
|
|
3541
|
-
if (viewpointState.allViewpoints.length == nextViewpointIdx + viewpointState.activeViewpoint.current) {
|
|
3542
|
-
nextViewpointIdx = -(viewpointState.allViewpoints.length - 1);
|
|
3543
|
-
}
|
|
3544
|
-
} else {
|
|
3545
|
-
nextViewpointIdx = -1;
|
|
3546
|
-
if (viewpointState.activeViewpoint.current + nextViewpointIdx < 0) {
|
|
3547
|
-
nextViewpointIdx = viewpointState.allViewpoints.length - 1;
|
|
3548
|
-
}
|
|
3549
|
-
}
|
|
3550
|
-
var viewpoint = scene.cameras.find(function (cam) {
|
|
3551
|
-
return cam.name == viewpointState.allViewpoints[viewpointState.activeViewpoint.current + nextViewpointIdx].name;
|
|
3552
|
-
});
|
|
3553
|
-
if (!viewpoint) throw new Error('missing viewpoint in scene');
|
|
3554
|
-
setViewpointState(_objectSpread(_objectSpread({}, viewpointState), {}, {
|
|
3555
|
-
activeViewpoint: {
|
|
3556
|
-
current: viewpointState.activeViewpoint.current + nextViewpointIdx,
|
|
3557
|
-
name: viewpoint.name
|
|
3558
|
-
}
|
|
3559
|
-
}));
|
|
3560
|
-
scene.activeCamera = viewpoint;
|
|
3561
|
-
viewpoint.attachControl((_sceneStore$scene = sceneStore.scene) === null || _sceneStore$scene === void 0 ? void 0 : _sceneStore$scene.getEngine().getRenderingCanvas(), true);
|
|
3562
|
-
}
|
|
3563
3506
|
return {
|
|
3564
|
-
gameCanvas: gameCanvas
|
|
3565
|
-
resolutionDiv: resolutionDiv,
|
|
3566
|
-
viewpoints: {
|
|
3567
|
-
state: viewpointState,
|
|
3568
|
-
methods: {
|
|
3569
|
-
create: createViewpoint,
|
|
3570
|
-
next: nextViewpoint
|
|
3571
|
-
}
|
|
3572
|
-
}
|
|
3507
|
+
gameCanvas: gameCanvas
|
|
3573
3508
|
};
|
|
3574
3509
|
}
|
|
3575
3510
|
|
|
@@ -3601,142 +3536,13 @@ function styleInject(css, ref) {
|
|
|
3601
3536
|
}
|
|
3602
3537
|
|
|
3603
3538
|
var canvas = "canvas-gZFEa";
|
|
3604
|
-
var flexContainerColumn = "flex-container-column-XYHvU";
|
|
3605
|
-
var flexContainerRow = "flex-container-row-ENPOV";
|
|
3606
|
-
var createButton = "create-button-NPGTz";
|
|
3607
|
-
var checkBox = "check-box-2GPp1";
|
|
3608
|
-
var inputField = "input-field-uCQ0h";
|
|
3609
3539
|
var css_248z = ".canvas-gZFEa.focus-visible-ubYpO {\n outline: medium none invert;\n outline: initial;\n}\n\n.canvas-gZFEa.focus-visible-ubYpO {\n outline: medium none invert;\n outline: initial;\n}\n\n.canvas-gZFEa.focus-visible-ubYpO {\n outline: medium none invert;\n outline: initial;\n}\n\n.canvas-gZFEa:focus-visible {\n outline: medium none invert;\n outline: initial;\n}\n\n.flex-container-column-XYHvU {\n display: flex;\n flex-wrap: nowrap;\n flex-direction: column;\n background-color: white;\n gap: 15px;\n padding: 10px;\n margin-top: 50px;\n border: 0.5px solid;\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n}\n\n.flex-container-column-closed-2D7IF {\n display: flex;\n flex-wrap: nowrap;\n flex-direction: column;\n background-color: white;\n gap: 15px;\n padding: 10px;\n}\n\n.flex-container-row-ENPOV {\n display: flex;\n justify-content: space-between;\n flex-wrap: nowrap;\n flex-direction: row;\n background-color: white;\n gap: 5px;\n}\n\n.create-button-NPGTz {\n width: 200px;\n height: 35px;\n border-radius: 5px;\n border-style: none;\n color: #fff;\n background-color: #713434;\n}\n\n.create-button-NPGTz:hover {\n background-color: #42090e;\n}\n\n.check-box-2GPp1 {\n width: 20px;\n height: 20px;\n margin: 0px;\n}\n\n.input-field-uCQ0h {\n width: 193px;\n height: 35px;\n border-radius: 5px;\n border-style: none;\n color: rgb(0, 0, 0);\n border-style: solid;\n border-color: #000000;\n background-color: #f7f7f7;\n border-width: 0.5px;\n}\n\n.input-field-uCQ0h:hover {\n background-color: #ebebeb;\n}\n";
|
|
3610
3540
|
styleInject(css_248z);
|
|
3611
3541
|
|
|
3612
|
-
var arrowLeft = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%2248%22%20width%3D%2248%22%3E%3Cpath%20d%3D%22M28.05%2036%2016%2023.95%2028.05%2011.9l2.15%202.15-9.9%209.9%209.9%209.9Z%22%2F%3E%3C%2Fsvg%3E";
|
|
3613
|
-
|
|
3614
|
-
var arrowRight = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%2248%22%20width%3D%2248%22%3E%3Cpath%20d%3D%22m18.75%2036-2.15-2.15%209.9-9.9-9.9-9.9%202.15-2.15L30.8%2023.95Z%22%2F%3E%3C%2Fsvg%3E";
|
|
3615
|
-
|
|
3616
|
-
function ViewpointCreationGui(_ref) {
|
|
3617
|
-
var callback = _ref.callback;
|
|
3618
|
-
var _useState = useState(''),
|
|
3619
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
3620
|
-
name = _useState2[0],
|
|
3621
|
-
setName = _useState2[1];
|
|
3622
|
-
var _useState3 = useState(false),
|
|
3623
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
3624
|
-
global = _useState4[0],
|
|
3625
|
-
setGlobal = _useState4[1];
|
|
3626
|
-
var _useState5 = useState(false),
|
|
3627
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
3628
|
-
showViewpointGui = _useState6[0],
|
|
3629
|
-
setShowViewpointGui = _useState6[1];
|
|
3630
|
-
return /*#__PURE__*/jsxs("div", {
|
|
3631
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
3632
|
-
id: "Viewpoint Gui",
|
|
3633
|
-
style: showViewpointGui ? {
|
|
3634
|
-
position: 'absolute',
|
|
3635
|
-
width: '250px'
|
|
3636
|
-
} : {
|
|
3637
|
-
display: 'none'
|
|
3638
|
-
},
|
|
3639
|
-
className: flexContainerColumn,
|
|
3640
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
3641
|
-
className: flexContainerRow,
|
|
3642
|
-
children: [/*#__PURE__*/jsx("input", {
|
|
3643
|
-
className: inputField,
|
|
3644
|
-
onChange: function onChange(e) {
|
|
3645
|
-
return setName(e.target.value);
|
|
3646
|
-
}
|
|
3647
|
-
}), /*#__PURE__*/jsx("div", {
|
|
3648
|
-
onClick: function onClick() {
|
|
3649
|
-
return setShowViewpointGui(false);
|
|
3650
|
-
},
|
|
3651
|
-
style: {
|
|
3652
|
-
width: '28px',
|
|
3653
|
-
height: '34px',
|
|
3654
|
-
backgroundImage: "url(".concat(arrowLeft, ")")
|
|
3655
|
-
}
|
|
3656
|
-
})]
|
|
3657
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
3658
|
-
className: flexContainerRow,
|
|
3659
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
3660
|
-
children: "Global"
|
|
3661
|
-
}), /*#__PURE__*/jsx("input", {
|
|
3662
|
-
type: "checkbox",
|
|
3663
|
-
className: checkBox,
|
|
3664
|
-
onClick: function onClick() {
|
|
3665
|
-
return setGlobal(!global);
|
|
3666
|
-
}
|
|
3667
|
-
})]
|
|
3668
|
-
}), /*#__PURE__*/jsx("button", {
|
|
3669
|
-
className: createButton,
|
|
3670
|
-
onClick: function onClick() {
|
|
3671
|
-
return callback(name, global);
|
|
3672
|
-
},
|
|
3673
|
-
children: "create"
|
|
3674
|
-
})]
|
|
3675
|
-
}), /*#__PURE__*/jsx("div", {
|
|
3676
|
-
onClick: function onClick() {
|
|
3677
|
-
return setShowViewpointGui(true);
|
|
3678
|
-
},
|
|
3679
|
-
style: showViewpointGui ? {
|
|
3680
|
-
display: 'none'
|
|
3681
|
-
} : {
|
|
3682
|
-
position: 'absolute',
|
|
3683
|
-
marginTop: '50px',
|
|
3684
|
-
width: '30px',
|
|
3685
|
-
height: '36px',
|
|
3686
|
-
backgroundImage: "url(".concat(arrowRight, ")")
|
|
3687
|
-
}
|
|
3688
|
-
})]
|
|
3689
|
-
});
|
|
3690
|
-
}
|
|
3691
|
-
function ViewpointSelectionGui(_ref2) {
|
|
3692
|
-
var name = _ref2.name,
|
|
3693
|
-
nextViewpoint = _ref2.nextViewpoint;
|
|
3694
|
-
return /*#__PURE__*/jsxs("div", {
|
|
3695
|
-
id: "viewpointSelectionGui",
|
|
3696
|
-
style: {
|
|
3697
|
-
position: 'absolute',
|
|
3698
|
-
bottom: 5,
|
|
3699
|
-
left: '41%',
|
|
3700
|
-
display: 'flex',
|
|
3701
|
-
flexDirection: 'row'
|
|
3702
|
-
},
|
|
3703
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
3704
|
-
id: "setLastViewpoint",
|
|
3705
|
-
style: {
|
|
3706
|
-
width: 50,
|
|
3707
|
-
height: 35,
|
|
3708
|
-
backgroundImage: "url(".concat(arrowLeft, ")")
|
|
3709
|
-
},
|
|
3710
|
-
onClick: function onClick() {
|
|
3711
|
-
return nextViewpoint(false);
|
|
3712
|
-
}
|
|
3713
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
3714
|
-
style: {
|
|
3715
|
-
paddingTop: '12px'
|
|
3716
|
-
},
|
|
3717
|
-
children: [" ", name, " "]
|
|
3718
|
-
}), /*#__PURE__*/jsx("div", {
|
|
3719
|
-
id: "setNextViewpoint",
|
|
3720
|
-
style: {
|
|
3721
|
-
width: 50,
|
|
3722
|
-
height: 35,
|
|
3723
|
-
backgroundImage: "url(".concat(arrowRight, ")")
|
|
3724
|
-
},
|
|
3725
|
-
onClick: function onClick() {
|
|
3726
|
-
return nextViewpoint(true);
|
|
3727
|
-
}
|
|
3728
|
-
})]
|
|
3729
|
-
});
|
|
3730
|
-
}
|
|
3731
|
-
|
|
3732
3542
|
var RealTimeRenderer = /*#__PURE__*/memo(function (props) {
|
|
3733
|
-
var _viewpoints$state$all;
|
|
3734
3543
|
var _useRealTimeRenderDat = useRealTimeRenderData(props),
|
|
3735
|
-
resolutionDiv = _useRealTimeRenderDat.resolutionDiv,
|
|
3736
|
-
viewpoints = _useRealTimeRenderDat.viewpoints,
|
|
3737
3544
|
gameCanvas = _useRealTimeRenderDat.gameCanvas;
|
|
3738
|
-
return /*#__PURE__*/
|
|
3739
|
-
ref: resolutionDiv,
|
|
3545
|
+
return /*#__PURE__*/jsx("div", {
|
|
3740
3546
|
style: {
|
|
3741
3547
|
position: 'absolute',
|
|
3742
3548
|
top: '0px',
|
|
@@ -3745,19 +3551,7 @@ var RealTimeRenderer = /*#__PURE__*/memo(function (props) {
|
|
|
3745
3551
|
backgroundColor: 'white',
|
|
3746
3552
|
zIndex: 2
|
|
3747
3553
|
},
|
|
3748
|
-
|
|
3749
|
-
if (ev.key == 'ArrowLeft') {
|
|
3750
|
-
viewpoints.methods.next(false);
|
|
3751
|
-
} else if (ev.key == 'ArrowRight') {
|
|
3752
|
-
viewpoints.methods.next(false);
|
|
3753
|
-
}
|
|
3754
|
-
},
|
|
3755
|
-
children: [props.viewpoints && /*#__PURE__*/jsx(ViewpointCreationGui, {
|
|
3756
|
-
callback: viewpoints.methods.create
|
|
3757
|
-
}), viewpoints.state.allViewpoints && ((_viewpoints$state$all = viewpoints.state.allViewpoints) === null || _viewpoints$state$all === void 0 ? void 0 : _viewpoints$state$all.length) > 0 && /*#__PURE__*/jsx(ViewpointSelectionGui, {
|
|
3758
|
-
nextViewpoint: viewpoints.methods.next,
|
|
3759
|
-
name: viewpoints.state.activeViewpoint.name
|
|
3760
|
-
}), /*#__PURE__*/jsx("canvas", {
|
|
3554
|
+
children: /*#__PURE__*/jsx("canvas", {
|
|
3761
3555
|
id: "gameCanvas",
|
|
3762
3556
|
ref: gameCanvas,
|
|
3763
3557
|
style: {
|
|
@@ -3767,11 +3561,11 @@ var RealTimeRenderer = /*#__PURE__*/memo(function (props) {
|
|
|
3767
3561
|
display: 'block'
|
|
3768
3562
|
},
|
|
3769
3563
|
className: canvas
|
|
3770
|
-
})
|
|
3564
|
+
})
|
|
3771
3565
|
});
|
|
3772
3566
|
}, function (prevProps, curProps) {
|
|
3773
|
-
var _prevProps$overlayIma, _curProps$overlayImag, _prevProps$overlayIma2, _curProps$overlayImag2;
|
|
3774
|
-
if (((_prevProps$overlayIma = prevProps.overlayImage) === null || _prevProps$overlayIma === void 0 ? void 0 : _prevProps$overlayIma.base64) != ((_curProps$overlayImag = curProps.overlayImage) === null || _curProps$overlayImag === void 0 ? void 0 : _curProps$overlayImag.base64) || ((_prevProps$overlayIma2 = prevProps.overlayImage) === null || _prevProps$overlayIma2 === void 0 ? void 0 : _prevProps$overlayIma2.isStaticBg) != ((_curProps$overlayImag2 = curProps.overlayImage) === null || _curProps$overlayImag2 === void 0 ? void 0 : _curProps$overlayImag2.isStaticBg)) return false;
|
|
3567
|
+
var _prevProps$overlayIma, _curProps$overlayImag, _prevProps$overlayIma2, _curProps$overlayImag2, _curProps$overlayImag3;
|
|
3568
|
+
if (((_prevProps$overlayIma = prevProps.overlayImage) === null || _prevProps$overlayIma === void 0 ? void 0 : _prevProps$overlayIma.base64) != ((_curProps$overlayImag = curProps.overlayImage) === null || _curProps$overlayImag === void 0 ? void 0 : _curProps$overlayImag.base64) || ((_prevProps$overlayIma2 = prevProps.overlayImage) === null || _prevProps$overlayIma2 === void 0 ? void 0 : _prevProps$overlayIma2.isStaticBg) != ((_curProps$overlayImag2 = curProps.overlayImage) === null || _curProps$overlayImag2 === void 0 ? void 0 : _curProps$overlayImag2.isStaticBg) || (_curProps$overlayImag3 = curProps.overlayImage) !== null && _curProps$overlayImag3 !== void 0 && _curProps$overlayImag3.isStart) return false;
|
|
3775
3569
|
if (prevProps.renderjob != curProps.renderjob) return false;
|
|
3776
3570
|
if (JSON.stringify(prevProps.elementsInfo) != JSON.stringify(curProps.elementsInfo)) return false;
|
|
3777
3571
|
if (prevProps.inBackground != curProps.inBackground) return false;
|