architwin 1.9.2 → 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.
- package/lib/architwin.d.ts +13 -1
- package/lib/architwin.js +176 -94
- package/lib/atwinui/components/toolbar/i18n.js +2 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +2 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +26 -11
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.d.ts +39 -5
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.js +263 -57
- package/lib/atwinui/events.d.ts +11 -2
- package/lib/atwinui/events.js +343 -121
- package/lib/loaders/polydrawerLoader.d.ts +2 -0
- package/lib/loaders/polydrawerLoader.js +29 -5
- package/lib/types.d.ts +13 -3
- package/lib/utils.d.ts +6 -0
- package/lib/utils.js +15 -0
- package/package.json +1 -1
- package/static/atwinui.css +1 -1
- package/static/utility.css +4 -0
package/lib/architwin.d.ts
CHANGED
|
@@ -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
|
|
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";
|
|
@@ -202,7 +202,7 @@ let _visualize = true, _editPolygonMode = false, _drawPolygonMode = false, _tube
|
|
|
202
202
|
// _thisVertexComponent:MpSdk.Scene.IComponent, // Current Vertex Component
|
|
203
203
|
// _thisVerticeNode:MpSdk.Scene.INode, // Current VerticeNode
|
|
204
204
|
// _thisVertexPath = new Array()
|
|
205
|
-
let visualize = true, _activeVertex, editMode = false, drawMode = false, _thisVertexNode, _thisVertexComponent, _thisVerticesNode, _thisVertexPath = new Array(), _currentPolygon, _polygonShapePath, _verticeComponentsCollection = [], _highestYaxisPoint, _polygonFloorOffset = 0.1, _autoLevelFloorEnabled = true, _floorBaseHeight;
|
|
205
|
+
let visualize = true, _activeVertex, editMode = false, drawMode = false, _thisVertexNode, _thisVertexComponent, _thisVerticesNode, _thisVertexPath = new Array(), _currentPolygon, _polygonShapePath, _verticeComponentsCollection = [], _vertexConnectiveComponentCollection = [], _vertexConnectiveNodeCollection = [], _highestYaxisPoint, _polygonFloorOffset = 0.1, _autoLevelFloorEnabled = true, _floorBaseHeight, _offsetedBaseHeight = _floorBaseHeight ? _floorBaseHeight + _polygonFloorOffset : undefined;
|
|
206
206
|
let _intersectionData, _tubes, _verticeEmitPath, _verticeEditEmitPath;
|
|
207
207
|
let _navigationInputNode;
|
|
208
208
|
let _navigationComponent;
|
|
@@ -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
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
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;
|
|
@@ -5312,6 +5315,7 @@ function addVerticeControls(component, index) {
|
|
|
5312
5315
|
// Trigger onInputsUpdated
|
|
5313
5316
|
_activeVertex.inputs.active = false;
|
|
5314
5317
|
if (_currentPolygon) {
|
|
5318
|
+
//setSelectedObject(_currentPolygon.object,_currentPolygon.node,_currentPolygon.component, 'POLYGON')
|
|
5315
5319
|
setPolygonPath(_currentPolygon.object.id, _thisVertexPath);
|
|
5316
5320
|
}
|
|
5317
5321
|
//@ts-expect-error
|
|
@@ -5350,6 +5354,68 @@ function createVerticeControls(component, isDeleting = false) {
|
|
|
5350
5354
|
}
|
|
5351
5355
|
verticeNode.start();
|
|
5352
5356
|
}
|
|
5357
|
+
/**
|
|
5358
|
+
* Creates the individual vertex nodes and components and attached vertice controls
|
|
5359
|
+
* @param {Vector3} position - Coordinates
|
|
5360
|
+
*/
|
|
5361
|
+
function createVertexPoints(position, redrawing = false) {
|
|
5362
|
+
log.info("createVertexPoints()");
|
|
5363
|
+
if (!position) {
|
|
5364
|
+
log.error("Position is undefined");
|
|
5365
|
+
return;
|
|
5366
|
+
}
|
|
5367
|
+
// If no node is active
|
|
5368
|
+
if (_thisVertexNode === undefined) {
|
|
5369
|
+
log.info("_thisVertexNode is undefined. Adding vertex...");
|
|
5370
|
+
let start = Object.assign({}, position);
|
|
5371
|
+
log.info("_floorBaseHeight", _floorBaseHeight);
|
|
5372
|
+
if (_floorBaseHeight !== undefined) {
|
|
5373
|
+
log.info("Using _floorBaseHeight");
|
|
5374
|
+
start.y = _floorBaseHeight;
|
|
5375
|
+
}
|
|
5376
|
+
if (redrawing == false) {
|
|
5377
|
+
start.y += _polygonFloorOffset;
|
|
5378
|
+
}
|
|
5379
|
+
// Generate Tag ID from position
|
|
5380
|
+
const r = (x) => Math.round(x * 100) / 100;
|
|
5381
|
+
let thisName = "x" + r(start.x) + "y" + r(start.y) + "z" + r(start.z);
|
|
5382
|
+
if (redrawing) {
|
|
5383
|
+
thisName = `${thisName}-${uid.rnd()}`;
|
|
5384
|
+
}
|
|
5385
|
+
//@ts-expect-error
|
|
5386
|
+
[_thisVertexNode, _thisVertexComponent] = addVertex(thisName, [start]);
|
|
5387
|
+
_thisVertexPath.push(start);
|
|
5388
|
+
log.info("_thisVertexPath ", _thisVertexPath);
|
|
5389
|
+
if (visualize) {
|
|
5390
|
+
_activeVertex.inputs.collider = false;
|
|
5391
|
+
}
|
|
5392
|
+
//Add to the array so we can re enable the vertex controls of the polygon later
|
|
5393
|
+
_vertexConnectiveComponentCollection.push(_thisVertexComponent);
|
|
5394
|
+
_vertexConnectiveNodeCollection.push(_thisVertexNode);
|
|
5395
|
+
log.info("_thisVertexNode ", _thisVertexNode);
|
|
5396
|
+
createVerticeControls(_thisVertexComponent);
|
|
5397
|
+
}
|
|
5398
|
+
else {
|
|
5399
|
+
log.info("_thisVertexNode is defined");
|
|
5400
|
+
log.info("before position ", position);
|
|
5401
|
+
log.info("before _floorBaseHeight ", _floorBaseHeight);
|
|
5402
|
+
let point = Object.assign({}, position);
|
|
5403
|
+
// _intersectionData.position.y += (_highestYaxisPoint + _polygonFloorOffset)
|
|
5404
|
+
if (_floorBaseHeight !== undefined) {
|
|
5405
|
+
point = {
|
|
5406
|
+
x: position.x,
|
|
5407
|
+
y: _floorBaseHeight,
|
|
5408
|
+
z: position.z
|
|
5409
|
+
};
|
|
5410
|
+
}
|
|
5411
|
+
//point.y += _polygonFloorOffset
|
|
5412
|
+
log.info("after position ", point);
|
|
5413
|
+
_thisVertexPath.push(Object.assign({}, point));
|
|
5414
|
+
_thisVertexComponent.inputs.path = [..._thisVertexPath];
|
|
5415
|
+
// Show Vertices
|
|
5416
|
+
createVerticeControls(_thisVertexComponent);
|
|
5417
|
+
}
|
|
5418
|
+
}
|
|
5353
5419
|
function createVerticeClickSpy() {
|
|
5354
5420
|
log.info("createVerticeClickSpy()");
|
|
5355
5421
|
if (_isVerticeClickSpyCreated) {
|
|
@@ -5371,65 +5437,46 @@ function createVerticeClickSpy() {
|
|
|
5371
5437
|
log.info("isCtrlPressed ", isCtrlPressed);
|
|
5372
5438
|
if (isCtrlPressed) {
|
|
5373
5439
|
if (_drawPolygonMode) {
|
|
5440
|
+
createVertexPoints(_intersectionData.position);
|
|
5374
5441
|
// If no node is active
|
|
5375
|
-
if (_thisVertexNode === undefined) {
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
}
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
// _highestYaxisPoint = _intersectionData.position.y
|
|
5414
|
-
// }
|
|
5415
|
-
// if (_floorBaseHeight !== undefined && _floorBaseHeight > _highestYaxisPoint) {
|
|
5416
|
-
// _highestYaxisPoint = _floorBaseHeight
|
|
5417
|
-
// }
|
|
5418
|
-
// _intersectionData.position.y += (_highestYaxisPoint + _polygonFloorOffset)
|
|
5419
|
-
if (_floorBaseHeight !== undefined) {
|
|
5420
|
-
point = {
|
|
5421
|
-
x: _intersectionData.position.x,
|
|
5422
|
-
y: _floorBaseHeight,
|
|
5423
|
-
z: _intersectionData.position.z
|
|
5424
|
-
};
|
|
5425
|
-
}
|
|
5426
|
-
//point.y += _polygonFloorOffset
|
|
5427
|
-
log.info("after _intersectionData.position ", point);
|
|
5428
|
-
_thisVertexPath.push(Object.assign({}, point));
|
|
5429
|
-
_thisVertexComponent.inputs.path = [..._thisVertexPath];
|
|
5430
|
-
// Show Vertices
|
|
5431
|
-
createVerticeControls(_thisVertexComponent);
|
|
5432
|
-
}
|
|
5442
|
+
// if (_thisVertexNode === undefined) {
|
|
5443
|
+
// let start = { ..._intersectionData.position };
|
|
5444
|
+
// log.info("_floorBaseHeight", _floorBaseHeight)
|
|
5445
|
+
// if (_floorBaseHeight !== undefined) {
|
|
5446
|
+
// log.info("Using _floorBaseHeight")
|
|
5447
|
+
// start.y = _floorBaseHeight
|
|
5448
|
+
// }
|
|
5449
|
+
// start.y += _polygonFloorOffset
|
|
5450
|
+
// // Generate Tag ID from position
|
|
5451
|
+
// const r = (x) => Math.round(x * 100) / 100;
|
|
5452
|
+
// let thisName = "x" + r(start.x) + "y" + r(start.y) + "z" + r(start.z);
|
|
5453
|
+
// //@ts-expect-error
|
|
5454
|
+
// [_thisVertexNode, _thisVertexComponent] = addVertex(thisName, [start]);
|
|
5455
|
+
// _thisVertexPath.push(start);
|
|
5456
|
+
// log.info("_thisVertexPath ", _thisVertexPath)
|
|
5457
|
+
// if (visualize) {
|
|
5458
|
+
// _activeVertex.inputs.collider = false;
|
|
5459
|
+
// }
|
|
5460
|
+
// createVerticeControls(_thisVertexComponent);
|
|
5461
|
+
// } else {
|
|
5462
|
+
// log.info("before _intersectionData.position ",_intersectionData.position)
|
|
5463
|
+
// log.info("before _floorBaseHeight ",_floorBaseHeight)
|
|
5464
|
+
// let point = {..._intersectionData.position}
|
|
5465
|
+
// // _intersectionData.position.y += (_highestYaxisPoint + _polygonFloorOffset)
|
|
5466
|
+
// if (_floorBaseHeight !== undefined) {
|
|
5467
|
+
// point = {
|
|
5468
|
+
// x: _intersectionData.position.x,
|
|
5469
|
+
// y: _floorBaseHeight,
|
|
5470
|
+
// z: _intersectionData.position.z
|
|
5471
|
+
// }
|
|
5472
|
+
// }
|
|
5473
|
+
// //point.y += _polygonFloorOffset
|
|
5474
|
+
// log.info("after _intersectionData.position ",point)
|
|
5475
|
+
// _thisVertexPath.push({ ...point });
|
|
5476
|
+
// _thisVertexComponent.inputs.path = [..._thisVertexPath];
|
|
5477
|
+
// // Show Vertices
|
|
5478
|
+
// createVerticeControls(_thisVertexComponent);
|
|
5479
|
+
// }
|
|
5433
5480
|
dispatchSpaceEvent(SPACE_EVENTS.VERTEX_PLACED, {
|
|
5434
5481
|
position: _intersectionData.position,
|
|
5435
5482
|
path: _thisVertexPath
|
|
@@ -5496,7 +5543,26 @@ function enableVerticeControls(component) {
|
|
|
5496
5543
|
log.error("Path of component is empty or undefined");
|
|
5497
5544
|
return;
|
|
5498
5545
|
}
|
|
5499
|
-
|
|
5546
|
+
startDraw();
|
|
5547
|
+
//@ts-expect-error
|
|
5548
|
+
const currenPath = [...component.inputs.path];
|
|
5549
|
+
const last = currenPath.pop();
|
|
5550
|
+
log.info("currenPath ", currenPath);
|
|
5551
|
+
////@ts-expect-error
|
|
5552
|
+
_thisVertexPath = [...currenPath];
|
|
5553
|
+
const first = _thisVertexPath[0];
|
|
5554
|
+
const r = (x) => Math.round(x * 100) / 100;
|
|
5555
|
+
let name = "x" + r(first.x) + "y" + r(first.y) + "z" + r(first.z);
|
|
5556
|
+
name = `${name}-${uid.rnd()}`;
|
|
5557
|
+
//@ts-expect-error
|
|
5558
|
+
[_thisVertexNode, _thisVertexComponent] = addVertex(name, _thisVertexPath);
|
|
5559
|
+
log.info("_thisVertexPath ", _thisVertexPath);
|
|
5560
|
+
if (visualize) {
|
|
5561
|
+
_activeVertex.inputs.collider = false;
|
|
5562
|
+
}
|
|
5563
|
+
_thisVertexPath.push(Object.assign({}, last));
|
|
5564
|
+
_thisVertexComponent.inputs.path = [..._thisVertexPath];
|
|
5565
|
+
createVerticeControls(_thisVertexComponent);
|
|
5500
5566
|
}
|
|
5501
5567
|
/**
|
|
5502
5568
|
* Deletes the edge of a polygon.
|
|
@@ -5679,10 +5745,46 @@ function toggleWallVisibility(component, name) {
|
|
|
5679
5745
|
return;
|
|
5680
5746
|
}
|
|
5681
5747
|
const state = toggleMeshChildrenVisibility(component, name);
|
|
5682
|
-
const wallLabelName = replaceWordInString(name,
|
|
5748
|
+
// const wallLabelName = replaceWordInString(name,'wall','wallLabel')
|
|
5749
|
+
const wallLabelName = name.replace("wall", "wallLabel");
|
|
5683
5750
|
toggleMeshChildrenVisibility(component, wallLabelName);
|
|
5684
5751
|
return state;
|
|
5685
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
|
+
}
|
|
5686
5788
|
/**
|
|
5687
5789
|
* Returns the children of a model's component
|
|
5688
5790
|
* @param component
|
|
@@ -5760,12 +5862,14 @@ function setFloorBaseHeight(baseHeight) {
|
|
|
5760
5862
|
return;
|
|
5761
5863
|
}
|
|
5762
5864
|
_floorBaseHeight = baseHeight;
|
|
5865
|
+
_offsetedBaseHeight = _floorBaseHeight + _polygonFloorOffset;
|
|
5763
5866
|
}
|
|
5764
5867
|
/**
|
|
5765
5868
|
* Clear the value of the base height for floors of polygons
|
|
5766
5869
|
*/
|
|
5767
5870
|
function clearFloorBaseHeight() {
|
|
5768
5871
|
_floorBaseHeight = undefined;
|
|
5872
|
+
_offsetedBaseHeight = undefined;
|
|
5769
5873
|
}
|
|
5770
5874
|
//===================== END VERTEX DRAWING METHODS =========================//
|
|
5771
5875
|
//===================== START KEYBINDINGS =========================//
|
|
@@ -6749,35 +6853,13 @@ class PolygonClickSpy {
|
|
|
6749
6853
|
_currentPolygon = {
|
|
6750
6854
|
node: this.node,
|
|
6751
6855
|
component: this.component,
|
|
6752
|
-
object: this.object_data
|
|
6856
|
+
object: this.object_data,
|
|
6857
|
+
type: 'POLYGON'
|
|
6753
6858
|
};
|
|
6754
6859
|
}
|
|
6755
6860
|
}
|
|
6756
6861
|
}
|
|
6757
6862
|
}
|
|
6758
|
-
class VerticeEditSpy {
|
|
6759
|
-
constructor(path, callback) {
|
|
6760
|
-
this.path = path;
|
|
6761
|
-
this.callback = callback;
|
|
6762
|
-
}
|
|
6763
|
-
onEvent(data) {
|
|
6764
|
-
log.info("VerticeEditSpy");
|
|
6765
|
-
// if (data.collider !== null) {
|
|
6766
|
-
// const nodeIterator = _tubes.nodeIterator();
|
|
6767
|
-
// let nodes = nodeIterator.next();
|
|
6768
|
-
// while (!nodes.done) {
|
|
6769
|
-
// const componentIterator = nodes.value.componentIterator();
|
|
6770
|
-
// let component = componentIterator.next();
|
|
6771
|
-
// component.value.inputs.collider = data.collider;
|
|
6772
|
-
// nodes = nodeIterator.next();
|
|
6773
|
-
// }
|
|
6774
|
-
// }
|
|
6775
|
-
// // Trigger onInputsUpdated
|
|
6776
|
-
// _activeVertex.inputs.active = false;
|
|
6777
|
-
// _activeVertex.inputs.path[data.index] = data.position;
|
|
6778
|
-
// _activeVertex.inputs.active = true;
|
|
6779
|
-
}
|
|
6780
|
-
}
|
|
6781
6863
|
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,
|
|
6782
6864
|
//minimap
|
|
6783
6865
|
minimap, _modelDetails, _onMouseClickInstance, transformHistory,
|
|
@@ -6835,7 +6917,7 @@ initToolbarUI, themeManager,
|
|
|
6835
6917
|
//utils
|
|
6836
6918
|
convertToEuler, disableSweeps, enableSweep, disableSweep,
|
|
6837
6919
|
//Draw polygon
|
|
6838
|
-
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,
|
|
6839
6921
|
// Space partition
|
|
6840
6922
|
setSpacePartitionNodes,
|
|
6841
6923
|
// others
|
|
@@ -117,6 +117,7 @@ i18n
|
|
|
117
117
|
"MarkBaseHeight": "Click to mark an area as your desired base height",
|
|
118
118
|
"Saving": "Saving",
|
|
119
119
|
"DeletePartition": "Delete Partition",
|
|
120
|
+
"ModifyPartition": "Modify Partition"
|
|
120
121
|
}
|
|
121
122
|
},
|
|
122
123
|
ja: {
|
|
@@ -228,6 +229,7 @@ i18n
|
|
|
228
229
|
"NoPartitionDeleted": "削除できる区画がありません",
|
|
229
230
|
"Saving": "保存",
|
|
230
231
|
"DeletePartition": "パーティション削除",
|
|
232
|
+
"ModifyPartition": "パーティションの変更"
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
235
|
},
|
|
@@ -72,3 +72,5 @@ export declare function setCurrentPartitionData(): Promise<void>;
|
|
|
72
72
|
export declare function getCurrentPartitionData(): PartitionNode;
|
|
73
73
|
export declare function getNewlyAddedPartition(): Array<PartitionNode>;
|
|
74
74
|
export declare function getDeletedSavedPartitionArray(): Array<PartitionNode>;
|
|
75
|
+
export declare function getDrawingMode(): boolean;
|
|
76
|
+
export declare function setDrawingMode(state: boolean): void;
|
|
@@ -15,6 +15,7 @@ import { generateUUID, extractUUID } from '../../../../utils';
|
|
|
15
15
|
import { getCurrentEditRoomData } from './roomTreePane';
|
|
16
16
|
import { toggleModal, setModalAction } from "../modal";
|
|
17
17
|
import { Notyf } from 'notyf';
|
|
18
|
+
import log from 'loglevel';
|
|
18
19
|
let isDrawing = false;
|
|
19
20
|
let roomFormMode = "ADD" /* FORM_MODE.ADD */;
|
|
20
21
|
let isSaving = false;
|
|
@@ -69,6 +70,10 @@ export function renderRoomFormPane() {
|
|
|
69
70
|
${i18n.t('DrawPartition')}
|
|
70
71
|
<span class="mdi mdi-cube-outline"></span>
|
|
71
72
|
</div>
|
|
73
|
+
<div class="at_button at_draw_partition_btn at_w-full at_hidden" id="at-modify-partition-form-btn" data-cy="at-modify-partition-form-btn">
|
|
74
|
+
${i18n.t('ModifyPartition')}
|
|
75
|
+
<span class="mdi mdi-cube-outline"></span>
|
|
76
|
+
</div>
|
|
72
77
|
<div class="at_partition_list_container at_h-min-40" id="at-partition-list-container" data-cy="at-partition-list-container">
|
|
73
78
|
<div class="at_face_title" id="at-face-title" style="display: none;">
|
|
74
79
|
<span class="mdi mdi-chevron-left" id="at-back-partition"></span>
|
|
@@ -388,7 +393,9 @@ function displayFaces(polygon) {
|
|
|
388
393
|
const element = document.createElement('div');
|
|
389
394
|
element.classList.add('at_face_vertex_item');
|
|
390
395
|
// Display the floor details
|
|
391
|
-
|
|
396
|
+
if (polygon.floor) {
|
|
397
|
+
element.appendChild(displayFloor(polygon.floor));
|
|
398
|
+
}
|
|
392
399
|
// Display each wall's details
|
|
393
400
|
polygon.walls.forEach((wall) => {
|
|
394
401
|
element.appendChild(displayWalls(wall));
|
|
@@ -741,16 +748,9 @@ export function setPolygonData(payload) {
|
|
|
741
748
|
}
|
|
742
749
|
// Iterate over walls to set UUID and names
|
|
743
750
|
if (payload.walls && payload.walls.length > 0) {
|
|
744
|
-
payload.walls = payload.walls.map((wall, index) => {
|
|
745
|
-
var _a, _b, _c, _d;
|
|
746
|
-
return (Object.assign(Object.assign({}, roundToTwoDecimals(wall)), { name: `_wall-${index + 1}`, uuid: wall.uuid || generateUUID(), options: {
|
|
747
|
-
color: (_b = (_a = wall.options) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : 0xffffff,
|
|
748
|
-
opacity: (_d = (_c = wall.options) === null || _c === void 0 ? void 0 : _c.opacity) !== null && _d !== void 0 ? _d : 1.0
|
|
749
|
-
} }));
|
|
750
|
-
});
|
|
751
|
+
payload.walls = payload.walls.map((wall, index) => (Object.assign(Object.assign({}, roundToTwoDecimals(wall)), { name: `_wall-${index + 1}`, uuid: wall.uuid || generateUUID() })));
|
|
751
752
|
}
|
|
752
753
|
currentPolygonData = payload;
|
|
753
|
-
setCurrentPartitionData();
|
|
754
754
|
}
|
|
755
755
|
/**
|
|
756
756
|
* Sets the partition data, including updating the floor level and generating a new
|
|
@@ -766,8 +766,13 @@ export function setCurrentPartitionData() {
|
|
|
766
766
|
let currentPolygon = null;
|
|
767
767
|
yield new Promise(resolve => {
|
|
768
768
|
const interval = setInterval(() => {
|
|
769
|
+
var _a, _b;
|
|
769
770
|
currentPolygon = getCurrentPolygon();
|
|
770
|
-
if (currentPolygon.object.object_data.uuid
|
|
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)) {
|
|
771
776
|
clearInterval(interval);
|
|
772
777
|
resolve();
|
|
773
778
|
}
|
|
@@ -807,7 +812,7 @@ function updatePartitionDataArray(payload, currentPartitionDataArray) {
|
|
|
807
812
|
newlyAddedPartition.push(payload);
|
|
808
813
|
console.log("newlyAddedPartition", payload);
|
|
809
814
|
currentPartitionData = payload;
|
|
810
|
-
dispatchSpaceEvent(SPACE_EVENTS.PARTITION_EDITED, currentPartitionData);
|
|
815
|
+
dispatchSpaceEvent(SPACE_EVENTS.PARTITION_EDITED, { data: currentPartitionData });
|
|
811
816
|
}
|
|
812
817
|
export function getCurrentPartitionData() {
|
|
813
818
|
return currentPartitionData;
|
|
@@ -818,3 +823,13 @@ export function getNewlyAddedPartition() {
|
|
|
818
823
|
export function getDeletedSavedPartitionArray() {
|
|
819
824
|
return deletedSavedPartitionArray;
|
|
820
825
|
}
|
|
826
|
+
export function getDrawingMode() {
|
|
827
|
+
return isDrawing;
|
|
828
|
+
}
|
|
829
|
+
export function setDrawingMode(state) {
|
|
830
|
+
if (typeof state !== 'boolean') {
|
|
831
|
+
log.error("Invalid parameter value");
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
isDrawing = state;
|
|
835
|
+
}
|
|
@@ -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,29 +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
|
|
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
|
|
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;
|
|
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;
|