architwin 1.13.10 → 1.13.12
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/actionHistory.d.ts +1 -0
- package/lib/actionHistory.js +4 -1
- package/lib/actionPathHistory.d.ts +18 -0
- package/lib/actionPathHistory.js +64 -0
- package/lib/architwin.d.ts +5 -1
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/card.js +5 -0
- package/lib/atwinui/components/toolbar/i18n.js +32 -24
- package/lib/atwinui/components/toolbar/menuBar.js +5 -5
- package/lib/atwinui/components/toolbar/modelControlsPane.js +19 -19
- package/lib/atwinui/components/toolbar/pipeFormPane.d.ts +2 -0
- package/lib/atwinui/components/toolbar/pipeFormPane.js +73 -61
- package/lib/atwinui/components/toolbar/pipeListPane.d.ts +3 -0
- package/lib/atwinui/components/toolbar/pipeListPane.js +57 -43
- package/lib/atwinui/components/toolbar/screenSharePane.d.ts +3 -1
- package/lib/atwinui/components/toolbar/screenSharePane.js +91 -39
- package/lib/atwinui/components/toolbar/spaceUserListPane.js +1 -1
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +5 -5
- package/lib/atwinui/events.js +19 -11
- package/lib/loaders/polydrawerLoader.js +2 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +7 -0
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ import { Notyf } from 'notyf';
|
|
|
16
16
|
import i18n from './i18n';
|
|
17
17
|
import { getBasepoint, getCoordinateSystem, getMeasurementUnit, getMPBasepoint, getScaleFactor } from "./actionSettingsPane";
|
|
18
18
|
import { convertYupScaleToZupScale } from "../../../worldConversion";
|
|
19
|
+
import { toggleActionBarButtons } from "../../components/toolbar";
|
|
19
20
|
let activeCard, activeLibraryCard;
|
|
20
21
|
let _basePath = '../../../../architwin/static';
|
|
21
22
|
export function renderObjectCard(payload, objectComponent) {
|
|
@@ -161,6 +162,10 @@ export function setActiveCard(cardId) {
|
|
|
161
162
|
//@ts-expect-error
|
|
162
163
|
transformHistory.addAction(selected.object.id, selected.node.position, selected.node.obj3D.rotation, selected.node.scale);
|
|
163
164
|
}
|
|
165
|
+
if (_mpConfig.toolbarConfig) {
|
|
166
|
+
toggleActionBarButtons('at-redo-action-btn', transformHistory.canRedo(selected.object.id));
|
|
167
|
+
toggleActionBarButtons('at-undo-action-btn', transformHistory.canUndo(selected.object.id));
|
|
168
|
+
}
|
|
164
169
|
});
|
|
165
170
|
}
|
|
166
171
|
export function clearActiveCard() {
|
|
@@ -168,7 +168,6 @@ i18n
|
|
|
168
168
|
"General Settings": "General Settings",
|
|
169
169
|
"UploadImage": "Upload Image",
|
|
170
170
|
"Unsend": "Unsend",
|
|
171
|
-
"PipesMenu": "Pipes",
|
|
172
171
|
"Pipes": "Pipes",
|
|
173
172
|
"SelectPipeType": "Select Pipe Type",
|
|
174
173
|
"AddPipeType": "Add Pipe Type",
|
|
@@ -193,11 +192,16 @@ i18n
|
|
|
193
192
|
"ConfirmDeletePipeCategory": "Are you sure you want to delete this pipe category?",
|
|
194
193
|
"DeletePipe": "Delete pipe",
|
|
195
194
|
"ConfirmDeletePipe": "Are you sure you want to delete this pipe?",
|
|
196
|
-
"PipeCategoryName": "Enter pipe type",
|
|
195
|
+
"PipeCategoryName": "Enter pipe type name",
|
|
197
196
|
"HideShowAllPipes": "Hide/Show All Pipes",
|
|
198
|
-
"PipePlaceHolder": "Ex: Gas Pipe",
|
|
199
197
|
"Pipe": "Pipe",
|
|
200
|
-
"Vertex": "Vertex"
|
|
198
|
+
"Vertex": "Vertex",
|
|
199
|
+
"ConfirmDeleteVertex": "Are you sure you want to delete this vertex?",
|
|
200
|
+
"DeleteVertex": "Delete vertex",
|
|
201
|
+
"Ascending": "Ascending",
|
|
202
|
+
"Descending": "Descending",
|
|
203
|
+
"Newest": "Newest",
|
|
204
|
+
"Oldest": "Oldest"
|
|
201
205
|
}
|
|
202
206
|
},
|
|
203
207
|
ja: {
|
|
@@ -365,36 +369,40 @@ i18n
|
|
|
365
369
|
"Search...": "検索...",
|
|
366
370
|
"UploadImage": "画像をアップロード",
|
|
367
371
|
"Unsend": "取り消し",
|
|
368
|
-
"PipesMenu": "矢印マーカー",
|
|
369
372
|
"Pipes": "矢印マーカー",
|
|
370
373
|
"SelectPipeType": "矢印マーカー種別選択",
|
|
371
|
-
"AddPipeType": "
|
|
372
|
-
"EditPipeType": "
|
|
373
|
-
"PipeTypeName": "
|
|
374
|
-
"CategoryColor": "
|
|
375
|
-
"NoPipesToDisplay": "
|
|
376
|
-
"DrawPipe": "
|
|
374
|
+
"AddPipeType": "矢印マーカー種別を追加",
|
|
375
|
+
"EditPipeType": "矢印マーカー種別を編集",
|
|
376
|
+
"PipeTypeName": "矢印マーカー名",
|
|
377
|
+
"CategoryColor": "矢印マーカー色",
|
|
378
|
+
"NoPipesToDisplay": "表示する矢印マーカーがありません",
|
|
379
|
+
"DrawPipe": " 矢印マーカーを描画",
|
|
377
380
|
"NoVertexToDisplay": "表示する頂点がありません",
|
|
378
|
-
"NoPipesTypeToDisplay": "
|
|
381
|
+
"NoPipesTypeToDisplay": "表示する矢印マーカー種別がありません",
|
|
379
382
|
"DrawingModeIsActive": "描画モードが適応中",
|
|
380
|
-
"PipeSavedSuccessfully": "
|
|
381
|
-
"SaveTheCurrentPipeBeforeProceeding": "
|
|
383
|
+
"PipeSavedSuccessfully": "矢印マーカーを保存しました",
|
|
384
|
+
"SaveTheCurrentPipeBeforeProceeding": "現在描画している矢印マーカーを保存してから進めてください",
|
|
382
385
|
"CategorySuccessfullySaved": "カテゴリを正常に保存しました",
|
|
383
|
-
"
|
|
386
|
+
"PipeSuccessfullyDeleted": "矢印マーカーが正常に削除されました!",
|
|
384
387
|
"CannotDrawNoColorSelected": "描画不可:色を選択していません",
|
|
385
388
|
"DrawingModeIsNowActive": "描画モードが現在有効です",
|
|
386
389
|
"DrawingModeIsCurrentlyInactive": "描画モードは現在無効です",
|
|
387
|
-
"DeletePipeCategory": "
|
|
390
|
+
"DeletePipeCategory": "矢印マーカー種別を削除",
|
|
388
391
|
"VertexDeletedSuccessfully": "頂点が正常に削除されました",
|
|
389
|
-
"PipeCategoryDeletedSuccessfully": "
|
|
390
|
-
"ConfirmDeletePipeCategory": "
|
|
391
|
-
"DeletePipe": "
|
|
392
|
-
"ConfirmDeletePipe": "
|
|
393
|
-
"PipeCategoryName": "
|
|
394
|
-
"HideShowAllPipes": "
|
|
395
|
-
"PipePlaceHolder": "配管種別名を入力",
|
|
392
|
+
"PipeCategoryDeletedSuccessfully": "矢印マーカー種別が正常に削除されました!",
|
|
393
|
+
"ConfirmDeletePipeCategory": "この矢印マーカー種別を削除してもよろしいですか?",
|
|
394
|
+
"DeletePipe": "矢印マーカーを削除",
|
|
395
|
+
"ConfirmDeletePipe": "この矢印マーカーを削除してもよろしいですか?",
|
|
396
|
+
"PipeCategoryName": "矢印マーカー種別を入力",
|
|
397
|
+
"HideShowAllPipes": "全ての矢印マーカーを表示/非表示",
|
|
396
398
|
"Pipe": "矢印マーカー",
|
|
397
|
-
"Vertex": "頂点"
|
|
399
|
+
"Vertex": "頂点",
|
|
400
|
+
"ConfirmDeleteVertex": "この頂点を削除してもよろしいですか?",
|
|
401
|
+
"DeleteVertex": "削除",
|
|
402
|
+
"Ascending": "オブジェクト名称昇順",
|
|
403
|
+
"Descending": "オブジェクト名称降順",
|
|
404
|
+
"Newest": "新しく登録された順",
|
|
405
|
+
"Oldest": "古く登録された順",
|
|
398
406
|
}
|
|
399
407
|
}
|
|
400
408
|
},
|
|
@@ -48,11 +48,7 @@ export function renderMenuBar(iFrame) {
|
|
|
48
48
|
</div>
|
|
49
49
|
<div class="at_sidebar_button_icon" style="display:${isPipeEnabled ? 'block' : 'none'}">
|
|
50
50
|
<span class="mdi mdi-arrow-decision" id="at-pipe-btn" data-cy="at-pipe-btn" target-pane="at-pipe-list-pane"></span>
|
|
51
|
-
<div class="at_icon_tooltip" data-cy="at-tooltip-pipe">${i18n.t('
|
|
52
|
-
</div>
|
|
53
|
-
<div class="at_sidebar_button_icon" style="display:${isThemeEnabled ? 'block' : 'none'}">
|
|
54
|
-
<span class="mdi mdi-palette" id="at-theme-picker-btn" data-cy="at-theme-picker-btn" target-pane="at-theme-pane"></span>
|
|
55
|
-
<div class="at_icon_tooltip" data-cy="at-tooltip-theme">${i18n.t('Theme')}</div>
|
|
51
|
+
<div class="at_icon_tooltip" data-cy="at-tooltip-pipe">${i18n.t('Pipes')}</div>
|
|
56
52
|
</div>
|
|
57
53
|
<div class="at_sidebar_button_icon" style="display:${isRoomCreationEnabled ? 'block' : 'none'}">
|
|
58
54
|
<span class="mdi mdi-ruler-square-compass" id="at-room-creation-btn" data-cy="at-room-creation-btn" target-pane="at-room-tree-pane"></span>
|
|
@@ -62,6 +58,10 @@ export function renderMenuBar(iFrame) {
|
|
|
62
58
|
<img class="mdi at_bim_settings_img" src="${bimImageIcon}" alt="bim" id="at-settings-btn" data-cy="at-settings-btn" target-pane="at-settings-pane"/>
|
|
63
59
|
<div class="at_icon_tooltip" data-cy="at-tooltip-settings">${i18n.t('Settings')}</div>
|
|
64
60
|
</div>
|
|
61
|
+
<div class="at_sidebar_button_icon" style="display:${isThemeEnabled ? 'block' : 'none'}">
|
|
62
|
+
<span class="mdi mdi-palette" id="at-theme-picker-btn" data-cy="at-theme-picker-btn" target-pane="at-theme-pane"></span>
|
|
63
|
+
<div class="at_icon_tooltip" data-cy="at-tooltip-theme">${i18n.t('Theme')}</div>
|
|
64
|
+
</div>
|
|
65
65
|
<div class="at_sidebar_button_icon" style="display:${isGeneralSettingsEnabled ? 'block' : 'none'}">
|
|
66
66
|
<span class="mdi mdi-cog-outline" id="at-general-setting-btn" data-cy="at-general-setting-btn" target-pane="at-general-setting-pane"></span>
|
|
67
67
|
<div class="at_icon_tooltip" data-cy="at-tooltip-general-setting">${i18n.t('General Settings')}</div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { convertMeasurement, degreesToRadians, percentToScale, radiansToDegrees, scaleToPercent, useCapitalizeFirstLetter } from "../../../utils";
|
|
2
|
-
import { getSelectedObject, setObjectTransformation, get3DXObjects,
|
|
2
|
+
import { getSelectedObject, setObjectTransformation, get3DXObjects, _3DXObjects, isToolbarFeatureEnabled } from "../../../architwin";
|
|
3
3
|
import { COORDINATE_SYSTEM, UNITS } from "../../../types";
|
|
4
4
|
import { convertZupToYup, convertYupToZup, getOffsetPositionFromBasepoint, convertYupScaleToZupScale, convertZupScaleToYupScale } from "../../../worldConversion";
|
|
5
5
|
import { getScaleFactor, getMeasurementUnit, getBasepoint, getCoordinateSystem, isAdjust, getMPBasepoint, getRotationUnit } from "./actionSettingsPane";
|
|
6
6
|
import { Notyf } from 'notyf';
|
|
7
7
|
import log from 'loglevel';
|
|
8
8
|
import i18n from "./i18n";
|
|
9
|
-
import { toggleActionBarButtons } from "../../components/toolbar"
|
|
9
|
+
// import { toggleActionBarButtons } from "../../components/toolbar"
|
|
10
10
|
let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500 });
|
|
11
11
|
export let activeModelControlPane = false;
|
|
12
12
|
export let modelControlPane;
|
|
@@ -290,23 +290,23 @@ export function getCoordinateValues() {
|
|
|
290
290
|
transform.object_scale = transformType === 'scale' ? mpScale : selectedObject.node.scale;
|
|
291
291
|
transform.object_rotation = transformType === 'rotate' ? mpRotation : selectedObject.object.object_rotation;
|
|
292
292
|
console.log("caroline input transform", transform, formCoords);
|
|
293
|
-
if (transform && formCoords) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
293
|
+
// if (transform && formCoords) {
|
|
294
|
+
// console.log("caroline input undo coordinates", transform, formCoords)
|
|
295
|
+
// setObjectTransformation(selectedObject.node, transform)
|
|
296
|
+
// //Add to the action history so it can be reverse with undo or redo
|
|
297
|
+
// console.log("caroline input undo test", formCoords)
|
|
298
|
+
// const currentTransform = JSON.stringify(formCoords)
|
|
299
|
+
// if (currentTransform) {
|
|
300
|
+
// console.log("caroline input current transform", transform, currentTransform)
|
|
301
|
+
// actionHistory.push(currentTransform)
|
|
302
|
+
// // @ts-expect-error
|
|
303
|
+
// transformHistory.addAction(selectedObject.object.id, transform.object_position, transform.object_rotation, transform.object_scale)
|
|
304
|
+
// }
|
|
305
|
+
// if (_mpConfig.toolbarConfig) {
|
|
306
|
+
// toggleActionBarButtons('at-redo-action-btn',transformHistory.canRedo(selectedObject.object.id))
|
|
307
|
+
// toggleActionBarButtons('at-undo-action-btn',transformHistory.canUndo(selectedObject.object.id))
|
|
308
|
+
// }
|
|
309
|
+
// }
|
|
310
310
|
console.log("getCoordinateValues rotation quaternion values", selectedObject.node.quaternion);
|
|
311
311
|
return transform;
|
|
312
312
|
}
|
|
@@ -7,7 +7,7 @@ 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 { _3DXObjects, _pathConfig, _pipes, _selectedPipe, _selectedPipeCategory,
|
|
10
|
+
import { _3DXObjects, _pathConfig, _pipes, _selectedPipe, _selectedPipeCategory, cancelDraw, dispatchSpaceEvent, disposeModel, enableVerticeControls, getCurrentCameraPose, moveToSweep, pathHistory, redoPipePath, renderPath, setPathLineOptions, setPipeIsDrawingMode, setPipes, startDraw, undoPipePath } from "../../../architwin";
|
|
11
11
|
import i18n from './i18n';
|
|
12
12
|
import { COLLAPSE, SPACE_EVENTS } from "../../../types";
|
|
13
13
|
import { Collapse } from "./collapse";
|
|
@@ -37,7 +37,7 @@ export class PipeForm {
|
|
|
37
37
|
</div>
|
|
38
38
|
<div class="">
|
|
39
39
|
<span class="">${i18n.t('PipeTypeName')}</span>
|
|
40
|
-
<input id="at_pipe_type_name_input" class="at_pipe_input" type="text" name="pipe-name" placeholder="${i18n.t('
|
|
40
|
+
<input id="at_pipe_type_name_input" class="at_pipe_input" type="text" name="pipe-name" placeholder="${i18n.t('PipeCategoryName')}" required>
|
|
41
41
|
</div>
|
|
42
42
|
<div class="at_h-responsive-264">
|
|
43
43
|
<div class="at_py-3">
|
|
@@ -79,7 +79,7 @@ export class PipeForm {
|
|
|
79
79
|
// Creates collapse pipe under a category
|
|
80
80
|
createCollapseElement(category, pipes) {
|
|
81
81
|
const element = document.createElement('div');
|
|
82
|
-
element.id = 'at-pipe-
|
|
82
|
+
element.id = 'at-pipe-form-collapse';
|
|
83
83
|
element.setAttribute('data-cy', 'at-pipe-pane');
|
|
84
84
|
element.innerHTML = pipes != undefined && (pipes === null || pipes === void 0 ? void 0 : pipes.filter(pipe => (pipe === null || pipe === void 0 ? void 0 : pipe.category_uuid) === category.uuid).length)
|
|
85
85
|
? `
|
|
@@ -118,7 +118,6 @@ export class PipeForm {
|
|
|
118
118
|
<div class="at_collapsible_content" id="${COLLAPSE.CONTENT_ID}">
|
|
119
119
|
<div class="at_p-2">
|
|
120
120
|
${(() => {
|
|
121
|
-
console.log("TEMPLERE ==>", pipe);
|
|
122
121
|
let parsed, vertices;
|
|
123
122
|
try {
|
|
124
123
|
parsed = JSON.parse(pipe === null || pipe === void 0 ? void 0 : pipe.json_data);
|
|
@@ -160,7 +159,7 @@ export class PipeForm {
|
|
|
160
159
|
</div>
|
|
161
160
|
` : `
|
|
162
161
|
<div class="at_flex at_justify_center at_items_center at_flex_column at_h-responsive-650">
|
|
163
|
-
<div><span class="mdi mdi-
|
|
162
|
+
<div><span class="mdi mdi-arrow-decision at_pipe_category-container"></span></div>
|
|
164
163
|
<div> ${i18n.t('NoPipesToDisplay')}</div>
|
|
165
164
|
</div>
|
|
166
165
|
`;
|
|
@@ -210,7 +209,7 @@ export class PipeForm {
|
|
|
210
209
|
moveToSweep(parsed.sweepId, parsed.rotation);
|
|
211
210
|
_3DXObjects.filter(obj => obj.object.uuid != uuid).forEach(targetObj => {
|
|
212
211
|
if (targetObj) {
|
|
213
|
-
|
|
212
|
+
disposeModel(targetObj);
|
|
214
213
|
}
|
|
215
214
|
});
|
|
216
215
|
}
|
|
@@ -278,7 +277,7 @@ export class PipeForm {
|
|
|
278
277
|
const updated = { vertices: payload, sweepId: getCurrentCameraPose().sweep, rotation: getCurrentCameraPose().rotation };
|
|
279
278
|
_selectedPipe.json_data = JSON.stringify(updated);
|
|
280
279
|
yield dispatchSpaceEvent(SPACE_EVENTS.PIPE_ON_CHANGE, Object.assign({}, _selectedPipe));
|
|
281
|
-
this.populateFormCollapse(_selectedPipeCategory, _selectedPipe);
|
|
280
|
+
// this.populateFormCollapse(_selectedPipeCategory, _selectedPipe);
|
|
282
281
|
this.setEditMode(_selectedPipe);
|
|
283
282
|
});
|
|
284
283
|
}
|
|
@@ -324,47 +323,65 @@ export class PipeForm {
|
|
|
324
323
|
const target = e.currentTarget;
|
|
325
324
|
const type = target.dataset.type;
|
|
326
325
|
const uuid = target.dataset.uuid;
|
|
326
|
+
const isHeader = type === COLLAPSE.HEADER;
|
|
327
|
+
const config = {
|
|
328
|
+
title: i18n.t(isHeader ? 'DeletePipe' : 'DeleteVertex'),
|
|
329
|
+
description: i18n.t(isHeader ? 'ConfirmDeletePipe' : 'ConfirmDeleteVertex'),
|
|
330
|
+
buttonLabel: i18n.t('YesDelete'),
|
|
331
|
+
};
|
|
327
332
|
toggleModal();
|
|
328
|
-
setModalAction({
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (type == COLLAPSE.HEADER) {
|
|
336
|
-
dispatchSpaceEvent(SPACE_EVENTS.PIPE_REMOVED, uuid);
|
|
337
|
-
const targetObj = _3DXObjects.find(obj => obj.object.uuid == uuid);
|
|
338
|
-
if (targetObj) {
|
|
339
|
-
disposeModel(targetObj);
|
|
340
|
-
}
|
|
341
|
-
notyf.success(`${i18n.t('PipeSuccessfullyDeleted!')}`);
|
|
342
|
-
toggleModal(false);
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
dispatchSpaceEvent(SPACE_EVENTS.PIPE_VERTEX_REMOVED, uuid);
|
|
346
|
-
const index = Number(target.dataset.index);
|
|
347
|
-
this.renderPipePath(_selectedPipe.uuid);
|
|
348
|
-
if (this.getDrawButton((_a = JSON.parse(_selectedPipeCategory.json_data)) === null || _a === void 0 ? void 0 : _a.color, 'black').classList.contains('active')) {
|
|
349
|
-
const targetObj = _3DXObjects.find(obj => obj.object.uuid == _selectedPipe.uuid);
|
|
350
|
-
enableVerticeControls(targetObj.component);
|
|
351
|
-
}
|
|
352
|
-
notyf.success(`${i18n.t('VertexDeletedSuccessfully!')}`);
|
|
353
|
-
toggleModal(false);
|
|
354
|
-
}
|
|
355
|
-
this.collapse.removeElement(uuid, type);
|
|
356
|
-
}
|
|
357
|
-
});
|
|
333
|
+
setModalAction(config, () => __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
dispatchSpaceEvent(isHeader ? SPACE_EVENTS.PIPE_REMOVED : SPACE_EVENTS.PIPE_VERTEX_REMOVED, uuid);
|
|
335
|
+
yield waitForChange(() => (isHeader ? _pipes : Object.assign({}, _selectedPipe)), { interval: 500, timeout: 10000 });
|
|
336
|
+
isHeader ? this.handlePipeDelete(uuid) : this.handleVertexDelete(uuid);
|
|
337
|
+
toggleModal(false);
|
|
338
|
+
this.collapse.removeElement(uuid, type);
|
|
339
|
+
}));
|
|
358
340
|
}));
|
|
359
341
|
});
|
|
360
342
|
}
|
|
343
|
+
handlePipeDelete(uuid) {
|
|
344
|
+
if (!_pipes.some(p => p.category_uuid === _selectedPipeCategory.uuid)) {
|
|
345
|
+
document.getElementById('at-pipe-form-collapse').innerHTML = `
|
|
346
|
+
<div class="at_flex at_justify_center at_items_center at_flex_column at_h-responsive-650">
|
|
347
|
+
<div><span class="mdi mdi-arrow-decision at_pipe_category-container"></span></div>
|
|
348
|
+
<div> ${i18n.t('NoPipesToDisplay')}</div>
|
|
349
|
+
</div>
|
|
350
|
+
`;
|
|
351
|
+
}
|
|
352
|
+
const obj = _3DXObjects.find(o => o.object.uuid === uuid);
|
|
353
|
+
if (obj)
|
|
354
|
+
disposeModel(obj);
|
|
355
|
+
notyf.success(i18n.t('PipeDeletedSuccessfully'));
|
|
356
|
+
}
|
|
357
|
+
handleVertexDelete(uuid) {
|
|
358
|
+
var _a, _b, _c;
|
|
359
|
+
if (((_b = (_a = JSON.parse(_selectedPipe.json_data)) === null || _a === void 0 ? void 0 : _a.vertices) === null || _b === void 0 ? void 0 : _b.length) === 0) {
|
|
360
|
+
document.getElementById(`${COLLAPSE.CONTENT_ID}`).innerHTML = `
|
|
361
|
+
<div class="at_flex at_justify_center at_items_center at_flex_column">
|
|
362
|
+
<div><span class="mdi mdi-ray-start-vertex-end at_pipe_category-container"></span></div>
|
|
363
|
+
<div>${i18n.t('NoVertexToDisplay')}</div>
|
|
364
|
+
</div>
|
|
365
|
+
`;
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
this.renderPipePath(_selectedPipe.uuid);
|
|
369
|
+
}
|
|
370
|
+
if (this.getDrawButton((_c = JSON.parse(_selectedPipeCategory.json_data)) === null || _c === void 0 ? void 0 : _c.color, 'black').classList.contains('active')) {
|
|
371
|
+
const targetObj = _3DXObjects.find(obj => obj.object.uuid == _selectedPipe.uuid);
|
|
372
|
+
if (!targetObj)
|
|
373
|
+
return;
|
|
374
|
+
enableVerticeControls(targetObj.component);
|
|
375
|
+
}
|
|
376
|
+
notyf.success(`${i18n.t('VertexDeletedSuccessfully!')}`);
|
|
377
|
+
}
|
|
361
378
|
// draw pipe listener
|
|
362
379
|
draw() {
|
|
363
380
|
const btn = this.getDrawButton(null, 'white');
|
|
364
381
|
if (!btn)
|
|
365
382
|
return;
|
|
366
383
|
btn.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
|
|
367
|
-
var _a, _b;
|
|
384
|
+
var _a, _b, _c, _d;
|
|
368
385
|
const target = e.currentTarget;
|
|
369
386
|
const uuid = target.dataset.uuid;
|
|
370
387
|
const categoryData = JSON.parse((_a = _selectedPipeCategory === null || _selectedPipeCategory === void 0 ? void 0 : _selectedPipeCategory.json_data) !== null && _a !== void 0 ? _a : '{}');
|
|
@@ -378,26 +395,21 @@ export class PipeForm {
|
|
|
378
395
|
target.style.backgroundColor = (_b = JSON.parse(_selectedPipeCategory.json_data)) === null || _b === void 0 ? void 0 : _b.color;
|
|
379
396
|
target.style.color = 'black';
|
|
380
397
|
target.textContent = `${i18n.t('DoneDrawing')}`;
|
|
381
|
-
|
|
382
|
-
const targetObj = _3DXObjects.find(obj => obj.object.uuid === pipe.uuid);
|
|
383
|
-
if (targetObj) {
|
|
384
|
-
setModelVisibility(targetObj.object.id, false);
|
|
385
|
-
}
|
|
386
|
-
});
|
|
398
|
+
_3DXObjects.filter(obj => obj.object.uuid != _selectedPipe.uuid).forEach(disposeModel);
|
|
387
399
|
setPipeIsDrawingMode(true);
|
|
388
400
|
startDraw({
|
|
389
401
|
lineTypeComponentConfig: Object.assign(Object.assign({}, _pathConfig.lineTypeComponentConfig), { scrollSpeed: 0.70, radialSegments: 3, radius: 0.11 })
|
|
390
402
|
});
|
|
391
403
|
notyf.success(`${i18n.t('DrawingModeIsNowActive')}`);
|
|
392
404
|
if (_selectedPipe.uuid) {
|
|
393
|
-
console.log("EDIT PIPE ACTIVE", _selectedPipe.uuid);
|
|
394
405
|
const targetObject = _3DXObjects.find(obj => obj.object.uuid === _selectedPipe.uuid);
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
406
|
+
if (targetObject) {
|
|
407
|
+
if (Array.isArray((_d = (_c = targetObject === null || targetObject === void 0 ? void 0 : targetObject.component) === null || _c === void 0 ? void 0 : _c.inputs) === null || _d === void 0 ? void 0 : _d.path) && targetObject.component.inputs.path.length > 1) {
|
|
408
|
+
disposeModel(targetObject);
|
|
409
|
+
enableVerticeControls(targetObject.component);
|
|
410
|
+
}
|
|
411
|
+
this.setEditMode(_selectedPipe);
|
|
412
|
+
}
|
|
401
413
|
}
|
|
402
414
|
else {
|
|
403
415
|
yield dispatchSpaceEvent(SPACE_EVENTS.PIPE_ADD, {});
|
|
@@ -411,7 +423,7 @@ export class PipeForm {
|
|
|
411
423
|
this.savePiPeEventHandler();
|
|
412
424
|
cancelDraw();
|
|
413
425
|
setPipeIsDrawingMode(false);
|
|
414
|
-
this.renderPipePath(uuid)
|
|
426
|
+
// this.renderPipePath(uuid)
|
|
415
427
|
target.textContent = i18n.t('DrawPipe');
|
|
416
428
|
target.style.backgroundColor = null;
|
|
417
429
|
target.style.color = 'white';
|
|
@@ -424,15 +436,14 @@ export class PipeForm {
|
|
|
424
436
|
yield dispatchSpaceEvent(SPACE_EVENTS.DRAW_PIPE_UNDO);
|
|
425
437
|
this.populateFormCollapse(_selectedPipeCategory, _selectedPipe);
|
|
426
438
|
this.setEditMode(_selectedPipe);
|
|
427
|
-
|
|
439
|
+
undoPipePath();
|
|
428
440
|
});
|
|
429
441
|
}
|
|
430
442
|
redoEventHandler() {
|
|
431
443
|
dispatchSpaceEvent(SPACE_EVENTS.DRAW_PIPE_REDO, _selectedPipe);
|
|
432
444
|
this.populateFormCollapse(_selectedPipeCategory, _selectedPipe);
|
|
433
445
|
this.setEditMode(_selectedPipe);
|
|
434
|
-
|
|
435
|
-
redoDrawAction();
|
|
446
|
+
redoPipePath();
|
|
436
447
|
}
|
|
437
448
|
undo() {
|
|
438
449
|
const btn = document.getElementById('at-pipe-undo-btn');
|
|
@@ -444,7 +455,7 @@ export class PipeForm {
|
|
|
444
455
|
notyf.error(`${i18n.t('DrawingModeIsCurrentlyInactive')}`);
|
|
445
456
|
return;
|
|
446
457
|
}
|
|
447
|
-
if (
|
|
458
|
+
if (!pathHistory.canUndo())
|
|
448
459
|
return;
|
|
449
460
|
this.undoEventHandler();
|
|
450
461
|
}));
|
|
@@ -460,7 +471,7 @@ export class PipeForm {
|
|
|
460
471
|
notyf.error(`${i18n.t('DrawingModeIsCurrentlyInactive')}`);
|
|
461
472
|
return;
|
|
462
473
|
}
|
|
463
|
-
if (
|
|
474
|
+
if (!pathHistory.canRedo())
|
|
464
475
|
return;
|
|
465
476
|
this.redoEventHandler();
|
|
466
477
|
}));
|
|
@@ -479,9 +490,7 @@ export class PipeForm {
|
|
|
479
490
|
return;
|
|
480
491
|
document.querySelectorAll('.at_circle.selected').forEach(el => el.classList.remove('selected'));
|
|
481
492
|
target.classList.add('selected');
|
|
482
|
-
console.log("clicked");
|
|
483
493
|
const bgColor = getComputedStyle(target).backgroundColor;
|
|
484
|
-
console.log("CAHNGE COLOR ==>", bgColor);
|
|
485
494
|
this.getDrawButton(bgColor, 'black');
|
|
486
495
|
const obj = { color: bgColor };
|
|
487
496
|
_selectedPipeCategory.json_data = JSON.stringify(obj);
|
|
@@ -511,7 +520,6 @@ export class PipeForm {
|
|
|
511
520
|
if (!btn)
|
|
512
521
|
return;
|
|
513
522
|
if (btn === null || btn === void 0 ? void 0 : btn.classList.contains('active')) {
|
|
514
|
-
console.log("DRAW BUTTON ===>", btn.classList);
|
|
515
523
|
btn.style.backgroundColor = background;
|
|
516
524
|
btn.style.color = color;
|
|
517
525
|
}
|
|
@@ -552,7 +560,11 @@ export class PipeForm {
|
|
|
552
560
|
// render specific pipe category and its pipes
|
|
553
561
|
renderPipePath(uuid) {
|
|
554
562
|
var _a;
|
|
555
|
-
_3DXObjects.filter(x => x.type === 'PATH').forEach(
|
|
563
|
+
_3DXObjects.filter(x => x.type === 'PATH').forEach(obj => {
|
|
564
|
+
if (obj) {
|
|
565
|
+
disposeModel(obj);
|
|
566
|
+
}
|
|
567
|
+
});
|
|
556
568
|
const category = JSON.parse((_a = _selectedPipeCategory === null || _selectedPipeCategory === void 0 ? void 0 : _selectedPipeCategory.json_data) !== null && _a !== void 0 ? _a : '{}');
|
|
557
569
|
const targetPipes = uuid
|
|
558
570
|
? _pipes.filter(p => p.uuid === uuid)
|
|
@@ -12,6 +12,9 @@ export declare class PipeList {
|
|
|
12
12
|
edit(): void;
|
|
13
13
|
toggle(): void;
|
|
14
14
|
delete(): void;
|
|
15
|
+
private handleDisposePipeObjectModel;
|
|
16
|
+
private handleCategoryDelete;
|
|
17
|
+
private handlePipeDelete;
|
|
15
18
|
renderPipePaths(): void;
|
|
16
19
|
initDropdown(options: string[]): void;
|
|
17
20
|
}
|