vtkviewer-vue 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.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +753 -0
  3. package/README.md +1760 -0
  4. package/lib/types/components/PluginToolbar.vue.d.ts +7 -0
  5. package/lib/types/components/ToolbarExtension.vue.d.ts +9 -0
  6. package/lib/types/components/ToolbarInfoPanel.vue.d.ts +10 -0
  7. package/lib/types/components/VtkViewer.vue.d.ts +32 -0
  8. package/lib/types/components/index.d.ts +4 -0
  9. package/lib/types/composables/index.d.ts +7 -0
  10. package/lib/types/composables/useFormatLoader.d.ts +33 -0
  11. package/lib/types/composables/useResponsiveLayout.d.ts +46 -0
  12. package/lib/types/composables/useUIPlugins.d.ts +57 -0
  13. package/lib/types/composables/useViewer.d.ts +47 -0
  14. package/lib/types/configs/index.d.ts +76 -0
  15. package/lib/types/core/CommandRegistrar.d.ts +12 -0
  16. package/lib/types/core/CommandRegistry.d.ts +34 -0
  17. package/lib/types/core/ConfigAccessor.d.ts +33 -0
  18. package/lib/types/core/DisposalRegistry.d.ts +32 -0
  19. package/lib/types/core/EventBus.d.ts +79 -0
  20. package/lib/types/core/FormatDetector.d.ts +59 -0
  21. package/lib/types/core/I18nManager.d.ts +135 -0
  22. package/lib/types/core/InteractionSubContext.d.ts +73 -0
  23. package/lib/types/core/RenderSubContext.d.ts +74 -0
  24. package/lib/types/core/ResetManager.d.ts +122 -0
  25. package/lib/types/core/ResetRegistry.d.ts +170 -0
  26. package/lib/types/core/SceneSubContext.d.ts +25 -0
  27. package/lib/types/core/StateManager.d.ts +104 -0
  28. package/lib/types/core/ThemeContext.d.ts +37 -0
  29. package/lib/types/core/ToolbarExtensionRegistry.d.ts +105 -0
  30. package/lib/types/core/ToolbarInfoRegistry.d.ts +77 -0
  31. package/lib/types/core/UISubContext.d.ts +32 -0
  32. package/lib/types/core/ViewerContext.d.ts +101 -0
  33. package/lib/types/core/ViewerContextBuilder.d.ts +57 -0
  34. package/lib/types/core/createViewerContext.d.ts +26 -0
  35. package/lib/types/core/index.d.ts +23 -0
  36. package/lib/types/icons/index.d.ts +47 -0
  37. package/lib/types/index.d.ts +7 -0
  38. package/lib/types/plugins/PluginBase.d.ts +131 -0
  39. package/lib/types/plugins/PluginRegistry.d.ts +67 -0
  40. package/lib/types/plugins/defaults.d.ts +3 -0
  41. package/lib/types/plugins/format/DrcPlugin.d.ts +30 -0
  42. package/lib/types/plugins/format/GlbPlugin.d.ts +23 -0
  43. package/lib/types/plugins/format/ObjPlugin.d.ts +23 -0
  44. package/lib/types/plugins/format/PdbPlugin.d.ts +33 -0
  45. package/lib/types/plugins/format/PlyPlugin.d.ts +24 -0
  46. package/lib/types/plugins/format/StlPlugin.d.ts +25 -0
  47. package/lib/types/plugins/format/VtiPlugin.d.ts +60 -0
  48. package/lib/types/plugins/format/VtpPlugin.d.ts +24 -0
  49. package/lib/types/plugins/format/VtuPlugin.d.ts +25 -0
  50. package/lib/types/plugins/format/ZipPlugin.d.ts +38 -0
  51. package/lib/types/plugins/format/index.d.ts +13 -0
  52. package/lib/types/plugins/index.d.ts +13 -0
  53. package/lib/types/plugins/injectionKeys.d.ts +22 -0
  54. package/lib/types/plugins/pluginUtils.d.ts +61 -0
  55. package/lib/types/plugins/service/DragDropPlugin.d.ts +94 -0
  56. package/lib/types/plugins/service/KeyBindingPlugin.d.ts +83 -0
  57. package/lib/types/plugins/service/MemoryPressurePlugin.d.ts +68 -0
  58. package/lib/types/plugins/service/index.d.ts +6 -0
  59. package/lib/types/plugins/toolbar/animation/AnimationPlugin.d.ts +34 -0
  60. package/lib/types/plugins/toolbar/animation/index.d.ts +1 -0
  61. package/lib/types/plugins/toolbar/index.d.ts +9 -0
  62. package/lib/types/plugins/toolbar/interaction/CenterModelPlugin.d.ts +21 -0
  63. package/lib/types/plugins/toolbar/interaction/FullscreenPlugin.d.ts +27 -0
  64. package/lib/types/plugins/toolbar/interaction/PanPlugin.d.ts +24 -0
  65. package/lib/types/plugins/toolbar/interaction/ResetAllPlugin.d.ts +25 -0
  66. package/lib/types/plugins/toolbar/interaction/RotatePlugin.d.ts +24 -0
  67. package/lib/types/plugins/toolbar/interaction/ViewSelectPlugin.d.ts +26 -0
  68. package/lib/types/plugins/toolbar/interaction/ZoomPlugin.d.ts +24 -0
  69. package/lib/types/plugins/toolbar/interaction/index.d.ts +7 -0
  70. package/lib/types/plugins/toolbar/model/ClippingPlugin.d.ts +87 -0
  71. package/lib/types/plugins/toolbar/model/ColorByPlugin.d.ts +113 -0
  72. package/lib/types/plugins/toolbar/model/LoadModelPlugin.d.ts +93 -0
  73. package/lib/types/plugins/toolbar/model/RenderPrecisionPlugin.d.ts +68 -0
  74. package/lib/types/plugins/toolbar/model/RenderStylePlugin.d.ts +88 -0
  75. package/lib/types/plugins/toolbar/model/UnloadModelPlugin.d.ts +25 -0
  76. package/lib/types/plugins/toolbar/model/index.d.ts +6 -0
  77. package/lib/types/plugins/toolbar/scene/AxesPlugin.d.ts +96 -0
  78. package/lib/types/plugins/toolbar/scene/BackgroundColorPlugin.d.ts +25 -0
  79. package/lib/types/plugins/toolbar/scene/LanguageSwitchPlugin.d.ts +45 -0
  80. package/lib/types/plugins/toolbar/scene/LightIntensityPlugin.d.ts +42 -0
  81. package/lib/types/plugins/toolbar/scene/RenderGridPlugin.d.ts +98 -0
  82. package/lib/types/plugins/toolbar/scene/ThemeSwitchPlugin.d.ts +49 -0
  83. package/lib/types/plugins/toolbar/scene/index.d.ts +6 -0
  84. package/lib/types/plugins/toolbar/tools/BookmarkPlugin.d.ts +70 -0
  85. package/lib/types/plugins/toolbar/tools/MeasurementPlugin.d.ts +112 -0
  86. package/lib/types/plugins/toolbar/tools/PerformancePlugin.d.ts +55 -0
  87. package/lib/types/plugins/toolbar/tools/ScreenshotPlugin.d.ts +58 -0
  88. package/lib/types/plugins/toolbar/tools/index.d.ts +4 -0
  89. package/lib/types/plugins/toolbar/utils.d.ts +67 -0
  90. package/lib/types/plugins/types/index.d.ts +250 -0
  91. package/lib/types/plugins/ui/ErrorPlugin.d.ts +30 -0
  92. package/lib/types/plugins/ui/FilenameInfoPlugin.d.ts +40 -0
  93. package/lib/types/plugins/ui/LoadingPlugin.d.ts +28 -0
  94. package/lib/types/plugins/ui/SceneTreePlugin.d.ts +60 -0
  95. package/lib/types/plugins/ui/WebGLContextLostPlugin.d.ts +33 -0
  96. package/lib/types/plugins/ui/index.d.ts +8 -0
  97. package/lib/types/polyfills.d.ts +1 -0
  98. package/lib/types/types/index.d.ts +187 -0
  99. package/lib/types/types/vtk-modules.d.ts +80 -0
  100. package/lib/types/utils/asyncUtils.d.ts +8 -0
  101. package/lib/types/utils/colorByUtils.d.ts +55 -0
  102. package/lib/types/utils/debugLog.d.ts +13 -0
  103. package/lib/types/utils/errorHandler.d.ts +28 -0
  104. package/lib/types/utils/index.d.ts +10 -0
  105. package/lib/types/utils/sceneUtils.d.ts +11 -0
  106. package/lib/types/utils/themeManager.d.ts +78 -0
  107. package/lib/types/utils/volumeUtils.d.ts +14 -0
  108. package/lib/types/utils/vtkHelpers.d.ts +46 -0
  109. package/lib/types/utils/vtuLoader.d.ts +26 -0
  110. package/lib/types/utils/zipReader.d.ts +71 -0
  111. package/lib/vtkviewer.css +2 -0
  112. package/lib/vtkviewer.js +54714 -0
  113. package/lib/vtkviewer.umd.cjs +4560 -0
  114. package/package.json +89 -0
