architwin 1.9.3 → 1.9.4

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.
@@ -452,12 +452,24 @@ declare function startDraw(): void;
452
452
  declare function exitDraw(): void;
453
453
  declare function cancelDraw(): void;
454
454
  declare function getCurrentPolygon(): IObjectData;
455
+ /**
456
+ * Toggles the visibility of the children of a mesh
457
+ * @param {MpSdk.Scene.IComponent} component - Component of the model
458
+ * @param {string} name - name of the model
459
+ */
460
+ declare function toggleMeshChildrenVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
455
461
  /**
456
462
  * Wrapper function around toggleMeshChildrenVisibility
457
463
  * @param {MpSdk.Scene.IComponent} component - Component of the model
458
464
  * @param {string} name - name of the model
459
465
  */
460
466
  declare function toggleWallVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
467
+ /**
468
+ * Wrapper function around toggleMeshChildrenVisibility
469
+ * @param {MpSdk.Scene.IComponent} component - Component of the model
470
+ * @param {string} name - name of the model
471
+ */
472
+ declare function toggleFloorVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
461
473
  /**
462
474
  * Returns the children of a model's component
463
475
  * @param component
@@ -633,4 +645,4 @@ declare function unFollowParticipant(unFollowParticipant: any): void;
633
645
  * @param {Array<PartitionNode>} partitionNodes Array of partition nodes
634
646
  */
635
647
  declare function setSpacePartitionNodes(partitionNodes: Array<PartitionNode>): Promise<void>;
636
- export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, getCurrentFloor, moveInDirection, cameraLookAt, cameraPan, cameraRotate, cameraSetRotation, getViewMode, setViewMode, captureSpaceScreenshot, captureScreenshotAndCameraDetails, getNearbyObjects, setTransformMode, setSelectedObject, clearSelectedObject, revertTransform, setTransformControls, removeTransformControls, setRenderDistance, addObject, getObject, addObjectToSpace, addMediaScreen, attachMediaScreenContent, updateObject, updateShowcaseObject, deleteObject, deleteShowcaseObject, copyObject, replaceObject, getTargetPosition, setObjectTransformation, setPointerCoordinates, addTextMarkupScreen, setTextMarkupScreenContent, goTo3dx, goToModel, hasTimeElapsed, getSelectedObject, renderAvatar, setSpaceAvatar, get3DXObjects, setLibrary, getLibrary, disposeModel, renderInSpaceMediaScreen, goToPosition, goToParticipant, getNearestSweepFromObject, cancelModelPlacement, renderViewpointMarker, toggleViewpointVisibility, convertDegRotationToEuler, pauseVideo, playVideo, setVideoPlayback, setAnimationState, showMinimap, hideMinimap, getMapConfig, addTag, getTags, gotoTag, renderTag, disposeTag, disposeTags, getMpTags, getMpTag, showTags, attachTagMedia, detachTagMedia, moveTag, editTagLabel, editTagDescription, editTagStem, editTagIcon, editTagColor, saveTag, rotateCameraToObject, setModelVisibility, tagStateSubscriber, setTagIcon, setTagCategories, setUserAssignedCategories, getUserAssignedCategories, setTagMessageRecepients, getTagMessageRecepients, setTagMessages, getTagMessages, setSelectedTagUuid, getSelectedTagUuid, toggleFitToScreen, getFloors, getLabels, renderMeetingSidebar, createMeetingTemplate, joinMeetingTemplate, meet, dispatchSpaceEvent, subscribeSpaceEvent, unsubscribeSpaceEvent, registerCustomSpaceEvent, initSocketIo, socketEmit, getParticipants, followParticipant, unFollowParticipant, enableHUD, disableHUD, getMediaScreenHUDs, canSetHud, saveMediaScreenHud, removeMediaScreenHud, enableFitScreen, disableFitScreen, initToolbarUI, themeManager, convertToEuler, disableSweeps, enableSweep, disableSweep, tubeLineType, _sceneObject, _tubes, drawLine, renderPolygonFromPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setTubeLinePath, getCurrentTubeLine, renderPolygon, toggleWallVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge, setSpacePartitionNodes, getSpaceId, getCurrentPolygon };
648
+ export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, getCurrentFloor, moveInDirection, cameraLookAt, cameraPan, cameraRotate, cameraSetRotation, getViewMode, setViewMode, captureSpaceScreenshot, captureScreenshotAndCameraDetails, getNearbyObjects, setTransformMode, setSelectedObject, clearSelectedObject, revertTransform, setTransformControls, removeTransformControls, setRenderDistance, addObject, getObject, addObjectToSpace, addMediaScreen, attachMediaScreenContent, updateObject, updateShowcaseObject, deleteObject, deleteShowcaseObject, copyObject, replaceObject, getTargetPosition, setObjectTransformation, setPointerCoordinates, addTextMarkupScreen, setTextMarkupScreenContent, goTo3dx, goToModel, hasTimeElapsed, getSelectedObject, renderAvatar, setSpaceAvatar, get3DXObjects, setLibrary, getLibrary, disposeModel, renderInSpaceMediaScreen, goToPosition, goToParticipant, getNearestSweepFromObject, cancelModelPlacement, renderViewpointMarker, toggleViewpointVisibility, convertDegRotationToEuler, pauseVideo, playVideo, setVideoPlayback, setAnimationState, showMinimap, hideMinimap, getMapConfig, addTag, getTags, gotoTag, renderTag, disposeTag, disposeTags, getMpTags, getMpTag, showTags, attachTagMedia, detachTagMedia, moveTag, editTagLabel, editTagDescription, editTagStem, editTagIcon, editTagColor, saveTag, rotateCameraToObject, setModelVisibility, tagStateSubscriber, setTagIcon, setTagCategories, setUserAssignedCategories, getUserAssignedCategories, setTagMessageRecepients, getTagMessageRecepients, setTagMessages, getTagMessages, setSelectedTagUuid, getSelectedTagUuid, toggleFitToScreen, getFloors, getLabels, renderMeetingSidebar, createMeetingTemplate, joinMeetingTemplate, meet, dispatchSpaceEvent, subscribeSpaceEvent, unsubscribeSpaceEvent, registerCustomSpaceEvent, initSocketIo, socketEmit, getParticipants, followParticipant, unFollowParticipant, enableHUD, disableHUD, getMediaScreenHUDs, canSetHud, saveMediaScreenHud, removeMediaScreenHud, enableFitScreen, disableFitScreen, initToolbarUI, themeManager, convertToEuler, disableSweeps, enableSweep, disableSweep, tubeLineType, _sceneObject, _tubes, drawLine, renderPolygonFromPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setTubeLinePath, getCurrentTubeLine, renderPolygon, toggleWallVisibility, toggleMeshChildrenVisibility, toggleFloorVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge, setSpacePartitionNodes, getSpaceId, getCurrentPolygon };
package/lib/architwin.js CHANGED
@@ -11,7 +11,7 @@ import axios from "axios";
11
11
  import { planeType, planeFactory,
12
12
  // planeType2,
13
13
  planeImageFactory, planeVideoFactory, planePdfFactory, setHudState, gltfType, gltfFactory, boxType, boxFactory, textType, textFactory, css3DType, css3DFactory, planeTypeImage, planeTypeVideo, planeTypePdf, sweepPuckType, puckBackgroundFactory, viewpointType, viewpointFactory, tubeLineType, tubeLineFactory, verticeType, verticeFactory, bufferGeometryType, bufferGeometry } from "./loaders";
14
- import { meterToMillimeter, generateUUID, formatMatterportUrl, initBundleVersion, isEqual, replaceWordInString } from "./utils";
14
+ import { meterToMillimeter, generateUUID, formatMatterportUrl, initBundleVersion, isEqual } from "./utils";
15
15
  import { initToolbarUI, themeManager, toggleActionBarButtons, setActiveActionBtn } from "./atwinui";
16
16
  import { SPACE_EVENTS, } from "./types";
17
17
  import * as JSZip from "jszip";
