architwin 1.8.3 → 1.8.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 +14 -2
- package/lib/architwin.js +90 -25
- package/lib/atwinui/components/toolbar/roomCreation/roomFormPane.js +9 -6
- package/lib/atwinui/events.js +3 -3
- package/lib/loaders/polydrawerLoader.d.ts +2 -1
- package/lib/loaders/polydrawerLoader.js +15 -4
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
package/lib/architwin.d.ts
CHANGED
|
@@ -424,7 +424,7 @@ declare function renderPolygonFromPath(path: Array<Vector3>): void;
|
|
|
424
424
|
* @param {PartitionPayload|Array<Vector3>} payload
|
|
425
425
|
* @returns {void}
|
|
426
426
|
*/
|
|
427
|
-
declare function renderPolygon(payload: PartitionPayload | Array<Vector3
|
|
427
|
+
declare function renderPolygon(payload: PartitionPayload | Array<Vector3>, updatePolygon?: boolean): IShowcaseObject;
|
|
428
428
|
/**
|
|
429
429
|
* Updates the polygons by passing a new array of vertices. Do note that any vertex markers visible will not automatically update their position
|
|
430
430
|
* @param {number} id - id of the polygon object
|
|
@@ -436,6 +436,18 @@ declare function startDraw(): void;
|
|
|
436
436
|
declare function exitDraw(): void;
|
|
437
437
|
declare function cancelDraw(): void;
|
|
438
438
|
declare function getCurrentPolygon(): IObjectData;
|
|
439
|
+
/**
|
|
440
|
+
* Wrapper function around toggleMeshChildrenVisibility
|
|
441
|
+
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
442
|
+
* @param {string | Array<string>} name - name of the model
|
|
443
|
+
*/
|
|
444
|
+
declare function toggleWallVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Returns the children of a model's component
|
|
447
|
+
* @param component
|
|
448
|
+
* @returns
|
|
449
|
+
*/
|
|
450
|
+
declare function getChildrenOfModel(component: MpSdk.Scene.IComponent): any;
|
|
439
451
|
declare function setTagIcon(payload: {
|
|
440
452
|
tag: MpSdk.Tag.TagData;
|
|
441
453
|
iconName: string;
|
|
@@ -579,4 +591,4 @@ declare function unFollowParticipant(unFollowParticipant: any): void;
|
|
|
579
591
|
* @param roomNodes Array of room nodes
|
|
580
592
|
*/
|
|
581
593
|
declare function setSpaceRoomNodes(roomNodes: Array<RoomNode>): Promise<void>;
|
|
582
|
-
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, _roomNodes, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, 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, setSpaceRoomNodes, getSpaceId, getCurrentPolygon };
|
|
594
|
+
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, _roomNodes, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, 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, setSpaceRoomNodes, getSpaceId, getCurrentPolygon };
|
package/lib/architwin.js
CHANGED
|
@@ -5131,7 +5131,7 @@ function renderPolygonFromPath(path) {
|
|
|
5131
5131
|
* @param {PartitionPayload|Array<Vector3>} payload
|
|
5132
5132
|
* @returns {void}
|
|
5133
5133
|
*/
|
|
5134
|
-
function renderPolygon(payload) {
|
|
5134
|
+
function renderPolygon(payload, updatePolygon = false) {
|
|
5135
5135
|
if (!payload) {
|
|
5136
5136
|
log.error("Payload is undefined");
|
|
5137
5137
|
return;
|
|
@@ -5168,38 +5168,44 @@ function renderPolygon(payload) {
|
|
|
5168
5168
|
component: polyComponent,
|
|
5169
5169
|
type: 'POLYGON'
|
|
5170
5170
|
};
|
|
5171
|
+
const eventPath = _sceneObject.addEmitPath(polyComponent, 'polygonclicked');
|
|
5172
|
+
_sceneObject.spyOnEvent(new PolygonClickSpy(eventPath, showcaseObj, polyNode, polyComponent, dispatchSpaceEvent));
|
|
5171
5173
|
_3DXObjects.push(newObj);
|
|
5172
5174
|
_currentPolygon = newObj;
|
|
5175
|
+
log.info("_currentPolygon ", _currentPolygon);
|
|
5173
5176
|
}
|
|
5174
5177
|
catch (error) {
|
|
5175
5178
|
log.error("Error renderPolygon ", error);
|
|
5176
5179
|
}
|
|
5177
5180
|
}
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5181
|
+
if (updatePolygon) {
|
|
5182
|
+
const index = _3DXObjects.findIndex(item => item.object.id == _currentPolygon.object.id);
|
|
5183
|
+
_currentPolygon.node = polyNode;
|
|
5184
|
+
_currentPolygon.component = polyComponent;
|
|
5185
|
+
_currentPolygon.object.object_data.uuid = generateUUID();
|
|
5186
|
+
_currentPolygon.object.object_data.json_data = {
|
|
5187
|
+
vertexPath: payload
|
|
5188
|
+
};
|
|
5189
|
+
_3DXObjects[index] = _currentPolygon;
|
|
5190
|
+
if (payload.length > 3) {
|
|
5191
|
+
console.log(" _3DXObjects[index] ", _3DXObjects[index]);
|
|
5192
|
+
setPolygonPath(_3DXObjects[index].object.id, payload);
|
|
5193
|
+
}
|
|
5189
5194
|
}
|
|
5190
5195
|
}
|
|
5191
5196
|
else {
|
|
5192
5197
|
polyNode = _sceneObject.addNode();
|
|
5193
5198
|
polyComponent = polyNode.addComponent(bufferGeometryType, {
|
|
5194
|
-
path: payload.polygon_json.path
|
|
5199
|
+
path: payload.polygon_json.path,
|
|
5200
|
+
uuid: payload.uuid
|
|
5195
5201
|
});
|
|
5196
5202
|
polyNode.start();
|
|
5197
5203
|
polyObj.uuid = payload.uuid;
|
|
5198
5204
|
polyObj.name = payload.name;
|
|
5199
5205
|
polyObj.json_data = payload.polygon_json;
|
|
5200
5206
|
_sceneObject.addInputPath(polyComponent, 'path', `path_${showcaseObj.id}`);
|
|
5201
|
-
|
|
5202
|
-
|
|
5207
|
+
const eventPath = _sceneObject.addEmitPath(polyComponent, 'polygonclicked');
|
|
5208
|
+
_sceneObject.spyOnEvent(new PolygonClickSpy(eventPath, showcaseObj, polyNode, polyComponent, dispatchSpaceEvent));
|
|
5203
5209
|
const newObj = {
|
|
5204
5210
|
object: showcaseObj,
|
|
5205
5211
|
node: polyNode,
|
|
@@ -5383,6 +5389,7 @@ function exitDraw() {
|
|
|
5383
5389
|
toggleSpaceNavigation(true);
|
|
5384
5390
|
_drawPolygonMode = false;
|
|
5385
5391
|
_currentPolygon = undefined;
|
|
5392
|
+
_polygonShapePath = undefined;
|
|
5386
5393
|
_atwin.Pointer.resetTexture();
|
|
5387
5394
|
}
|
|
5388
5395
|
function cancelDraw() {
|
|
@@ -5460,6 +5467,59 @@ function addVertex(name, path) {
|
|
|
5460
5467
|
_activeVertex = drawComponent;
|
|
5461
5468
|
return [drawNode, drawComponent];
|
|
5462
5469
|
}
|
|
5470
|
+
/**
|
|
5471
|
+
* Toggles the visibility of the children of a mesh
|
|
5472
|
+
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
5473
|
+
* @param {string} name - name of the model
|
|
5474
|
+
*/
|
|
5475
|
+
function toggleMeshChildrenVisibility(component, name) {
|
|
5476
|
+
if (!component) {
|
|
5477
|
+
log.error("Component is undefined");
|
|
5478
|
+
return;
|
|
5479
|
+
}
|
|
5480
|
+
if (!name) {
|
|
5481
|
+
log.error("name is undefined");
|
|
5482
|
+
return;
|
|
5483
|
+
}
|
|
5484
|
+
//@ts-expect-error
|
|
5485
|
+
component.mesh.children.forEach(child => {
|
|
5486
|
+
if (child.name == name) {
|
|
5487
|
+
child.visible = !child.visible;
|
|
5488
|
+
return child.visible;
|
|
5489
|
+
}
|
|
5490
|
+
});
|
|
5491
|
+
}
|
|
5492
|
+
/**
|
|
5493
|
+
* Wrapper function around toggleMeshChildrenVisibility
|
|
5494
|
+
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
5495
|
+
* @param {string | Array<string>} name - name of the model
|
|
5496
|
+
*/
|
|
5497
|
+
function toggleWallVisibility(component, name) {
|
|
5498
|
+
if (!component) {
|
|
5499
|
+
log.error("Component is undefined");
|
|
5500
|
+
return;
|
|
5501
|
+
}
|
|
5502
|
+
if (!name) {
|
|
5503
|
+
log.error("name is undefined");
|
|
5504
|
+
return;
|
|
5505
|
+
}
|
|
5506
|
+
const state = toggleMeshChildrenVisibility(component, name);
|
|
5507
|
+
return state;
|
|
5508
|
+
}
|
|
5509
|
+
/**
|
|
5510
|
+
* Returns the children of a model's component
|
|
5511
|
+
* @param component
|
|
5512
|
+
* @returns
|
|
5513
|
+
*/
|
|
5514
|
+
function getChildrenOfModel(component) {
|
|
5515
|
+
if (!component) {
|
|
5516
|
+
log.error("Component is undefined");
|
|
5517
|
+
return;
|
|
5518
|
+
}
|
|
5519
|
+
//@ts-expect-error
|
|
5520
|
+
const children = component.mesh.children;
|
|
5521
|
+
return children;
|
|
5522
|
+
}
|
|
5463
5523
|
//===================== END VERTEX DRAWING METHODS =========================//
|
|
5464
5524
|
//===================== START TAGS =========================//
|
|
5465
5525
|
// set tag icon
|
|
@@ -6400,15 +6460,20 @@ class PolygonClickSpy {
|
|
|
6400
6460
|
this.callback = callback;
|
|
6401
6461
|
}
|
|
6402
6462
|
onEvent(data) {
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6463
|
+
if (data.input.type == 'click') {
|
|
6464
|
+
if (_drawPolygonMode == false) {
|
|
6465
|
+
log.info("VerticeClickSpy");
|
|
6466
|
+
log.info('Clicked on polygon', data);
|
|
6467
|
+
//Emit event to application
|
|
6468
|
+
this.callback('PARTITION_CLICKED', this.object_data);
|
|
6469
|
+
setSelectedObject(this.object_data, this.node, this.component, 'POLYGON');
|
|
6470
|
+
_currentPolygon = {
|
|
6471
|
+
node: this.node,
|
|
6472
|
+
component: this.component,
|
|
6473
|
+
object: this.object_data
|
|
6474
|
+
};
|
|
6475
|
+
}
|
|
6476
|
+
}
|
|
6412
6477
|
}
|
|
6413
6478
|
}
|
|
6414
6479
|
class VerticeEditSpy {
|
|
@@ -6491,7 +6556,7 @@ initToolbarUI, themeManager,
|
|
|
6491
6556
|
//utils
|
|
6492
6557
|
convertToEuler, disableSweeps, enableSweep, disableSweep,
|
|
6493
6558
|
//Draw polygon
|
|
6494
|
-
tubeLineType, _sceneObject, _tubes, drawLine, renderPolygonFromPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setTubeLinePath, getCurrentTubeLine, renderPolygon,
|
|
6559
|
+
tubeLineType, _sceneObject, _tubes, drawLine, renderPolygonFromPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setTubeLinePath, getCurrentTubeLine, renderPolygon, toggleWallVisibility, getChildrenOfModel,
|
|
6495
6560
|
// Room creation
|
|
6496
6561
|
setSpaceRoomNodes,
|
|
6497
6562
|
// others
|
|
@@ -360,9 +360,12 @@ function renderFloor(floor) {
|
|
|
360
360
|
function renderWalls(wall, index) {
|
|
361
361
|
console.log('renderWall()', wall);
|
|
362
362
|
const element = document.createElement('div');
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
const match = wall.name.match(/_wall-(\d+)$/);
|
|
364
|
+
let wallName = '';
|
|
365
|
+
if (match) {
|
|
366
|
+
console.log("HELLO");
|
|
367
|
+
wallName = `${i18n.t(`Wall`)} ${match[1]}`;
|
|
368
|
+
}
|
|
366
369
|
element.innerHTML =
|
|
367
370
|
`
|
|
368
371
|
<div class="at_face_item">
|
|
@@ -370,11 +373,11 @@ function renderWalls(wall, index) {
|
|
|
370
373
|
<span class="mdi mdi-perspective-less at_face_icon_rotate_270"></span>
|
|
371
374
|
</div>
|
|
372
375
|
<div class="at_face_name" id="at-expand-btn-${wall.uuid}" data-cy="at-expand-btn-${wall.uuid}">
|
|
373
|
-
${
|
|
376
|
+
${wallName}
|
|
374
377
|
<span class="mdi mdi-chevron-down" id="at-expand-btn-${wall.uuid}" data-cy="at-expand-btn-${wall.uuid}"></span>
|
|
375
378
|
</div>
|
|
376
379
|
<div class="at_icon_right">
|
|
377
|
-
<span class="
|
|
380
|
+
<span class=""></span>
|
|
378
381
|
</div>
|
|
379
382
|
</div>
|
|
380
383
|
<div class="at_edit_name" id="at-edit-name-${wall.uuid}" data-cy="at-edit-name-${wall.uuid}" >
|
|
@@ -552,7 +555,7 @@ export function setPolygonData(payload) {
|
|
|
552
555
|
if (payload.walls && payload.walls.length > 0) {
|
|
553
556
|
payload.walls = payload.walls.map((wall, index) => {
|
|
554
557
|
var _a, _b, _c, _d;
|
|
555
|
-
return (Object.assign(Object.assign({}, roundToTwoDecimals(wall)), { name: `
|
|
558
|
+
return (Object.assign(Object.assign({}, roundToTwoDecimals(wall)), { name: `_wall-${index + 1}`, uuid: wall.uuid || generateUUID(), options: {
|
|
556
559
|
color: (_b = (_a = wall.options) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : 0xffffff,
|
|
557
560
|
opacity: (_d = (_c = wall.options) === null || _c === void 0 ? void 0 : _c.opacity) !== null && _d !== void 0 ? _d : 1.0 // Default opacity (fully opaque)
|
|
558
561
|
} }));
|
package/lib/atwinui/events.js
CHANGED
|
@@ -130,7 +130,7 @@ function toggleDisplayPane(targetId) {
|
|
|
130
130
|
if (paneId === 'at-object-list-pane') {
|
|
131
131
|
const objectsInSpace = get3DXObjects();
|
|
132
132
|
const objectComponents = objectsInSpace.map(obj => obj.component);
|
|
133
|
-
const spaceObjects = objectsInSpace.map(obj => obj.object);
|
|
133
|
+
const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON').map(obj => obj.object);
|
|
134
134
|
renderObjectCards(spaceObjects, objectComponents);
|
|
135
135
|
if (targetId === 'at-cancel-library-btn') {
|
|
136
136
|
yield cancelModelPlacement();
|
|
@@ -1132,7 +1132,7 @@ function handleSetModelsView() {
|
|
|
1132
1132
|
modelsListViewBtn.classList.remove('at_ghost_active');
|
|
1133
1133
|
modelsView = 'card';
|
|
1134
1134
|
log.info("modelCardViewBtn", modelsView);
|
|
1135
|
-
const spaceObjects = _3DXObjects.map(obj => obj.object);
|
|
1135
|
+
const spaceObjects = _3DXObjects.filter(obj => obj.type !== 'POLYGON').map(obj => obj.object);
|
|
1136
1136
|
const objectComponents = _3DXObjects.map(obj => obj.component);
|
|
1137
1137
|
renderObjectCards(spaceObjects, objectComponents);
|
|
1138
1138
|
});
|
|
@@ -1141,7 +1141,7 @@ function handleSetModelsView() {
|
|
|
1141
1141
|
modelsCardViewBtn.classList.remove('at_ghost_active');
|
|
1142
1142
|
modelsView = 'list';
|
|
1143
1143
|
log.info("modelListViewBtn", modelsView);
|
|
1144
|
-
const spaceObjects = _3DXObjects.map(obj => obj.object);
|
|
1144
|
+
const spaceObjects = _3DXObjects.filter(obj => obj.type !== "POLYGON").map(obj => obj.object);
|
|
1145
1145
|
const objectComponents = _3DXObjects.map(obj => obj.component);
|
|
1146
1146
|
renderObjectList(spaceObjects, objectComponents);
|
|
1147
1147
|
});
|
|
@@ -110,6 +110,7 @@ export declare class BufferGeometry {
|
|
|
110
110
|
inputs: {
|
|
111
111
|
id: number;
|
|
112
112
|
name: string;
|
|
113
|
+
uuid: string;
|
|
113
114
|
position: any;
|
|
114
115
|
fillColor: string;
|
|
115
116
|
hoverColor: string;
|
|
@@ -140,7 +141,7 @@ export declare class BufferGeometry {
|
|
|
140
141
|
onDestroy(): void;
|
|
141
142
|
renderWall(): void;
|
|
142
143
|
createLabelCanvas(text: string): HTMLCanvasElement;
|
|
143
|
-
renderWalls(WALL_HEIGHT: number): (EdgePolyData | WallPolyData)[];
|
|
144
|
+
renderWalls(WALL_HEIGHT: number): (EdgePolyData[] | WallPolyData[])[];
|
|
144
145
|
renderPolygon: () => void;
|
|
145
146
|
}
|
|
146
147
|
export declare const bufferGeometryType = "bufferGeometry";
|
|
@@ -76,7 +76,7 @@ export class TubeLine {
|
|
|
76
76
|
this.renderTubeLine();
|
|
77
77
|
console.log("paths ", this.inputs.path);
|
|
78
78
|
if (this.inputs.path.length >= 3 && this.inputs.renderPolygonOnAdd) {
|
|
79
|
-
renderPolygon(this.inputs.path);
|
|
79
|
+
renderPolygon(this.inputs.path, true);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -434,6 +434,7 @@ export class BufferGeometry {
|
|
|
434
434
|
this.inputs = {
|
|
435
435
|
id: 0,
|
|
436
436
|
name: '',
|
|
437
|
+
uuid: '',
|
|
437
438
|
position: null,
|
|
438
439
|
fillColor: 'rgb(0,255,0)',
|
|
439
440
|
hoverColor: 'rgb(255,0,0)',
|
|
@@ -526,6 +527,7 @@ export class BufferGeometry {
|
|
|
526
527
|
opacity: this.inputs.wallOpacity,
|
|
527
528
|
transparent: true
|
|
528
529
|
}));
|
|
530
|
+
wallMesh.name = `${this.inputs.uuid}-wall-${i + 1}`;
|
|
529
531
|
const wallLength = new THREE.Vector3(endPoint.x - startPoint.x, endPoint.y - startPoint.y, endPoint.z - startPoint.z).length();
|
|
530
532
|
const wallArea = wallLength * WALL_HEIGHT;
|
|
531
533
|
// Create wall label
|
|
@@ -591,6 +593,7 @@ export class BufferGeometry {
|
|
|
591
593
|
color: this.inputs.wallColor,
|
|
592
594
|
opacity: this.inputs.wallOpacity
|
|
593
595
|
},
|
|
596
|
+
name: `${this.inputs.uuid}-wall-${i + 1}`,
|
|
594
597
|
area: wallArea,
|
|
595
598
|
wall_height: WALL_HEIGHT,
|
|
596
599
|
edges: wallEdges
|
|
@@ -615,6 +618,9 @@ export class BufferGeometry {
|
|
|
615
618
|
walls: wallDataArray
|
|
616
619
|
};
|
|
617
620
|
dispatchSpaceEvent(SPACE_EVENTS.PARTITION_UPDATED, partitionData);
|
|
621
|
+
console.log("Polygon mesh ", this.groupedMesh);
|
|
622
|
+
//@ts-expect-error
|
|
623
|
+
this.mesh = this.groupedMesh;
|
|
618
624
|
this.outputs.objectRoot = this.groupedMesh;
|
|
619
625
|
this.outputs.collider = this.groupedMesh;
|
|
620
626
|
};
|
|
@@ -622,6 +628,9 @@ export class BufferGeometry {
|
|
|
622
628
|
}
|
|
623
629
|
onEvent(eventType, data) {
|
|
624
630
|
if (eventType === 'INTERACTION.CLICK') {
|
|
631
|
+
data.input.type = 'click';
|
|
632
|
+
//@ts-expect-error
|
|
633
|
+
this.notify('polygonclicked', data);
|
|
625
634
|
}
|
|
626
635
|
if (eventType === 'INTERACTION.DRAG') {
|
|
627
636
|
}
|
|
@@ -629,8 +638,6 @@ export class BufferGeometry {
|
|
|
629
638
|
}
|
|
630
639
|
if (eventType === 'INTERACTION.DRAG_END') {
|
|
631
640
|
}
|
|
632
|
-
////@ts-expect-error
|
|
633
|
-
//this.notify('polygonclicked', data);
|
|
634
641
|
}
|
|
635
642
|
onDestroy() {
|
|
636
643
|
this.outputs.collider = null;
|
|
@@ -656,6 +663,8 @@ export class BufferGeometry {
|
|
|
656
663
|
;
|
|
657
664
|
renderWalls(WALL_HEIGHT) {
|
|
658
665
|
const THREE = this.context.three;
|
|
666
|
+
let floorDataArray = [];
|
|
667
|
+
let wallDataArray = [];
|
|
659
668
|
for (let i = 0; i < this.inputs.path.length; i++) {
|
|
660
669
|
const startPoint = this.inputs.path[i];
|
|
661
670
|
const endPoint = this.inputs.path[(i + 1) % this.inputs.path.length];
|
|
@@ -747,8 +756,10 @@ export class BufferGeometry {
|
|
|
747
756
|
wall_height: WALL_HEIGHT,
|
|
748
757
|
edges: wallEdges
|
|
749
758
|
};
|
|
750
|
-
|
|
759
|
+
floorDataArray.push(floorEdges);
|
|
760
|
+
wallDataArray.push(wallData);
|
|
751
761
|
}
|
|
762
|
+
return [floorDataArray, wallDataArray];
|
|
752
763
|
}
|
|
753
764
|
;
|
|
754
765
|
}
|
package/lib/types.d.ts
CHANGED