@@ -0,0 +1,94 @@
1
+ import { PluginConfig, IServicePlugin } from '../types';
2
+ import { PluginBase } from '../PluginBase';
3
+ /** 拖拽加载插件配置 */
4
+ export interface DragDropPluginConfig extends PluginConfig {
5
+ /** 是否允许多文件 */
6
+ multiple?: boolean;
7
+ /** 拖拽区域选择器 */
8
+ dropZoneSelector?: string;
9
+ /** 自定义验证函数 */
10
+ validateFile?: (file: File) => boolean | Promise<boolean>;
11
+ }
12
+ /**
13
+ * 拖拽加载插件
14
+ * 提供文件拖拽加载功能,包含文件验证和视觉反馈
15
+ */
16
+ export declare class DragDropPlugin extends PluginBase<DragDropPluginConfig> implements IServicePlugin {
17
+ readonly metadata: {
18
+ id: string;
19
+ name: string;
20
+ type: "service";
21
+ description: string;
22
+ };
23
+ readonly defaultConfig: DragDropPluginConfig;
24
+ private dropZone;
25
+ private isDragging;
26
+ private dragCounter;
27
+ private _disposed;
28
+ /** 由已注册格式插件动态构建的支持扩展名列表 */
29
+ private supportedExtensions;
30
+ private boundHandleDragEnter;
31
+ private boundHandleDragOver;
32
+ private boundHandleDragLeave;
33
+ private boundHandleDrop;
34
+ private boundPreventDefault;
35
+ private setupTimer;
36
+ protected onInit(): void;
37
+ /**
38
+ * 遍历已注册的格式插件,收集所有支持的扩展名
39
+ */
40
+ private refreshSupportedExtensions;
41
+ /**
42
+ * 设置拖拽事件监听
43
+ */
44
+ private setupDragDrop;
45
+ /**
46
+ * 处理拖拽进入
47
+ */
48
+ private handleDragEnter;
49
+ /**
50
+ * 处理拖拽悬停
51
+ */
52
+ private handleDragOver;
53
+ /**
54
+ * 处理拖拽离开
55
+ */
56
+ private handleDragLeave;
57
+ /**
58
+ * 处理文件放置
59
+ */
60
+ private handleDrop;
61
+ /**
62
+ * 验证文件
63
+ */
64
+ private validateFiles;
65
+ /**
66
+ * 获取文件扩展名
67
+ */
68
+ private getExtension;
69
+ /**
70
+ * 显示拖拽覆盖层
71
+ */
72
+ private showDropOverlay;
73
+ /**
74
+ * 隐藏拖拽覆盖层
75
+ */
76
+ private hideDropOverlay;
77
+ /**
78
+ * 显示错误信息
79
+ */
80
+ private showError;
81
+ /**
82
+ * 启用拖拽
83
+ */
84
+ enable(): void;
85
+ /**
86
+ * 禁用拖拽
87
+ */
88
+ disable(): void;
89
+ /**
90
+ * 移除拖拽事件监听
91
+ */
92
+ private removeDragDrop;
93
+ protected onDispose(): void;
94
+ }
@@ -0,0 +1,83 @@
1
+ import { KeyboardShortcutAction, PluginConfig, IServicePlugin } from '../types';
2
+ import { PluginBase } from '../PluginBase';
3
+ /** 快捷键注册项 */
4
+ interface KeyBindingEntry {
5
+ id: string;
6
+ shortcut: KeyboardShortcutAction;
7
+ pluginId: string;
8
+ }
9
+ /**
10
+ * 快捷键注册表
11
+ * 管理所有键盘快捷键的注册、冲突检测和执行
12
+ */
13
+ export declare class KeyBindingRegistry {
14
+ private bindings;
15
+ private keyMap;
16
+ /**
17
+ * 构建快捷键的完整按键字符串(包含修饰键)
18
+ * 字母键统一转为小写,避免 Caps Lock 导致不匹配
19
+ */
20
+ private buildShortcutKey;
21
+ /**
22
+ * 注册快捷键
23
+ */
24
+ register(pluginId: string, shortcut: KeyboardShortcutAction): void;
25
+ /**
26
+ * 注销插件的所有快捷键
27
+ */
28
+ unregisterPlugin(pluginId: string): void;
29
+ /**
30
+ * 处理键盘事件
31
+ */
32
+ handleKeydown(event: KeyboardEvent): void;
33
+ /**
34
+ * 构建按键字符串
35
+ * 字母键统一转为小写,避免 Caps Lock 导致不匹配
36
+ */
37
+ private buildKeyString;
38
+ /**
39
+ * 获取所有已注册的快捷键
40
+ */
41
+ getAll(): KeyBindingEntry[];
42
+ /**
43
+ * 检查快捷键是否已注册
44
+ */
45
+ has(key: string): boolean;
46
+ /**
47
+ * 检查快捷键是否已注册(使用完整按键字符串)
48
+ */
49
+ hasShortcut(shortcut: KeyboardShortcutAction): boolean;
50
+ /**
51
+ * 清除所有快捷键
52
+ */
53
+ clear(): void;
54
+ }
55
+ /** 键盘快捷键插件配置 */
56
+ export interface KeyBindingPluginConfig extends PluginConfig {
57
+ }
58
+ /**
59
+ * 键盘快捷键管理插件
60
+ * 采用延迟收集模式,在所有插件初始化完成后统一收集快捷键
61
+ */
62
+ export declare class KeyBindingPlugin extends PluginBase<KeyBindingPluginConfig> implements IServicePlugin {
63
+ readonly metadata: {
64
+ id: string;
65
+ name: string;
66
+ type: "service";
67
+ description: string;
68
+ };
69
+ private registry;
70
+ private keydownHandler;
71
+ protected onInit(): void;
72
+ /**
73
+ * 获取快捷键注册表(供外部调用)
74
+ */
75
+ getRegistry(): KeyBindingRegistry;
76
+ /**
77
+ * 延迟收集所有工具栏插件的快捷键
78
+ * 在所有插件初始化完成后执行
79
+ */
80
+ private collectShortcuts;
81
+ protected onDispose(): void;
82
+ }
83
+ export {};
@@ -0,0 +1,68 @@
1
+ import { PluginConfig, IServicePlugin } from '../types';
2
+ import { PluginBase } from '../PluginBase';
3
+ /** 内存压力等级 */
4
+ export type MemoryPressureLevel = 'normal' | 'warning' | 'danger';
5
+ /** 内存压力配置 */
6
+ export interface MemoryPressurePluginConfig extends PluginConfig {
7
+ /** 警告阈值(MB) */
8
+ warningThresholdMB?: number;
9
+ /** 危险阈值(MB) */
10
+ dangerThresholdMB?: number;
11
+ /** 监控间隔(ms) */
12
+ checkInterval?: number;
13
+ }
14
+ /** 内存统计信息 */
15
+ export interface MemoryStats {
16
+ usedMB: number;
17
+ totalMB: number;
18
+ limitMB: number;
19
+ pressureLevel: MemoryPressureLevel;
20
+ }
21
+ /**
22
+ * 内存压力管理插件
23
+ * 使用 performance.memory API 监控JavaScript堆内存
24
+ * 提供三级压力评估:normal/warning/danger
25
+ */
26
+ export declare class MemoryPressurePlugin extends PluginBase<MemoryPressurePluginConfig> implements IServicePlugin {
27
+ readonly metadata: {
28
+ id: string;
29
+ name: string;
30
+ type: "service";
31
+ description: string;
32
+ };
33
+ readonly defaultConfig: MemoryPressurePluginConfig;
34
+ private checkTimer;
35
+ private currentLevel;
36
+ protected onInit(): void;
37
+ /**
38
+ * 开始内存监控
39
+ */
40
+ private startMonitoring;
41
+ /**
42
+ * 检查内存使用情况
43
+ */
44
+ private checkMemory;
45
+ /**
46
+ * 计算压力等级
47
+ */
48
+ private calculatePressureLevel;
49
+ /**
50
+ * 保守清理策略
51
+ * 清理未使用纹理、不可见几何体
52
+ */
53
+ private performConservativeCleanup;
54
+ /**
55
+ * 激进清理策略
56
+ * 清理所有缓存、强制GC
57
+ */
58
+ private performAggressiveCleanup;
59
+ /**
60
+ * 获取当前内存统计
61
+ */
62
+ getStats(): MemoryStats | null;
63
+ /**
64
+ * 获取当前压力等级
65
+ */
66
+ getPressureLevel(): MemoryPressureLevel;
67
+ protected onDispose(): void;
68
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 服务插件导出
3
+ */
4
+ export * from './DragDropPlugin';
5
+ export * from './MemoryPressurePlugin';
6
+ export * from './KeyBindingPlugin';
@@ -0,0 +1,34 @@
1
+ import { PluginIcon, ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
2
+ import { PluginBase } from '../../PluginBase';
3
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
+ /** 动画插件配置 */
5
+ export interface AnimationPluginConfig extends ToolbarPluginConfig {
6
+ /** 播放状态图标 */
7
+ playIcon?: PluginIcon;
8
+ /** 暂停状态图标 */
9
+ pauseIcon?: PluginIcon;
10
+ }
11
+ export declare class AnimationPlugin extends PluginBase<AnimationPluginConfig> implements IToolbarPlugin {
12
+ readonly metadata: {
13
+ id: string;
14
+ name: string;
15
+ type: "toolbar";
16
+ description: string;
17
+ };
18
+ readonly order = 0;
19
+ readonly defaultConfig: AnimationPluginConfig;
20
+ private isPlaying;
21
+ private currentFrame;
22
+ private totalFrames;
23
+ protected onInit(): void;
24
+ protected onDispose(): void;
25
+ private play;
26
+ private pause;
27
+ private goToFrame;
28
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
29
+ [key: string]: any;
30
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
31
+ isVisible(): boolean;
32
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
33
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
34
+ }
@@ -0,0 +1 @@
1
+ export * from './AnimationPlugin';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 工具栏插件导出
3
+ */
4
+ export * from './interaction';
5
+ export * from './model';
6
+ export * from './tools';
7
+ export * from './animation';
8
+ export * from './scene';
9
+ export * from './utils';
@@ -0,0 +1,21 @@
1
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
2
+ import { PluginBase } from '../../PluginBase';
3
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
+ /** 居中模型插件配置 */
5
+ export interface CenterModelPluginConfig extends ToolbarPluginConfig {
6
+ }
7
+ export declare class CenterModelPlugin extends PluginBase<CenterModelPluginConfig> implements IToolbarPlugin {
8
+ readonly metadata: {
9
+ id: string;
10
+ name: string;
11
+ type: "toolbar";
12
+ description: string;
13
+ };
14
+ readonly order = 3;
15
+ readonly defaultConfig: CenterModelPluginConfig;
16
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
17
+ [key: string]: any;
18
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
19
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
20
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
21
+ }
@@ -0,0 +1,27 @@
1
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
2
+ import { PluginBase } from '../../PluginBase';
3
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
+ /** 全屏插件配置 */
5
+ export interface FullscreenPluginConfig extends ToolbarPluginConfig {
6
+ }
7
+ export declare class FullscreenPlugin extends PluginBase<FullscreenPluginConfig> implements IToolbarPlugin {
8
+ readonly metadata: {
9
+ id: string;
10
+ name: string;
11
+ type: "toolbar";
12
+ description: string;
13
+ };
14
+ readonly order = 1;
15
+ readonly defaultConfig: FullscreenPluginConfig;
16
+ private isFullscreen;
17
+ private boundOnFullscreenChange;
18
+ protected onInit(): void;
19
+ protected onDispose(): void;
20
+ private onFullscreenChange;
21
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
24
+ isVisible(): boolean;
25
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
26
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
27
+ }
@@ -0,0 +1,24 @@
1
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
2
+ import { PluginBase } from '../../PluginBase';
3
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
+ /** 平移插件配置 */
5
+ export interface PanPluginConfig extends ToolbarPluginConfig {
6
+ }
7
+ export declare class PanPlugin extends PluginBase<PanPluginConfig> implements IToolbarPlugin {
8
+ readonly metadata: {
9
+ id: string;
10
+ name: string;
11
+ type: "toolbar";
12
+ description: string;
13
+ };
14
+ readonly order = 2;
15
+ readonly defaultConfig: PanPluginConfig;
16
+ private active;
17
+ protected onInit(): void;
18
+ private onToolChanged;
19
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
20
+ [key: string]: any;
21
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
22
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
23
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
24
+ }
@@ -0,0 +1,25 @@
1
+ import { IResettableActions, ResetAction } from '../../../core';
2
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
3
+ import { PluginBase } from '../../PluginBase';
4
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
5
+ /** 重置所有插件配置 */
6
+ export interface ResetAllPluginConfig extends ToolbarPluginConfig {
7
+ }
8
+ export declare class ResetAllPlugin extends PluginBase<ResetAllPluginConfig> implements IToolbarPlugin, IResettableActions {
9
+ readonly metadata: {
10
+ id: string;
11
+ name: string;
12
+ type: "toolbar";
13
+ description: string;
14
+ };
15
+ readonly order = 4;
16
+ readonly defaultConfig: ResetAllPluginConfig;
17
+ registerResetActions(): ResetAction[];
18
+ /** 执行重置所有操作(仅重置相机和交互状态) */
19
+ private resetAll;
20
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
21
+ [key: string]: any;
22
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
23
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
24
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
25
+ }
@@ -0,0 +1,24 @@
1
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
2
+ import { PluginBase } from '../../PluginBase';
3
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
+ /** 旋转插件配置 */
5
+ export interface RotatePluginConfig extends ToolbarPluginConfig {
6
+ }
7
+ export declare class RotatePlugin extends PluginBase<RotatePluginConfig> implements IToolbarPlugin {
8
+ readonly metadata: {
9
+ id: string;
10
+ name: string;
11
+ type: "toolbar";
12
+ description: string;
13
+ };
14
+ readonly order = 0;
15
+ readonly defaultConfig: RotatePluginConfig;
16
+ private active;
17
+ protected onInit(): void;
18
+ private onToolChanged;
19
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
20
+ [key: string]: any;
21
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
22
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
23
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
24
+ }
@@ -0,0 +1,26 @@
1
+ import { IResettableActions, ResetAction } from '../../../core';
2
+ import { ToolbarPluginConfig, IToolbarPlugin } from '../../types';
3
+ import { PluginBase } from '../../PluginBase';
4
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
5
+ /** 视图选择插件配置 */
6
+ export interface ViewSelectPluginConfig extends ToolbarPluginConfig {
7
+ }
8
+ export declare class ViewSelectPlugin extends PluginBase<ViewSelectPluginConfig> implements IToolbarPlugin, IResettableActions {
9
+ readonly metadata: {
10
+ id: string;
11
+ name: string;
12
+ type: "toolbar";
13
+ description: string;
14
+ };
15
+ readonly order = 4;
16
+ readonly defaultConfig: ViewSelectPluginConfig;
17
+ /** 下拉框当前值(类级别状态) */
18
+ private currentValue;
19
+ protected onInit(): void;
20
+ /** 重置下拉框到默认状态 */
21
+ resetDropdown(): void;
22
+ registerResetActions(): ResetAction[];
23
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
24
+ [key: string]: any;
25
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
26
+ }
@@ -0,0 +1,24 @@
1
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
2
+ import { PluginBase } from '../../PluginBase';
3
+ import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
+ /** 缩放插件配置 */
5
+ export interface ZoomPluginConfig extends ToolbarPluginConfig {
6
+ }
7
+ export declare class ZoomPlugin extends PluginBase<ZoomPluginConfig> implements IToolbarPlugin {
8
+ readonly metadata: {
9
+ id: string;
10
+ name: string;
11
+ type: "toolbar";
12
+ description: string;
13
+ };
14
+ readonly order = 1;
15
+ readonly defaultConfig: ZoomPluginConfig;
16
+ private active;
17
+ protected onInit(): void;
18
+ private onToolChanged;
19
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
20
+ [key: string]: any;
21
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
22
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
23
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
24
+ }
@@ -0,0 +1,7 @@
1
+ export * from './CenterModelPlugin';
2
+ export * from './FullscreenPlugin';
3
+ export * from './PanPlugin';
4
+ export * from './ResetAllPlugin';
5
+ export * from './RotatePlugin';
6
+ export * from './ViewSelectPlugin';
7
+ export * from './ZoomPlugin';
@@ -0,0 +1,87 @@
1
+ import { Component, DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { IResettableActions, ResetAction } from '../../../core';
3
+ import { ToolbarPluginConfig, KeyboardShortcutConfigItem, KeyboardShortcutAction, IToolbarPlugin } from '../../types';
4
+ import { PluginBase } from '../../PluginBase';
5
+ type ClippingMode = 'clip' | 'cut' | 'section';
6
+ type NormalPreset = 'X' | 'Y' | 'Z' | '-X' | '-Y' | '-Z';
7
+ export interface ClippingPluginConfig extends ToolbarPluginConfig {
8
+ defaultMode?: ClippingMode;
9
+ defaultNormal?: NormalPreset;
10
+ insideOut?: boolean;
11
+ cutSectionColor?: [number, number, number];
12
+ enableWidget?: boolean;
13
+ }
14
+ export declare class ClippingPlugin extends PluginBase<ClippingPluginConfig> implements IToolbarPlugin, IResettableActions {
15
+ readonly metadata: {
16
+ id: string;
17
+ name: string;
18
+ type: "toolbar";
19
+ description: string;
20
+ };
21
+ readonly order = 5;
22
+ readonly defaultConfig: ClippingPluginConfig;
23
+ private enabled;
24
+ private mode;
25
+ private planeOrigin;
26
+ private planeNormal;
27
+ private insideOut;
28
+ private panelOpen;
29
+ private modelShow;
30
+ private widgetShow;
31
+ private lastClipParams;
32
+ private getClipParamsKey;
33
+ private plane;
34
+ private clipper;
35
+ private cutter;
36
+ private cutActors;
37
+ private widgetManager;
38
+ private widget;
39
+ private actorBackups;
40
+ protected onInit(): void;
41
+ protected onDispose(): void;
42
+ registerResetActions(): ResetAction[];
43
+ private initVtkResources;
44
+ private initWidget;
45
+ private destroyVtkResources;
46
+ private toggleClipping;
47
+ private enableClipping;
48
+ private disableClipping;
49
+ /** 切换模型可见性(暂时隐藏/显示原始模型,便于查看剖切工具) */
50
+ private toggleModelVisibility;
51
+ /** 设置场景模型的可见性 */
52
+ private setModelVisibility;
53
+ /** 切换剖切工具可见性(暂时隐藏/显示 widget,便于观察剖切面) */
54
+ private toggleWidgetVisibility;
55
+ /** 设置剖切工具 widget 的可见性 */
56
+ private setWidgetVisibility;
57
+ private setMode;
58
+ private setNormalPreset;
59
+ private flipDirection;
60
+ private applyClipping;
61
+ private getSceneActors;
62
+ private backupActorInputs;
63
+ private restoreActorInputs;
64
+ private clearCutActors;
65
+ private centerPlaneOnModel;
66
+ private onSceneLoaded;
67
+ private syncPlaneToState;
68
+ private syncStateToWidget;
69
+ private syncWidgetToPlane;
70
+ private scheduleClipUpdate;
71
+ private resetToDefaults;
72
+ private registerInfoPanel;
73
+ /** 重置剖切参数到初始状态(保持剖切开启) */
74
+ private resetClippingParams;
75
+ private registerExtension;
76
+ /** 渲染扩展区内容 */
77
+ renderExtension(): Component;
78
+ /** 扩展区是否激活 */
79
+ isExtensionActive(): boolean;
80
+ render(): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
81
+ [key: string]: any;
82
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
83
+ isVisible(): boolean;
84
+ getShortcutConfig(): KeyboardShortcutConfigItem[];
85
+ getKeyboardShortcutActions(): KeyboardShortcutAction[];
86
+ }
87
+ export {};