architwin 1.10.10 → 2.0.0
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 +7 -2
- package/lib/architwin.js +83 -10
- package/lib/atwinui/components/toolbar/actionSettingsPane.d.ts +6 -1
- package/lib/atwinui/components/toolbar/actionSettingsPane.js +70 -21
- package/lib/atwinui/components/toolbar/i18n.js +12 -2
- package/lib/atwinui/components/toolbar/menuBar.js +1 -4
- package/lib/atwinui/components/toolbar/modelControlsPane.d.ts +5 -1
- package/lib/atwinui/components/toolbar/modelControlsPane.js +324 -65
- package/lib/atwinui/events.js +177 -11
- package/lib/types.d.ts +30 -1
- package/lib/types.js +6 -0
- package/lib/worldConversion.d.ts +1 -0
- package/lib/worldConversion.js +23 -0
- package/package.json +1 -1
- package/static/atwinui.css +5 -0
package/lib/atwinui/events.js
CHANGED
|
@@ -7,16 +7,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTagRow, getTagFormData, addClickEventToTagRow, setActiveCard, setActiveMenu, removeObjectCard, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown, clearActiveActionBtn, clearActiveCard, toggleActionBarButtons, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList, toggleModal, setModalAction } from "./components/toolbar";
|
|
11
|
-
import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, } from "../architwin";
|
|
10
|
+
import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTagRow, getTagFormData, addClickEventToTagRow, setActiveCard, setActiveMenu, removeObjectCard, clearActiveMenu, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown, clearActiveActionBtn, clearActiveCard, toggleActionBarButtons, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList, toggleModal, setModalAction } from "./components/toolbar";
|
|
11
|
+
import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
|
-
import { SPACE_EVENTS } from "../types";
|
|
14
|
+
import { SPACE_EVENTS, COORDINATE_SYSTEM } from "../types";
|
|
15
15
|
import { initFormData } from "./components/toolbar/tagFormPane";
|
|
16
16
|
import { renderObjectList } from "./components/toolbar/objectListPane";
|
|
17
17
|
import { renderLibraryList } from "./components/toolbar/libraryPane";
|
|
18
18
|
import { renderObjectCard } from "./components/toolbar/card";
|
|
19
|
-
import { toggleModelControl, getCoordinateValues, showCurrentCoordinateValue, handleModelControlInputs } from "./components/toolbar/modelControlsPane";
|
|
19
|
+
import { toggleModelControl, getCoordinateValues, showCurrentCoordinateValue, handleModelControlInputs, setSelectedObjectCoordinateSystem, getSelectedObjectCoordinateSystem, setCoordinateSystemType } from "./components/toolbar/modelControlsPane";
|
|
20
20
|
import { attachTagMedia, handleTagPlacerCreated, cancelMoveTag } from "../tag";
|
|
21
21
|
import i18n from './components/toolbar/i18n';
|
|
22
22
|
import { isValidUrl, debounce, isElementVisible, extractUUID } from "../utils";
|
|
@@ -25,7 +25,9 @@ import * as minimap from '../minimap';
|
|
|
25
25
|
import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
|
|
26
26
|
import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI } from "./components/toolbar/spacePartition/roomTreePane";
|
|
27
27
|
import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, setCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon } from "./components/toolbar/spacePartition/roomFormPane";
|
|
28
|
-
import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint } from "./components/toolbar/actionSettingsPane";
|
|
28
|
+
import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint, toggleActionSettings, getBasepointObjectPayload, displayConvertedCoordinates, getCoordinateSystem, getScaleFactor, getMeasurementUnit, getRotationUnit, setBasepointObjectPayload } from "./components/toolbar/actionSettingsPane";
|
|
29
|
+
import { updateDisplayedCoordinates } from './components/toolbar/modelControlsPane';
|
|
30
|
+
import { convertZupToYup, getOffsetPositionFromBasepoint } from "../worldConversion";
|
|
29
31
|
let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
|
|
30
32
|
let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500, types: [
|
|
31
33
|
{
|
|
@@ -237,6 +239,7 @@ function toggleDisplayPane(targetId) {
|
|
|
237
239
|
log.info("at-settings-pane");
|
|
238
240
|
setTempBasepoint(undefined);
|
|
239
241
|
initSettingsValues();
|
|
242
|
+
toggleActionSettings(true);
|
|
240
243
|
}
|
|
241
244
|
if (!getBasepoint()) {
|
|
242
245
|
const target = _3DXObjects.find(obj => obj.type === 'BASEPOINT');
|
|
@@ -323,6 +326,8 @@ function setupIndividualEventListeners() {
|
|
|
323
326
|
handleScaleFactorSettings();
|
|
324
327
|
handleSaveActionSettings();
|
|
325
328
|
handleCalibrateBasepoint();
|
|
329
|
+
handleObjectCoordinateSystem();
|
|
330
|
+
handleConfirmObjectUpdate();
|
|
326
331
|
}
|
|
327
332
|
//================ OBJECT EVENT HANDLERS ===============//
|
|
328
333
|
function handleTranslateObject() {
|
|
@@ -1139,10 +1144,42 @@ function handleConfirmTransform() {
|
|
|
1139
1144
|
const confirmTransformBtn = document.getElementById('at-confirm-transform');
|
|
1140
1145
|
if (confirmTransformBtn) {
|
|
1141
1146
|
confirmTransformBtn.addEventListener('click', () => {
|
|
1147
|
+
const settingsPane = document.getElementById('at-settings-pane');
|
|
1148
|
+
const isSettingsPaneVisible = isElementVisible(settingsPane);
|
|
1142
1149
|
const transform = getCoordinateValues();
|
|
1150
|
+
const selected = getSelectedObject();
|
|
1151
|
+
if (isToolbarFeatureEnabled('bim')) {
|
|
1152
|
+
const selectedSystem = getSelectedObjectCoordinateSystem();
|
|
1153
|
+
if (selectedSystem) {
|
|
1154
|
+
//If the selected coordinate system in the radio options does not match the
|
|
1155
|
+
//value of the coordinates system of the current object, perform conversion
|
|
1156
|
+
//if matches, no need to convert
|
|
1157
|
+
if (selected.object.coordinate_system != selectedSystem) {
|
|
1158
|
+
if (selectedSystem == COORDINATE_SYSTEM.BIM) {
|
|
1159
|
+
transform.object_position = convertZupToYup(transform.object_position);
|
|
1160
|
+
// if (basepointCoord) {
|
|
1161
|
+
// transform.object_position = convertZupToYup(transform.object_position,basepointCoord)
|
|
1162
|
+
// }else{
|
|
1163
|
+
// transform.object_position = convertZupToYup(transform.object_position)
|
|
1164
|
+
// }
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
const index = _3DXObjects.findIndex(obj => obj.object.id == selected.object.id);
|
|
1168
|
+
if (index != undefined) {
|
|
1169
|
+
selected.object.coordinate_system = selectedSystem;
|
|
1170
|
+
_3DXObjects[index].object.coordinate_system = selectedSystem;
|
|
1171
|
+
setSelectedObject(_3DXObjects[index].object, _3DXObjects[index].node, _3DXObjects[index].component, '3DX');
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1143
1175
|
if (transform) {
|
|
1144
1176
|
log.info("handleConfirmTransform ", transform);
|
|
1145
|
-
|
|
1177
|
+
if (isToolbarFeatureEnabled('bim')) {
|
|
1178
|
+
const basepointCoord = getBasepoint();
|
|
1179
|
+
if (basepointCoord && selectedObject.type != 'BASEPOINT') {
|
|
1180
|
+
transform.object_position = getOffsetPositionFromBasepoint(transform.object_position, basepointCoord);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1146
1183
|
setObjectTransformation(selected.node, transform);
|
|
1147
1184
|
//clearCoordinateInputs()
|
|
1148
1185
|
//Add to the action history so it can be reverse with undo or redo
|
|
@@ -1162,12 +1199,39 @@ function handleConfirmTransform() {
|
|
|
1162
1199
|
y: transform.object_rotation.y,
|
|
1163
1200
|
z: transform.object_rotation.z
|
|
1164
1201
|
};
|
|
1202
|
+
payload.json_data = JSON.stringify({ coordinate_system: payload.coordinate_system });
|
|
1165
1203
|
payload.object_scale = transform.object_scale;
|
|
1204
|
+
console.log("======Payload: ", payload);
|
|
1166
1205
|
dispatchSpaceEvent(SPACE_EVENTS.DRAG_END, payload);
|
|
1167
1206
|
removeTransformControls();
|
|
1168
1207
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1208
|
+
if (isSettingsPaneVisible) {
|
|
1209
|
+
console.log("isSettingsPaneVisible", isSettingsPaneVisible);
|
|
1210
|
+
const basepointCoord = convertZupToYup(transform.object_position);
|
|
1211
|
+
setTempBasepoint(basepointCoord);
|
|
1212
|
+
setBasepoint(basepointCoord);
|
|
1213
|
+
const truncateToThreeDecimals = (num) => Math.floor(num * 1000) / 1000;
|
|
1214
|
+
const truncatedCoordinate = {
|
|
1215
|
+
x: truncateToThreeDecimals(basepointCoord.x),
|
|
1216
|
+
y: truncateToThreeDecimals(basepointCoord.y),
|
|
1217
|
+
z: truncateToThreeDecimals(basepointCoord.z),
|
|
1218
|
+
};
|
|
1219
|
+
displayConvertedCoordinates(truncatedCoordinate);
|
|
1220
|
+
// const index = _3DXObjects.findIndex(obj => obj.type = "BASEPOINT")
|
|
1221
|
+
// const basepoint = _3DXObjects[index]
|
|
1222
|
+
const target = _3DXObjects.find(obj => obj.type === "BASEPOINT");
|
|
1223
|
+
const basepoint = target ? JSON.parse(JSON.stringify(target.object)) : null;
|
|
1224
|
+
basepoint.coordinate_system = COORDINATE_SYSTEM.BIM;
|
|
1225
|
+
console.log("_3DXObjects", _3DXObjects);
|
|
1226
|
+
console.log("basepointObjectPayload before", basepoint);
|
|
1227
|
+
setBasepointObjectPayload(basepoint);
|
|
1228
|
+
console.log("basepointObjectPayload after", basepoint);
|
|
1229
|
+
console.log("_3DXObjects", _3DXObjects);
|
|
1230
|
+
const adjustBasepointBtn = document.getElementById('at-calibrate-basepoint-btn');
|
|
1231
|
+
adjustBasepointBtn.innerText = i18n.t('Close');
|
|
1232
|
+
goToModel(basepoint.id);
|
|
1233
|
+
setCoordinateSystemType();
|
|
1234
|
+
}
|
|
1171
1235
|
});
|
|
1172
1236
|
}
|
|
1173
1237
|
}
|
|
@@ -1178,7 +1242,7 @@ function setupSpaceEventSubscriptions() {
|
|
|
1178
1242
|
subscribeSpaceEvent(SPACE_EVENTS.TAG_MESSAGE_RETRIEVED, handleRetrieveTagMessage);
|
|
1179
1243
|
subscribeSpaceEvent(SPACE_EVENTS.TAG_LINK_GENERATED, handleCopyTagLink);
|
|
1180
1244
|
subscribeSpaceEvent(SPACE_EVENTS.VIEW_TAG_MESSAGE, handleViewTagMessage);
|
|
1181
|
-
subscribeSpaceEvent(SPACE_EVENTS.DRAG_END,
|
|
1245
|
+
subscribeSpaceEvent(SPACE_EVENTS.DRAG_END, handleDragEnd);
|
|
1182
1246
|
subscribeSpaceEvent(SPACE_EVENTS.TAGPLACER_CREATED, handleTagPlacerCreated);
|
|
1183
1247
|
subscribeSpaceEvent(SPACE_EVENTS.UPDATE_ROOM_TREE, handleUpdateRoomTree);
|
|
1184
1248
|
subscribeSpaceEvent(SPACE_EVENTS.PARTITION_CLICKED, handlePartitionSelected);
|
|
@@ -1186,6 +1250,22 @@ function setupSpaceEventSubscriptions() {
|
|
|
1186
1250
|
subscribeSpaceEvent(SPACE_EVENTS.VERTEX_PLACED, handleVertexPlace);
|
|
1187
1251
|
subscribeSpaceEvent(SPACE_EVENTS.DRAW_HISTORY, handleDrawHistory);
|
|
1188
1252
|
}
|
|
1253
|
+
function handleDragEnd(payload) {
|
|
1254
|
+
console.log("paylaod", payload);
|
|
1255
|
+
const settingsPane = document.getElementById('at-settings-pane');
|
|
1256
|
+
const isSettingsPaneVisible = isElementVisible(settingsPane);
|
|
1257
|
+
if (isSettingsPaneVisible) {
|
|
1258
|
+
const truncateToThreeDecimals = (num) => Math.floor(num * 1000) / 1000;
|
|
1259
|
+
const truncatedCoordinate = {
|
|
1260
|
+
x: truncateToThreeDecimals(payload.object_position.x),
|
|
1261
|
+
y: truncateToThreeDecimals(payload.object_position.y),
|
|
1262
|
+
z: truncateToThreeDecimals(payload.object_position.z),
|
|
1263
|
+
};
|
|
1264
|
+
displayConvertedCoordinates(truncatedCoordinate);
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
showCurrentCoordinateValue();
|
|
1268
|
+
}
|
|
1189
1269
|
function handleDrawHistory(payload) {
|
|
1190
1270
|
console.log("payload", payload);
|
|
1191
1271
|
const undoCount = (payload.undoDrawActions).length;
|
|
@@ -1215,6 +1295,7 @@ function handleVertexPlace() {
|
|
|
1215
1295
|
redoBtn.classList.add('at_disabled');
|
|
1216
1296
|
}
|
|
1217
1297
|
function handleMouseClickObject(object) {
|
|
1298
|
+
var _a, _b, _c;
|
|
1218
1299
|
log.info("handleMouseClickObject()", object);
|
|
1219
1300
|
if (object) {
|
|
1220
1301
|
let objectId;
|
|
@@ -1226,12 +1307,38 @@ function handleMouseClickObject(object) {
|
|
|
1226
1307
|
else {
|
|
1227
1308
|
objectId = object.id;
|
|
1228
1309
|
}
|
|
1229
|
-
|
|
1310
|
+
const basepoint = _3DXObjects.find(obj => obj.type === "BASEPOINT");
|
|
1311
|
+
if (basepoint) {
|
|
1312
|
+
// @ts-ignore
|
|
1313
|
+
if (object === null || object === void 0 ? void 0 : object.objectData) {
|
|
1314
|
+
// @ts-ignore
|
|
1315
|
+
if ((_a = object === null || object === void 0 ? void 0 : object.objectData) === null || _a === void 0 ? void 0 : _a.id) {
|
|
1316
|
+
// @ts-ignore
|
|
1317
|
+
if (((_b = object === null || object === void 0 ? void 0 : object.objectData) === null || _b === void 0 ? void 0 : _b.id) === ((_c = basepoint === null || basepoint === void 0 ? void 0 : basepoint.object) === null || _c === void 0 ? void 0 : _c.id)) {
|
|
1318
|
+
toggleActionBar('hide');
|
|
1319
|
+
if (!activePane) {
|
|
1320
|
+
toggleDisplayPane('at-settings-btn');
|
|
1321
|
+
setActiveMenu('at-settings-btn');
|
|
1322
|
+
}
|
|
1323
|
+
else if (activePane && activePane.id !== 'at-settings-pane') {
|
|
1324
|
+
toggleDisplayPane('at-settings-btn');
|
|
1325
|
+
setActiveMenu('at-settings-btn');
|
|
1326
|
+
}
|
|
1327
|
+
// setTimeout(removeTransformControls, 0.001)
|
|
1328
|
+
removeTransformControls();
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
console.log("basepoint, object", basepoint, object);
|
|
1230
1335
|
if (!activePane) {
|
|
1231
1336
|
toggleDisplayPane('at-object-list-btn');
|
|
1337
|
+
setActiveMenu('at-object-list-btn');
|
|
1232
1338
|
}
|
|
1233
1339
|
else if (activePane && activePane.id !== 'at-object-list-pane') {
|
|
1234
1340
|
toggleDisplayPane('at-object-list-btn');
|
|
1341
|
+
setActiveMenu('at-object-list-btn');
|
|
1235
1342
|
}
|
|
1236
1343
|
setActiveCard(`at-card-image-${objectId}`);
|
|
1237
1344
|
handleScrollToView('at-object-cards', `at-card-${objectId}`);
|
|
@@ -2117,7 +2224,15 @@ function handleCoordinateSystem() {
|
|
|
2117
2224
|
document.querySelectorAll('input[name="coordinate-system"]').forEach(input => {
|
|
2118
2225
|
input.addEventListener('change', (event) => {
|
|
2119
2226
|
const target = event.target;
|
|
2120
|
-
|
|
2227
|
+
if (target.value == "matterport") {
|
|
2228
|
+
setTempCoordinateSystem(COORDINATE_SYSTEM.MATTERPORT);
|
|
2229
|
+
}
|
|
2230
|
+
else if (target.value == "bim") {
|
|
2231
|
+
setTempCoordinateSystem(COORDINATE_SYSTEM.BIM);
|
|
2232
|
+
}
|
|
2233
|
+
else {
|
|
2234
|
+
console.error("Coordinate system not found.");
|
|
2235
|
+
}
|
|
2121
2236
|
});
|
|
2122
2237
|
});
|
|
2123
2238
|
}
|
|
@@ -2137,6 +2252,37 @@ function handleSaveActionSettings() {
|
|
|
2137
2252
|
setRotationUnit(getTempRotationUnit());
|
|
2138
2253
|
setBasepoint(getTempBasepoint());
|
|
2139
2254
|
setTempBasepoint(undefined);
|
|
2255
|
+
console.log("BASEPOINT", getBasepoint());
|
|
2256
|
+
const coord_system = getCoordinateSystem();
|
|
2257
|
+
const scale_factor = getScaleFactor();
|
|
2258
|
+
const measurement_unit = getMeasurementUnit();
|
|
2259
|
+
const rotation_unit = getRotationUnit();
|
|
2260
|
+
const basepoint = getBasepointObjectPayload();
|
|
2261
|
+
const payload = {
|
|
2262
|
+
coord_system: coord_system,
|
|
2263
|
+
scale_factor: scale_factor,
|
|
2264
|
+
measurement_unit: measurement_unit,
|
|
2265
|
+
rotation_unit: rotation_unit,
|
|
2266
|
+
project_basepoint: basepoint,
|
|
2267
|
+
};
|
|
2268
|
+
const bim = {
|
|
2269
|
+
bim: payload
|
|
2270
|
+
};
|
|
2271
|
+
const coordSystemCalibration = {
|
|
2272
|
+
coordSystemCalibration: bim
|
|
2273
|
+
};
|
|
2274
|
+
const spaceId = getSpaceId(window.location.href);
|
|
2275
|
+
console.log("coordSystemCalibration", coordSystemCalibration);
|
|
2276
|
+
dispatchSpaceEvent(SPACE_EVENTS.BASEPOINT_UPDATED, { spaceId: spaceId, payload: coordSystemCalibration });
|
|
2277
|
+
const translateControlPane = document.getElementById('at-model-control-pane');
|
|
2278
|
+
const istranslateControlPaneVisible = isElementVisible(translateControlPane);
|
|
2279
|
+
if (istranslateControlPaneVisible) {
|
|
2280
|
+
toggleModelControl(false, 'translate');
|
|
2281
|
+
}
|
|
2282
|
+
// menu bar
|
|
2283
|
+
toggleActionSettings(false);
|
|
2284
|
+
clearActiveMenu('at-save-settings');
|
|
2285
|
+
notyf.success(`${i18n.t('SuccessSettingsSaved')}`);
|
|
2140
2286
|
});
|
|
2141
2287
|
}
|
|
2142
2288
|
function handleCalibrateBasepoint() {
|
|
@@ -2146,6 +2292,26 @@ function handleCalibrateBasepoint() {
|
|
|
2146
2292
|
toggleCalibrateBasepoint();
|
|
2147
2293
|
});
|
|
2148
2294
|
}
|
|
2295
|
+
function handleObjectCoordinateSystem() {
|
|
2296
|
+
document.querySelectorAll('input[name="obj-coordinate-system"]').forEach(input => {
|
|
2297
|
+
input.addEventListener('change', (event) => {
|
|
2298
|
+
const target = event.target;
|
|
2299
|
+
if (target.value) {
|
|
2300
|
+
setSelectedObjectCoordinateSystem(target.value);
|
|
2301
|
+
// getObjectCoordinateSystem(target.value)
|
|
2302
|
+
}
|
|
2303
|
+
});
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
function handleConfirmObjectUpdate() {
|
|
2307
|
+
const confirmCoordPost = document.getElementById('at-confirm-transform');
|
|
2308
|
+
if (confirmCoordPost) {
|
|
2309
|
+
confirmCoordPost.addEventListener('click', () => {
|
|
2310
|
+
console.log("====This is clicked");
|
|
2311
|
+
updateDisplayedCoordinates();
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2149
2315
|
export {
|
|
2150
2316
|
//state
|
|
2151
2317
|
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt,
|
package/lib/types.d.ts
CHANGED
|
@@ -233,6 +233,7 @@ export interface IShowcaseObject {
|
|
|
233
233
|
is_new: boolean;
|
|
234
234
|
object_data: I3DObject;
|
|
235
235
|
coordinate_system?: string;
|
|
236
|
+
json_data?: string;
|
|
236
237
|
}
|
|
237
238
|
export interface IVideoObject {
|
|
238
239
|
data: IShowcaseObject;
|
|
@@ -376,6 +377,7 @@ export interface ObjectConfig {
|
|
|
376
377
|
rotation?: Vector3;
|
|
377
378
|
id?: number;
|
|
378
379
|
object_uuid?: string;
|
|
380
|
+
json_data?: string;
|
|
379
381
|
}
|
|
380
382
|
export interface ComponentOptions {
|
|
381
383
|
name?: string | undefined;
|
|
@@ -705,7 +707,8 @@ export declare enum SPACE_EVENTS {
|
|
|
705
707
|
PARTITION_CLICKED = "PARTITION_CLICKED",
|
|
706
708
|
PARTITION_DISPOSED = "PARTITION_DISPOSED",
|
|
707
709
|
PARTITION_RENDERED = "PARTITION_RENDERED",
|
|
708
|
-
DRAW_HISTORY = "DRAW_HISTORY"
|
|
710
|
+
DRAW_HISTORY = "DRAW_HISTORY",
|
|
711
|
+
BASEPOINT_UPDATED = "BASEPOINT_UPDATED"
|
|
709
712
|
}
|
|
710
713
|
export declare const enum TAG_COLOR {
|
|
711
714
|
MAROON = "MAROON",
|
|
@@ -1075,3 +1078,29 @@ export interface PartitionNode {
|
|
|
1075
1078
|
created_on?: string;
|
|
1076
1079
|
modified_on?: string;
|
|
1077
1080
|
}
|
|
1081
|
+
export interface ICoordinateSystemCalibration {
|
|
1082
|
+
coord_system: string;
|
|
1083
|
+
scale_factor: string;
|
|
1084
|
+
measurement_unit: string;
|
|
1085
|
+
rotation_unit: string;
|
|
1086
|
+
project_basepoint: IShowcaseObject;
|
|
1087
|
+
}
|
|
1088
|
+
export interface ICurrentSpace {
|
|
1089
|
+
uuid: string;
|
|
1090
|
+
access_token: string;
|
|
1091
|
+
folder_uuid: string;
|
|
1092
|
+
owner_uuid: string;
|
|
1093
|
+
space_sid: string;
|
|
1094
|
+
space_name: string;
|
|
1095
|
+
space_url: string;
|
|
1096
|
+
space_image?: string;
|
|
1097
|
+
memo1?: string;
|
|
1098
|
+
memo2?: string;
|
|
1099
|
+
modified_on?: string;
|
|
1100
|
+
created_on?: string;
|
|
1101
|
+
hidden?: boolean;
|
|
1102
|
+
}
|
|
1103
|
+
export declare enum COORDINATE_SYSTEM {
|
|
1104
|
+
MATTERPORT = "YUP",
|
|
1105
|
+
BIM = "ZUP"
|
|
1106
|
+
}
|
package/lib/types.js
CHANGED
|
@@ -95,6 +95,7 @@ export var SPACE_EVENTS;
|
|
|
95
95
|
SPACE_EVENTS["PARTITION_DISPOSED"] = "PARTITION_DISPOSED";
|
|
96
96
|
SPACE_EVENTS["PARTITION_RENDERED"] = "PARTITION_RENDERED";
|
|
97
97
|
SPACE_EVENTS["DRAW_HISTORY"] = "DRAW_HISTORY";
|
|
98
|
+
SPACE_EVENTS["BASEPOINT_UPDATED"] = "BASEPOINT_UPDATED";
|
|
98
99
|
})(SPACE_EVENTS || (SPACE_EVENTS = {}));
|
|
99
100
|
export var MEETING_SIDEBAR;
|
|
100
101
|
(function (MEETING_SIDEBAR) {
|
|
@@ -110,3 +111,8 @@ export var ZOOM_COMMAND;
|
|
|
110
111
|
ZOOM_COMMAND["TOGGLE_VIDEO_OFF"] = "TOGGLE VIDEO OFF";
|
|
111
112
|
ZOOM_COMMAND["TOGGLE_MIC_OFF"] = "TOGGLE MIC OFF";
|
|
112
113
|
})(ZOOM_COMMAND || (ZOOM_COMMAND = {}));
|
|
114
|
+
export var COORDINATE_SYSTEM;
|
|
115
|
+
(function (COORDINATE_SYSTEM) {
|
|
116
|
+
COORDINATE_SYSTEM["MATTERPORT"] = "YUP";
|
|
117
|
+
COORDINATE_SYSTEM["BIM"] = "ZUP";
|
|
118
|
+
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
package/lib/worldConversion.d.ts
CHANGED
package/lib/worldConversion.js
CHANGED
|
@@ -137,3 +137,26 @@ export function convertYupScaleToZupScale(scale, unit = 'm', scaleFactor = 1) {
|
|
|
137
137
|
z: scaleY
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
+
export function getOffsetPositionFromBasepoint(position, basePoint, unit = 'm', scaleFactor = 1) {
|
|
141
|
+
if (!position) {
|
|
142
|
+
log.error("position is undefined");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (!basePoint) {
|
|
146
|
+
log.error("basepoint is undefined");
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const unitConverter = getUnitConverter(unit);
|
|
150
|
+
const baseX = unitConverter(basePoint.x) * scaleFactor;
|
|
151
|
+
const baseY = unitConverter(basePoint.y) * scaleFactor;
|
|
152
|
+
const baseZ = unitConverter(basePoint.z) * scaleFactor;
|
|
153
|
+
// Apply base point offset
|
|
154
|
+
const x = position.x - baseX;
|
|
155
|
+
const y = position.y - baseY;
|
|
156
|
+
const z = position.z - baseZ;
|
|
157
|
+
return {
|
|
158
|
+
x,
|
|
159
|
+
y,
|
|
160
|
+
z
|
|
161
|
+
};
|
|
162
|
+
}
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED
|
@@ -1598,6 +1598,11 @@
|
|
|
1598
1598
|
margin-right: 25px;
|
|
1599
1599
|
margin-left: 25px;
|
|
1600
1600
|
}
|
|
1601
|
+
|
|
1602
|
+
.at_mt_static_text_container.hidden{
|
|
1603
|
+
display: none;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1601
1606
|
.at_mt_cal_text{
|
|
1602
1607
|
background: var(--text-color-light);
|
|
1603
1608
|
color: var(--bg-secondary-azusa);
|