architwin 1.14.13 → 1.14.15
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/i18n.js +6 -2
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +83 -20
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.d.ts +9 -1
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.js +219 -57
- package/lib/atwinui/components/toolbar/tagIotFormPane.js +45 -16
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.d.ts +0 -1
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +0 -6
- package/lib/atwinui/events.d.ts +3 -1
- package/lib/atwinui/events.js +61 -10
- package/lib/loaders/polydrawerLoader.d.ts +3 -0
- package/lib/loaders/polydrawerLoader.js +26 -22
- package/lib/types.d.ts +5 -0
- package/package.json +1 -1
- package/static/atwinui.css +41 -8
- package/static/utility.css +1 -1
|
@@ -570,6 +570,7 @@ function renderDeviceRow(payload) {
|
|
|
570
570
|
const deviceRow = document.createElement('div');
|
|
571
571
|
deviceRow.classList.add('at_flex_row');
|
|
572
572
|
deviceRow.classList.add('at_item');
|
|
573
|
+
deviceRow.id = `at-data-device-id-${payload.id}`;
|
|
573
574
|
deviceRow.innerHTML = `
|
|
574
575
|
<div class="at_subitem_left">
|
|
575
576
|
<span class="mdi mdi-cube-outline"></span>
|
|
@@ -599,23 +600,9 @@ function renderDeviceRow(payload) {
|
|
|
599
600
|
const devId = selectedDevice.id.split('at-delete-device-')[1];
|
|
600
601
|
// finds the index of the selected device
|
|
601
602
|
const findDevice = linkedDevicesArray.findIndex(dev => dev.id === devId);
|
|
602
|
-
if (findDevice
|
|
603
|
+
if (findDevice !== -1) {
|
|
603
604
|
selectedDevice.setAttribute('disabled', 'true');
|
|
604
|
-
|
|
605
|
-
if (parent) {
|
|
606
|
-
// displays delete Device back in Dropdown List
|
|
607
|
-
const findHideDev = document.querySelector(`div[iot-device-uuid="${devId}"]`);
|
|
608
|
-
const devicesDropdown = document.getElementById('at-iot-selected-device');
|
|
609
|
-
if (findHideDev) {
|
|
610
|
-
findHideDev.style.display = "block";
|
|
611
|
-
parent.style.display = 'none';
|
|
612
|
-
linkedDevicesArray.splice(findDevice, 1);
|
|
613
|
-
}
|
|
614
|
-
if (linkedDevicesArray.length === 0) {
|
|
615
|
-
devicesDropdown.innerText = i18n.t('SelectDevice');
|
|
616
|
-
setIotDeviceOptions();
|
|
617
|
-
}
|
|
618
|
-
}
|
|
605
|
+
deleteDeviceRow(devId);
|
|
619
606
|
toggleModal(false);
|
|
620
607
|
notify.success(`${i18n.t('SuccessDeleteDevice')}`);
|
|
621
608
|
selectedDevice.setAttribute('disabled', 'false');
|
|
@@ -630,6 +617,48 @@ function renderDeviceRow(payload) {
|
|
|
630
617
|
return;
|
|
631
618
|
}
|
|
632
619
|
}
|
|
620
|
+
// 🗑️ Delete row function
|
|
621
|
+
function deleteDeviceRow(deviceId) {
|
|
622
|
+
log.info('deleteDeviceRow()', deviceId);
|
|
623
|
+
// 1️⃣ Normalize ID for matching
|
|
624
|
+
const normalizedId = String(deviceId).trim();
|
|
625
|
+
// 2️⃣ Remove from DOM
|
|
626
|
+
// const deviceRow = document.querySelector<HTMLElement>(`[at-data-device-id-"${normalizedId}"]`)
|
|
627
|
+
const deviceRow = document.getElementById(`at-data-device-id-${normalizedId}`);
|
|
628
|
+
if (deviceRow) {
|
|
629
|
+
deviceRow.remove();
|
|
630
|
+
log.info(`Device row [${normalizedId}] removed from DOM.`);
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
log.warn(`No DOM element found for device [${normalizedId}]`);
|
|
634
|
+
}
|
|
635
|
+
// 3️⃣ Remove from linkedDevicesArray (if defined)
|
|
636
|
+
if (Array.isArray(linkedDevicesArray)) {
|
|
637
|
+
const index = linkedDevicesArray.findIndex(d => String(d.id).trim() === normalizedId);
|
|
638
|
+
if (index !== -1) {
|
|
639
|
+
linkedDevicesArray.splice(index, 1);
|
|
640
|
+
log.info(`Device [${normalizedId}] removed from linkedDevicesArray.`);
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
log.warn(`Device [${normalizedId}] not found in linkedDevicesArray.`);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
// 4️⃣ Show the deleted device again in dropdown (if exists)
|
|
647
|
+
const dropdownItem = document.querySelector(`div[iot-device-uuid="${normalizedId}"]`);
|
|
648
|
+
if (dropdownItem) {
|
|
649
|
+
dropdownItem.style.display = 'block';
|
|
650
|
+
log.info(`Dropdown item for device [${normalizedId}] shown again.`);
|
|
651
|
+
}
|
|
652
|
+
// 5️⃣ Update dropdown label if no devices remain
|
|
653
|
+
const devicesContainer = document.getElementById('at-device-item-container');
|
|
654
|
+
if (devicesContainer && devicesContainer.children.length === 0) {
|
|
655
|
+
const devicesDropdown = document.getElementById('at-iot-selected-device');
|
|
656
|
+
if (devicesDropdown) {
|
|
657
|
+
devicesDropdown.innerText = i18n.t('SelectDevice');
|
|
658
|
+
log.info(`Dropdown label reset to "SelectDevice".`);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
633
662
|
/**
|
|
634
663
|
* Clears all Fields Input Fields including the Linked Devices Table
|
|
635
664
|
*
|
|
@@ -6,4 +6,3 @@ export declare function renderViewingRemoteSpace(): HTMLElement;
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function renderRemoteSpaceViewing(user: ScreenShareUser): void;
|
|
8
8
|
export declare function handleRemoteViewResponsiveChanges(): void;
|
|
9
|
-
export declare function handleScreenShareRemoteEndSessionEvent(): void;
|
|
@@ -100,9 +100,3 @@ export function handleRemoteViewResponsiveChanges() {
|
|
|
100
100
|
container.classList.toggle("at_display_flex_end", isMobile);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
export function handleScreenShareRemoteEndSessionEvent() {
|
|
104
|
-
const element = document.getElementById("at-viewing-remote-space-pane");
|
|
105
|
-
if (element) {
|
|
106
|
-
element.style.display = 'none';
|
|
107
|
-
}
|
|
108
|
-
}
|
package/lib/atwinui/events.d.ts
CHANGED
|
@@ -43,4 +43,6 @@ declare function handleDeletePartition(targetId: string): void;
|
|
|
43
43
|
* Handles the display logic for showing the custom minimap.
|
|
44
44
|
*/
|
|
45
45
|
declare function handleShowCustomMinimap(): void;
|
|
46
|
-
|
|
46
|
+
declare function handleWindowVisibility(visibilityBtn: HTMLElement): Promise<void>;
|
|
47
|
+
declare function clearActivePane(): void;
|
|
48
|
+
export { activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor, batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleWindowVisibility, clearActivePane };
|
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 } from "../architwin";
|
|
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, toggleMeshChildrenVisibility } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
14
|
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, sortTagOptions, sortObjectOptions, CUSTOM_MAP_MODE } from "../types";
|
|
@@ -23,14 +23,14 @@ import { isValidUrl, debounce, isElementVisible, extractUUID, showLoader, isVec3
|
|
|
23
23
|
import log from 'loglevel';
|
|
24
24
|
import * as minimap from '../minimap';
|
|
25
25
|
import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
|
|
26
|
-
import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild } from "./components/toolbar/spacePartition/roomTreePane";
|
|
26
|
+
import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild, highlightSelectedWallWindow } from "./components/toolbar/spacePartition/roomTreePane";
|
|
27
27
|
import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, setCurrentPartitionData, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getDrawingMode } from "./components/toolbar/spacePartition/roomFormPane";
|
|
28
28
|
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";
|
|
29
29
|
import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
|
|
30
30
|
import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
|
|
31
31
|
import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm, sortTags, updateSelectedTagSortOption, resetSelectedTagSortOption } from './components/toolbar/tagListPane';
|
|
32
32
|
import { renderUserRows } from "./components/toolbar/spaceUserListPane";
|
|
33
|
-
import { handleRemoteViewResponsiveChanges,
|
|
33
|
+
import { handleRemoteViewResponsiveChanges, renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
|
|
34
34
|
import { PipeList } from "./components/toolbar/pipeListPane";
|
|
35
35
|
import { PipeForm } from "./components/toolbar/pipeFormPane";
|
|
36
36
|
import { unsendComment, timedoutComment, getTheseTagMessages } from './components/toolbar/tagMessagingPane';
|
|
@@ -1439,18 +1439,24 @@ function setupSpaceEventSubscriptions() {
|
|
|
1439
1439
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_HOST_END_SESSION, handleScreenShareEndSessionEvent);
|
|
1440
1440
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_ACCEPT_REQUEST, handleScreenShareAcceptRequest);
|
|
1441
1441
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_BACK_USER_LIST_PANE, handleScreenShareBackUserListPane);
|
|
1442
|
-
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_TERMINATED, handleScreenShareRemoteEndSessionEvent);
|
|
1443
1442
|
}
|
|
1444
1443
|
function handlePartitionColiderClickSelected(payload) {
|
|
1445
1444
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1446
|
-
const
|
|
1445
|
+
const polygonId = extractUUID(payload.collider.name);
|
|
1446
|
+
const polygonName = payload.collider.name.toLowerCase();
|
|
1447
1447
|
if ((activePane === null || activePane === void 0 ? void 0 : activePane.getAttribute('id')) !== 'at-room-tree-pane') {
|
|
1448
1448
|
yield toggleDisplayPane('at-room-creation-btn');
|
|
1449
1449
|
}
|
|
1450
1450
|
else {
|
|
1451
1451
|
yield new Promise(resolve => requestAnimationFrame(resolve));
|
|
1452
1452
|
}
|
|
1453
|
-
|
|
1453
|
+
if (polygonName.includes('window')) {
|
|
1454
|
+
const index = polygonName.split('_')[1].split('-')[1];
|
|
1455
|
+
highlightSelectedWallWindow(polygonId, index);
|
|
1456
|
+
}
|
|
1457
|
+
if (polygonName.includes('wall') || polygonName.includes('floor')) {
|
|
1458
|
+
highlightSelectedPartitionChild(polygonId, payload.collider.name);
|
|
1459
|
+
}
|
|
1454
1460
|
});
|
|
1455
1461
|
}
|
|
1456
1462
|
function handleDragEnd(payload) {
|
|
@@ -2140,9 +2146,9 @@ function handleDeletePartition(targetId) {
|
|
|
2140
2146
|
function handleCancelPartition() {
|
|
2141
2147
|
const cancelRoomBtn = document.getElementById('at-cancel-room-form-btn');
|
|
2142
2148
|
cancelRoomBtn.addEventListener('click', () => {
|
|
2143
|
-
getNewlyAddedPartition().map(partition => {
|
|
2149
|
+
getNewlyAddedPartition().map((partition) => __awaiter(this, void 0, void 0, function* () {
|
|
2144
2150
|
const target = _3DXObjects.find(obj => obj.object.object_data.uuid === partition.uuid);
|
|
2145
|
-
disposeModel(target);
|
|
2151
|
+
yield disposeModel(target);
|
|
2146
2152
|
dispatchSpaceEvent(SPACE_EVENTS.PARTITION_DISPOSED, partition);
|
|
2147
2153
|
const filteredRoomNodes = _partitionNodes.map((roomNode) => {
|
|
2148
2154
|
// Filter children based on partitionUuid if children exist
|
|
@@ -2151,7 +2157,7 @@ function handleCancelPartition() {
|
|
|
2151
2157
|
}
|
|
2152
2158
|
});
|
|
2153
2159
|
setSpacePartitionNodes(filteredRoomNodes);
|
|
2154
|
-
});
|
|
2160
|
+
}));
|
|
2155
2161
|
clearWallBaseHeight();
|
|
2156
2162
|
const objects = get3DXObjects();
|
|
2157
2163
|
const currentPartitionData = getCurrentEditRoomData();
|
|
@@ -2167,6 +2173,23 @@ function handleCancelPartition() {
|
|
|
2167
2173
|
if (currentPartitionData) {
|
|
2168
2174
|
const currentPartition = currentPartitionData.children.find(child => child.uuid == target.object.object_data.uuid);
|
|
2169
2175
|
const polyJson = typeof currentPartition.polygon_json === 'string' ? JSON.parse(currentPartition.polygon_json) : currentPartition.polygon_json;
|
|
2176
|
+
log.info("JAMES polyJson", polyJson);
|
|
2177
|
+
// delete newly added windows
|
|
2178
|
+
_3DXObjects.map(object => {
|
|
2179
|
+
if (object.children) {
|
|
2180
|
+
object.children.map((win) => __awaiter(this, void 0, void 0, function* () {
|
|
2181
|
+
log.info("JAMES window", win);
|
|
2182
|
+
yield disposeModel(win);
|
|
2183
|
+
// Find the wall that owns this window
|
|
2184
|
+
const wall = polyJson.walls.find(wall => wall.uuid === win.wallUUID);
|
|
2185
|
+
if (wall && wall.windows) {
|
|
2186
|
+
// Remove this specific window (by its index) from that wall
|
|
2187
|
+
wall.windows = wall.windows.filter(w => w.index !== win.index);
|
|
2188
|
+
log.info(`Removed window ${win.index} from wall ${wall.uuid}`);
|
|
2189
|
+
}
|
|
2190
|
+
}));
|
|
2191
|
+
}
|
|
2192
|
+
});
|
|
2170
2193
|
if (polyJson && polyJson.path) {
|
|
2171
2194
|
const payload = {
|
|
2172
2195
|
uuid: target.object.object_data.uuid,
|
|
@@ -3272,10 +3295,38 @@ function handleClickEventInObjectSortOption() {
|
|
|
3272
3295
|
});
|
|
3273
3296
|
}
|
|
3274
3297
|
}
|
|
3298
|
+
function handleWindowVisibility(visibilityBtn) {
|
|
3299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3300
|
+
try {
|
|
3301
|
+
const partitionId = visibilityBtn.getAttribute('partition-id');
|
|
3302
|
+
const windowIndex = visibilityBtn.closest('li').getAttribute('window-index');
|
|
3303
|
+
const wallId = visibilityBtn.closest('li').getAttribute('wall-id');
|
|
3304
|
+
const windowNameAsMeshChild = `${wallId}_window-${windowIndex}`;
|
|
3305
|
+
const windowLabelNameAsMeshChild = `windowLabel-${windowIndex}`;
|
|
3306
|
+
const polygonObjs = get3DXObjects().filter(p => p.type === 'POLYGON');
|
|
3307
|
+
const targetObject = polygonObjs.find(obj => obj.object.object_data.uuid === partitionId);
|
|
3308
|
+
const { component } = targetObject;
|
|
3309
|
+
const isVisible = visibilityBtn.classList.toggle('mdi-eye');
|
|
3310
|
+
toggleVisibilityState(visibilityBtn, isVisible);
|
|
3311
|
+
toggleMeshChildrenVisibility(component, windowNameAsMeshChild, isVisible);
|
|
3312
|
+
toggleMeshChildrenVisibility(component, windowLabelNameAsMeshChild, isVisible);
|
|
3313
|
+
}
|
|
3314
|
+
catch (e) {
|
|
3315
|
+
console.error("Error window visibility: ", e);
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3318
|
+
}
|
|
3319
|
+
function clearActivePane() {
|
|
3320
|
+
activePane = null;
|
|
3321
|
+
const paneElement = activePane;
|
|
3322
|
+
if (paneElement) {
|
|
3323
|
+
paneElement.style.display = 'none';
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3275
3326
|
export {
|
|
3276
3327
|
//state
|
|
3277
3328
|
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
|
|
3278
3329
|
//methods
|
|
3279
3330
|
batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap,
|
|
3280
3331
|
// partition
|
|
3281
|
-
handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, };
|
|
3332
|
+
handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleWindowVisibility, clearActivePane };
|
|
@@ -44,6 +44,8 @@ export declare class TubeLine {
|
|
|
44
44
|
polygonData: any;
|
|
45
45
|
renderPolygonOnAdd: boolean;
|
|
46
46
|
targetUUID: any;
|
|
47
|
+
isWindowEditing: boolean;
|
|
48
|
+
objectIndex: any;
|
|
47
49
|
};
|
|
48
50
|
outputs: Record<string, unknown> & MpSdk.Scene.PredefinedOutputs;
|
|
49
51
|
context: MpSdk.Scene.IComponentContext;
|
|
@@ -139,6 +141,7 @@ export declare class BufferGeometry {
|
|
|
139
141
|
targetUUID: any;
|
|
140
142
|
deductWindowFromWallArea: boolean;
|
|
141
143
|
windowOutlineColor: number;
|
|
144
|
+
isWindowEditing: boolean;
|
|
142
145
|
};
|
|
143
146
|
outputs: Record<string, unknown> & MpSdk.Scene.PredefinedOutputs;
|
|
144
147
|
context: MpSdk.Scene.IComponentContext;
|
|
@@ -40,6 +40,8 @@ export class TubeLine {
|
|
|
40
40
|
polygonData: undefined,
|
|
41
41
|
renderPolygonOnAdd: true,
|
|
42
42
|
targetUUID: undefined,
|
|
43
|
+
isWindowEditing: false,
|
|
44
|
+
objectIndex: undefined
|
|
43
45
|
};
|
|
44
46
|
//@ts-expect-error
|
|
45
47
|
this.outputs = {
|
|
@@ -87,7 +89,9 @@ export class TubeLine {
|
|
|
87
89
|
drawingMode: this.inputs.drawingMode,
|
|
88
90
|
targetIndex: this.inputs.targetIndex,
|
|
89
91
|
polygonData: this.inputs.polygonData,
|
|
90
|
-
targetUUID: this.inputs.targetUUID
|
|
92
|
+
targetUUID: this.inputs.targetUUID,
|
|
93
|
+
isWindowEditing: this.inputs.isWindowEditing,
|
|
94
|
+
objectIndex: this.inputs.objectIndex,
|
|
91
95
|
};
|
|
92
96
|
renderPolygon(this.inputs.path, options);
|
|
93
97
|
}
|
|
@@ -496,8 +500,7 @@ export class BufferGeometry {
|
|
|
496
500
|
floorName: '',
|
|
497
501
|
floorColor: 0x0000ff,
|
|
498
502
|
wallColor: 0xffd150,
|
|
499
|
-
|
|
500
|
-
windowColor: 0xC09672,
|
|
503
|
+
windowColor: 0x275c8b,
|
|
501
504
|
floorOpacity: 0.3,
|
|
502
505
|
wallOpacity: 0.6,
|
|
503
506
|
visible: true,
|
|
@@ -512,7 +515,8 @@ export class BufferGeometry {
|
|
|
512
515
|
targetIndex: undefined,
|
|
513
516
|
targetUUID: undefined,
|
|
514
517
|
deductWindowFromWallArea: true,
|
|
515
|
-
windowOutlineColor:
|
|
518
|
+
windowOutlineColor: 0x65BBE9,
|
|
519
|
+
isWindowEditing: false
|
|
516
520
|
};
|
|
517
521
|
this.emits = {
|
|
518
522
|
changed: true,
|
|
@@ -694,22 +698,17 @@ export class BufferGeometry {
|
|
|
694
698
|
const windowsPolyData = polyData.walls.reduce((acc, wall, index) => {
|
|
695
699
|
if (wall.windows && wall.windows.length > 0) {
|
|
696
700
|
acc = [...acc, ...wall.windows];
|
|
697
|
-
wallDataArray[index].windows = wall.windows
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
// if (wall.windows && wall.windows.length > 0) {
|
|
702
|
-
// totalWindowArea = wall.windows.reduce((sum, window) => {
|
|
703
|
-
// return sum + (window.area || 0);
|
|
704
|
-
// }, 0);
|
|
705
|
-
// }
|
|
706
|
-
// // Subtract window area from wall area
|
|
707
|
-
// wallDataArray[index].area = Math.max(0, wallDataArray[index].area - totalWindowArea);
|
|
708
|
-
// }
|
|
701
|
+
wallDataArray[index].windows = wall.windows.map(window => {
|
|
702
|
+
window.wall_uuid = wall.uuid;
|
|
703
|
+
return window;
|
|
704
|
+
});
|
|
709
705
|
}
|
|
710
706
|
return acc;
|
|
711
707
|
}, []);
|
|
712
|
-
this.renderWindows(windowsPolyData)
|
|
708
|
+
//this.renderWindows(windowsPolyData)
|
|
709
|
+
for (let i = 0; i < polyData.walls.length; i++) {
|
|
710
|
+
this.renderWindows(polyData.walls[i].windows);
|
|
711
|
+
}
|
|
713
712
|
}
|
|
714
713
|
}
|
|
715
714
|
catch (error) {
|
|
@@ -755,7 +754,7 @@ export class BufferGeometry {
|
|
|
755
754
|
};
|
|
756
755
|
windowDataArray.push(windowEdges);
|
|
757
756
|
}
|
|
758
|
-
let windowName =
|
|
757
|
+
let windowName = `Window ${this.inputs.targetIndex + 1}`;
|
|
759
758
|
let windowMaterial = undefined;
|
|
760
759
|
if (polyData.walls[targetWallIndex] && polyData.walls[targetWallIndex].windows[this.inputs.targetIndex]) {
|
|
761
760
|
const currWindow = polyData.walls[targetWallIndex].windows[this.inputs.targetIndex];
|
|
@@ -768,6 +767,7 @@ export class BufferGeometry {
|
|
|
768
767
|
path: this.inputs.path,
|
|
769
768
|
name: windowName,
|
|
770
769
|
index: this.inputs.targetIndex,
|
|
770
|
+
wall_uuid: this.inputs.targetUUID,
|
|
771
771
|
options: {
|
|
772
772
|
color: this.inputs.windowColor,
|
|
773
773
|
is_visible: true,
|
|
@@ -792,7 +792,7 @@ export class BufferGeometry {
|
|
|
792
792
|
return sum + (window.area || 0);
|
|
793
793
|
}, 0);
|
|
794
794
|
}
|
|
795
|
-
polyData.walls[targetWallIndex].
|
|
795
|
+
polyData.walls[targetWallIndex].netArea = Math.max(0, polyData.walls[targetWallIndex].area - totalWindowArea);
|
|
796
796
|
}
|
|
797
797
|
partitionData = polyData;
|
|
798
798
|
}
|
|
@@ -965,6 +965,7 @@ export class BufferGeometry {
|
|
|
965
965
|
wallMesh.name = this.inputs.uuid != '' ? `${this.inputs.uuid}_wall-${i}` : `wall-${i}`;
|
|
966
966
|
const wallLength = new THREE.Vector3(endPoint.x - startPoint.x, endPoint.y - startPoint.y, endPoint.z - startPoint.z).length();
|
|
967
967
|
let wallArea = wallLength * WALL_HEIGHT;
|
|
968
|
+
let netWallArea = wallArea;
|
|
968
969
|
if (this.inputs.deductWindowFromWallArea && metadata) {
|
|
969
970
|
const currentWallIndex = wallDataArray.length == 0 ? wallDataArray.length : wallDataArray.length - 1;
|
|
970
971
|
let totalWindowArea = 0;
|
|
@@ -975,7 +976,7 @@ export class BufferGeometry {
|
|
|
975
976
|
}, 0);
|
|
976
977
|
}
|
|
977
978
|
// Subtract window area from wall area
|
|
978
|
-
|
|
979
|
+
netWallArea = Math.max(0, wallArea - totalWindowArea);
|
|
979
980
|
}
|
|
980
981
|
// Create wall label
|
|
981
982
|
let wallMaterial;
|
|
@@ -1083,6 +1084,7 @@ export class BufferGeometry {
|
|
|
1083
1084
|
},
|
|
1084
1085
|
index: i,
|
|
1085
1086
|
area: wallArea,
|
|
1087
|
+
netArea: netWallArea,
|
|
1086
1088
|
width: wallDimensions.width,
|
|
1087
1089
|
perimeter: wallDimensions.perimeter,
|
|
1088
1090
|
wall_height: WALL_HEIGHT,
|
|
@@ -1151,10 +1153,11 @@ export class BufferGeometry {
|
|
|
1151
1153
|
transparent: true,
|
|
1152
1154
|
depthWrite: false
|
|
1153
1155
|
}));
|
|
1154
|
-
windowMesh.name = windows[i].
|
|
1156
|
+
windowMesh.name = windows[i].wall_uuid ? `${windows[i].wall_uuid}_window-${i}` : `window-${i}`;
|
|
1155
1157
|
const outlineGeometry = new THREE.EdgesGeometry(windowGeometry);
|
|
1156
1158
|
const outlineMaterial = new THREE.LineBasicMaterial({ color: this.inputs.windowOutlineColor, linewidth: 3 });
|
|
1157
1159
|
const outlineMesh = new THREE.LineSegments(outlineGeometry, outlineMaterial);
|
|
1160
|
+
outlineMesh.name = windowMesh.name;
|
|
1158
1161
|
windowMesh.add(outlineMesh);
|
|
1159
1162
|
// Add window center label if material is defined
|
|
1160
1163
|
if (windows[i].material || windows[i].name) {
|
|
@@ -1205,8 +1208,9 @@ export class BufferGeometry {
|
|
|
1205
1208
|
.add(p0);
|
|
1206
1209
|
const labelOffset = 0.01;
|
|
1207
1210
|
windowCenterLabel.position.copy(center3D).addScaledVector(normal.clone().negate(), labelOffset);
|
|
1211
|
+
windowCenterLabel.name = windowMesh.name;
|
|
1208
1212
|
windowCenterLabel.lookAt(windowCenterLabel.position.clone().add(normal.clone().negate()));
|
|
1209
|
-
windowCenterLabel.name = windows[i].uuid ? `${windows[i].uuid}_windowLabel` : `windowLabel-${i}`;
|
|
1213
|
+
//windowCenterLabel.name = windows[i].uuid ? `${windows[i].uuid}_windowLabel` : `windowLabel-${i}`;
|
|
1210
1214
|
this.groupedMesh.add(windowCenterLabel);
|
|
1211
1215
|
}
|
|
1212
1216
|
catch (e) {
|
package/lib/types.d.ts
CHANGED
|
@@ -266,6 +266,7 @@ export interface IObjectData {
|
|
|
266
266
|
node?: Scene.INode;
|
|
267
267
|
type?: string;
|
|
268
268
|
index?: number;
|
|
269
|
+
wallUUID?: string;
|
|
269
270
|
}[];
|
|
270
271
|
}
|
|
271
272
|
export interface IObjectFilters {
|
|
@@ -462,6 +463,8 @@ export interface ComponentOptions {
|
|
|
462
463
|
targetIndex?: number | undefined;
|
|
463
464
|
targetUUID?: string | undefined;
|
|
464
465
|
deductWindowFromWallArea?: boolean | undefined;
|
|
466
|
+
isWindowEditing?: boolean | undefined;
|
|
467
|
+
objectIndex?: number | undefined;
|
|
465
468
|
}
|
|
466
469
|
export interface VectorCoords {
|
|
467
470
|
object_position: Vector3;
|
|
@@ -1110,6 +1113,7 @@ export interface WallPolyData {
|
|
|
1110
1113
|
};
|
|
1111
1114
|
material?: string | undefined;
|
|
1112
1115
|
area: number;
|
|
1116
|
+
netArea?: number | undefined;
|
|
1113
1117
|
perimeter: number | undefined;
|
|
1114
1118
|
width: number | undefined;
|
|
1115
1119
|
wall_height: number;
|
|
@@ -1119,6 +1123,7 @@ export interface WallPolyData {
|
|
|
1119
1123
|
export interface WindowPolyData {
|
|
1120
1124
|
path: Array<Vector3>;
|
|
1121
1125
|
uuid?: string | undefined;
|
|
1126
|
+
wall_uuid?: string | undefined;
|
|
1122
1127
|
name?: string | undefined;
|
|
1123
1128
|
index?: number | undefined;
|
|
1124
1129
|
options?: {
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED
|
@@ -1460,11 +1460,6 @@
|
|
|
1460
1460
|
padding: 10px 10px 5px 10px !important;
|
|
1461
1461
|
}
|
|
1462
1462
|
|
|
1463
|
-
.at_disabled {
|
|
1464
|
-
pointer-events: none;
|
|
1465
|
-
opacity: 0.4;
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
1463
|
/* Basic styling for the tree */
|
|
1469
1464
|
/* .at_tree {
|
|
1470
1465
|
list-style-type: none;
|
|
@@ -1545,7 +1540,7 @@
|
|
|
1545
1540
|
|
|
1546
1541
|
.at_room_tree_child li {
|
|
1547
1542
|
margin: 5px 0;
|
|
1548
|
-
|
|
1543
|
+
margin-left: 30px;
|
|
1549
1544
|
padding-right: 5px;
|
|
1550
1545
|
display: flex;
|
|
1551
1546
|
justify-content: space-between;
|
|
@@ -2295,10 +2290,16 @@ dialog#at-screen-share-request-modal::backdrop {
|
|
|
2295
2290
|
}
|
|
2296
2291
|
|
|
2297
2292
|
.at_dropdown_item .at_subitem_right {
|
|
2298
|
-
cursor:
|
|
2293
|
+
cursor: default;
|
|
2299
2294
|
display: flex;
|
|
2300
2295
|
}
|
|
2301
2296
|
|
|
2297
|
+
.at_dropdown_item .at_subitem_right .mdi-check,
|
|
2298
|
+
.at_dropdown_item .at_subitem_right .mdi-pencil,
|
|
2299
|
+
.at_dropdown_item .at_subitem_right .mdi-delete-outline {
|
|
2300
|
+
cursor: pointer;
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2302
2303
|
.at_dropdown_item .at_subitem_right span:hover{
|
|
2303
2304
|
color: var(--bg-accent-azusa)
|
|
2304
2305
|
}
|
|
@@ -2405,8 +2406,40 @@ dialog#at-screen-share-request-modal::backdrop {
|
|
|
2405
2406
|
|
|
2406
2407
|
.at_partition_wall_row_item {
|
|
2407
2408
|
cursor: pointer;
|
|
2409
|
+
display: flex;
|
|
2410
|
+
flex-direction: column;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
.at_partition_child_header {
|
|
2414
|
+
width: 100%;
|
|
2415
|
+
padding-left: 5px;
|
|
2416
|
+
padding-right: 5px;
|
|
2417
|
+
display: flex;
|
|
2418
|
+
flex-direction: row;
|
|
2419
|
+
justify-content: space-between;
|
|
2408
2420
|
}
|
|
2409
2421
|
|
|
2410
2422
|
.at_partition_floor_row_item {
|
|
2411
|
-
|
|
2423
|
+
cursor: pointer;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
.at_partition_child_expand_icon {
|
|
2427
|
+
padding: unset !important;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
li.at_partition_floor_row_item,
|
|
2431
|
+
li.at_partition_wall_row_item {
|
|
2432
|
+
padding-right: unset !important;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
.at_partition_child_header.selected {
|
|
2436
|
+
padding-right: 5px !important;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
.at_hidden {
|
|
2440
|
+
display: none;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
.at_wall_window_row_item.selected {
|
|
2444
|
+
padding-left: 5px;
|
|
2412
2445
|
}
|