architwin 1.15.4 → 1.15.6

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.
@@ -0,0 +1,17 @@
1
+ export declare class ActionPartitionHistory {
2
+ private history;
3
+ private index;
4
+ private current;
5
+ addToHistory(partition: any): void;
6
+ undo(): any;
7
+ redo(): any;
8
+ getCurrent(): any;
9
+ setCurrent(partition: any): any;
10
+ getAllHistory(): {
11
+ history: any[];
12
+ index: number;
13
+ };
14
+ clearHistory(): void;
15
+ canUndo(): boolean;
16
+ canRedo(): boolean;
17
+ }
@@ -0,0 +1,62 @@
1
+ import log from "loglevel";
2
+ export class ActionPartitionHistory {
3
+ constructor() {
4
+ this.history = []; // all recorded partition states
5
+ this.index = -1; // current pointer
6
+ this.current = null; // fallback for "original" state
7
+ }
8
+ addToHistory(partition) {
9
+ const newPartition = structuredClone(partition);
10
+ if (this.index < this.history.length - 1) {
11
+ this.history = this.history.slice(0, this.index + 1);
12
+ }
13
+ if (this.history.length === 0 ||
14
+ JSON.stringify(this.history[this.history.length - 1]) !== JSON.stringify(newPartition)) {
15
+ this.history.push(newPartition);
16
+ this.index = this.history.length - 1;
17
+ log.info("newPartition", newPartition, this.current, this.history.length);
18
+ }
19
+ }
20
+ undo() {
21
+ if (!this.canUndo())
22
+ return null;
23
+ this.index--;
24
+ if (this.index < 0)
25
+ return this.current ? this.current : null;
26
+ return this.getCurrent();
27
+ }
28
+ redo() {
29
+ if (!this.canRedo())
30
+ return null;
31
+ this.index++;
32
+ return this.getCurrent();
33
+ }
34
+ getCurrent() {
35
+ if (this.index >= 0 && this.index < this.history.length) {
36
+ return structuredClone(this.history[this.index]);
37
+ }
38
+ return this.current ? this.current : null;
39
+ }
40
+ setCurrent(partition) {
41
+ this.current = structuredClone(partition); // or _.cloneDeep(partition)
42
+ return this.current;
43
+ }
44
+ getAllHistory() {
45
+ return {
46
+ history: this.history.map(p => structuredClone(p)),
47
+ index: this.index,
48
+ };
49
+ }
50
+ clearHistory() {
51
+ this.history = [];
52
+ this.index = -1;
53
+ this.current = null;
54
+ console.log("History cleared.");
55
+ }
56
+ canUndo() {
57
+ return this.index >= 0;
58
+ }
59
+ canRedo() {
60
+ return this.index < this.history.length - 1;
61
+ }
62
+ }
@@ -6,7 +6,7 @@ export class ActionPathHistory {
6
6
  }
7
7
  // Save a new path