@@ -2844,13 +2844,13 @@ function addImageToSlideShow(data, component, objectID) {
2844
2844
  }
2845
2845
  function getMousePosition() {
2846
2846
  return __awaiter(this, void 0, void 0, function* () {
2847
- let planePosition;
2848
- const pointer = _atwin.Pointer.intersection.subscribe(function (intersection) {
2849
- planePosition = intersection.position;
2850
- // log.info("This is intersection mouse position", planePosition);
2847
+ return new Promise((resolve) => {
2848
+ const pointer = _atwin.Pointer.intersection.subscribe(function (intersection) {
2849
+ // log.info("This is intersection mouse position", intersection.position);
2850
+ pointer.cancel();
2851
+ resolve(intersection.position);
2852
+ });
2851
2853
  });
2852
- pointer.cancel();
2853
- return planePosition;
2854
2854
  });
2855
2855
  }
2856
2856
  function getDomMousePosition(event) {
@@ -5222,7 +5222,10 @@ function renderPolygon(payload, updatePolygon = false) {
5222
5222
  polyNode = _sceneObject.addNode();
5223
5223
  polyComponent = polyNode.addComponent(bufferGeometryType, {
5224
5224
  path: payload.polygon_json.path,
5225
- uuid: payload.uuid
5225
+ uuid: payload.uuid,
5226
+ wallData: payload.polygon_json.walls,
5227
+ floorData: payload.polygon_json.floor,
5228
+ visible: payload.polygon_json.options ? payload.polygon_json.options.is_visible : true
5226
5229
  });
5227
5230
  polyNode.start();
5228
5231
  polyObj.uuid = payload.uuid;
@@ -5742,10 +5745,46 @@ function toggleWallVisibility(component, name) {
5742
5745
  return;
5743
5746
  }
5744
5747
  const state = toggleMeshChildrenVisibility(component, name);
5745
- const wallLabelName = replaceWordInString(name, 'wall', 'wallLabel');
5748
+ // const wallLabelName = replaceWordInString(name,'wall','wallLabel')
5749
+ const wallLabelName = name.replace("wall", "wallLabel");
5746
5750
  toggleMeshChildrenVisibility(component, wallLabelName);
5747
5751
  return state;
5748
5752
  }
5753
+ /**
5754
+ * Wrapper function around toggleMeshChildrenVisibility
5755
+ * @param {MpSdk.Scene.IComponent} component - Component of the model
5756
+ * @param {string} name - name of the model
5757
+ */
5758
+ function toggleFloorVisibility(component, name) {
5759
+ if (!component) {
5760
+ log.error("Component is undefined");
5761
+ return;
5762
+ }
5763
+ if (!name) {
5764
+ log.error("name is undefined");
5765
+ return;
5766
+ }
5767
+ const state = toggleMeshChildrenVisibility(component, name);
5768
+ //@ts-expect-error
5769
+ const edgeCount = component.inputs.path.length;
5770
+ if (edgeCount !== undefined) {
5771
+ let edgeLabelNames = [];
5772
+ const parts = name.split('_');
5773
+ if (parts.length > 1) {
5774
+ const uuid = parts[0];
5775
+ for (let index = 0; index < edgeCount; index++) {
5776
+ toggleMeshChildrenVisibility(component, `${uuid}_edgeLabel-${index}`);
5777
+ }
5778
+ }
5779
+ else {
5780
+ for (let index = 0; index < edgeCount; index++) {
5781
+ edgeLabelNames.push(`edgeLabel-${index}`);
5782
+ toggleMeshChildrenVisibility(component, `edgeLabel-${index}`);
5783
+ }
5784
+ }
5785
+ }
5786
+ return state;
5787
+ }
5749
5788
  /**
5750
5789
  * Returns the children of a model's component
5751
5790
  * @param component
@@ -6878,7 +6917,7 @@ initToolbarUI, themeManager,
6878
6917
  //utils
6879
6918
  convertToEuler, disableSweeps, enableSweep, disableSweep,
6880
6919
  //Draw polygon
6881
- tubeLineType, _sceneObject, _tubes, drawLine, renderPolygonFromPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setTubeLinePath, getCurrentTubeLine, renderPolygon, toggleWallVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge,
6920
+ tubeLineType, _sceneObject, _tubes, drawLine, renderPolygonFromPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setTubeLinePath, getCurrentTubeLine, renderPolygon, toggleWallVisibility, toggleMeshChildrenVisibility, toggleFloorVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge,
6882
6921
  // Space partition
6883
6922
  setSpacePartitionNodes,
6884
6923
  // others
@@ -393,7 +393,9 @@ function displayFaces(polygon) {
393
393
  const element = document.createElement('div');
394
394
  element.classList.add('at_face_vertex_item');
395
395
  // Display the floor details
396
- element.appendChild(displayFloor(polygon.floor));
396
+ if (polygon.floor) {
397
+ element.appendChild(displayFloor(polygon.floor));
398
+ }
397
399
  // Display each wall's details
398
400
  polygon.walls.forEach((wall) => {
399
401
  element.appendChild(displayWalls(wall));
@@ -746,16 +748,9 @@ export function setPolygonData(payload) {
746
748
  }
747
749
  // Iterate over walls to set UUID and names
748
750
  if (payload.walls && payload.walls.length > 0) {
749
- payload.walls = payload.walls.map((wall, index) => {
750
- var _a, _b, _c, _d;
751
- return (Object.assign(Object.assign({}, roundToTwoDecimals(wall)), { name: `_wall-${index + 1}`, uuid: wall.uuid || generateUUID(), options: {
752
- color: (_b = (_a = wall.options) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : 0xffffff,
753
- opacity: (_d = (_c = wall.options) === null || _c === void 0 ? void 0 : _c.opacity) !== null && _d !== void 0 ? _d : 1.0
754
- } }));
755
- });
751
+ payload.walls = payload.walls.map((wall, index) => (Object.assign(Object.assign({}, roundToTwoDecimals(wall)), { name: `_wall-${index + 1}`, uuid: wall.uuid || generateUUID() })));
756
752
  }
757
753
  currentPolygonData = payload;
758
- setCurrentPartitionData();
759
754
  }
760
755
  /**
761
756
  * Sets the partition data, including updating the floor level and generating a new
@@ -771,8 +766,13 @@ export function setCurrentPartitionData() {
771
766
  let currentPolygon = null;
772
767
  yield new Promise(resolve => {
773
768
  const interval = setInterval(() => {
769
+ var _a, _b;
774
770
  currentPolygon = getCurrentPolygon();
775
- if (currentPolygon.object.object_data.uuid != undefined) {
771
+ if (((_b = (_a = currentPolygon === null || currentPolygon === void 0 ? void 0 : currentPolygon.object) === null || _a === void 0 ? void 0 : _a.object_data) === null || _b === void 0 ? void 0 : _b.uuid) !== undefined) {
772
+ clearInterval(interval);
773
+ resolve();
774
+ }
775
+ if (!(currentPolygon === null || currentPolygon === void 0 ? void 0 : currentPolygon.object)) {
776
776
  clearInterval(interval);
777
777
  resolve();
778
778
  }
@@ -812,7 +812,7 @@ function updatePartitionDataArray(payload, currentPartitionDataArray) {
812
812
  newlyAddedPartition.push(payload);
813
813
  console.log("newlyAddedPartition", payload);
814
814
  currentPartitionData = payload;
815
- dispatchSpaceEvent(SPACE_EVENTS.PARTITION_EDITED, currentPartitionData);
815
+ dispatchSpaceEvent(SPACE_EVENTS.PARTITION_EDITED, { data: currentPartitionData });
816
816
  }
817
817
  export function getCurrentPartitionData() {
818
818
  return currentPartitionData;
@@ -1,4 +1,4 @@
1
- import { PartitionNode } from "../../../../types";
1
+ import { IObjectData, PartitionNode } from "../../../../types";
2
2
  /**
3
3
  * Renders and returns the HTML element for the room tree pane.
4
4
  * @returns {HTMLElement} The HTML element representing the room tree pane.
@@ -8,30 +8,63 @@ export declare function renderRoomTreePane(): HTMLElement;
8
8
  * Displays the UI for the Room tree structure.
9
9
  * @param partitions - Details of the partitions to construct the tree.
10
10
  */
11
- export declare function displayRoomTree(partitions: Array<PartitionNode>): void;
11
+ export declare function displayRoomTree(partitions: Array<PartitionNode>, objectData?: Array<IObjectData>): void;
12
12
  /**
13
13
  * Creates and returns a DOM element representing a partition node in the room tree.
14
14
  * @param {PartitionNode} partition - The details of the room to be rendered.
15
15
  * @returns {HTMLElement}
16
16
  */
17
- export declare function displayPartition(partition: PartitionNode): HTMLUListElement;
17
+ export declare function displayRoomPartition(partition: PartitionNode, objectData?: Array<IObjectData>): HTMLUListElement;
18
18
  /**
19
19
  * Displays the partitions for a specific room.
20
20
  * @param {PartitionNode} partitions - The details of the room partitions to be rendered.
21
21
  * @param partitionId - The identifier of the room to which the partitions belong.
22
22
  * @returns {HTMLElement}
23
23
  */
24
- export declare function displayPartitions(partitions: PartitionNode[], partitionId: string): void;
24
+ export declare function displayChildPartitions(partitions: PartitionNode[], parentPartitionId: string, objectData?: Array<IObjectData>): void;
25
25
  /**s
26
26
  * Displays the items within a specific partition.
27
27
  * @param partitionItems - The details of the partition items to be rendered.
28
28
  * @returns {HTMLElement}
29
29
  */
30
- export declare function displayPartitionItems(partitionItems: any): string;
30
+ export declare function displayPartitionItems(partitionItems: any, partitionId?: string, object?: any): string;
31
31
  export declare function updateParentVisibility(isPartition: boolean, currentBtn: HTMLElement): void;
32
+ /**
33
+ * Retrieves the stored room data.
34
+ * @returns An array of room nodes.
35
+ */
36
+ export declare function getRoomData(): PartitionNode[];
32
37
  /**
33
38
  * Retrieves the current room data being edited.
34
39
  * @returns The current room node being edited.
35
40
  */
36
41
  export declare function getCurrentEditRoomData(): PartitionNode;
37
42
  export declare function getSelectedPartitionId(): String;
43
+ /**
44
+ * Updates the visibility of a partition and its children if it's a parent partition.
45
+ * @param isVisible - The visibility state to set (true/false).
46
+ * @param currPartition - The current partition node to update.
47
+ * @param isParentPartition - Indicates if the current partition is a parent (true) or a child (false).
48
+ */
49
+ export declare function updatePartitionVisibilityUI(isVisible: boolean, currPartition: PartitionNode, isParentPartition: boolean, isUpdateAllChildren: boolean): Promise<void>;
50
+ /**
51
+ * Updates the visibility of a specific polygon (floor or wall) within a partition.
52
+ * @param isVisible - The visibility state to set (true/false).
53
+ * @param currPartition - The current partition node containing the polygon data.
54
+ * @param isFloor - Indicates if the target is a floor (true) or a wall (false).
55
+ * @param polygonItemId - The ID of the specific polygon (floor or wall) to update.
56
+ */
57
+ export declare function updatePolygonVisibilityData(isVisible: boolean, currPartition: PartitionNode, isFloor: boolean, polygonItemId: string): Promise<void>;
58
+ /**
59
+ * Toggles the target element visibility state.
60
+ * @param element - Target HTML element.
61
+ * @param isVisible - Visibility state of the element.
62
+ */
63
+ export declare function toggleVisibilityState(element: HTMLElement, isVisible: boolean): void;
64
+ export declare function setFilteredDisplay(type: String): void;
65
+ /**
66
+ * Toggles the visibility button state of the target room.
67
+ * @param parentId - ID of the room
68
+ * @param isVisible - Visibility value
69
+ */
70
+ export declare function updateRoomVisibilityUI(parentId: string, isVisible: boolean): void;