zyf-model-engine 0.0.1 → 0.1.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/index.cjs +293 -0
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.mjs +21645 -0
- package/package.json +29 -99
- package/style.css +1 -0
- package/types/components/CSvgIcon/components/SvgPathIcon.vue.d.ts +9 -0
- package/types/components/CSvgIcon/defaultIcons.d.ts +23 -0
- package/types/components/CSvgIcon/index.vue.d.ts +30 -0
- package/types/components/Empty/index.vue.d.ts +16 -0
- package/types/components/Overflow/index.vue.d.ts +11 -0
- package/types/components/UtilsMenu/components/BaseInfo/index.vue.d.ts +122 -0
- package/types/components/UtilsMenu/components/Card/index.vue.d.ts +42 -0
- package/types/components/UtilsMenu/components/ComInfo/index.vue.d.ts +128 -0
- package/types/components/UtilsMenu/components/Config/index.vue.d.ts +8 -0
- package/types/components/UtilsMenu/components/Cutting/clipping.d.ts +56 -0
- package/types/components/UtilsMenu/components/Cutting/index.vue.d.ts +128 -0
- package/types/components/UtilsMenu/components/Measure/index.vue.d.ts +122 -0
- package/types/components/UtilsMenu/components/Measure/interface/index.d.ts +5 -0
- package/types/components/UtilsMenu/components/Measure/measure.d.ts +106 -0
- package/types/components/UtilsMenu/components/ModelTree/index.vue.d.ts +875 -0
- package/types/components/UtilsMenu/components/ModelTree/interface/index.d.ts +19 -0
- package/types/components/UtilsMenu/components/ModelTree/utils/index.d.ts +13 -0
- package/types/components/UtilsMenu/components/Roam/index.vue.d.ts +125 -0
- package/types/components/UtilsMenu/components/SubMenu/index.vue.d.ts +18 -0
- package/types/components/UtilsMenu/index.vue.d.ts +15 -0
- package/types/components/UtilsMenu/interface/index.d.ts +129 -0
- package/types/index-dxf.vue.d.ts +15 -0
- package/types/index.d.ts +209 -0
- package/types/index.vue.d.ts +18 -0
- package/types/libs/CFace.d.ts +16 -0
- package/types/libs/CLabel.d.ts +13 -0
- package/types/libs/CLine.d.ts +49 -0
- package/types/libs/CText.d.ts +17 -0
- package/types/libs/MathUtils.d.ts +26 -0
- package/types/libs/ViewCube.d.ts +21 -0
- package/types/libs/materials.d.ts +4 -0
- package/types/libs/svg.d.ts +26 -0
- package/types/libs/types.d.ts +177 -0
- package/types/main.d.ts +22 -0
- package/types/manager/highLightMeshManager.d.ts +31 -0
- package/types/manager/lightManager.d.ts +35 -0
- package/types/manager/rayCasterManager.d.ts +18 -0
- package/types/tools/Events.d.ts +15 -0
- package/types/tools/math.d.ts +13 -0
- package/types/vendor/DXFPaser/BatchingKey.d.ts +25 -0
- package/types/vendor/DXFPaser/DxfFetcher.d.ts +6 -0
- package/types/vendor/DXFPaser/DxfScene.d.ts +95 -0
- package/types/vendor/DXFPaser/DxfWorker.d.ts +44 -0
- package/types/vendor/DXFPaser/DynamicBuffer.d.ts +30 -0
- package/types/vendor/DXFPaser/Entity.d.ts +18 -0
- package/types/vendor/DXFPaser/MTextFormatParser.d.ts +15 -0
- package/types/vendor/DXFPaser/MaterialKey.d.ts +8 -0
- package/types/vendor/DXFPaser/RBTree.d.ts +5 -0
- package/types/vendor/DXFPaser/TextRenderer.d.ts +43 -0
- package/types/vendor/DXFPaser/index.d.ts +26 -0
- package/types/vendor/controls/BaseArrow.d.ts +20 -0
- package/types/vendor/controls/FirstPersonControls.d.ts +32 -0
- package/types/vendor/controls/FlyControls.d.ts +18 -0
- package/types/vendor/controls/OrbitControls.d.ts +75 -0
- package/types/vendor/controls/TransformControls.d.ts +41 -0
- package/types/vendor/controls/directionControls.d.ts +26 -0
- package/types/vendor/loaders/GLTFLoader.d.ts +71 -0
- package/types/workbench/DxfViewer.d.ts +16 -0
- package/types/workbench/clickInfo.d.ts +24 -0
- package/types/workbench/clipping.d.ts +62 -0
- package/types/workbench/dxfMeasure.d.ts +92 -0
- package/types/workbench/dxfTools.d.ts +78 -0
- package/types/workbench/functionalComponent.d.ts +127 -0
- package/types/workbench/modelTree.d.ts +89 -0
- package/.editorconfig +0 -15
- package/.env +0 -13
- package/.env.development +0 -20
- package/.env.production +0 -25
- package/.env.test +0 -25
- package/.eslintignore +0 -15
- package/.eslintrc-auto-import.json +0 -65
- package/.eslintrc.cjs +0 -66
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -5
- package/.prettierignore +0 -9
- package/.prettierrc.cjs +0 -41
- package/.stylelintignore +0 -4
- package/.stylelintrc.cjs +0 -40
- package/.vscode/extensions.json +0 -14
- package/.vscode/settings.json +0 -92
- package/CHANGELOG.md +0 -246
- package/LICENSE +0 -21
- package/README.md +0 -205
- package/auto-imports.d.ts +0 -132
- package/build/getEnv.ts +0 -46
- package/build/plugins.ts +0 -138
- package/build/proxy.ts +0 -28
- package/commitlint.config.cjs +0 -84
- package/components.d.ts +0 -28
- package/index.html +0 -105
- package/lint-staged.config.cjs +0 -8
- package/postcss.config.cjs +0 -5
- package/public/logo.png +0 -0
- package/src/App.vue +0 -16
- package/src/api/config/servicePort.ts +0 -3
- package/src/api/enums/httpEnum.ts +0 -35
- package/src/api/helper/axiosCancel.ts +0 -50
- package/src/api/helper/axiosFileCancel.ts +0 -62
- package/src/api/helper/checkStatus.ts +0 -97
- package/src/api/index.ts +0 -142
- package/src/api/interface/index.ts +0 -27
- package/src/assets/global-icons/icon-demo.svg +0 -1
- package/src/assets/iconfont/iconfont.scss +0 -44
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/images/empty-img.png +0 -0
- package/src/assets/option-icons/add.svg +0 -1
- package/src/assets/option-icons/check.svg +0 -1
- package/src/assets/option-icons/config.svg +0 -1
- package/src/assets/option-icons/del.svg +0 -1
- package/src/assets/option-icons/detail.svg +0 -1
- package/src/assets/option-icons/edit.svg +0 -2
- package/src/assets/option-icons/export.svg +0 -1
- package/src/assets/option-icons/folder.svg +0 -1
- package/src/assets/option-icons/full-screen.svg +0 -1
- package/src/assets/option-icons/more.svg +0 -1
- package/src/assets/option-icons/return.svg +0 -1
- package/src/assets/option-icons/search.svg +0 -1
- package/src/components/CSvgIcon/index.scss +0 -23
- package/src/components/CSvgIcon/index.vue +0 -74
- package/src/components/CTree/index.scss +0 -48
- package/src/components/CTree/index.vue +0 -176
- package/src/components/CTree/interface/index.ts +0 -6
- package/src/components/Dialog/index.scss +0 -74
- package/src/components/Dialog/index.vue +0 -87
- package/src/components/Empty/index.scss +0 -16
- package/src/components/Empty/index.vue +0 -43
- package/src/components/Grid/components/GridItem.vue +0 -68
- package/src/components/Grid/index.vue +0 -167
- package/src/components/Grid/interface/index.ts +0 -6
- package/src/components/Loading/index.scss +0 -67
- package/src/components/Loading/index.vue +0 -13
- package/src/components/Overflow/index.vue +0 -76
- package/src/components/ProTable/components/ColSetting.vue +0 -45
- package/src/components/ProTable/components/Pagination.vue +0 -29
- package/src/components/ProTable/components/SearchForm/components/SearchFormItem.vue +0 -93
- package/src/components/ProTable/components/SearchForm/index.scss +0 -12
- package/src/components/ProTable/components/SearchForm/index.vue +0 -91
- package/src/components/ProTable/components/TableColumn.vue +0 -56
- package/src/components/ProTable/index.scss +0 -14
- package/src/components/ProTable/index.vue +0 -274
- package/src/components/ProTable/interface/index.ts +0 -86
- package/src/components/ScrollBox/index.vue +0 -44
- package/src/components/SvgIcon/index.vue +0 -20
- package/src/components/Tabs/index.vue +0 -142
- package/src/config/index.ts +0 -12
- package/src/config/nprogress.ts +0 -12
- package/src/config/piniaPersist.ts +0 -19
- package/src/config/serviceLoading.ts +0 -45
- package/src/enums/httpEnum.ts +0 -24
- package/src/hooks/interface/index.ts +0 -32
- package/src/hooks/useOnline.ts +0 -27
- package/src/hooks/useTable.ts +0 -167
- package/src/main.ts +0 -35
- package/src/plugins/button/button.vue +0 -56
- package/src/plugins/index.js +0 -26
- package/src/plugins/index.vue +0 -24
- package/src/plugins/msg/msg.vue +0 -56
- package/src/stores/commonStore.ts +0 -9
- package/src/stores/index.ts +0 -8
- package/src/stores/interface/index.ts +0 -1
- package/src/styles/common.scss +0 -87
- package/src/styles/element.scss +0 -233
- package/src/styles/reset.scss +0 -20
- package/src/styles/var.scss +0 -2
- package/src/typings/global.d.ts +0 -37
- package/src/typings/window.d.ts +0 -8
- package/src/utils/color.ts +0 -59
- package/src/utils/commonUtils.ts +0 -175
- package/src/utils/errorHandler.ts +0 -28
- package/src/utils/is.ts +0 -147
- package/src/utils/layoutUtils.ts +0 -83
- package/src/utils/localUtils.ts +0 -42
- package/src/utils/serviceDict.ts +0 -9
- package/src/vite-env.d.ts +0 -6
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -76
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TreeProps, TreeNodeData } from 'element-plus/es/components/tree-v2/src/types';
|
|
2
|
+
import { Group } from 'three';
|
|
3
|
+
import { CardProp } from '../../../interface/index';
|
|
4
|
+
import { default as Viewer } from '../../../../..';
|
|
5
|
+
export type TabType = "model" | "floor" | "category";
|
|
6
|
+
type MutableOptionalTreeConfig = Partial<Mutable<TreeProps>>;
|
|
7
|
+
export interface ModelTreeProps extends CardProp {
|
|
8
|
+
viewer?: Viewer;
|
|
9
|
+
tabs?: TabType[];
|
|
10
|
+
jsonFileUrl?: string;
|
|
11
|
+
model?: Group;
|
|
12
|
+
loadCallback?: () => any;
|
|
13
|
+
nodeCheckCallback?: (data: TreeNodeData, checked: boolean) => any;
|
|
14
|
+
nodeClickCallback?: (data: any) => any;
|
|
15
|
+
treeConfig?: MutableOptionalTreeConfig;
|
|
16
|
+
hiddenMeshGuids?: string[];
|
|
17
|
+
changeTabSaveHiddenMesh?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 加载 JSON 格式的模型树。
|
|
3
|
+
* @param url - JSON 文件的 URL
|
|
4
|
+
* @param loaded - 加载完成后的回调函数
|
|
5
|
+
* @param hiddenMeshGuids - 隐藏构件的guid
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadTreeJson(url: string, name: string, hiddenMeshGuids?: string[], changeTabSaveHiddenMesh?: boolean): Promise<{
|
|
8
|
+
category: any;
|
|
9
|
+
floor: any;
|
|
10
|
+
model: any;
|
|
11
|
+
secondUuids: any[];
|
|
12
|
+
hiddenSecondIds: Record<string, string>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { RoamChildProp } from '../../interface/index';
|
|
2
|
+
type __VLS_Props = RoamChildProp & {
|
|
3
|
+
state: "fly" | "person";
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
6
|
+
getCardDOMRect: () => any;
|
|
7
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
8
|
+
CardRef: {
|
|
9
|
+
$: import('vue').ComponentInternalInstance;
|
|
10
|
+
$data: {};
|
|
11
|
+
$props: Partial<{
|
|
12
|
+
size: {
|
|
13
|
+
width?: string;
|
|
14
|
+
height?: string;
|
|
15
|
+
};
|
|
16
|
+
close: boolean;
|
|
17
|
+
drag: boolean;
|
|
18
|
+
resize: boolean;
|
|
19
|
+
position: {
|
|
20
|
+
left?: string;
|
|
21
|
+
right?: string;
|
|
22
|
+
top?: string;
|
|
23
|
+
bottom?: string;
|
|
24
|
+
};
|
|
25
|
+
z: number;
|
|
26
|
+
}> & Omit<{
|
|
27
|
+
readonly title?: string;
|
|
28
|
+
readonly render?: import('vue').Component;
|
|
29
|
+
readonly z?: number;
|
|
30
|
+
readonly size?: {
|
|
31
|
+
width?: string;
|
|
32
|
+
height?: string;
|
|
33
|
+
};
|
|
34
|
+
readonly position?: {
|
|
35
|
+
left?: string;
|
|
36
|
+
right?: string;
|
|
37
|
+
top?: string;
|
|
38
|
+
bottom?: string;
|
|
39
|
+
};
|
|
40
|
+
readonly resize?: boolean;
|
|
41
|
+
readonly resizeCallback?: (rect: DOMRect) => void;
|
|
42
|
+
readonly drag?: boolean;
|
|
43
|
+
readonly dragCallback?: (rect: DOMRect) => void;
|
|
44
|
+
readonly close?: boolean;
|
|
45
|
+
readonly closeCallback?: (rect?: DOMRect | undefined) => void;
|
|
46
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "size" | "close" | "drag" | "resize" | "position" | "z">;
|
|
47
|
+
$attrs: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
};
|
|
50
|
+
$refs: {
|
|
51
|
+
[x: string]: unknown;
|
|
52
|
+
} & {
|
|
53
|
+
basePanel: HTMLDivElement;
|
|
54
|
+
};
|
|
55
|
+
$slots: Readonly<{
|
|
56
|
+
[name: string]: import('vue').Slot<any>;
|
|
57
|
+
}>;
|
|
58
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
59
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
60
|
+
$host: Element | null;
|
|
61
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
62
|
+
$el: HTMLDivElement;
|
|
63
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('../../interface/index').CardProp> & Readonly<{}>, {
|
|
64
|
+
getBoundingClientRect: () => DOMRect;
|
|
65
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
66
|
+
size: {
|
|
67
|
+
width?: string;
|
|
68
|
+
height?: string;
|
|
69
|
+
};
|
|
70
|
+
close: boolean;
|
|
71
|
+
drag: boolean;
|
|
72
|
+
resize: boolean;
|
|
73
|
+
position: {
|
|
74
|
+
left?: string;
|
|
75
|
+
right?: string;
|
|
76
|
+
top?: string;
|
|
77
|
+
bottom?: string;
|
|
78
|
+
};
|
|
79
|
+
z: number;
|
|
80
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
81
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
82
|
+
created?: (() => void) | (() => void)[];
|
|
83
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
84
|
+
mounted?: (() => void) | (() => void)[];
|
|
85
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
86
|
+
updated?: (() => void) | (() => void)[];
|
|
87
|
+
activated?: (() => void) | (() => void)[];
|
|
88
|
+
deactivated?: (() => void) | (() => void)[];
|
|
89
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
90
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
91
|
+
destroyed?: (() => void) | (() => void)[];
|
|
92
|
+
unmounted?: (() => void) | (() => void)[];
|
|
93
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
94
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
95
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
96
|
+
};
|
|
97
|
+
$forceUpdate: () => void;
|
|
98
|
+
$nextTick: typeof import('vue').nextTick;
|
|
99
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
100
|
+
} & Readonly<{
|
|
101
|
+
size: {
|
|
102
|
+
width?: string;
|
|
103
|
+
height?: string;
|
|
104
|
+
};
|
|
105
|
+
close: boolean;
|
|
106
|
+
drag: boolean;
|
|
107
|
+
resize: boolean;
|
|
108
|
+
position: {
|
|
109
|
+
left?: string;
|
|
110
|
+
right?: string;
|
|
111
|
+
top?: string;
|
|
112
|
+
bottom?: string;
|
|
113
|
+
};
|
|
114
|
+
z: number;
|
|
115
|
+
}> & Omit<Readonly<import('../../interface/index').CardProp> & Readonly<{}>, "getBoundingClientRect" | ("size" | "close" | "drag" | "resize" | "position" | "z")> & import('vue').ShallowUnwrapRef<{
|
|
116
|
+
getBoundingClientRect: () => DOMRect;
|
|
117
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
118
|
+
$slots: {
|
|
119
|
+
header?(_: {}): any;
|
|
120
|
+
default?(_: {}): any;
|
|
121
|
+
footer?(_: {}): any;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
}, HTMLDivElement>;
|
|
125
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseProp } from '../../interface/index';
|
|
2
|
+
interface Prop {
|
|
3
|
+
leave?: number;
|
|
4
|
+
utils: {
|
|
5
|
+
[key: string]: BaseProp;
|
|
6
|
+
};
|
|
7
|
+
keyPath?: string[];
|
|
8
|
+
currentActive?: Record<string, BaseProp | undefined>;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import('vue').DefineComponent<Prop, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
handleSelect: (...args: any[]) => void;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<Prop> & Readonly<{
|
|
13
|
+
onHandleSelect?: (...args: any[]) => any;
|
|
14
|
+
}>, {
|
|
15
|
+
leave: number;
|
|
16
|
+
keyPath: string[];
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseProp, UtilsMenuProps } from './interface/index';
|
|
2
|
+
declare function batchDeselectAll(): void;
|
|
3
|
+
declare const _default: import('vue').DefineComponent<UtilsMenuProps, {
|
|
4
|
+
handleSelect: (key: string | string[], keyPath?: string[]) => void;
|
|
5
|
+
currentActive: import('vue').Ref<Record<string, BaseProp>, Record<string, BaseProp>>;
|
|
6
|
+
treeRef: import('vue').Ref<any, any>;
|
|
7
|
+
measureRef: import('vue').Ref<any, any>;
|
|
8
|
+
comInfoRef: import('vue').Ref<any, any>;
|
|
9
|
+
cuttingRef: import('vue').Ref<any, any>;
|
|
10
|
+
baseInfoRef: import('vue').Ref<any, any>;
|
|
11
|
+
configRef: import('vue').Ref<any, any>;
|
|
12
|
+
RoamRef: import('vue').Ref<any, any>;
|
|
13
|
+
batchDeselectAll: typeof batchDeselectAll;
|
|
14
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UtilsMenuProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { default as Viewer } from '../../..';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
import { TreeProps, TreeNodeData } from 'element-plus/es/components/tree-v2/src/types';
|
|
4
|
+
import { Group } from 'three';
|
|
5
|
+
export interface BaseValue {
|
|
6
|
+
label: string;
|
|
7
|
+
value: any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface BaseProp {
|
|
11
|
+
name: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
active?: boolean;
|
|
14
|
+
show?: boolean;
|
|
15
|
+
children?: Record<string, BaseProp>;
|
|
16
|
+
conflictKey?: string[];
|
|
17
|
+
activeCallback?: (...arg: any[]) => any;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface CardProp {
|
|
21
|
+
title?: string;
|
|
22
|
+
render?: Component;
|
|
23
|
+
z?: number;
|
|
24
|
+
size?: {
|
|
25
|
+
width?: string;
|
|
26
|
+
height?: string;
|
|
27
|
+
};
|
|
28
|
+
position?: {
|
|
29
|
+
left?: string;
|
|
30
|
+
right?: string;
|
|
31
|
+
top?: string;
|
|
32
|
+
bottom?: string;
|
|
33
|
+
};
|
|
34
|
+
resize?: boolean;
|
|
35
|
+
resizeCallback?: (rect: DOMRect) => void;
|
|
36
|
+
drag?: boolean;
|
|
37
|
+
dragCallback?: (rect: DOMRect) => void;
|
|
38
|
+
close?: boolean;
|
|
39
|
+
closeCallback?: (rect?: DOMRect | undefined) => void;
|
|
40
|
+
}
|
|
41
|
+
export type TabType = "model" | "floor" | "category";
|
|
42
|
+
type MutableOptionalTreeConfig = Partial<Mutable<TreeProps>>;
|
|
43
|
+
export interface ModelTreeProps {
|
|
44
|
+
tabs?: TabType[];
|
|
45
|
+
jsonFileUrl: string;
|
|
46
|
+
model: Group;
|
|
47
|
+
loadCallback?: () => any;
|
|
48
|
+
nodeCheckCallback?: (data: TreeNodeData, checked: boolean) => any;
|
|
49
|
+
nodeClickCallback?: (data: any) => any;
|
|
50
|
+
treeConfig?: MutableOptionalTreeConfig;
|
|
51
|
+
hiddenMeshGuids?: string[];
|
|
52
|
+
changeTabSaveHiddenMesh?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface Tree {
|
|
55
|
+
viewer: Viewer;
|
|
56
|
+
config: ModelTreeProps;
|
|
57
|
+
cardConfig: CardProp;
|
|
58
|
+
}
|
|
59
|
+
interface Cutting {
|
|
60
|
+
children: {
|
|
61
|
+
global: BaseProp & {
|
|
62
|
+
cardConfig?: CardProp;
|
|
63
|
+
};
|
|
64
|
+
local: BaseProp & {
|
|
65
|
+
cardConfig?: CardProp;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
interface Screenshot {
|
|
70
|
+
config?: {
|
|
71
|
+
download?: boolean;
|
|
72
|
+
imgName?: string;
|
|
73
|
+
type?: "image/png" | "image/jpeg" | "image/jpg";
|
|
74
|
+
quality?: number;
|
|
75
|
+
screenshotCallback?: (data: string) => any;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface Measure {
|
|
79
|
+
viewer: Viewer;
|
|
80
|
+
cardConfig?: CardProp;
|
|
81
|
+
}
|
|
82
|
+
export interface BaseInfo {
|
|
83
|
+
viewer: Viewer;
|
|
84
|
+
cardConfig?: CardProp;
|
|
85
|
+
otherInfo?: BaseValue[];
|
|
86
|
+
}
|
|
87
|
+
export interface ComInfo {
|
|
88
|
+
viewer: Viewer;
|
|
89
|
+
cardConfig?: CardProp;
|
|
90
|
+
otherInfo?: Record<string, any>;
|
|
91
|
+
}
|
|
92
|
+
export interface Config {
|
|
93
|
+
viewer: Viewer;
|
|
94
|
+
cardConfig?: CardProp;
|
|
95
|
+
otherInfo?: {
|
|
96
|
+
modelLine?: boolean;
|
|
97
|
+
sectionLine?: boolean;
|
|
98
|
+
bgColor?: string[];
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export interface RoamChildProp {
|
|
102
|
+
viewer: Viewer;
|
|
103
|
+
cardConfig?: CardProp;
|
|
104
|
+
}
|
|
105
|
+
interface Roam {
|
|
106
|
+
children?: {
|
|
107
|
+
fly?: BaseProp & RoamChildProp;
|
|
108
|
+
person?: BaseProp & RoamChildProp;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export interface UtilsProp {
|
|
112
|
+
review?: BaseProp;
|
|
113
|
+
tree?: Tree & BaseProp;
|
|
114
|
+
roam?: Roam & BaseProp;
|
|
115
|
+
screenshot?: Screenshot & BaseProp;
|
|
116
|
+
cutting?: Cutting & BaseProp;
|
|
117
|
+
measure?: Measure & BaseProp;
|
|
118
|
+
comInfo?: ComInfo & BaseProp;
|
|
119
|
+
fullScreen?: BaseProp;
|
|
120
|
+
baseInfo?: BaseInfo & BaseProp;
|
|
121
|
+
config?: ComInfo & BaseProp;
|
|
122
|
+
[key: string]: BaseProp;
|
|
123
|
+
}
|
|
124
|
+
export interface UtilsMenuProps {
|
|
125
|
+
show?: boolean;
|
|
126
|
+
viewer: Viewer;
|
|
127
|
+
options?: UtilsProp;
|
|
128
|
+
}
|
|
129
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DxfViewer } from './workbench/DxfViewer';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
url: string;
|
|
4
|
+
showTools?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
7
|
+
viewer: () => DxfViewer;
|
|
8
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
url: string;
|
|
10
|
+
showTools: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
|
+
dxfTools: HTMLDivElement;
|
|
13
|
+
viewerDom: HTMLCanvasElement;
|
|
14
|
+
}, HTMLDivElement>;
|
|
15
|
+
export default _default;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Box3, BufferGeometry, Clock, Group, LineSegments, Mesh, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Vector3, WebGLRenderer } from 'three';
|
|
2
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
3
|
+
import { FlyControls } from './vendor/controls/FlyControls';
|
|
4
|
+
import { FirstPersonControls } from './vendor/controls/FirstPersonControls';
|
|
5
|
+
import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
6
|
+
import { controlParams, ViewerOptions } from './libs/types';
|
|
7
|
+
import { default as LightManager } from './manager/lightManager';
|
|
8
|
+
import { default as HighLightMeshManager } from './manager/highLightMeshManager';
|
|
9
|
+
import { default as RayCasterManager } from './manager/rayCasterManager';
|
|
10
|
+
import { default as WorkerPool } from './vendor/worker/index';
|
|
11
|
+
/**
|
|
12
|
+
* Viewer 类:用于管理和渲染 Three.js 场景。
|
|
13
|
+
* 提供了加载模型、控制相机、添加灯光、处理用户交互等功能。
|
|
14
|
+
*/
|
|
15
|
+
export default class Viewer {
|
|
16
|
+
allMesh: {
|
|
17
|
+
[k: string]: Object3D;
|
|
18
|
+
};
|
|
19
|
+
workerPool: WorkerPool;
|
|
20
|
+
readonly clock: Clock;
|
|
21
|
+
readonly time = 0;
|
|
22
|
+
private animationFrameId;
|
|
23
|
+
private person;
|
|
24
|
+
private cubeCamera;
|
|
25
|
+
private cubeScene;
|
|
26
|
+
private tempFileUrls;
|
|
27
|
+
lightManager: LightManager;
|
|
28
|
+
highLightMeshManager: HighLightMeshManager;
|
|
29
|
+
rayCasterManager: RayCasterManager;
|
|
30
|
+
perspectiveCamera: PerspectiveCamera;
|
|
31
|
+
orthographicCamera: OrthographicCamera;
|
|
32
|
+
floorGroup: Group;
|
|
33
|
+
orbitControl: OrbitControls;
|
|
34
|
+
flyControl: FlyControls;
|
|
35
|
+
firstControl: FirstPersonControls;
|
|
36
|
+
renderer: WebGLRenderer;
|
|
37
|
+
camera: PerspectiveCamera | OrthographicCamera;
|
|
38
|
+
scene: Scene;
|
|
39
|
+
element: HTMLCanvasElement;
|
|
40
|
+
objs: {
|
|
41
|
+
[k: string]: Object3D;
|
|
42
|
+
};
|
|
43
|
+
objects: {
|
|
44
|
+
[k: string]: Mesh | LineSegments;
|
|
45
|
+
};
|
|
46
|
+
resizeFlag: boolean;
|
|
47
|
+
containerGroup: Group;
|
|
48
|
+
controlType: string;
|
|
49
|
+
flag: boolean;
|
|
50
|
+
stopRender: boolean;
|
|
51
|
+
options: ViewerOptions;
|
|
52
|
+
initOptions: ViewerOptions;
|
|
53
|
+
utilsMenuRef: any;
|
|
54
|
+
/**
|
|
55
|
+
* 构造函数:初始化 Viewer 对象。
|
|
56
|
+
* @param dom - 绑定的 Canvas 元素
|
|
57
|
+
* @param options - 配置选项,包括是否显示 ViewCube 和背景透明度等
|
|
58
|
+
*/
|
|
59
|
+
constructor(dom: HTMLCanvasElement, options?: ViewerOptions);
|
|
60
|
+
setOptions(options: ViewerOptions, callback: () => any): void;
|
|
61
|
+
/**
|
|
62
|
+
* 初始化场景:设置相机、渲染器、灯光等。
|
|
63
|
+
* @param options - 配置选项
|
|
64
|
+
*/
|
|
65
|
+
private init;
|
|
66
|
+
/**
|
|
67
|
+
* 初始化 ViewCube。
|
|
68
|
+
* @returns 初始化的 ViewCube 对象
|
|
69
|
+
*/
|
|
70
|
+
private initCube;
|
|
71
|
+
/**
|
|
72
|
+
* 渲染场景。
|
|
73
|
+
*/
|
|
74
|
+
renderScene(): void;
|
|
75
|
+
/**
|
|
76
|
+
* 添加第一人称控制器。
|
|
77
|
+
* @param cube - 可选的 ViewCube 对象
|
|
78
|
+
*/
|
|
79
|
+
private addPerson;
|
|
80
|
+
/**
|
|
81
|
+
* 控制器参数
|
|
82
|
+
* @param type[string] orbit fly person
|
|
83
|
+
* @param params[controlParams] 控制器的相应参数
|
|
84
|
+
*/
|
|
85
|
+
setControl(type: string, params: controlParams): void;
|
|
86
|
+
/**
|
|
87
|
+
* 截图方法
|
|
88
|
+
* @param type 截图生成图片的格式
|
|
89
|
+
* @param quality 图片质量
|
|
90
|
+
* @returns base64 图片数据
|
|
91
|
+
*/
|
|
92
|
+
screenShoot(type?: "image/png" | "image/jpeg" | "image/jpg", quality?: number): string;
|
|
93
|
+
lookingDownEntity(uuids: string[], up: Vector3): void;
|
|
94
|
+
/**
|
|
95
|
+
* 初始化控制器:轨道控制器、飞行控制器、第一人称控制器。
|
|
96
|
+
*/
|
|
97
|
+
private initControl;
|
|
98
|
+
/**
|
|
99
|
+
* 添加实体到场景中 (以obj的uuid为索引记录到objs中 并添加到场景对象上)。
|
|
100
|
+
* @param obj - 要添加的 Object3D 对象
|
|
101
|
+
*/
|
|
102
|
+
addObject(obj: Object3D): void;
|
|
103
|
+
/**
|
|
104
|
+
* 添加射线检测对象到容器组中。
|
|
105
|
+
* @param obj - 要添加的 Object3D 对象
|
|
106
|
+
*/
|
|
107
|
+
addRays(obj: Object3D): void;
|
|
108
|
+
/**
|
|
109
|
+
* 调整场景大小。
|
|
110
|
+
* @param width - 新的宽度
|
|
111
|
+
* @param height - 新的高度
|
|
112
|
+
*/
|
|
113
|
+
resize(width: number, height: number): void;
|
|
114
|
+
/**
|
|
115
|
+
* 创建并返回一个新的 Group 对象 调用该函数时 自动将group加入到场景对象中 并将调用mesh对象的uuid作为key值记录到this.objs中。
|
|
116
|
+
* @returns 创建的 Group 对象
|
|
117
|
+
*/
|
|
118
|
+
private _createGroup;
|
|
119
|
+
/**
|
|
120
|
+
* 创建并添加 2D 标签到场景中。
|
|
121
|
+
* @param html - 标签的 HTML 内容
|
|
122
|
+
* @param position - 标签的位置
|
|
123
|
+
* @param callback - 点击标签时的回调函数
|
|
124
|
+
* @returns 创建的 CSS2DObject 对象
|
|
125
|
+
*/
|
|
126
|
+
create2DLabel(html: string, position: {
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
z: number;
|
|
130
|
+
}, callback?: () => void): CSS2DObject;
|
|
131
|
+
/**
|
|
132
|
+
* 加载 ZIP 格式的模型文件。
|
|
133
|
+
* @param zipData - ZIP 文件的二进制数据
|
|
134
|
+
* @param id - 模型的 ID
|
|
135
|
+
* @param loaded - 加载完成后的回调函数
|
|
136
|
+
* @returns 加载的模型对象
|
|
137
|
+
*/
|
|
138
|
+
loadZipModel(url: string, id: string, loadend: (utilsMenuRef: any) => void, loadError?: (error: any) => any): Promise<any>;
|
|
139
|
+
loadMultipleGlbModel(urls: string[], id: string, loadend: (utilsMenuRef: any) => void, loadError?: (error: any) => any): Promise<unknown>;
|
|
140
|
+
/**
|
|
141
|
+
* 加载模型并处理构件树。
|
|
142
|
+
* @param url - 模型文件的 URL
|
|
143
|
+
* @param images - 模型所需的图片
|
|
144
|
+
* @param loaded - 加载完成后的回调函数
|
|
145
|
+
* @param jsonUrl - 可选的 JSON 文件 URL
|
|
146
|
+
* @returns 加载的模型对象
|
|
147
|
+
*/
|
|
148
|
+
loadModel(modelUrls: string[], images: {
|
|
149
|
+
[k: string]: string;
|
|
150
|
+
} | null, loaded: (model: Group, jsonUrl?: string) => void): Object3D;
|
|
151
|
+
loadModelCallBack(model: Group, jsonUrl?: string, loadend?: (utilsMenuRef: any) => void): void;
|
|
152
|
+
/**
|
|
153
|
+
* 加载单个 GLB 文件。
|
|
154
|
+
* @param url - GLB 文件的 URL
|
|
155
|
+
* @param images - 模型所需的图片
|
|
156
|
+
* @param group - 模型组
|
|
157
|
+
* @param loaded - 加载完成后的回调函数
|
|
158
|
+
*/
|
|
159
|
+
private _loadGlbByUrl;
|
|
160
|
+
/**
|
|
161
|
+
* 设置第一人称控制器的拾取面信息。
|
|
162
|
+
* @param meshs - 需要拾取的 Mesh 对象
|
|
163
|
+
*/
|
|
164
|
+
setControlRays(meshs: Array<Mesh> | Mesh): void;
|
|
165
|
+
/**
|
|
166
|
+
* 重置视角。
|
|
167
|
+
* @param time - 重置动画的时间
|
|
168
|
+
*/
|
|
169
|
+
resetView(time?: number): void;
|
|
170
|
+
/**
|
|
171
|
+
* 设置指定构件的颜色。
|
|
172
|
+
* @param guids - 需要设置颜色的构件的 UUID 数组
|
|
173
|
+
* @param color - 颜色值
|
|
174
|
+
*/
|
|
175
|
+
setColorGroup(guids: string[], color: number): void;
|
|
176
|
+
hiddenObjectPartsByHiddenMeshGuids(): void;
|
|
177
|
+
setObjectPartsToBeVisibleAndHiddenByGuid(geometry: BufferGeometry, guid: string, visible: boolean): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* 播放相机动画。
|
|
180
|
+
* @param position - 相机目标位置
|
|
181
|
+
* @param target - 相机注视点
|
|
182
|
+
* @param up - 相机的上方向
|
|
183
|
+
* @param time - 动画时间
|
|
184
|
+
*/
|
|
185
|
+
animate(position: Vector3, target: Vector3, up?: Vector3, time?: number): void;
|
|
186
|
+
/**
|
|
187
|
+
* 切换相机类型。
|
|
188
|
+
* @param type - 相机类型:orthogonal | perspective
|
|
189
|
+
*/
|
|
190
|
+
toggleCamera(type: "orthogonal" | "perspective"): void;
|
|
191
|
+
/**
|
|
192
|
+
* 获取所有对象的包围盒。
|
|
193
|
+
* @returns 所有对象的包围盒
|
|
194
|
+
*/
|
|
195
|
+
getAllObjectBox(): Box3;
|
|
196
|
+
/**
|
|
197
|
+
* 设置相机和控制器的位置。
|
|
198
|
+
* @param position - 相机位置
|
|
199
|
+
* @param target - 相机注视点
|
|
200
|
+
*/
|
|
201
|
+
setCameraAndControl(position: Vector3, target: Vector3): void;
|
|
202
|
+
mergeBufferGeometries(geos: any, callback?: (geos: BufferGeometry | undefined) => any): void;
|
|
203
|
+
focusOnTheMesh(mesh: Mesh): void;
|
|
204
|
+
setAllMaterialsTransparent(opacity: number): void;
|
|
205
|
+
/**
|
|
206
|
+
* 销毁场景:释放资源并停止渲染。
|
|
207
|
+
*/
|
|
208
|
+
destroy(isInit?: boolean): void;
|
|
209
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ViewerOptions } from './libs/types';
|
|
2
|
+
export interface viewerProps {
|
|
3
|
+
url: string | string[];
|
|
4
|
+
options?: ViewerOptions;
|
|
5
|
+
loadZipModelCallback?: (ref: any) => any;
|
|
6
|
+
loadCallback?: (model: any) => any;
|
|
7
|
+
errorCallback?: (error: any) => any;
|
|
8
|
+
}
|
|
9
|
+
declare function loadModel(): Promise<void>;
|
|
10
|
+
declare const _default: import('vue').DefineComponent<viewerProps, {
|
|
11
|
+
viewer: any;
|
|
12
|
+
menuUtilsRef: any;
|
|
13
|
+
model: any;
|
|
14
|
+
loadModel: typeof loadModel;
|
|
15
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<viewerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
viewerDom: HTMLCanvasElement;
|
|
17
|
+
}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Mesh, Vector3 } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* 构建二维平面
|
|
4
|
+
* @param points Vector3点数组
|
|
5
|
+
* @param type 是否选择纯透明的面材质
|
|
6
|
+
* @returns Mesh
|
|
7
|
+
*/
|
|
8
|
+
export declare function createTwoFace(points: Vector3[], type?: boolean): Mesh;
|
|
9
|
+
/**
|
|
10
|
+
* @description 构建三维多边形面:对 points[0] 与后续每两点构成的三角形做三角剖分,
|
|
11
|
+
* 生成 BufferGeometry + 橙色半透明材质的 Mesh(type=true 时用纯透明材质)
|
|
12
|
+
* @param points Vector3 数组,至少 3 个点
|
|
13
|
+
* @param type true=透明面, false=面积面(默认 false)
|
|
14
|
+
* @returns Mesh
|
|
15
|
+
*/
|
|
16
|
+
export declare const createThreeFace: (points: Vector3[], type?: boolean) => Mesh;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {string} text 文本内容
|
|
6
|
+
* @param {Vector3} position 文本位置
|
|
7
|
+
* @param {string} size 文字大小 fontSize
|
|
8
|
+
* @param {string} color 文字颜色
|
|
9
|
+
* @param {string} bacColor 背景颜色
|
|
10
|
+
* @param {boolean} visible 是否可见
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function createLabel(text: string, position?: Vector3, size?: string, color?: string, bacColor?: string, visible?: boolean): CSS2DObject;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
import { Line2 } from 'three/examples/jsm/lines/Line2';
|
|
3
|
+
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry';
|
|
4
|
+
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial';
|
|
5
|
+
/**
|
|
6
|
+
* 多个顶点组成的连续直线
|
|
7
|
+
* 封装 three.js Line2 + LineGeometry + LineMaterial,支持实线/虚线、
|
|
8
|
+
* 颜色/线宽/透明度/状态(default/selected/highlight)、自动创建顶点小球等配置
|
|
9
|
+
*/
|
|
10
|
+
type CLineAttrs = {
|
|
11
|
+
vertexs?: Array<Vector3> | Array<Array<number>> | Array<number>;
|
|
12
|
+
dashed?: boolean;
|
|
13
|
+
color?: number;
|
|
14
|
+
lineWidth?: number;
|
|
15
|
+
transparent?: boolean;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
uuid?: string;
|
|
18
|
+
dashSize?: number;
|
|
19
|
+
gapSize?: number;
|
|
20
|
+
state?: "default" | "selected" | "highlight";
|
|
21
|
+
multistage?: boolean;
|
|
22
|
+
renderOrder?: number;
|
|
23
|
+
name?: string;
|
|
24
|
+
createPoints?: boolean;
|
|
25
|
+
constraint?: any;
|
|
26
|
+
marks?: any;
|
|
27
|
+
data?: any;
|
|
28
|
+
};
|
|
29
|
+
export declare class CLine extends Line2 {
|
|
30
|
+
name: string;
|
|
31
|
+
geometry: LineGeometry;
|
|
32
|
+
material: LineMaterial;
|
|
33
|
+
constructor(attrs?: CLineAttrs);
|
|
34
|
+
initUI(attrs?: CLineAttrs): void;
|
|
35
|
+
/**
|
|
36
|
+
* 设置顶点
|
|
37
|
+
* @param vertexs [vector3 , vector3 ...] | [ [a1,b1,c1 ] ,[ a2,b2,c2] ...] | [a,b,c,d...]
|
|
38
|
+
*/
|
|
39
|
+
setVertexs(vertexs: Array<Vector3> | Array<Array<number>> | Array<number>): CLine;
|
|
40
|
+
getVertexs(): Vector3[];
|
|
41
|
+
setDashed(dashed: boolean): void;
|
|
42
|
+
setDashSize(size: number): void;
|
|
43
|
+
setGapSize(size: number): void;
|
|
44
|
+
setLineWidth(linewidth?: number): void;
|
|
45
|
+
setTransparent(transparent: boolean): void;
|
|
46
|
+
setOpacity(opacity?: number): void;
|
|
47
|
+
setColor(color?: number): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Sprite } from 'three';
|
|
2
|
+
import { textType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @description 创建带圆角背景的文字 Sprite:通过 Canvas2D 绘制文字 + 背景圆角矩形,
|
|
5
|
+
* 再贴到 CanvasTexture → SpriteMaterial,返回一个始终面向相机的 Sprite
|
|
6
|
+
* @param attrs.text 显示文字, hPxText 字号(默认 50px), fgColor 字色,
|
|
7
|
+
* fontFamily 字体, bold 是否粗体, italic 是否斜体, bgColor 背景色
|
|
8
|
+
* @returns Sprite 或 undefined
|
|
9
|
+
*/
|
|
10
|
+
export declare const createText: (attrs: textType) => Sprite | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* @description 创建高度标注文字 Sprite(比 createText 字号大、支持文字对齐 textAlign),
|
|
13
|
+
* 用于标高测量结果的三维标签
|
|
14
|
+
* @param attrs 同 createText,额外支持 hWorldAll(世界坐标下的高度)
|
|
15
|
+
* @returns Sprite 或 undefined
|
|
16
|
+
*/
|
|
17
|
+
export declare const createHeightText: (attrs: textType) => Sprite | undefined;
|