8
8
  addToHistory(path) {
9
- const newPath = JSON.parse(JSON.stringify(path));
9
+ const newPath = structuredClone(path);
10
10
  // If we undid something and then added a new path → cut off "future" history
11
11
  if (this.index < this.history.length - 1) {
12
12
  this.history = this.history.slice(0, this.index + 1);
@@ -40,7 +40,7 @@ export class ActionPathHistory {
40
40
  return this.current; // fallback if index = -1
41
41
  }
42
42
  setCurrent(paths) {
43
- this.current = JSON.parse(JSON.stringify(paths));
43
+ this.current = structuredClone(paths);
44
44
  return this.current;
45
45
  }
46
46
  getAllHistory() {
@@ -19,6 +19,7 @@ import { removeScreenShareSessionData } from "./atwinui/components/toolbar/scree
19
19
  import { clearActivePane } from "./atwinui/events";
20
20
  declare const transformHistory: ActionHistory;
21
21
  declare const pathHistory: ActionPathHistory;
22
+ declare const partitionHistory: ActionPathHistory;
22
23
  declare const _config: {
23
24
  mp: {
24
25
  urlParams: string[];
@@ -61,8 +62,6 @@ declare let _atwinConnections: ISdkConnections;
61
62
  declare let _onMouseClickInstance: Function;
62
63
  declare let _modelDetails: MpSdk.Model.ModelDetails;
63
64
  declare const tagColors: string[];
64
- declare let _undoDrawActions: any[], // actions that can be redone
65
- _redoDrawActions: any[];
66
65
  declare let _tubes: MpSdk.Scene.IObject;
67
66
  declare let _pathConfig: PathConfig;
68
67
  declare let _partitionNodes: PartitionNode[];
@@ -546,6 +545,7 @@ declare function deleteVertex(index?: number): void;
546
545
  * @returns
547
546
  */
548
547
  declare function enableVerticeControls(component: MpSdk.Scene.IComponent): void;
548
+ declare function getVertexPath(): Array<Vector3>;
549
549
  /**
550
550
  * Deletes the edge of a polygon.
551
551
  * @param component - The component of the polygon instance
@@ -560,6 +560,11 @@ declare function deleteEdge(component: MpSdk.Scene.IComponent, endPoint: Vector3
560
560
  * @returns
561
561
  */
562
562
  declare function setDrawingConfig(config: PathConfig): void;
563
+ /**
564
+ * Gets the current configuration used by the drawing system
565
+ * @returns Current configuration used by the drawing system
566
+ */
567
+ declare function getDrawingConfig(): PathConfig;
563
568
  /**
564
569
  * Resets the configuration for the drawing system to its defaults
565
570
  */
@@ -650,7 +655,6 @@ declare function getWallBaseHeight(): number;
650
655
  declare function clearWallBaseHeight(): void;
651
656
  declare function undoDrawAction(): void;
652
657
  declare function redoDrawAction(): void;
653
- declare function addUndoDrawActions(action: any): void;
654
658
  declare function setTagIcon(payload: {
655
659
  tag: MpSdk.Tag.TagData;
656
660
  iconName: string;
@@ -936,4 +940,4 @@ declare function redoPipePath(): void;
936
940
  * @returns void
937
941
  * */
938
942
  declare function setPointerEnabled(value: boolean): void;
939
- export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, _tagIotCategoryTypes, _tagIotDevices, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, _currentSpace, _spaceUsers, _screenSharingHostUser, _screenSharingParticipantUsers, _undoDrawActions, _redoDrawActions, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, getCurrentFloor, moveInDirection, cameraLookAt, cameraPan, cameraRotate, cameraSetRotation, getViewMode, setViewMode, captureSpaceScreenshot, captureScreenshotAndCameraDetails, captureCurrentView, cameraZoomBy, cameraZoomReset, cameraZoomTo, getNearbyObjects, setTransformMode, setSelectedObject, clearSelectedObject, revertTransform, setTransformControls, removeTransformControls, setRenderDistance, addObject, getObject, addObjectToSpace, renderModel, addMediaScreen, attachMediaScreenContent, updateObject, updateShowcaseObject, deleteObject, deleteShowcaseObject, copyObject, replaceObject, getTargetPosition, setObjectTransformation, setPointerCoordinates, addTextMarkupScreen, setTextMarkupScreenContent, goTo3dx, goToModel, hasTimeElapsed, getSelectedObject, renderAvatar, setSpaceAvatar, get3DXObjects, set3DXObjects, clear3DXObjects, setLibrary, getLibrary, disposeModel, disposeAllModels, renderInSpaceMediaScreen, goToPosition, goToParticipant, getNearestSweepFromObject, cancelModelPlacement, renderViewpointMarker, toggleViewpointVisibility, convertDegRotationToEuler, isToolbarFeatureEnabled, goToMPOrigin, pauseVideo, playVideo, setVideoPlayback, setAnimationState, showMinimap, hideMinimap, getMapConfig, addTag, getTags, gotoTag, renderTag, disposeTag, disposeTags, getMpTags, getTagDataCollection, getMpTag, showTags, attachTagMedia, detachTagMedia, moveTag, editTagLabel, editTagDescription, editTagStem, editTagIcon, editTagColor, attachSandbox, registerSandbox, saveTag, rotateCameraToObject, setModelVisibility, tagStateSubscriber, setTagIcon, setTagCategories, setUserAssignedCategories, getUserAssignedCategories, setTagMessageRecepients, getTagMessageRecepients, setTagMessages, getTagMessages, setSelectedTagUuid, getSelectedTagUuid, setCurrentSpace, toggleFitToScreen, getFloors, getLabels, renderMeetingSidebar, createMeetingTemplate, joinMeetingTemplate, meet, dispatchSpaceEvent, subscribeSpaceEvent, unsubscribeSpaceEvent, registerCustomSpaceEvent, clearSpaceEventQueue, initSocketIo, socketEmit, getParticipants, followParticipant, unFollowParticipant, enableHUD, disableHUD, getMediaScreenHUDs, canSetHud, saveMediaScreenHud, removeMediaScreenHud, enableFitScreen, disableFitScreen, initToolbarUI, themeManager, convertToEuler, disableSweeps, enableSweeps, enableSweep, disableSweep, tubeLineType, pathLineType, _sceneObject, _tubes, drawPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setPathLine, setPathLineOptions, getCurrentTubeLine, renderPolygon, toggleWallVisibility, toggleMeshChildrenVisibility, toggleFloorVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge, disposePathLine, getFloorBaseHeight, setMeshChildrenMaterialProperty, undoDrawAction, redoDrawAction, addUndoDrawActions, setWallBaseHeight, getWallBaseHeight, clearWallBaseHeight, setSpacePartitionNodes, setCurrentPolygon, getSpaceId, getCurrentPolygon, getPathBetweenSweeps, moveAlongPath, _atwinConnections, convertZupToYup, convertYupToZup, getRelativePosition, getOriginalWorldPosition, setSpaceMetadata, getSpaceMetadata, getAssetUrl, setIotCategoryTypes, setIotDeviceTypes, setIoTDeviceTagIcons, getIoTDeviceTagIcons, setScreenSharingHostUser, setScreenSharingParticipantUsers, renderCursorMarkerPointer, updatePointerTexture, toggleElementVisibility, renderPath, setDrawingConfig, resetDrawingConfig, _pipeCategories, _selectedPipeCategory, setPipeCategories, setSelectedPipeCategory, getSelectedPipeCategory, _pipes, _selectedPipe, setPipes, setSelectedPipe, getSelectedPipe, deleteVertex, setPipeIsDrawingMode, getPipeIsDrawingMode, setPointerEnabled, removeScreenShareSessionData, setVertexPath, _pathConfig, undoPipePath, redoPipePath, pathHistory, _renderTagPaneContent, clearActivePane, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
943
+ export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, _tagIotCategoryTypes, _tagIotDevices, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, _currentSpace, _spaceUsers, _screenSharingHostUser, _screenSharingParticipantUsers, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, getCurrentFloor, moveInDirection, cameraLookAt, cameraPan, cameraRotate, cameraSetRotation, getViewMode, setViewMode, captureSpaceScreenshot, captureScreenshotAndCameraDetails, captureCurrentView, cameraZoomBy, cameraZoomReset, cameraZoomTo, getNearbyObjects, setTransformMode, setSelectedObject, clearSelectedObject, revertTransform, setTransformControls, removeTransformControls, setRenderDistance, addObject, getObject, addObjectToSpace, renderModel, addMediaScreen, attachMediaScreenContent, updateObject, updateShowcaseObject, deleteObject, deleteShowcaseObject, copyObject, replaceObject, getTargetPosition, setObjectTransformation, setPointerCoordinates, addTextMarkupScreen, setTextMarkupScreenContent, goTo3dx, goToModel, hasTimeElapsed, getSelectedObject, renderAvatar, setSpaceAvatar, get3DXObjects, set3DXObjects, clear3DXObjects, setLibrary, getLibrary, disposeModel, disposeAllModels, renderInSpaceMediaScreen, goToPosition, goToParticipant, getNearestSweepFromObject, cancelModelPlacement, renderViewpointMarker, toggleViewpointVisibility, convertDegRotationToEuler, isToolbarFeatureEnabled, goToMPOrigin, pauseVideo, playVideo, setVideoPlayback, setAnimationState, showMinimap, hideMinimap, getMapConfig, addTag, getTags, gotoTag, renderTag, disposeTag, disposeTags, getMpTags, getTagDataCollection, getMpTag, showTags, attachTagMedia, detachTagMedia, moveTag, editTagLabel, editTagDescription, editTagStem, editTagIcon, editTagColor, attachSandbox, registerSandbox, saveTag, rotateCameraToObject, setModelVisibility, tagStateSubscriber, setTagIcon, setTagCategories, setUserAssignedCategories, getUserAssignedCategories, setTagMessageRecepients, getTagMessageRecepients, setTagMessages, getTagMessages, setSelectedTagUuid, getSelectedTagUuid, setCurrentSpace, toggleFitToScreen, getFloors, getLabels, renderMeetingSidebar, createMeetingTemplate, joinMeetingTemplate, meet, dispatchSpaceEvent, subscribeSpaceEvent, unsubscribeSpaceEvent, registerCustomSpaceEvent, clearSpaceEventQueue, initSocketIo, socketEmit, getParticipants, followParticipant, unFollowParticipant, enableHUD, disableHUD, getMediaScreenHUDs, canSetHud, saveMediaScreenHud, removeMediaScreenHud, enableFitScreen, disableFitScreen, initToolbarUI, themeManager, convertToEuler, disableSweeps, enableSweeps, enableSweep, disableSweep, tubeLineType, pathLineType, _sceneObject, _tubes, drawPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setPathLine, setPathLineOptions, getCurrentTubeLine, renderPolygon, toggleWallVisibility, toggleMeshChildrenVisibility, toggleFloorVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge, disposePathLine, getFloorBaseHeight, setMeshChildrenMaterialProperty, undoDrawAction, redoDrawAction, setWallBaseHeight, getWallBaseHeight, clearWallBaseHeight, getVertexPath, setSpacePartitionNodes, setCurrentPolygon, getSpaceId, getCurrentPolygon, getPathBetweenSweeps, moveAlongPath, _atwinConnections, convertZupToYup, convertYupToZup, getRelativePosition, getOriginalWorldPosition, setSpaceMetadata, getSpaceMetadata, getAssetUrl, setIotCategoryTypes, setIotDeviceTypes, setIoTDeviceTagIcons, getIoTDeviceTagIcons, setScreenSharingHostUser, setScreenSharingParticipantUsers, renderCursorMarkerPointer, updatePointerTexture, toggleElementVisibility, renderPath, setDrawingConfig, getDrawingConfig, resetDrawingConfig, _pipeCategories, _selectedPipeCategory, setPipeCategories, setSelectedPipeCategory, getSelectedPipeCategory, _pipes, _selectedPipe, setPipes, setSelectedPipe, getSelectedPipe, deleteVertex, setPipeIsDrawingMode, getPipeIsDrawingMode, setPointerEnabled, removeScreenShareSessionData, setVertexPath, _pathConfig, undoPipePath, redoPipePath, pathHistory, partitionHistory, _renderTagPaneContent, clearActivePane, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };