architwin 1.16.0 → 1.16.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/lib/architwin.d.ts +2 -1
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +2 -4
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +66 -63
- package/lib/atwinui/events.js +9 -23
- package/lib/loaders/polydrawerLoader.js +3 -1
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { FORM_MODE, PartitionNode, PolygonData, WallPolyData, IObjectData
|
|
1
|
+
import { FORM_MODE, PartitionNode, PolygonData, WallPolyData, IObjectData } from "../../../../types";
|
|
2
2
|
export declare let isEditWindow: boolean;
|
|
3
|
-
export declare let currentEditWindowIndex: number;
|
|
4
|
-
export declare let currentWindow: WindowPolyData;
|
|
5
3
|
export declare function renderRoomFormPane(): HTMLDivElement;
|
|
6
4
|
/**
|
|
7
5
|
* Toggles the state of the partition drawing functionality.
|
|
@@ -105,7 +103,7 @@ export declare function getCurrentPolygonData(): PolygonData;
|
|
|
105
103
|
* Sets the partition data, including updating the floor level and generating a new
|
|
106
104
|
* partition with its corresponding UUID, space UUID, and polygon data.
|
|
107
105
|
*/
|
|
108
|
-
export declare function setCurrentPartitionData(): Promise<void>;
|
|
106
|
+
export declare function setCurrentPartitionData(payload: PolygonData | undefined): Promise<void>;
|
|
109
107
|
export declare function removeWindow(index?: number): void;
|
|
110
108
|
export declare function toggleUndoRedoButtons(undo: boolean, redo: boolean): void;
|
|
111
109
|
export declare function getCurrentPartitionData(): PartitionNode;
|
|
@@ -41,10 +41,10 @@ let inputFloorMaterial;
|
|
|
41
41
|
let floorMaterial = '';
|
|
42
42
|
let inputWallMaterial;
|
|
43
43
|
let wallMaterial = '';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export let currentWindow = null;
|
|
44
|
+
let currentEditWindowIndex = null;
|
|
45
|
+
let currentWindowIndex = null;
|
|
47
46
|
let tempCurrentEditRoom = null;
|
|
47
|
+
export let isEditWindow = false;
|
|
48
48
|
export function renderRoomFormPane() {
|
|
49
49
|
log.info("__@ renderRoomFormPane: ", roomFormMode);
|
|
50
50
|
const element = document.createElement('div');
|
|
@@ -228,10 +228,11 @@ export function toggleDrawPartitionButton() {
|
|
|
228
228
|
isEditPartition = false;
|
|
229
229
|
previousPartitionData = null;
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
partitionHistory.clearHistory();
|
|
232
|
+
toggleUndoRedoButtons(false, false);
|
|
232
233
|
}
|
|
233
234
|
export function toggleDrawWindowButton() {
|
|
234
|
-
var _a, _b;
|
|
235
|
+
var _a, _b, _c;
|
|
235
236
|
log.info("toggleDrawWindowButton()", getCurrentPolygon(), _3DXObjects);
|
|
236
237
|
setCurrentPolygon(undefined);
|
|
237
238
|
const addDoorButton = document.getElementById('at-add-window-door-btn');
|
|
@@ -246,6 +247,7 @@ export function toggleDrawWindowButton() {
|
|
|
246
247
|
${i18n.t('DoneDrawing')}
|
|
247
248
|
<span class="mdi mdi-check-bold"></span>
|
|
248
249
|
`;
|
|
250
|
+
currentWindowIndex = (_a = currentWall.windows) === null || _a === void 0 ? void 0 : _a.length;
|
|
249
251
|
}
|
|
250
252
|
const objectIndex = _3DXObjects.findIndex(obj => obj.object.id == currentObject.object.id);
|
|
251
253
|
log.info("objectIndex", objectIndex);
|
|
@@ -253,7 +255,7 @@ export function toggleDrawWindowButton() {
|
|
|
253
255
|
lineTypeComponentConfig: {
|
|
254
256
|
renderPolygonOnAdd: false,
|
|
255
257
|
drawingMode: drawingMode,
|
|
256
|
-
targetIndex: (
|
|
258
|
+
targetIndex: (_c = currentEditWindowIndex !== null && currentEditWindowIndex !== void 0 ? currentEditWindowIndex : (_b = currentWall.windows) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0,
|
|
257
259
|
polygonData: currentPolygonData,
|
|
258
260
|
targetUUID: currentWall.uuid,
|
|
259
261
|
objectIndex: objectIndex
|
|
@@ -266,6 +268,7 @@ export function toggleDrawWindowButton() {
|
|
|
266
268
|
else {
|
|
267
269
|
isDrawing = false;
|
|
268
270
|
drawingMode = null;
|
|
271
|
+
currentWindowIndex = null;
|
|
269
272
|
currentPartitionData.polygon_json = JSON.stringify(currentPolygonData);
|
|
270
273
|
addDoorButton.classList.remove('at_add_window_door_btn_active');
|
|
271
274
|
addDoorButton.classList.add('at_add_window_door_btn');
|
|
@@ -290,16 +293,17 @@ export function toggleDrawWindowButton() {
|
|
|
290
293
|
log.info("objectIndex", objectIndex);
|
|
291
294
|
if (_3DXObjects[objectIndex].children) {
|
|
292
295
|
_3DXObjects[objectIndex].children.map((win) => __awaiter(this, void 0, void 0, function* () {
|
|
293
|
-
var
|
|
296
|
+
var _d;
|
|
294
297
|
log.info("WIND", win);
|
|
295
|
-
if (win.index == ((
|
|
298
|
+
if (win.index == ((_d = currentWall.windows) === null || _d === void 0 ? void 0 : _d.length) - 1 && win.wallUUID == currentWall.uuid) {
|
|
296
299
|
yield disposeModel(win);
|
|
297
300
|
}
|
|
298
301
|
}));
|
|
299
302
|
}
|
|
300
303
|
}
|
|
301
304
|
}
|
|
302
|
-
|
|
305
|
+
partitionHistory.clearHistory();
|
|
306
|
+
toggleUndoRedoButtons(false, false);
|
|
303
307
|
}
|
|
304
308
|
/**
|
|
305
309
|
* Displays the partition form based on the current form mode.
|
|
@@ -919,7 +923,6 @@ function setupEditWindow(element, window) {
|
|
|
919
923
|
const confirmBtn = element.querySelector(`#at-confirm-edit-window-${window.index}`);
|
|
920
924
|
if (!editBtn || !editNameContainer || !inputName || !nameLabel || !editMaterialContainer || !inputMaterial)
|
|
921
925
|
return;
|
|
922
|
-
currentWindow = window;
|
|
923
926
|
// Show inputs when edit icon is clicked
|
|
924
927
|
editBtn.addEventListener("click", () => {
|
|
925
928
|
if (isDrawing) {
|
|
@@ -956,17 +959,7 @@ function setupEditWindow(element, window) {
|
|
|
956
959
|
};
|
|
957
960
|
enableVerticeControls(windowComponent);
|
|
958
961
|
isDrawing = true;
|
|
959
|
-
|
|
960
|
-
if (currentPartitionData) {
|
|
961
|
-
data = {
|
|
962
|
-
polygon: {
|
|
963
|
-
uuid: currentPartitionData.uuid,
|
|
964
|
-
polygon_json: currentPolygonData
|
|
965
|
-
},
|
|
966
|
-
verticePath: window.path,
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
|
-
// partitionHistory.setCurrent(data)
|
|
962
|
+
// partitionHistory.setCurrent(window.path)
|
|
970
963
|
});
|
|
971
964
|
// // Confirm edit name and material
|
|
972
965
|
confirmBtn.addEventListener("click", () => {
|
|
@@ -977,7 +970,7 @@ function setupEditWindow(element, window) {
|
|
|
977
970
|
nameLabel.textContent = window.name;
|
|
978
971
|
editNameContainer.style.display = "none";
|
|
979
972
|
const newMaterial = inputMaterial.value.trim();
|
|
980
|
-
window.material = newMaterial
|
|
973
|
+
window.material = newMaterial;
|
|
981
974
|
editMaterialContainer.style.display = "none";
|
|
982
975
|
editBtn.style.display = "flex";
|
|
983
976
|
confirmBtn.style.display = "none";
|
|
@@ -1001,7 +994,7 @@ function setupEditWindow(element, window) {
|
|
|
1001
994
|
isDrawing = false;
|
|
1002
995
|
isEditWindow = false;
|
|
1003
996
|
partitionHistory.clearHistory();
|
|
1004
|
-
|
|
997
|
+
toggleUndoRedoButtons(false, false);
|
|
1005
998
|
});
|
|
1006
999
|
}
|
|
1007
1000
|
function saveWallChanges() {
|
|
@@ -1457,38 +1450,42 @@ export function clearTempCurrentPolygon() {
|
|
|
1457
1450
|
*/
|
|
1458
1451
|
export function setPolygonData(payload) {
|
|
1459
1452
|
console.log('setPolygonData()', payload);
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1453
|
+
if (payload != undefined) {
|
|
1454
|
+
// Helper function to round numbers to 2 decimals
|
|
1455
|
+
function roundToFourDecimals(value) {
|
|
1456
|
+
if (typeof value === "number") {
|
|
1457
|
+
return Math.round(value * 10000) / 10000; // Round to 4 decimals
|
|
1458
|
+
}
|
|
1459
|
+
else if (Array.isArray(value)) {
|
|
1460
|
+
return value.map(roundToFourDecimals); // Recursively round each item in the array
|
|
1461
|
+
}
|
|
1462
|
+
else if (typeof value === "object" && value !== null) {
|
|
1463
|
+
return Object.keys(value).reduce((acc, key) => {
|
|
1464
|
+
acc[key] = roundToFourDecimals(value[key]); // Recursively process each object property
|
|
1465
|
+
return acc;
|
|
1466
|
+
}, {});
|
|
1467
|
+
}
|
|
1468
|
+
return value;
|
|
1464
1469
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1470
|
+
// Round numbers in the polygon JSON recursively
|
|
1471
|
+
if (payload) {
|
|
1472
|
+
payload = roundToFourDecimals(payload);
|
|
1467
1473
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
}, {});
|
|
1474
|
+
// Set floor UUID and name
|
|
1475
|
+
if (payload.floor) {
|
|
1476
|
+
payload.floor.uuid = payload.floor.uuid || generateUUID();
|
|
1477
|
+
payload.floor.name = `floor`;
|
|
1473
1478
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
// Set floor UUID and name
|
|
1481
|
-
if (payload.floor) {
|
|
1482
|
-
payload.floor.uuid = payload.floor.uuid || generateUUID();
|
|
1483
|
-
payload.floor.name = `floor`;
|
|
1479
|
+
// Iterate over walls to set UUID and names
|
|
1480
|
+
if (payload.walls && payload.walls.length > 0) {
|
|
1481
|
+
payload.walls = payload.walls.map((wall, index) => (Object.assign(Object.assign({}, roundToFourDecimals(wall)), { name: `wall-${index}`, uuid: wall.uuid || generateUUID() })));
|
|
1482
|
+
}
|
|
1483
|
+
currentPolygonData = payload;
|
|
1484
|
+
setCurrentPartitionData(payload);
|
|
1484
1485
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
payload.walls = payload.walls.map((wall, index) => (Object.assign(Object.assign({}, roundToFourDecimals(wall)), { name: `wall-${index}`, uuid: wall.uuid || generateUUID() })));
|
|
1486
|
+
else {
|
|
1487
|
+
setCurrentPartitionData(undefined);
|
|
1488
1488
|
}
|
|
1489
|
-
currentPolygonData = payload;
|
|
1490
|
-
console.log("setPolygonData() currentPolygonData:", currentPolygonData);
|
|
1491
|
-
setCurrentPartitionData();
|
|
1492
1489
|
}
|
|
1493
1490
|
/**
|
|
1494
1491
|
* Returns current polygon data
|
|
@@ -1501,10 +1498,10 @@ export function getCurrentPolygonData() {
|
|
|
1501
1498
|
* Sets the partition data, including updating the floor level and generating a new
|
|
1502
1499
|
* partition with its corresponding UUID, space UUID, and polygon data.
|
|
1503
1500
|
*/
|
|
1504
|
-
export function setCurrentPartitionData() {
|
|
1501
|
+
export function setCurrentPartitionData(payload) {
|
|
1505
1502
|
var _a;
|
|
1506
1503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1507
|
-
console.log('setCurrentPartitionData()');
|
|
1504
|
+
console.log('setCurrentPartitionData()', payload);
|
|
1508
1505
|
const floorLevel = ((_a = document.getElementById('at-room-floor-level-input')) === null || _a === void 0 ? void 0 : _a.value) || null;
|
|
1509
1506
|
const currentUrl = window.location.href;
|
|
1510
1507
|
const spaceUUID = extractUUID(currentUrl);
|
|
@@ -1519,7 +1516,9 @@ export function setCurrentPartitionData() {
|
|
|
1519
1516
|
resolve();
|
|
1520
1517
|
}
|
|
1521
1518
|
if (currentObjectData == undefined) {
|
|
1522
|
-
|
|
1519
|
+
if (drawingMode === 'partition') {
|
|
1520
|
+
currentPolygonData = null;
|
|
1521
|
+
}
|
|
1523
1522
|
clearInterval(interval);
|
|
1524
1523
|
resolve();
|
|
1525
1524
|
}
|
|
@@ -1530,7 +1529,7 @@ export function setCurrentPartitionData() {
|
|
|
1530
1529
|
}
|
|
1531
1530
|
}, 50); // Check every 50ms
|
|
1532
1531
|
});
|
|
1533
|
-
if (
|
|
1532
|
+
if (payload) {
|
|
1534
1533
|
let polygonData = currentPolygonData;
|
|
1535
1534
|
polygonData.floor.floor_level = Number(floorLevel); // Set the floor level from the input
|
|
1536
1535
|
// Create a new partition data payload
|
|
@@ -1546,13 +1545,11 @@ export function setCurrentPartitionData() {
|
|
|
1546
1545
|
}
|
|
1547
1546
|
if (isEditPartition) {
|
|
1548
1547
|
newPayload.name = currentPartitionData.name;
|
|
1549
|
-
console.log("newPayload.name", newPayload.name);
|
|
1550
1548
|
}
|
|
1551
1549
|
if (currentHighlightedFace) {
|
|
1552
1550
|
setMeshChildrenMaterialProperty(currentHighlightedFace.component, currentHighlightedFace.name, currentHighlightedFace.type, currentHighlightedFace.value);
|
|
1553
1551
|
}
|
|
1554
1552
|
updatePartitionDataArray(newPayload, currentPartitionDataArray);
|
|
1555
|
-
log.info("if currentPartitionDataArray", currentPartitionDataArray);
|
|
1556
1553
|
if (drawingMode === 'partition') {
|
|
1557
1554
|
displayFaces(currentPolygonData);
|
|
1558
1555
|
}
|
|
@@ -1569,13 +1566,19 @@ export function setCurrentPartitionData() {
|
|
|
1569
1566
|
else {
|
|
1570
1567
|
const faceVertexContainer = document.getElementById('at-face-vertex-container');
|
|
1571
1568
|
faceVertexContainer.innerHTML = '';
|
|
1572
|
-
if (
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1569
|
+
if (drawingMode === 'partition') {
|
|
1570
|
+
if (currentPartitionData) {
|
|
1571
|
+
currentPartitionDataArray = currentPartitionDataArray.filter(partition => partition.uuid != currentPartitionData.uuid);
|
|
1572
|
+
dispatchSpaceEvent(SPACE_EVENTS.PARTITION_DISPOSED, currentPartitionData);
|
|
1573
|
+
currentPartitionData = null;
|
|
1574
|
+
log.info("else currentPartitionDataArray", currentPartitionDataArray);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
else if (drawingMode === 'window') {
|
|
1578
|
+
if (currentWall === null || currentWall === void 0 ? void 0 : currentWall.windows) {
|
|
1579
|
+
currentWall.windows.splice(currentWindowIndex, 1);
|
|
1580
|
+
faceVertexContainer.append(displayWall(currentWall));
|
|
1581
|
+
}
|
|
1579
1582
|
}
|
|
1580
1583
|
}
|
|
1581
1584
|
});
|
package/lib/atwinui/events.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTagRow, getTagFormData, addClickEventToTagRow, setActiveCard, setActiveMenu, removeObjectCard, clearActiveMenu, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown, clearActiveActionBtn, clearActiveCard, toggleActionBarButtons, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList, toggleModal, setModalAction, } from "./components/toolbar";
|
|
11
|
-
import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, _spaceUsers, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath, _screenSharingHostUser, toggleVisibilityTag, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory,
|
|
11
|
+
import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, _spaceUsers, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath, _screenSharingHostUser, toggleVisibilityTag, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory, _thisVertexPath,
|
|
12
12
|
// polygonHistory
|
|
13
13
|
} from "../architwin";
|
|
14
14
|
import { Notyf } from 'notyf';
|
|
@@ -26,7 +26,7 @@ import log from 'loglevel';
|
|
|
26
26
|
import * as minimap from '../minimap';
|
|
27
27
|
import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
|
|
28
28
|
import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild, highlightSelectedWindow, getRoomData } from "./components/toolbar/spacePartition/roomTreePane";
|
|
29
|
-
import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition,
|
|
29
|
+
import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getIsDrawing, getDrawingMode, getCurrentPolygonData, setTempCurrentRoomEditData, toggleUndoRedoButtons } from "./components/toolbar/spacePartition/roomFormPane";
|
|
30
30
|
import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint, toggleActionSettings, getBasepointObjectPayload, displayConvertedCoordinates, getCoordinateSystem, getScaleFactor, getMeasurementUnit, getRotationUnit, setBasepointObjectPayload } from "./components/toolbar/actionSettingsPane";
|
|
31
31
|
import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
|
|
32
32
|
import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
|
|
@@ -40,7 +40,6 @@ import { PipeForm } from "./components/toolbar/pipeFormPane";
|
|
|
40
40
|
import { toggleIoTCategoryOptions, toggleIoTDevicesOptions, setSelectedIoTSystemRadio, clearIoTDropdowns, initIoTFormData, setIotCategoryOptions, getIotTagFormData, iotTagFormMode, selectedIotTag, clearIotFields, getIotCategoryOption } from './components/toolbar/tagIotFormPane';
|
|
41
41
|
import { getTheseTagMessages, timedoutComment, unsendComment } from "./components/toolbar/tagMessagingPane";
|
|
42
42
|
import { handleScreenShareResponsiveChanges, handleScreenShareAcceptRequest, handleScreenShareBackUserListPane, handleScreenShareEndSessionEvent, handleScreenShareUsersUpdated, renderScreenShareLeaveConfirmationModal } from "./components/toolbar/screenSharePane";
|
|
43
|
-
import _ from "lodash";
|
|
44
43
|
const pipeList = new PipeList();
|
|
45
44
|
const pipeForm = new PipeForm();
|
|
46
45
|
let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
|
|
@@ -1584,28 +1583,9 @@ function setupSpaceEventSubscriptions() {
|
|
|
1584
1583
|
}
|
|
1585
1584
|
function handleVertexDragEnd(payload) {
|
|
1586
1585
|
log.info("handleVertexDragEnd()", payload);
|
|
1587
|
-
setCurrentPartitionData();
|
|
1588
1586
|
if (isToolbarFeatureEnabled("roomCreation")) {
|
|
1589
|
-
|
|
1590
|
-
const currentPartitionData = _.cloneDeep(getCurrentPartitionData());
|
|
1591
|
-
const currentPolygonData = _.cloneDeep(getCurrentPolygonData());
|
|
1592
|
-
const currentWall = getCurrentWall();
|
|
1593
|
-
const wallIndex = currentPolygonData.walls.findIndex(w => w.uuid == currentWall.uuid);
|
|
1594
|
-
if (currentPartitionData) {
|
|
1595
|
-
data = {
|
|
1596
|
-
polygon: {
|
|
1597
|
-
uuid: currentPartitionData.uuid,
|
|
1598
|
-
polygon_json: currentPolygonData
|
|
1599
|
-
},
|
|
1600
|
-
verticePath: currentPolygonData.walls[wallIndex].windows[currentWindow.index].path
|
|
1601
|
-
};
|
|
1602
|
-
partitionHistory.addToHistory(JSON.parse(JSON.stringify(data)));
|
|
1603
|
-
}
|
|
1604
|
-
log.info("all history", partitionHistory.getAllHistory());
|
|
1587
|
+
partitionHistory.addToHistory([..._thisVertexPath]);
|
|
1605
1588
|
}
|
|
1606
|
-
// partitionHistory.addToHistory(data)
|
|
1607
|
-
// polygonHistory.addToHistory(payload)
|
|
1608
|
-
// toggleUndoRedoButtons(polygonHistory.canUndo(), polygonHistory.canRedo())
|
|
1609
1589
|
}
|
|
1610
1590
|
function handlePartitionColiderClickSelected(payload) {
|
|
1611
1591
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1678,6 +1658,9 @@ function handleDragEnd(payload) {
|
|
|
1678
1658
|
function handleVertexPlace(payload) {
|
|
1679
1659
|
console.log("handleVertexPlace ==>", payload);
|
|
1680
1660
|
if (isToolbarFeatureEnabled('roomCreation')) {
|
|
1661
|
+
if (payload.path.length <= 2) {
|
|
1662
|
+
setPolygonData(undefined);
|
|
1663
|
+
}
|
|
1681
1664
|
toggleUndoRedoButtons(partitionHistory.canUndo(), partitionHistory.canRedo());
|
|
1682
1665
|
}
|
|
1683
1666
|
if (isToolbarFeatureEnabled('pipe')) {
|
|
@@ -1685,6 +1668,7 @@ function handleVertexPlace(payload) {
|
|
|
1685
1668
|
}
|
|
1686
1669
|
}
|
|
1687
1670
|
function handlePathUpdated(payload) {
|
|
1671
|
+
log.info("handlePathUpdated", payload);
|
|
1688
1672
|
setVertexPath(payload.path);
|
|
1689
1673
|
handleVertexPlace(payload);
|
|
1690
1674
|
}
|
|
@@ -2621,6 +2605,7 @@ function handleMarkFloor() {
|
|
|
2621
2605
|
partitionsUUIDs = currentPartitionData.children.map(child => child.uuid);
|
|
2622
2606
|
const target = objects.find(obj => partitionsUUIDs.includes(obj.object.object_data.uuid));
|
|
2623
2607
|
if (target) {
|
|
2608
|
+
setSelectedObject(target.object, target.node, target.component, target.type);
|
|
2624
2609
|
const polyJson = target.object.object_data.json_data;
|
|
2625
2610
|
const updatedPath = polyJson.path.map(path => {
|
|
2626
2611
|
path.y = adjustedHeight;
|
|
@@ -2635,6 +2620,7 @@ function handleMarkFloor() {
|
|
|
2635
2620
|
}
|
|
2636
2621
|
else if (currentPolygon) {
|
|
2637
2622
|
//setSelectedObject(currentPolygon.object,currentPolygon.node,currentPolygon.component,currentPolygon.type)
|
|
2623
|
+
setSelectedObject(currentPolygon.object, currentPolygon.node, currentPolygon.component, currentPolygon.type);
|
|
2638
2624
|
const polyJson = currentPolygon.object.object_data.json_data;
|
|
2639
2625
|
const updatedPath = polyJson.path.map(path => {
|
|
2640
2626
|
path.y = adjustedHeight;
|