@xtctwins/tctwins-bimx-engine 0.3.0 → 0.3.2
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/README.md +193 -196
- package/dist/{alert-ChDNxVgQ.mjs → Alert-5pEYzrMO.mjs} +8 -8
- package/dist/AnnotationTool-B3tDIyWy.mjs +239 -0
- package/dist/BIMX_Viewer_Lib.es.js +3 -3
- package/dist/BIMX_Viewer_Lib.umd.js +222 -175
- package/dist/CommentTool--UgPVIZZ.mjs +1541 -0
- package/dist/{HiddenTool-CoPawMRd.mjs → HiddenTool-rORoKTeD.mjs} +16 -16
- package/dist/{InspectorTool-BIvnydPf.mjs → InspectorTool-l4bDxTia.mjs} +66 -66
- package/dist/{MeasureTool-BUi0QI_R.mjs → MeasureTool-d-EV6m2R.mjs} +126 -102
- package/dist/{MouseTool-CdVwRiX1.mjs → MouseTool-DKMcdeRD.mjs} +35 -32
- package/dist/{NavigateTool-DoP9z3yP.mjs → NavigateTool-BNvZ8Oat.mjs} +13 -13
- package/dist/{panel.vue_vue_type_style_index_0_lang-BaSZShh_.mjs → Panel.vue_vue_type_style_index_0_lang-C4tqfy-B.mjs} +2 -2
- package/dist/{RoamTool-POFy076i.mjs → RoamTool-DJu93SVl.mjs} +14 -14
- package/dist/ScreenShotTool-D2h0Qjtv.mjs +430 -0
- package/dist/SectionTool-DHw2Zfzv.mjs +343 -0
- package/dist/SettingTool-D13GBT87.mjs +747 -0
- package/dist/StructureTree-DHaOzAP9.mjs +1662 -0
- package/dist/{tallPanel-DKlcFjrl.mjs → TallPanel-DtXOSzmF.mjs} +14 -14
- package/dist/bimTools-D3TraX9d.mjs +75 -0
- package/dist/el-slider-CHaMBaUG.mjs +1040 -0
- package/dist/{index-Dsq1epCY.mjs → index-BDupeKSG.mjs} +55597 -53543
- package/dist/index.html +17 -17
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +38 -10
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +37 -9
- package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFTool.vue.d.ts +4 -7
- package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +5 -7
- package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +5 -6
- package/types/components/BCFComponents/commentInput.vue.d.ts +36 -10
- package/types/components/BCFComponents/commentsView.vue.d.ts +36 -7
- package/types/components/BCFComponents/dialogPanel.vue.d.ts +5 -8
- package/types/components/BCFComponents/imageView.vue.d.ts +5 -7
- package/types/components/BCFComponents/imageZoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +18 -1
- package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +32 -1
- package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/{add.vue.d.ts → MobileCommentAdd.vue.d.ts} +6 -8
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +4 -5
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +478 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +499 -7
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/SectionTool.vue.d.ts +4 -0
- package/types/components/BimViewerComponents/SettingTool.vue.d.ts +4 -6
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +4026 -1
- package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +18 -1
- package/types/components/BimxViewerComp.vue.d.ts +7 -14
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +37 -10
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +37 -9
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +499 -7
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +478 -1
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +5 -8
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +38 -12
- package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +7 -9
- package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +5 -7
- package/types/components/bcf/AddObjectOrAnno.vue.d.ts +16 -0
- package/types/components/bcf/BCFAddPanel.vue.d.ts +55 -0
- package/types/components/bcf/BCFDetailPanel.vue.d.ts +59 -0
- package/types/components/bcf/BCFDisplayList.vue.d.ts +18 -0
- package/types/components/bcf/BCFFilter.vue.d.ts +14 -0
- package/types/components/bcf/BCFTool.vue.d.ts +15 -0
- package/types/components/bcf/CheckObjectPanel.vue.d.ts +11 -0
- package/types/components/bcf/CommentInput.vue.d.ts +51 -0
- package/types/components/bcf/CommentsView.vue.d.ts +48 -0
- package/types/components/bcf/DialogPanel.vue.d.ts +15 -0
- package/types/components/bcf/ImageView.vue.d.ts +17 -0
- package/types/components/bcf/ImageZoomIn.vue.d.ts +9 -0
- package/types/components/bcf/MobileBCFAdd.vue.d.ts +56 -0
- package/types/components/bcf/MobileBCFDetail.vue.d.ts +55 -0
- package/types/components/bcf/MobileBCFDisplayList.vue.d.ts +498 -0
- package/types/components/bcf/MobileBCFFilter.vue.d.ts +475 -0
- package/types/components/bcf/MobileBCFTool.vue.d.ts +17 -0
- package/types/components/bcf/MobileCommentInput.vue.d.ts +54 -0
- package/types/components/bcf/MobileCommentsView.vue.d.ts +17 -0
- package/types/components/bcf/SelectPanel.vue.d.ts +12 -0
- package/types/components/bimxViewer.vue.d.ts +7 -14
- package/types/components/comment/mobile/MobileCommentAdd.vue.d.ts +14 -0
- package/types/components/comment/mobile/MobileDetail.vue.d.ts +11 -0
- package/types/components/comment/mobile/MobileDraw.vue.d.ts +17 -0
- package/types/components/comment/mobile/MobileFilter.vue.d.ts +475 -0
- package/types/components/comment/mobile/MobileList.vue.d.ts +497 -0
- package/types/components/comment/mobile/MobileZoomIn.vue.d.ts +9 -0
- package/types/components/comment/pc/PcDraw.vue.d.ts +14 -0
- package/types/components/shared/Alert.vue.d.ts +32 -0
- package/types/components/shared/CloseButton.vue.d.ts +50 -0
- package/types/components/shared/CloseButtonDark.vue.d.ts +32 -0
- package/types/components/shared/EmptyPage.vue.d.ts +6 -0
- package/types/components/shared/Loading.vue.d.ts +2 -0
- package/types/components/shared/Panel.vue.d.ts +47 -0
- package/types/components/shared/Prompt.vue.d.ts +8 -0
- package/types/components/shared/RectangleButton.vue.d.ts +106 -0
- package/types/components/shared/TallPanel.vue.d.ts +69 -0
- package/types/components/shared/TallPanelNoPos.vue.d.ts +82 -0
- package/types/components/tools/AnnotationTool.vue.d.ts +14 -0
- package/types/components/tools/AppToolbar.vue.d.ts +27 -0
- package/types/components/tools/ClickEvent.vue.d.ts +6 -0
- package/types/components/tools/CommentTool.vue.d.ts +45 -0
- package/types/components/tools/HiddenTool.vue.d.ts +12 -0
- package/types/components/tools/InspectorTool.vue.d.ts +14 -0
- package/types/components/tools/MeasureTool.vue.d.ts +14 -0
- package/types/components/tools/MouseTool.vue.d.ts +6 -0
- package/types/components/tools/NavigateTool.vue.d.ts +10 -0
- package/types/components/tools/RoamTool.vue.d.ts +12 -0
- package/types/components/tools/ScreenShotTool.vue.d.ts +10 -0
- package/types/components/tools/SectionTool.vue.d.ts +14 -0
- package/types/components/tools/SettingTool.vue.d.ts +13 -0
- package/types/components/tools/StructureTree.vue.d.ts +11645 -0
- package/types/components/tools/Toolbar.vue.d.ts +10 -0
- package/types/components/utilsComponents/alert.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
- package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
- package/types/components/utilsComponents/loading.vue.d.ts +1 -1
- package/types/components/utilsComponents/panel.vue.d.ts +8 -2
- package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +3 -1
- package/types/components/utilsComponents/tallPanel.vue.d.ts +13 -3
- package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +13 -3
- package/types/composables/useBimViewerEvent.d.ts +44 -0
- package/types/composables/useEmitHandler.d.ts +2 -0
- package/types/composables/useToolActive.d.ts +1 -0
- package/types/composables/useToolReady.d.ts +1 -0
- package/types/i18n/index.d.ts +5 -1
- package/types/i18n/locales/en-US.d.ts +1 -0
- package/types/i18n/locales/zh-CN.d.ts +1 -0
- package/types/pages/BimxViewerEntry.vue.d.ts +5 -57
- package/types/pages/viewerEntry.vue.d.ts +7 -57
- package/types/store/bcfReflect.d.ts +13 -81
- package/types/store/const/app.d.ts +66 -0
- package/types/store/const/bimTools.d.ts +81 -0
- package/types/store/const/project.d.ts +48 -0
- package/types/store/const/theme.d.ts +16 -0
- package/types/store/const/toolbar.d.ts +26 -0
- package/types/store/const.d.ts +11 -228
- package/types/store/initConfigs.d.ts +1 -1
- package/types/store/toolbars.d.ts +68 -46
- package/types/store/userInfoStore.d.ts +1 -1
- package/types/stores/viewerStore.d.ts +112 -0
- package/types/types/bcf.d.ts +83 -0
- package/types/types/events.d.ts +88 -0
- package/types/utils/OSSHelper.d.ts +27 -0
- package/types/utils/cacheInfo.d.ts +26 -3
- package/types/utils/dbscan.d.ts +1 -0
- package/types/utils/eventBus.d.ts +1 -83
- package/types/viewerManager/viewerManager.d.ts +53 -3
- package/dist/AnnotationTool-CGRte6Cc.mjs +0 -167
- package/dist/CommentTool-CT3wFozB.mjs +0 -1529
- package/dist/ScreenShotTool-CcUyU0g7.mjs +0 -357
- package/dist/SectionTool-DGjjH3JO.mjs +0 -331
- package/dist/SettingTool-CjXfbX5r.mjs +0 -657
- package/dist/StructureTree-DdRX-y-V.mjs +0 -1583
- package/dist/const-DOnRsYpZ.mjs +0 -389
- package/dist/el-input-number-CK5d8pzH.mjs +0 -818
- package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +0 -22
- package/types/components/BimViewerComponents/emptyPage.vue.d.ts +0 -8
- package/types/tests/cmt.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,196 +1,193 @@
|
|
|
1
|
-
## @xtctwins/tctwins-bimx-engine
|
|
2
|
-
|
|
3
|
-
# xtc 三维文件查看器
|
|
4
|
-
|
|
5
|
-
## 安装相关依赖
|
|
6
|
-
|
|
7
|
-
## UI element-plus
|
|
8
|
-
|
|
9
|
-
<https://www.npmjs.com/package/element-plus>
|
|
10
|
-
|
|
11
|
-
```ssh
|
|
12
|
-
npm i element-plus
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## 事件总线 mitt
|
|
16
|
-
|
|
17
|
-
<https://www.npmjs.com/package/mitt>
|
|
18
|
-
|
|
19
|
-
```ssh
|
|
20
|
-
npm i mitt
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## 状态管理 pinia
|
|
24
|
-
|
|
25
|
-
<https://www.npmjs.com/package/pinia>
|
|
26
|
-
|
|
27
|
-
```ssh
|
|
28
|
-
npm i pinia
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 文件获取 ali-oss
|
|
32
|
-
|
|
33
|
-
<https://www.npmjs.com/package/ali-oss>
|
|
34
|
-
|
|
35
|
-
```ssh
|
|
36
|
-
npm i ali-oss
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
# 安装依赖
|
|
40
|
-
|
|
41
|
-
```ssh
|
|
42
|
-
// 安装依赖
|
|
43
|
-
npm i @xtctwins/tctwins-bimx-engine
|
|
44
|
-
// 引入样式
|
|
45
|
-
import "@xtctwins/tctwins-bimx-engine/dist/style.css";
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
# Example
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
<template>
|
|
52
|
-
<!-- 一个模型 -->
|
|
53
|
-
<!-- :model-buffer 和 :file-path 选一个使用即可-->
|
|
54
|
-
<!-- :model-buffer 是直接传入模型buffer数据-->
|
|
55
|
-
<!-- :file-path 是传入文件下载路径-->
|
|
56
|
-
<BIMXViewer
|
|
57
|
-
v-if="initialzed"
|
|
58
|
-
:load-meta="true"
|
|
59
|
-
:file-path="filePath"
|
|
60
|
-
:nav-cube-size="120"
|
|
61
|
-
:background-color="'#d0d0d0'"
|
|
62
|
-
@emit-handler="EmitHandler" />
|
|
63
|
-
|
|
64
|
-
<!-- 集成模型 -->
|
|
65
|
-
<!-- 请使用-->
|
|
66
|
-
<!--:file-paths="filePaths"-->
|
|
67
|
-
<!--:multi-model="true"-->
|
|
68
|
-
</template>
|
|
69
|
-
|
|
70
|
-
<script lang="ts" setup>
|
|
71
|
-
import { onMounted, ref } from "vue";
|
|
72
|
-
import { BIMXViewer } from "@xtctwins/tctwins-bimx-engine";
|
|
73
|
-
import type { EventContent } from "@xtctwins/tctwins-bimx-engine";
|
|
74
|
-
import "@xtctwins/tctwins-bimx-engine/dist/style.css";
|
|
75
|
-
|
|
76
|
-
const initialzed = ref(false);
|
|
77
|
-
const filePath = ref(`https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/test/1公寓幕墙.xtc`);
|
|
78
|
-
const filePaths = [
|
|
79
|
-
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170745913287.xtc",
|
|
80
|
-
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170736552499.xtc",
|
|
81
|
-
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170731500203.xtc"
|
|
82
|
-
];
|
|
83
|
-
const modelBuffer = ref<ArrayBuffer>();
|
|
84
|
-
|
|
85
|
-
onMounted(() => {
|
|
86
|
-
//如果选择直接传入模型modelBuffer,请在获取到buffer后再初始化BIMXViewer
|
|
87
|
-
// getModel(() => {
|
|
88
|
-
// initialzed.value = true;
|
|
89
|
-
// });
|
|
90
|
-
|
|
91
|
-
//如果使用filePath或者filePaths则直接初始化BIMXViewer即可
|
|
92
|
-
initialzed.value = true;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
//监听引擎传出的事件
|
|
96
|
-
const EmitHandler = (content: EventContent) => {
|
|
97
|
-
console.log(content);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
//xtc模型数据
|
|
101
|
-
const getModel = (callback: () => void) => {
|
|
102
|
-
// 自行填写获取模型文件的内容
|
|
103
|
-
// ...
|
|
104
|
-
// modelBuffer.value = ...
|
|
105
|
-
callback();
|
|
106
|
-
};
|
|
107
|
-
</script>
|
|
108
|
-
|
|
109
|
-
<style>
|
|
110
|
-
#app {
|
|
111
|
-
position: absolute;
|
|
112
|
-
left: 0;
|
|
113
|
-
right: 0;
|
|
114
|
-
top: 0;
|
|
115
|
-
bottom: 0;
|
|
116
|
-
width: 100%;
|
|
117
|
-
height: 100%;
|
|
118
|
-
}
|
|
119
|
-
</style>
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 其他参数解释
|
|
124
|
-
|
|
125
|
-
### 基础设置
|
|
126
|
-
|
|
127
|
-
是否载入构件属性信息(xts文件),
|
|
128
|
-
如果要载入,在模型xtc文件相同路径下必须有同名xts文件
|
|
129
|
-
|
|
130
|
-
```ssh
|
|
131
|
-
:load-meta="true"
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
是否显示导航盒
|
|
135
|
-
|
|
136
|
-
```ssh
|
|
137
|
-
:showNavCube="true"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
导航盒尺寸
|
|
141
|
-
|
|
142
|
-
```ssh
|
|
143
|
-
:nav-cube-size="120"
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
背景颜色
|
|
147
|
-
|
|
148
|
-
```ssh
|
|
149
|
-
:background-color="#d0d0d0"
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 功能
|
|
153
|
-
|
|
154
|
-
添加需要的即可
|
|
155
|
-
|
|
156
|
-
```ssh
|
|
157
|
-
inspector
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
inspector - 构建属性面板开启 (需要开启loadMeta)
|
|
161
|
-
|
|
162
|
-
```ssh
|
|
163
|
-
reseta
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
reseta - 重置模型视角
|
|
167
|
-
|
|
168
|
-
## 事件
|
|
169
|
-
|
|
170
|
-
```ssh
|
|
171
|
-
//监听引擎传出的事件
|
|
172
|
-
const EmitHandler = (content: EventContent) => {
|
|
173
|
-
console.log(content);
|
|
174
|
-
};
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
```ts
|
|
178
|
-
//事件内容
|
|
179
|
-
type EventContent = {
|
|
180
|
-
isTool: boolean;
|
|
181
|
-
event_target: ComponentName | "BimXViewer" | "ToolBar";
|
|
182
|
-
event_name: string;
|
|
183
|
-
content: {};
|
|
184
|
-
};
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
事件内容包括:
|
|
188
|
-
|
|
189
|
-
```ssh
|
|
190
|
-
"pickedEntity" - 点击构件
|
|
191
|
-
"pickedNothing" - 点击空白处
|
|
192
|
-
...
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
##### 此版本为测试环境
|
|
1
|
+
## @xtctwins/tctwins-bimx-engine
|
|
2
|
+
|
|
3
|
+
# xtc 三维文件查看器
|
|
4
|
+
|
|
5
|
+
## 安装相关依赖
|
|
6
|
+
|
|
7
|
+
## UI element-plus
|
|
8
|
+
|
|
9
|
+
<https://www.npmjs.com/package/element-plus>
|
|
10
|
+
|
|
11
|
+
```ssh
|
|
12
|
+
npm i element-plus
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 事件总线 mitt
|
|
16
|
+
|
|
17
|
+
<https://www.npmjs.com/package/mitt>
|
|
18
|
+
|
|
19
|
+
```ssh
|
|
20
|
+
npm i mitt
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 状态管理 pinia
|
|
24
|
+
|
|
25
|
+
<https://www.npmjs.com/package/pinia>
|
|
26
|
+
|
|
27
|
+
```ssh
|
|
28
|
+
npm i pinia
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 文件获取 ali-oss
|
|
32
|
+
|
|
33
|
+
<https://www.npmjs.com/package/ali-oss>
|
|
34
|
+
|
|
35
|
+
```ssh
|
|
36
|
+
npm i ali-oss
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
# 安装依赖
|
|
40
|
+
|
|
41
|
+
```ssh
|
|
42
|
+
// 安装依赖
|
|
43
|
+
npm i @xtctwins/tctwins-bimx-engine
|
|
44
|
+
// 引入样式
|
|
45
|
+
import "@xtctwins/tctwins-bimx-engine/dist/style.css";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
# Example
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
<template>
|
|
52
|
+
<!-- 一个模型 -->
|
|
53
|
+
<!-- :model-buffer 和 :file-path 选一个使用即可-->
|
|
54
|
+
<!-- :model-buffer 是直接传入模型buffer数据-->
|
|
55
|
+
<!-- :file-path 是传入文件下载路径-->
|
|
56
|
+
<BIMXViewer
|
|
57
|
+
v-if="initialzed"
|
|
58
|
+
:load-meta="true"
|
|
59
|
+
:file-path="filePath"
|
|
60
|
+
:nav-cube-size="120"
|
|
61
|
+
:background-color="'#d0d0d0'"
|
|
62
|
+
@emit-handler="EmitHandler" />
|
|
63
|
+
|
|
64
|
+
<!-- 集成模型 -->
|
|
65
|
+
<!-- 请使用-->
|
|
66
|
+
<!--:file-paths="filePaths"-->
|
|
67
|
+
<!--:multi-model="true"-->
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script lang="ts" setup>
|
|
71
|
+
import { onMounted, ref } from "vue";
|
|
72
|
+
import { BIMXViewer } from "@xtctwins/tctwins-bimx-engine";
|
|
73
|
+
import type { EventContent } from "@xtctwins/tctwins-bimx-engine";
|
|
74
|
+
import "@xtctwins/tctwins-bimx-engine/dist/style.css";
|
|
75
|
+
|
|
76
|
+
const initialzed = ref(false);
|
|
77
|
+
const filePath = ref(`https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/test/1公寓幕墙.xtc`);
|
|
78
|
+
const filePaths = [
|
|
79
|
+
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170745913287.xtc",
|
|
80
|
+
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170736552499.xtc",
|
|
81
|
+
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170731500203.xtc"
|
|
82
|
+
];
|
|
83
|
+
const modelBuffer = ref<ArrayBuffer>();
|
|
84
|
+
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
//如果选择直接传入模型modelBuffer,请在获取到buffer后再初始化BIMXViewer
|
|
87
|
+
// getModel(() => {
|
|
88
|
+
// initialzed.value = true;
|
|
89
|
+
// });
|
|
90
|
+
|
|
91
|
+
//如果使用filePath或者filePaths则直接初始化BIMXViewer即可
|
|
92
|
+
initialzed.value = true;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
//监听引擎传出的事件
|
|
96
|
+
const EmitHandler = (content: EventContent) => {
|
|
97
|
+
console.log(content);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
//xtc模型数据
|
|
101
|
+
const getModel = (callback: () => void) => {
|
|
102
|
+
// 自行填写获取模型文件的内容
|
|
103
|
+
// ...
|
|
104
|
+
// modelBuffer.value = ...
|
|
105
|
+
callback();
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style>
|
|
110
|
+
#app {
|
|
111
|
+
position: absolute;
|
|
112
|
+
left: 0;
|
|
113
|
+
right: 0;
|
|
114
|
+
top: 0;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 其他参数解释
|
|
124
|
+
|
|
125
|
+
### 基础设置
|
|
126
|
+
|
|
127
|
+
是否载入构件属性信息(xts文件),
|
|
128
|
+
如果要载入,在模型xtc文件相同路径下必须有同名xts文件
|
|
129
|
+
|
|
130
|
+
```ssh
|
|
131
|
+
:load-meta="true"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
是否显示导航盒
|
|
135
|
+
|
|
136
|
+
```ssh
|
|
137
|
+
:showNavCube="true"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
导航盒尺寸
|
|
141
|
+
|
|
142
|
+
```ssh
|
|
143
|
+
:nav-cube-size="120"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
背景颜色
|
|
147
|
+
|
|
148
|
+
```ssh
|
|
149
|
+
:background-color="#d0d0d0"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 功能
|
|
153
|
+
|
|
154
|
+
添加需要的即可
|
|
155
|
+
|
|
156
|
+
```ssh
|
|
157
|
+
inspector
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
inspector - 构建属性面板开启 (需要开启loadMeta)
|
|
161
|
+
|
|
162
|
+
```ssh
|
|
163
|
+
reseta
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
reseta - 重置模型视角
|
|
167
|
+
|
|
168
|
+
## 事件
|
|
169
|
+
|
|
170
|
+
```ssh
|
|
171
|
+
//监听引擎传出的事件
|
|
172
|
+
const EmitHandler = (content: EventContent) => {
|
|
173
|
+
console.log(content);
|
|
174
|
+
};
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
//事件内容
|
|
179
|
+
type EventContent = {
|
|
180
|
+
isTool: boolean;
|
|
181
|
+
event_target: ComponentName | "BimXViewer" | "ToolBar";
|
|
182
|
+
event_name: string;
|
|
183
|
+
content: {};
|
|
184
|
+
};
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
事件内容包括:
|
|
188
|
+
|
|
189
|
+
```ssh
|
|
190
|
+
"pickedEntity" - 点击构件
|
|
191
|
+
"pickedNothing" - 点击空白处
|
|
192
|
+
...
|
|
193
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as c, O as _, H as l, I as a } from "./index-BDupeKSG.mjs";
|
|
2
2
|
import { defineComponent as i, openBlock as r, createElementBlock as d, createElementVNode as e, unref as t, toDisplayString as p, createVNode as m } from "vue";
|
|
3
|
-
const u = { class: "alert_wrapper" }, h = { class: "alert_box_wrapper" }, f = { class: "alert_box" }, g = { class: "alert_img" }, v = ["src"],
|
|
4
|
-
__name: "
|
|
3
|
+
const u = { class: "alert_wrapper" }, h = { class: "alert_box_wrapper" }, f = { class: "alert_box" }, g = { class: "alert_img" }, v = ["src"], k = { class: "alert_title" }, w = { class: "alert_close" }, x = /* @__PURE__ */ i({
|
|
4
|
+
__name: "Alert",
|
|
5
5
|
props: {
|
|
6
6
|
panelTitle: {
|
|
7
7
|
type: String,
|
|
@@ -19,7 +19,7 @@ const u = { class: "alert_wrapper" }, h = { class: "alert_box_wrapper" }, f = {
|
|
|
19
19
|
},
|
|
20
20
|
setup(n) {
|
|
21
21
|
const s = c();
|
|
22
|
-
return (
|
|
22
|
+
return (b, y) => {
|
|
23
23
|
const o = l;
|
|
24
24
|
return r(), d("div", u, [
|
|
25
25
|
e("div", h, [
|
|
@@ -29,8 +29,8 @@ const u = { class: "alert_wrapper" }, h = { class: "alert_box_wrapper" }, f = {
|
|
|
29
29
|
src: `${t(_)}/bim-viewer/alert_warning.png`
|
|
30
30
|
}, null, 8, v)
|
|
31
31
|
]),
|
|
32
|
-
e("div",
|
|
33
|
-
e("div",
|
|
32
|
+
e("div", k, p(t(s)("alert.selectPoint")), 1),
|
|
33
|
+
e("div", w, [
|
|
34
34
|
m(o, {
|
|
35
35
|
"click-handle": n.clickHandle,
|
|
36
36
|
width: 18
|
|
@@ -41,7 +41,7 @@ const u = { class: "alert_wrapper" }, h = { class: "alert_box_wrapper" }, f = {
|
|
|
41
41
|
]);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), H = /* @__PURE__ */ a(x, [["__scopeId", "data-v-745a5d6a"]]);
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
H as _
|
|
47
47
|
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { _ as F } from "./Alert-5pEYzrMO.mjs";
|
|
2
|
+
import { defineComponent as Y, ref as V, watch as G, onMounted as J, onBeforeUnmount as K, openBlock as l, createElementBlock as d, unref as i, createCommentVNode as y, createElementVNode as u, normalizeClass as B, Fragment as S, renderList as N, toDisplayString as Q, withDirectives as Z, createVNode as nn, vShow as en } from "vue";
|
|
3
|
+
import { A as on, B as tn, C as a, D as E, O as _, I as an } from "./index-BDupeKSG.mjs";
|
|
4
|
+
import { A as f } from "./bimTools-D3TraX9d.mjs";
|
|
5
|
+
const rn = { class: "annotation_component" }, cn = {
|
|
6
|
+
key: 0,
|
|
7
|
+
id: "annotation_toolbar",
|
|
8
|
+
class: "annotation_toolbar"
|
|
9
|
+
}, sn = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "toolbar_trangle"
|
|
12
|
+
}, ln = { class: "annotation_toolbar_group" }, dn = ["id", "disabled", "onClick"], mn = ["src"], un = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "toolbar_trangle"
|
|
15
|
+
}, _n = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "mobile_annotation_toolbar"
|
|
18
|
+
}, fn = { class: "anno_toolList" }, bn = { class: "label-list" }, vn = ["onClick"], wn = { class: "item-img" }, gn = ["src"], Tn = { class: "item-name" }, pn = /* @__PURE__ */ Y({
|
|
19
|
+
__name: "AnnotationTool",
|
|
20
|
+
props: ["componentId"],
|
|
21
|
+
emits: ["uploadImage", "clickAnnotation", "emitHandler"],
|
|
22
|
+
setup(M, { emit: j }) {
|
|
23
|
+
const O = on(), C = tn(), I = M, D = j, x = V(!0), m = V(""), W = V();
|
|
24
|
+
let s, $, v = !1, p = null, w = null;
|
|
25
|
+
const X = {
|
|
26
|
+
image: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/image_active.png`,
|
|
27
|
+
file: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/file_active.png`,
|
|
28
|
+
record: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/record_active.png`,
|
|
29
|
+
text: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/text_active.png`,
|
|
30
|
+
video: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/video_active.png`
|
|
31
|
+
}, h = (n) => {
|
|
32
|
+
D("emitHandler", n);
|
|
33
|
+
};
|
|
34
|
+
G(
|
|
35
|
+
() => C.isToolActive(I.componentId),
|
|
36
|
+
(n) => {
|
|
37
|
+
var o, t;
|
|
38
|
+
if (n)
|
|
39
|
+
!v && ((t = window.bimViewer) != null && t.annotationTool) && g();
|
|
40
|
+
else if (m.value = "", (o = window.bimViewer) != null && o.annotationTool && typeof window.bimViewer.annotationTool.setEnabled == "function")
|
|
41
|
+
try {
|
|
42
|
+
window.bimViewer.annotationTool.setEnabled(!1);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.warn("[Bimx Engine] setEnabled(false) on close failed:", e);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
), J(() => {
|
|
48
|
+
var n;
|
|
49
|
+
W.value = a("annoLimit"), C.setReadyById(I.componentId), !v && ((n = window.bimViewer) != null && n.annotationTool) && g();
|
|
50
|
+
}), K(() => {
|
|
51
|
+
if (E.off("BimViewer", g), E.off("setAnnoStatus", P), p && w) {
|
|
52
|
+
try {
|
|
53
|
+
p.removeEventListener("click", w);
|
|
54
|
+
} catch (n) {
|
|
55
|
+
console.warn("[Bimx Engine] remove canvas click listener failed:", n);
|
|
56
|
+
}
|
|
57
|
+
p = null, w = null;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
function A(n) {
|
|
61
|
+
var o;
|
|
62
|
+
a("editPrivilege") != 1 && (!v && ((o = window.bimViewer) != null && o.annotationTool) && g(), m.value === n.code ? (m.value = "", L(n, !1)) : (m.value = n.code, L(n, !0)));
|
|
63
|
+
}
|
|
64
|
+
function P(n) {
|
|
65
|
+
const o = U(n.type);
|
|
66
|
+
o && A(o);
|
|
67
|
+
}
|
|
68
|
+
function g() {
|
|
69
|
+
if (!window.bimViewer || !window.bimViewer.annotationTool || !window.bimViewer.eventTrigger) {
|
|
70
|
+
console.warn("[Bimx Engine] bindEngineIntegration skipped: bimViewer/annotationTool/eventTrigger missing.");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (v) return;
|
|
74
|
+
s = window.bimViewer.annotationTool, $ = window.bimViewer.eventTrigger;
|
|
75
|
+
try {
|
|
76
|
+
s.setTypeImage(X);
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.warn("[Bimx Engine] setTypeImage failed:", e);
|
|
79
|
+
}
|
|
80
|
+
const n = (e, r) => {
|
|
81
|
+
const b = [
|
|
82
|
+
{ label: "annotationTool", obj: s },
|
|
83
|
+
{ label: "annotationTool.eventTrigger", obj: s == null ? void 0 : s.eventTrigger },
|
|
84
|
+
{ label: "bimViewer.eventTrigger", obj: $ }
|
|
85
|
+
];
|
|
86
|
+
let T = 0;
|
|
87
|
+
for (const c of b)
|
|
88
|
+
if (c.obj && typeof c.obj.on == "function")
|
|
89
|
+
try {
|
|
90
|
+
c.obj.on(e, r), T++;
|
|
91
|
+
} catch (k) {
|
|
92
|
+
console.warn(`[Bimx Engine] bind '${e}' on ${c.label} failed:`, k);
|
|
93
|
+
}
|
|
94
|
+
T === 0 && console.error(`[Bimx Engine] no emitter accepted '${e}' subscription!`);
|
|
95
|
+
}, o = /* @__PURE__ */ new WeakSet(), t = (e) => !e || typeof e != "object" ? !1 : o.has(e) ? !0 : (o.add(e), !1);
|
|
96
|
+
n("createAnnotation", (e) => {
|
|
97
|
+
t(e) || h({
|
|
98
|
+
isTool: !0,
|
|
99
|
+
event_target: "AnnotationTool",
|
|
100
|
+
event_name: "createAnnotation",
|
|
101
|
+
content: { currentAnnotation: e }
|
|
102
|
+
});
|
|
103
|
+
}), n("markerClicked", (e) => {
|
|
104
|
+
t(e) || h({
|
|
105
|
+
isTool: !0,
|
|
106
|
+
event_target: "AnnotationTool",
|
|
107
|
+
event_name: "clickAnnotation",
|
|
108
|
+
content: { targetAnno: e }
|
|
109
|
+
});
|
|
110
|
+
}), a("isMobile") || n("requestDeleteMarker", (e) => {
|
|
111
|
+
h({
|
|
112
|
+
isTool: !0,
|
|
113
|
+
event_target: "AnnotationTool",
|
|
114
|
+
event_name: "requestDelAnno",
|
|
115
|
+
content: {
|
|
116
|
+
msg: "请求删除指定标注",
|
|
117
|
+
annoId: e
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}), v = !0, R();
|
|
121
|
+
}
|
|
122
|
+
function L(n, o) {
|
|
123
|
+
q(o), H(n.code, o), h({
|
|
124
|
+
isTool: !0,
|
|
125
|
+
event_target: "AnnotationTool",
|
|
126
|
+
event_name: "clickAnnoTool",
|
|
127
|
+
content: {
|
|
128
|
+
active: o,
|
|
129
|
+
tool_type: n.code
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function H(n, o) {
|
|
134
|
+
var t;
|
|
135
|
+
if ((t = window.bimViewer) != null && t.annotationTool)
|
|
136
|
+
try {
|
|
137
|
+
window.bimViewer.annotationTool.setCurrentType(n, o);
|
|
138
|
+
} catch {
|
|
139
|
+
try {
|
|
140
|
+
window.bimViewer.annotationTool.setCurrentType(n);
|
|
141
|
+
} catch (r) {
|
|
142
|
+
console.error("[Bimx Engine] setCurrentType failed:", r);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function q(n) {
|
|
147
|
+
var o;
|
|
148
|
+
if ((o = window.bimViewer) != null && o.annotationTool)
|
|
149
|
+
try {
|
|
150
|
+
window.bimViewer.annotationTool.setEnabled(n);
|
|
151
|
+
} catch (t) {
|
|
152
|
+
console.error("[Bimx Engine] setEnabled error:", t);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function R() {
|
|
156
|
+
var n, o, t, e, r, b, T;
|
|
157
|
+
try {
|
|
158
|
+
const c = ((e = (t = (o = (n = window.bimViewer) == null ? void 0 : n.viewer) == null ? void 0 : o.scene) == null ? void 0 : t.canvas) == null ? void 0 : e.canvas) || ((T = (b = (r = window.bimViewer) == null ? void 0 : r.scene) == null ? void 0 : b.canvas) == null ? void 0 : T.canvas);
|
|
159
|
+
if (!c || typeof c.addEventListener != "function") {
|
|
160
|
+
console.warn("[Bimx Engine] cannot locate xeokit canvas element to attach click listener.");
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
p = c, w = (k) => {
|
|
164
|
+
if (!(!s || typeof s.clickToCreateAnno != "function"))
|
|
165
|
+
try {
|
|
166
|
+
s.clickToCreateAnno(k);
|
|
167
|
+
} catch (z) {
|
|
168
|
+
console.error("[Bimx Engine] clickToCreateAnno(event) error:", z);
|
|
169
|
+
}
|
|
170
|
+
}, c.addEventListener("click", w);
|
|
171
|
+
} catch (c) {
|
|
172
|
+
console.warn("[Bimx Engine] attach canvas click listener failed:", c);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function U(n) {
|
|
176
|
+
if (n === "image") return f[0];
|
|
177
|
+
if (n === "record") return f[1];
|
|
178
|
+
if (n === "video") return f[2];
|
|
179
|
+
if (n === "file") return f[3];
|
|
180
|
+
if (n === "text") return f[4];
|
|
181
|
+
}
|
|
182
|
+
return E.on("BimViewer", g), E.on("setAnnoStatus", P), (n, o) => {
|
|
183
|
+
const t = F;
|
|
184
|
+
return l(), d("div", rn, [
|
|
185
|
+
i(a)("isMobile") ? (l(), d("div", _n, [
|
|
186
|
+
u("div", fn, [
|
|
187
|
+
u("div", bn, [
|
|
188
|
+
(l(!0), d(S, null, N(i(f), (e, r) => (l(), d("div", {
|
|
189
|
+
key: r,
|
|
190
|
+
class: B(["label-item", { "label-item-active": m.value === e.code && i(a)("editPrivilege") == 0, noPermission: i(a)("editPrivilege") == 1 }]),
|
|
191
|
+
onClick: (b) => A(e)
|
|
192
|
+
}, [
|
|
193
|
+
u("div", wn, [
|
|
194
|
+
u("img", {
|
|
195
|
+
class: "label-item-img",
|
|
196
|
+
src: i(_) + `/bim-viewer/annotation/new-icons/bimkk-mobile-anno-${m.value === e.code && i(a)("editPrivilege") == 0 ? e.imgActive : e.img}.svg`,
|
|
197
|
+
alt: ""
|
|
198
|
+
}, null, 8, gn),
|
|
199
|
+
u("div", Tn, Q(i(O)(e.name)), 1)
|
|
200
|
+
])
|
|
201
|
+
], 10, vn))), 128))
|
|
202
|
+
])
|
|
203
|
+
])
|
|
204
|
+
])) : (l(), d("div", cn, [
|
|
205
|
+
i(a)("annotationPos").pos.includes("top") ? (l(), d("div", sn)) : y("", !0),
|
|
206
|
+
u("div", {
|
|
207
|
+
class: B(["annotation_toolbar_wrapper", { annotation_toolbar_wrapper_disable: i(a)("editPrivilege") == 1 }])
|
|
208
|
+
}, [
|
|
209
|
+
u("div", ln, [
|
|
210
|
+
(l(!0), d(S, null, N(i(f), (e, r) => (l(), d("button", {
|
|
211
|
+
id: `annotation_tool_btn_${r}`,
|
|
212
|
+
key: r,
|
|
213
|
+
class: B(["annotation_tool_btn", { active: m.value === e.code }]),
|
|
214
|
+
disabled: i(a)("editPrivilege") == 1,
|
|
215
|
+
onClick: (b) => A(e)
|
|
216
|
+
}, [
|
|
217
|
+
y("", !0),
|
|
218
|
+
u("img", {
|
|
219
|
+
src: `${i(_)}/bim-viewer/action-bars/panno-${m.value !== e.code ? e.img : e.imgActive}.svg`
|
|
220
|
+
}, null, 8, mn)
|
|
221
|
+
], 10, dn))), 128))
|
|
222
|
+
])
|
|
223
|
+
], 2),
|
|
224
|
+
i(a)("annotationPos").pos.includes("bottom") ? (l(), d("div", un)) : y("", !0)
|
|
225
|
+
])),
|
|
226
|
+
Z(nn(t, {
|
|
227
|
+
"click-handle": () => {
|
|
228
|
+
x.value = !1;
|
|
229
|
+
}
|
|
230
|
+
}, null, 8, ["click-handle"]), [
|
|
231
|
+
[en, x.value && i(a)("editPrivilege") == 0]
|
|
232
|
+
])
|
|
233
|
+
]);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}), Vn = /* @__PURE__ */ an(pn, [["__scopeId", "data-v-a8fb218b"]]);
|
|
237
|
+
export {
|
|
238
|
+
Vn as default
|
|
239
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { au as e, M as t, av as o, aw as i, V as l, ax as n, ay as I, az as r, aA as C, aB as f, aC as g, aD as u, aE as B, J as M } from "./index-BDupeKSG.mjs";
|
|
2
2
|
export {
|
|
3
3
|
e as BIMXViewer,
|
|
4
4
|
t as BIMX_CONFIGS,
|
|
@@ -12,6 +12,6 @@ export {
|
|
|
12
12
|
f as setGlobalI18n,
|
|
13
13
|
g as setI18nInstance,
|
|
14
14
|
u as setToolStatusById,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
B as setToolStatusBykey,
|
|
16
|
+
M as useLocaleStore
|
|
17
17
|
};
|