初始化

This commit is contained in:
yuding
2025-12-25 18:57:09 +08:00
parent 9b6959585d
commit bb82a1c555
45 changed files with 484 additions and 36938 deletions

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 全屏按钮配置
@@ -11,7 +12,7 @@ export const createFullscreenButton = (_engine: BimEngine): ButtonConfig => {
type: 'button',
label: 'toolbar.fullscreen',
align: 'vertical',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M5 5h5v2H7v3H5V5m9 0h5v5h-2V7h-3V5m3 9h2v5h-5v-2h3v-3m-7 3v2H5v-5h2v3h3z"/></svg>',
icon: getIcon('全屏'),
onClick: async () => {
console.log('全屏按钮被点击');

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 首页按钮配置
@@ -11,7 +12,7 @@ export const createHomeButton = (engine: BimEngine): ButtonConfig => {
groupId: 'group-1',
type: 'button',
label: 'toolbar.home',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M4 21V9l8-6l8 6v12h-6v-7h-4v7z"/></svg>',
icon: getIcon('主视角'),
keepActive: true,
onClick: (button) => {
console.log('首页按钮被点击:', button.id);

View File

@@ -1,20 +0,0 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
/**
* 定位按钮配置
*/
export const createLocationButton = (_engine: BimEngine): ButtonConfig => {
return {
id: 'location',
groupId: 'group-1',
type: 'button',
label: 'toolbar.location',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 13h2v-2.75h2V13h2V8.25l-3-2l-3 2zm3 9q-4.025-3.425-6.012-6.362T4 10.2q0-3.75 2.413-5.975T12 2t5.588 2.225T20 10.2q0 2.5-1.987 5.438T12 22"/></svg>',
keepActive: false,
onClick: (button) => {
// 预留:未来接入定位逻辑(此处已注入 engine
console.log('定位按钮被点击:', button.id);
}
};
};

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 地图按钮配置(开关按钮)
@@ -21,7 +22,7 @@ export const createMapButton = (engine: BimEngine): ButtonConfig => {
label: 'toolbar.map',
align: 'vertical',
keepActive: true,
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M20.5 3l-.16.03L15 5.1L9 3L3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1l5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"/></svg>',
icon: getIcon('地图'),
onClick: () => {
// 切换地图显示状态
if (engine.map?.isOpen()) {

View File

@@ -1,5 +1,6 @@
import type {ButtonConfig} from '../../../index.type';
import type {BimEngine} from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 测量按钮配置
@@ -11,7 +12,7 @@ export const createMeasureButton = (engine: BimEngine): ButtonConfig => {
groupId: 'group-1',
type: 'button',
label: 'toolbar.measure',
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M3 6a3 3 0 0 0-3 3v7a3 3 0 0 0 3 3h18a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3zm6 2H7v5a1 1 0 1 1-2 0V8H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1h-2v3a1 1 0 1 1-2 0V8h-2v5a1 1 0 1 1-2 0V8h-2v3a1 1 0 1 1-2 0z" clip-rule="evenodd"/></svg>',
icon: getIcon('测量'),
keepActive: true,
onClick: (button) => {
if (button.isActive) {

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 构件详情按钮配置
@@ -11,7 +12,7 @@ export const createPropertyButton = (engine: BimEngine): ButtonConfig => {
type: 'button',
label: 'toolbar.property',
align: 'vertical',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M13 9h5.5L13 3.5V9M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m0 18h12v-8H6v8m2-6h8v2H8v-2m0 4h5v2H8v-2z"/></svg>',
icon: getIcon('文档'),
onClick: () => {
console.log('构件详情按钮被点击');
engine.propertyPanel?.show();

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 轴向剖切按钮配置
@@ -14,7 +15,7 @@ export const createSectionAxisButton = (engine: BimEngine): ButtonConfig => {
exclusive: true,
align: 'vertical',
label: 'toolbar.sectionAxis',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><circle cx="12" cy="12" r="6" fill="currentColor"/></svg>',
icon: getIcon('轴向剖切'),
onClick: (button) => {
if (button.isActive) {
engine.sectionAxis?.show();

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 剖切盒按钮配置
@@ -14,7 +15,7 @@ export const createSectionBoxButton = (engine: BimEngine): ButtonConfig => {
exclusive: true,
align: 'vertical',
label: 'toolbar.sectionBox',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><circle cx="12" cy="12" r="6" fill="currentColor"/></svg>',
icon: getIcon('剖切盒'),
onClick: (button) => {
console.log('剖切盒被点击:', button.id, '激活状态:', button.isActive);
if (button.isActive) {

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 剖切菜单按钮配置
@@ -11,7 +12,7 @@ export const createSectionMenuButton = (_engine: BimEngine): ButtonConfig => {
type: 'menu',
label: 'toolbar.section',
align: 'vertical',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="currentColor"/></svg>',
icon: getIcon('剖切'),
keepActive: true,
onClick: (button) => {
console.log('剖切按钮被点击:', button.id);

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 拾取面剖切按钮配置
@@ -14,7 +15,7 @@ export const createSectionPlaneButton = (engine: BimEngine): ButtonConfig => {
exclusive: true,
align: 'vertical',
label: 'toolbar.sectionPlane',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><circle cx="12" cy="12" r="6" fill="currentColor"/></svg>',
icon: getIcon('拾曲面剖切'),
onClick: (button) => {
console.log('拾取面剖切被点击:', button.id, '激活状态:', button.isActive);
if (button.isActive) {

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 设置按钮配置
@@ -10,7 +11,7 @@ export const createSettingButton = (_engine: BimEngine): ButtonConfig => {
groupId: 'group-2',
type: 'button',
label: 'toolbar.setting',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="m9.25 22l-.4-3.2q-.325-.125-.612-.3t-.563-.375L4.7 19.375l-2.75-4.75l2.575-1.95Q4.5 12.5 4.5 12.338v-.675q0-.163.025-.338L1.95 9.375l2.75-4.75l2.975 1.25q.275-.2.575-.375t.6-.3l.4-3.2h5.5l.4 3.2q.325.125.613.3t.562.375l2.975-1.25l2.75 4.75l-2.575 1.95q.025.175.025.338v.674q0 .163-.05.338l2.575 1.95l-2.75 4.75l-2.95-1.25q-.275.2-.575.375t-.6.3l-.4 3.2zM11 20h1.975l.35-2.65q.775-.2 1.438-.587t1.212-.938l2.475 1.025l.975-1.7l-2.15-1.625q.125-.35.175-.737T17.5 12t-.05-.787t-.175-.738l2.15-1.625l-.975-1.7l-2.475 1.05q-.55-.575-1.212-.962t-1.438-.588L13 4h-1.975l-.35 2.65q-.775.2-1.437.588t-1.213.937L5.55 7.15l-.975 1.7l2.15 1.6q-.125.375-.175.75t-.05.8q0 .4.05.775t.175.75l-2.15 1.625l.975 1.7l2.475-1.05q.55.575 1.213.963t1.437.587zm1.05-4.5q1.45 0 2.475-1.025T15.55 12t-1.025-2.475T12.05 8.5q-1.475 0-2.488 1.025T8.55 12t1.013 2.475T12.05 15.5M12 12"/></svg>',
icon: getIcon('设置'),
keepActive: false,
onClick: (button) => {
// 预留:未来接入设置逻辑(此处已注入 engine

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 第三人称(鸟瞰)漫游按钮配置
@@ -14,7 +15,7 @@ export const createWalkBirdButton = (_engine: BimEngine): ButtonConfig => {
exclusive: true,
type: 'button',
label: 'toolbar.walkBird',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 22V8.775q-2.275-.6-3.637-2.512T4 2h2q0 2.075 1.338 3.538T10.75 7h2.5q.75 0 1.4.275t1.175.8L20.35 12.6l-1.4 1.4L15 10.05V22h-2v-6h-2v6zm3-16q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6"/></svg>',
icon: getIcon('地图'),
onClick: (button) => {
console.log('鸟瞰漫游被点击:', button.id);
}

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 漫游按钮配置(普通按钮,不带子菜单)
@@ -11,7 +12,7 @@ export const createWalkMenuButton = (engine: BimEngine): ButtonConfig => {
type: 'button',
label: 'toolbar.walk',
align: 'vertical',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 22V8.775q-2.275-.6-3.637-2.512T4 2h2q0 2.075 1.338 3.538T10.75 7h2.5q.75 0 1.4.275t1.175.8L20.35 12.6l-1.4 1.4L15 10.05V22h-2v-6h-2v6zm3-16q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6"/></svg>',
icon: getIcon('漫游'),
onClick: () => {
console.log('漫游按钮被点击');
engine.walkControl?.show();

View File

@@ -1,5 +1,6 @@
import type { ButtonConfig } from '../../../../index.type';
import type { BimEngine } from '../../../../../../bim-engine';
import { getIcon } from '../../../../../../utils/icon-manager';
/**
* 第一人称漫游按钮配置
@@ -14,7 +15,7 @@ export const createWalkPersonButton = (_engine: BimEngine): ButtonConfig => {
exclusive: true,
align: 'vertical',
label: 'toolbar.walkPerson',
icon: '<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 22V8.775q-2.275-.6-3.637-2.512T4 2h2q0 2.075 1.338 3.538T10.75 7h2.5q.75 0 1.4.275t1.175.8L20.35 12.6l-1.4 1.4L15 10.05V22h-2v-6h-2v6zm3-16q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6"/></svg>',
icon: getIcon('漫游'),
onClick: (button) => {
console.log('人视漫游被点击:', button.id);
}

View File

@@ -1,9 +1,10 @@
import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { getIcon } from '../../../../../utils/icon-manager';
/**
* 选框放大按钮配置
*
*
* 说明:
* - 当前仅添加 UI 按钮,点击事件先留空(后续接入引擎能力再实现)
* - 使用工厂函数模式注入 engine便于未来调用 engine API
@@ -15,7 +16,7 @@ export const createZoomBoxButton = (_engine: BimEngine): ButtonConfig => {
keepActive: true,
type: 'button',
label: 'toolbar.zoomBox',
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 20q-1.875 0-3.187-1.312T12 15.5t1.313-3.187T16.5 11t3.188 1.313T21 15.5q0 .65-.187 1.25T20.3 17.9l2 2q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2-2q-.55.325-1.15.513T16.5 20m0-2q1.05 0 1.775-.725T19 15.5t-.725-1.775T16.5 13t-1.775.725T14 15.5t.725 1.775T16.5 18M4 18V9v1v-4zm0 2q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v3q0 .425-.288.713T21 10h-8V6H4v12h5q.425 0 .713.288T10 19t-.288.713T9 20z"/></svg>',
icon: getIcon('框选放大'),
onClick: () => {
// 事件先留空:后续实现“框选放大/框选缩放”能力时再接入
// 这里不做任何动作,避免误触影响用户操作