architwin 1.10.14 → 1.10.16
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 +3 -3
- package/lib/architwin.js +58 -47
- package/lib/atwinui/components/toolbar/actionSettingsPane.js +46 -7
- package/lib/atwinui/components/toolbar/basepointCalibratePane.js +15 -4
- package/lib/atwinui/components/toolbar/card.js +13 -1
- package/lib/atwinui/components/toolbar/modelControlsPane.d.ts +4 -3
- package/lib/atwinui/components/toolbar/modelControlsPane.js +212 -227
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +20 -13
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.js +37 -37
- package/lib/atwinui/events.js +138 -101
- package/lib/loaders/polydrawerLoader.js +33 -20
- package/lib/types.d.ts +3 -1
- package/lib/types.js +2 -0
- package/lib/worldConversion.js +6 -6
- package/package.json +1 -1
package/lib/architwin.d.ts
CHANGED
|
@@ -463,7 +463,7 @@ declare function getCurrentPolygon(): IObjectData;
|
|
|
463
463
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
464
464
|
* @param {string} name - name of the model
|
|
465
465
|
*/
|
|
466
|
-
declare function toggleMeshChildrenVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
|
|
466
|
+
declare function toggleMeshChildrenVisibility(component: MpSdk.Scene.IComponent, name: string, visible?: boolean): boolean;
|
|
467
467
|
/**
|
|
468
468
|
* Updates the value of a property of a child of the mesh
|
|
469
469
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
@@ -478,13 +478,13 @@ declare function setMeshChildrenMaterialProperty(component: MpSdk.Scene.ICompone
|
|
|
478
478
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
479
479
|
* @param {string} name - name of the model
|
|
480
480
|
*/
|
|
481
|
-
declare function toggleWallVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
|
|
481
|
+
declare function toggleWallVisibility(component: MpSdk.Scene.IComponent, name: string, visible?: boolean): boolean;
|
|
482
482
|
/**
|
|
483
483
|
* Wrapper function around toggleMeshChildrenVisibility
|
|
484
484
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
485
485
|
* @param {string} name - name of the model
|
|
486
486
|
*/
|
|
487
|
-
declare function toggleFloorVisibility(component: MpSdk.Scene.IComponent, name: string): boolean;
|
|
487
|
+
declare function toggleFloorVisibility(component: MpSdk.Scene.IComponent, name: string, visible?: boolean): boolean;
|
|
488
488
|
/**
|
|
489
489
|
* Returns the children of a model's component
|
|
490
490
|
* @param component
|
package/lib/architwin.js
CHANGED
|
@@ -442,7 +442,6 @@ function loadDefaultMpSpace(url, config, showcase, callbacks = undefined) {
|
|
|
442
442
|
_atwinConnections[showcase.id] = _atwin;
|
|
443
443
|
log.info("Hello Bundle SDK", _atwin);
|
|
444
444
|
_atwin.App.state.subscribe((appState) => __awaiter(this, void 0, void 0, function* () {
|
|
445
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
446
445
|
log.info("appState", appState);
|
|
447
446
|
if (appState.phase === _atwin.App.Phase.LOADING) {
|
|
448
447
|
log.info("App is loading...");
|
|
@@ -757,33 +756,9 @@ function loadDefaultMpSpace(url, config, showcase, callbacks = undefined) {
|
|
|
757
756
|
initToolbarUI({ objects: spaceObjects });
|
|
758
757
|
themeManager(_mpConfig.toolbarConfig.themeConfig);
|
|
759
758
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
// setCoordinateSystem()
|
|
764
|
-
console.log("spaceJsonData?.coordSystemCalibration?.bim", (_b = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _b === void 0 ? void 0 : _b.bim);
|
|
765
|
-
setCoordinateSystem((_c = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _c === void 0 ? void 0 : _c.bim.coord_system);
|
|
766
|
-
setScaleFactor((_d = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _d === void 0 ? void 0 : _d.bim.scale_factor);
|
|
767
|
-
setRotationUnit((_e = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _e === void 0 ? void 0 : _e.bim.rotation_unit);
|
|
768
|
-
setMeasurementUnit((_f = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _f === void 0 ? void 0 : _f.bim.measurement_unit);
|
|
769
|
-
setTempCoordinateSystem((_g = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _g === void 0 ? void 0 : _g.bim.coord_system);
|
|
770
|
-
setTempScaleFactor((_h = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _h === void 0 ? void 0 : _h.bim.scale_factor);
|
|
771
|
-
setTempRotationUnit((_j = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _j === void 0 ? void 0 : _j.bim.rotation_unit);
|
|
772
|
-
setTempMeasurementUnit((_k = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _k === void 0 ? void 0 : _k.bim.measurement_unit);
|
|
773
|
-
if ((_l = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _l === void 0 ? void 0 : _l.bim.project_base) {
|
|
774
|
-
setBasepoint((_m = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _m === void 0 ? void 0 : _m.bim.project_base);
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
if ((_o = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _o === void 0 ? void 0 : _o.bim.mp_project_base) {
|
|
778
|
-
console.log("THERE IS A BASEPOINT");
|
|
779
|
-
const index = _3DXObjects.findIndex(obj => obj.object.object_data.amazon_uri == "https://cdn.jsdelivr.net/npm/architwin@latest/static/images/basepointmarker.png");
|
|
780
|
-
console.log("_3DXObjects", _3DXObjects[index], index);
|
|
781
|
-
if (index != -1) {
|
|
782
|
-
_3DXObjects[index].type = "BASEPOINT";
|
|
783
|
-
}
|
|
784
|
-
setBasepointObjectPayload((_p = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _p === void 0 ? void 0 : _p.bim.mp_project_base);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
759
|
+
}
|
|
760
|
+
if (isToolbarFeatureEnabled('bim')) {
|
|
761
|
+
initBimSettings();
|
|
787
762
|
}
|
|
788
763
|
}));
|
|
789
764
|
return _atwin;
|
|
@@ -3552,7 +3527,7 @@ function addObjectToSpace(mediaUrl, objectType, config = undefined, object_data)
|
|
|
3552
3527
|
if (config) {
|
|
3553
3528
|
if (config.json_data) {
|
|
3554
3529
|
const jsonData = JSON.parse(config.json_data);
|
|
3555
|
-
console.log("__@
|
|
3530
|
+
console.log("__@ jsonData: ", jsonData);
|
|
3556
3531
|
showcase_object.json_data = config.json_data;
|
|
3557
3532
|
if (jsonData.coordSystemCalibration) {
|
|
3558
3533
|
const thisCoordSystemCal = jsonData.coordSystemCalibration;
|
|
@@ -5028,10 +5003,10 @@ function goToModel(objectId) {
|
|
|
5028
5003
|
const target = _3DXObjects.find(obj => obj.object.id === objectId || obj.object.media_viewer_id === objectId);
|
|
5029
5004
|
if (target) {
|
|
5030
5005
|
const noBillboardTag = target.node.id;
|
|
5031
|
-
_atwin.Tag.allowAction(noBillboardTag, {
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
});
|
|
5006
|
+
// _atwin.Tag.allowAction(noBillboardTag, {
|
|
5007
|
+
// navigating: true,
|
|
5008
|
+
// // implies opening: false, etc
|
|
5009
|
+
// });
|
|
5035
5010
|
}
|
|
5036
5011
|
log.info("goToModel ", target);
|
|
5037
5012
|
if (target.node.position.x || target.node.position.y || target.node.position.z) {
|
|
@@ -5929,7 +5904,7 @@ function addVertex(name, path) {
|
|
|
5929
5904
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
5930
5905
|
* @param {string} name - name of the model
|
|
5931
5906
|
*/
|
|
5932
|
-
function toggleMeshChildrenVisibility(component, name) {
|
|
5907
|
+
function toggleMeshChildrenVisibility(component, name, visible) {
|
|
5933
5908
|
if (!component) {
|
|
5934
5909
|
log.error("Component is undefined");
|
|
5935
5910
|
return;
|
|
@@ -5941,7 +5916,7 @@ function toggleMeshChildrenVisibility(component, name) {
|
|
|
5941
5916
|
//@ts-expect-error
|
|
5942
5917
|
component.mesh.children.forEach(child => {
|
|
5943
5918
|
if (child.name == name) {
|
|
5944
|
-
child.visible = !child.visible;
|
|
5919
|
+
child.visible = visible !== undefined ? visible : !child.visible;
|
|
5945
5920
|
return child.visible;
|
|
5946
5921
|
}
|
|
5947
5922
|
});
|
|
@@ -6013,7 +5988,7 @@ function setMeshChildrenMaterialProperty(component, name, key, value) {
|
|
|
6013
5988
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
6014
5989
|
* @param {string} name - name of the model
|
|
6015
5990
|
*/
|
|
6016
|
-
function toggleWallVisibility(component, name) {
|
|
5991
|
+
function toggleWallVisibility(component, name, visible) {
|
|
6017
5992
|
if (!component) {
|
|
6018
5993
|
log.error("Component is undefined");
|
|
6019
5994
|
return;
|
|
@@ -6022,10 +5997,10 @@ function toggleWallVisibility(component, name) {
|
|
|
6022
5997
|
log.error("name is undefined");
|
|
6023
5998
|
return;
|
|
6024
5999
|
}
|
|
6025
|
-
const state = toggleMeshChildrenVisibility(component, name);
|
|
6000
|
+
const state = toggleMeshChildrenVisibility(component, name, visible);
|
|
6026
6001
|
// const wallLabelName = replaceWordInString(name,'wall','wallLabel')
|
|
6027
6002
|
const wallLabelName = name.replace("wall", "wallLabel");
|
|
6028
|
-
toggleMeshChildrenVisibility(component, wallLabelName);
|
|
6003
|
+
toggleMeshChildrenVisibility(component, wallLabelName, visible);
|
|
6029
6004
|
return state;
|
|
6030
6005
|
}
|
|
6031
6006
|
/**
|
|
@@ -6033,7 +6008,7 @@ function toggleWallVisibility(component, name) {
|
|
|
6033
6008
|
* @param {MpSdk.Scene.IComponent} component - Component of the model
|
|
6034
6009
|
* @param {string} name - name of the model
|
|
6035
6010
|
*/
|
|
6036
|
-
function toggleFloorVisibility(component, name) {
|
|
6011
|
+
function toggleFloorVisibility(component, name, visible) {
|
|
6037
6012
|
log.info("TEST toggleFloorVisibility: ", component, name);
|
|
6038
6013
|
if (!component) {
|
|
6039
6014
|
log.error("Component is undefined");
|
|
@@ -6043,7 +6018,7 @@ function toggleFloorVisibility(component, name) {
|
|
|
6043
6018
|
log.error("name is undefined");
|
|
6044
6019
|
return;
|
|
6045
6020
|
}
|
|
6046
|
-
const state = toggleMeshChildrenVisibility(component, name);
|
|
6021
|
+
const state = toggleMeshChildrenVisibility(component, name, visible);
|
|
6047
6022
|
//@ts-expect-error
|
|
6048
6023
|
const edgeCount = component.inputs.path.length;
|
|
6049
6024
|
if (edgeCount !== undefined) {
|
|
@@ -6052,13 +6027,13 @@ function toggleFloorVisibility(component, name) {
|
|
|
6052
6027
|
if (parts.length > 1) {
|
|
6053
6028
|
const uuid = parts[0];
|
|
6054
6029
|
for (let index = 0; index < edgeCount; index++) {
|
|
6055
|
-
toggleMeshChildrenVisibility(component, `${uuid}_edgeLabel-${index}
|
|
6030
|
+
toggleMeshChildrenVisibility(component, `${uuid}_edgeLabel-${index}`, visible);
|
|
6056
6031
|
}
|
|
6057
6032
|
}
|
|
6058
6033
|
else {
|
|
6059
6034
|
for (let index = 0; index < edgeCount; index++) {
|
|
6060
6035
|
edgeLabelNames.push(`edgeLabel-${index}`);
|
|
6061
|
-
toggleMeshChildrenVisibility(component, `edgeLabel-${index}
|
|
6036
|
+
toggleMeshChildrenVisibility(component, `edgeLabel-${index}`, visible);
|
|
6062
6037
|
}
|
|
6063
6038
|
}
|
|
6064
6039
|
}
|
|
@@ -6302,7 +6277,7 @@ function handleKeyDown(event) {
|
|
|
6302
6277
|
isCtrlPressed = true;
|
|
6303
6278
|
toggleSpaceNavigation(false);
|
|
6304
6279
|
}
|
|
6305
|
-
if (event.
|
|
6280
|
+
if (event.key == 'Alt') {
|
|
6306
6281
|
log.info("Alt key down");
|
|
6307
6282
|
isAltPressed = true;
|
|
6308
6283
|
toggleSpaceNavigation(false);
|
|
@@ -6336,18 +6311,19 @@ function handleKeyDown(event) {
|
|
|
6336
6311
|
lastKeyPressed = event.key;
|
|
6337
6312
|
}
|
|
6338
6313
|
function handleKeyUp(event) {
|
|
6314
|
+
log.info("handleKeyUp() ", event);
|
|
6339
6315
|
if (event.key === "Control") {
|
|
6340
|
-
log.info("Ctrl key
|
|
6316
|
+
log.info("Ctrl key up");
|
|
6341
6317
|
isCtrlPressed = false;
|
|
6342
6318
|
toggleSpaceNavigation(true);
|
|
6343
6319
|
}
|
|
6344
|
-
if (event.
|
|
6345
|
-
log.info("Alt key
|
|
6320
|
+
if (event.key == 'Alt') {
|
|
6321
|
+
log.info("Alt key up");
|
|
6346
6322
|
isAltPressed = false;
|
|
6347
6323
|
toggleSpaceNavigation(true);
|
|
6348
6324
|
}
|
|
6349
6325
|
if (event.key === "Shift") {
|
|
6350
|
-
log.info("Ctrl key
|
|
6326
|
+
log.info("Ctrl key up");
|
|
6351
6327
|
isShiftPressed = false;
|
|
6352
6328
|
}
|
|
6353
6329
|
}
|
|
@@ -6362,6 +6338,41 @@ function setupKeybindingEventListeners(iframe) {
|
|
|
6362
6338
|
window.addEventListener('keydown', handleKeyDown);
|
|
6363
6339
|
window.addEventListener('keyup', handleKeyUp);
|
|
6364
6340
|
}
|
|
6341
|
+
function initBimSettings() {
|
|
6342
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
6343
|
+
try {
|
|
6344
|
+
if (_currentSpace && _currentSpace.json_data) {
|
|
6345
|
+
const spaceJsonData = JSON.parse(_currentSpace.json_data);
|
|
6346
|
+
if ((_a = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _a === void 0 ? void 0 : _a.bim) {
|
|
6347
|
+
// setCoordinateSystem()
|
|
6348
|
+
log.info("spaceJsonData?.coordSystemCalibration?.bim", (_b = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _b === void 0 ? void 0 : _b.bim);
|
|
6349
|
+
setCoordinateSystem((_c = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _c === void 0 ? void 0 : _c.bim.coord_system);
|
|
6350
|
+
setScaleFactor((_d = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _d === void 0 ? void 0 : _d.bim.scale_factor);
|
|
6351
|
+
setRotationUnit((_e = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _e === void 0 ? void 0 : _e.bim.rotation_unit);
|
|
6352
|
+
setMeasurementUnit((_f = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _f === void 0 ? void 0 : _f.bim.measurement_unit);
|
|
6353
|
+
setTempCoordinateSystem((_g = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _g === void 0 ? void 0 : _g.bim.coord_system);
|
|
6354
|
+
setTempScaleFactor((_h = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _h === void 0 ? void 0 : _h.bim.scale_factor);
|
|
6355
|
+
setTempRotationUnit((_j = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _j === void 0 ? void 0 : _j.bim.rotation_unit);
|
|
6356
|
+
setTempMeasurementUnit((_k = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _k === void 0 ? void 0 : _k.bim.measurement_unit);
|
|
6357
|
+
if ((_l = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _l === void 0 ? void 0 : _l.bim.project_base) {
|
|
6358
|
+
setBasepoint((_m = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _m === void 0 ? void 0 : _m.bim.project_base);
|
|
6359
|
+
}
|
|
6360
|
+
}
|
|
6361
|
+
if ((_o = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _o === void 0 ? void 0 : _o.bim.mp_project_base) {
|
|
6362
|
+
console.log("THERE IS A BASEPOINT");
|
|
6363
|
+
const index = _3DXObjects.findIndex(obj => obj.object.object_data.amazon_uri == "https://cdn.jsdelivr.net/npm/architwin@latest/static/images/basepointmarker.png");
|
|
6364
|
+
log.info("_3DXObjects", _3DXObjects[index], index);
|
|
6365
|
+
if (index != -1) {
|
|
6366
|
+
_3DXObjects[index].type = "BASEPOINT";
|
|
6367
|
+
}
|
|
6368
|
+
setBasepointObjectPayload((_p = spaceJsonData === null || spaceJsonData === void 0 ? void 0 : spaceJsonData.coordSystemCalibration) === null || _p === void 0 ? void 0 : _p.bim.mp_project_base);
|
|
6369
|
+
}
|
|
6370
|
+
}
|
|
6371
|
+
}
|
|
6372
|
+
catch (error) {
|
|
6373
|
+
log.error("initBimSettings error ", error);
|
|
6374
|
+
}
|
|
6375
|
+
}
|
|
6365
6376
|
//===================== END KEYBINDING =========================//
|
|
6366
6377
|
//===================== START TAGS =========================//
|
|
6367
6378
|
// set tag icon
|
|
@@ -107,10 +107,16 @@ export function renderActionSettingsPane() {
|
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
|
|
110
|
-
<div class="
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
<div class="at_button_row at_justify_between" >
|
|
111
|
+
<div class="at_button at_ghost" id="at-cancel-settings" data-cy="at-save-settings">
|
|
112
|
+
${i18n.t('Cancel')}
|
|
113
|
+
<span class="mdi mdi-close-circle-outline"></span>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="at_button at_ghost" id="at-save-settings" data-cy="at-save-settings">
|
|
116
|
+
${i18n.t('Save')}
|
|
117
|
+
<span class="mdi mdi-content-save"></span>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
114
120
|
`;
|
|
115
121
|
return element;
|
|
116
122
|
}
|
|
@@ -192,6 +198,7 @@ export function initSettingsValues() {
|
|
|
192
198
|
// set measurement unit
|
|
193
199
|
const measurementUnitElement = document.getElementById(`at-selected-measurement-unit-text`);
|
|
194
200
|
let measurementUnitValue = `${i18n.t('Meter')}`;
|
|
201
|
+
console.log("=============measurement from document", measurementUnitValue, measurementUnit == UNITS.METER);
|
|
195
202
|
if (measurementUnit == UNITS.METER) {
|
|
196
203
|
measurementUnitValue = `${i18n.t('Meter')}`;
|
|
197
204
|
}
|
|
@@ -530,7 +537,10 @@ export function setCoordinateSystem(value) {
|
|
|
530
537
|
coordinateSystem = value;
|
|
531
538
|
let text = value;
|
|
532
539
|
text = text.charAt(0).toUpperCase() + text.substring(1).toLowerCase();
|
|
533
|
-
document.getElementById('at-coordinate-system-text')
|
|
540
|
+
const el = document.getElementById('at-coordinate-system-text');
|
|
541
|
+
if (el) {
|
|
542
|
+
el.innerText = `${i18n.t("CoordinateSystem")}: ${i18n.t(text)}`;
|
|
543
|
+
}
|
|
534
544
|
console.log("Coordinate System set to:", value);
|
|
535
545
|
}
|
|
536
546
|
export function getScaleFactor() {
|
|
@@ -544,7 +554,21 @@ export function getMeasurementUnit() {
|
|
|
544
554
|
return measurementUnit;
|
|
545
555
|
}
|
|
546
556
|
export function setMeasurementUnit(value) {
|
|
547
|
-
|
|
557
|
+
if (value == 'm') {
|
|
558
|
+
measurementUnit = UNITS.METER;
|
|
559
|
+
}
|
|
560
|
+
else if (value == 'mm') {
|
|
561
|
+
measurementUnit = UNITS.MILLIMETER;
|
|
562
|
+
}
|
|
563
|
+
else if (value == 'cm') {
|
|
564
|
+
measurementUnit = UNITS.CENTIMETER;
|
|
565
|
+
}
|
|
566
|
+
else if (value == 'ft') {
|
|
567
|
+
measurementUnit = UNITS.FOOT;
|
|
568
|
+
}
|
|
569
|
+
else if (value == 'in') {
|
|
570
|
+
measurementUnit = UNITS.INCH;
|
|
571
|
+
}
|
|
548
572
|
console.log("Measurement Unit set to:", value);
|
|
549
573
|
}
|
|
550
574
|
export function getRotationUnit() {
|
|
@@ -567,7 +591,22 @@ export function getTempScaleFactor() {
|
|
|
567
591
|
return tempScaleFactor;
|
|
568
592
|
}
|
|
569
593
|
export function setTempMeasurementUnit(value) {
|
|
570
|
-
|
|
594
|
+
if (value == 'm') {
|
|
595
|
+
tempMeasurementUnit = UNITS.METER;
|
|
596
|
+
}
|
|
597
|
+
else if (value == 'mm') {
|
|
598
|
+
tempMeasurementUnit = UNITS.MILLIMETER;
|
|
599
|
+
}
|
|
600
|
+
else if (value == 'cm') {
|
|
601
|
+
tempMeasurementUnit = UNITS.CENTIMETER;
|
|
602
|
+
}
|
|
603
|
+
else if (value == 'ft') {
|
|
604
|
+
tempMeasurementUnit = UNITS.FOOT;
|
|
605
|
+
}
|
|
606
|
+
else if (value == 'in') {
|
|
607
|
+
tempMeasurementUnit = UNITS.INCH;
|
|
608
|
+
}
|
|
609
|
+
console.log("Temp Measurement Unit set to:", value);
|
|
571
610
|
}
|
|
572
611
|
export function getTempMeasurementUnit() {
|
|
573
612
|
return tempMeasurementUnit;
|
|
@@ -2,7 +2,7 @@ import { Notyf } from "notyf";
|
|
|
2
2
|
import i18n from "./i18n";
|
|
3
3
|
import { _3DXObjects, getSelectedObject } from "../../../architwin";
|
|
4
4
|
import { UNITS } from "../../../types";
|
|
5
|
-
import { getMeasurementUnit, getTempBasepoint, getTempMeasurementUnit } from "./actionSettingsPane";
|
|
5
|
+
import { getBasepoint, getMeasurementUnit, getTempBasepoint, getTempMeasurementUnit } from "./actionSettingsPane";
|
|
6
6
|
import { convertMeasurement } from "../../../utils";
|
|
7
7
|
let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500 });
|
|
8
8
|
export function renderBasepointCalibratePane() {
|
|
@@ -91,12 +91,23 @@ export function initBsepointCalibratePane() {
|
|
|
91
91
|
const measurementUnit = getMeasurementUnit();
|
|
92
92
|
const tempMeasurementUnit = getTempMeasurementUnit();
|
|
93
93
|
const tempBasepoint = getTempBasepoint();
|
|
94
|
+
const basepoint = getBasepoint();
|
|
95
|
+
let bpXValues;
|
|
96
|
+
let bpYValues;
|
|
97
|
+
let bpZValues;
|
|
98
|
+
if (tempBasepoint) {
|
|
99
|
+
bpXValues = tempBasepoint.x;
|
|
100
|
+
bpYValues = tempBasepoint.y;
|
|
101
|
+
bpZValues = tempBasepoint.z;
|
|
102
|
+
}
|
|
103
|
+
else if (basepoint) {
|
|
104
|
+
bpXValues = basepoint.x;
|
|
105
|
+
bpYValues = basepoint.y;
|
|
106
|
+
bpZValues = basepoint.z;
|
|
107
|
+
}
|
|
94
108
|
let mpXValues = object.object.object_position.x;
|
|
95
109
|
let mpYValues = object.object.object_position.y;
|
|
96
110
|
let mpZValues = object.object.object_position.z;
|
|
97
|
-
let bpXValues = tempBasepoint.x;
|
|
98
|
-
let bpYValues = tempBasepoint.y;
|
|
99
|
-
let bpZValues = tempBasepoint.z;
|
|
100
111
|
if (measurementUnit != UNITS.METER) {
|
|
101
112
|
// if(tempMeasurementUnit == measurementUnit){
|
|
102
113
|
mpXValues = convertMeasurement(mpXValues, UNITS.METER, measurementUnit);
|
|
@@ -7,12 +7,13 @@ 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 { goToModel, setSelectedObject, get3DXObjects, getLibrary, getTargetPosition, addObjectToSpace, _mpConfig, dispatchSpaceEvent, removeTransformControls, _onMouseClickInstance, cancelModelPlacement } from "../../../architwin";
|
|
10
|
+
import { goToModel, setSelectedObject, get3DXObjects, getLibrary, getTargetPosition, addObjectToSpace, _mpConfig, dispatchSpaceEvent, removeTransformControls, _onMouseClickInstance, cancelModelPlacement, isToolbarFeatureEnabled, convertYupToZup } from "../../../architwin";
|
|
11
11
|
import { SPACE_EVENTS } from "../../../types";
|
|
12
12
|
import { toggleDisplayPane, cancelModelPlacementPrompt } from "../../events";
|
|
13
13
|
import { clearActiveActionBtn } from "./actionBar";
|
|
14
14
|
import { Notyf } from 'notyf';
|
|
15
15
|
import i18n from './i18n';
|
|
16
|
+
import { getBasepoint, getCoordinateSystem, getMPBasepoint } from "./actionSettingsPane";
|
|
16
17
|
let activeCard, activeLibraryCard;
|
|
17
18
|
let _basePath = '../../../../architwin/static';
|
|
18
19
|
export function renderObjectCard(payload, objectComponent) {
|
|
@@ -250,6 +251,17 @@ export function setActiveLibraryCard(cardId) {
|
|
|
250
251
|
yield getTargetPosition((coords) => __awaiter(this, void 0, void 0, function* () {
|
|
251
252
|
const payload = yield addObjectToSpace(selectedObject.amazon_uri, selectedObject.object_type, { position: coords });
|
|
252
253
|
payload.object_data = selectedObject;
|
|
254
|
+
if (isToolbarFeatureEnabled('bim')) {
|
|
255
|
+
payload.coordinate_system = getCoordinateSystem();
|
|
256
|
+
const thisObjBimPosition = convertYupToZup(payload.object_position, getMPBasepoint(), getBasepoint());
|
|
257
|
+
console.log("======thisObjBimPosition: ", thisObjBimPosition);
|
|
258
|
+
const coordPayload = {
|
|
259
|
+
coord_system: getCoordinateSystem(),
|
|
260
|
+
bim_coordinates: thisObjBimPosition
|
|
261
|
+
};
|
|
262
|
+
payload.json_data = JSON.stringify({ coordSystemCalibration: coordPayload });
|
|
263
|
+
}
|
|
264
|
+
console.log("======Payload:", payload);
|
|
253
265
|
dispatchSpaceEvent(SPACE_EVENTS.MODEL_RENDERED, { model: payload });
|
|
254
266
|
clearActiveLibraryCard();
|
|
255
267
|
toggleDisplayPane('at-cancel-library-btn');
|
|
@@ -9,9 +9,10 @@ export declare function getCoordinateValues(): Object3DPosition;
|
|
|
9
9
|
export declare function clearCoordinateInputs(): void;
|
|
10
10
|
export declare function showCurrentCoordinateValue(payload?: IShowcaseObject): void;
|
|
11
11
|
export declare function handleModelControlInputs(): void;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function updateSelectedObject(): void;
|
|
13
13
|
export declare function getSelectedObjectCoordinateSystem(): any;
|
|
14
14
|
export declare function setSelectedObjectCoordinateSystem(payload: string): void;
|
|
15
15
|
export declare function setCoordinateSystemType(): void;
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
16
|
+
export declare function displayConvertedObjectCoordinates(): void;
|
|
17
|
+
export declare function setConvertedBimPosition(bimPos: Vector3): void;
|
|
18
|
+
export declare function getConvertedBimPosition(): Vector3;
|