提交代码
This commit is contained in:
@@ -12,7 +12,6 @@ import { createWalkRadialButton } from '../components/radial-toolbar/buttons/wal
|
||||
|
||||
export interface RadialToolbarManagerOptions {
|
||||
items?: RadialMenuItem[];
|
||||
itemsPerRing?: number;
|
||||
}
|
||||
|
||||
export class RadialToolbarManager extends BaseManager {
|
||||
@@ -24,7 +23,6 @@ export class RadialToolbarManager extends BaseManager {
|
||||
this.toolbar = new RadialToolbar({
|
||||
container,
|
||||
items: options?.items ?? this.createDefaultItems(),
|
||||
itemsPerRing: options?.itemsPerRing ?? 4,
|
||||
mainButtonIcon: getIcon('主视角'),
|
||||
mainButtonLabel: 'toolbar.home',
|
||||
onMainButtonClick: () => {
|
||||
@@ -61,6 +59,10 @@ export class RadialToolbarManager extends BaseManager {
|
||||
this.toolbar.setItemActive('walk', dock.isOpen('walk'));
|
||||
}
|
||||
|
||||
public addItem(item: RadialMenuItem): void {
|
||||
this.toolbar?.addItem(item);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
if (this.unsubscribeDockState) {
|
||||
this.unsubscribeDockState();
|
||||
|
||||
@@ -61,6 +61,7 @@ export class SectionAxisDialogManager extends BaseDialogManager {
|
||||
this.panel = new SectionAxisPanel({
|
||||
defaultAxis: 'x',
|
||||
defaultHidden: false,
|
||||
defaultFill: this.engineComponent?.getFillCutFace() ?? false,
|
||||
onHideToggle: (isHidden) => {
|
||||
console.log('[SectionAxisDialogManager] 隐藏切换:', isHidden);
|
||||
if (isHidden) {
|
||||
@@ -69,6 +70,9 @@ export class SectionAxisDialogManager extends BaseDialogManager {
|
||||
this.engineComponent?.recoverSection();
|
||||
}
|
||||
},
|
||||
onFillToggle: (isFilled) => {
|
||||
this.engineComponent?.setFillCutFace(isFilled);
|
||||
},
|
||||
onReverse: () => {
|
||||
this.engineComponent?.reverseSection();
|
||||
},
|
||||
|
||||
@@ -53,6 +53,7 @@ export class SectionBoxDialogManager extends BaseDialogManager {
|
||||
this.panel = new SectionBoxPanel({
|
||||
defaultHidden: false,
|
||||
defaultReversed: false,
|
||||
defaultFill: this.engineComponent?.getFillCutFace() ?? false,
|
||||
onHideToggle: (isHidden) => {
|
||||
console.log('[SectionBoxDialogManager] 隐藏切换:', isHidden);
|
||||
if (isHidden) {
|
||||
@@ -61,6 +62,9 @@ export class SectionBoxDialogManager extends BaseDialogManager {
|
||||
this.engineComponent?.recoverSection();
|
||||
}
|
||||
},
|
||||
onFillToggle: (isFilled) => {
|
||||
this.engineComponent?.setFillCutFace(isFilled);
|
||||
},
|
||||
onFitToModel: () => {
|
||||
// 对接底层 scaleBox():缩放剖切盒到场景整体包围盒
|
||||
this.engineComponent?.scaleSectionBox();
|
||||
@@ -70,7 +74,7 @@ export class SectionBoxDialogManager extends BaseDialogManager {
|
||||
// UI 侧会自行将滑块强制恢复到 0-100,并将隐藏/反向按钮恢复为关闭状态。
|
||||
this.engineComponent?.deactivateSection();
|
||||
this.engineComponent?.activeSection('box');
|
||||
// 确保剖切可见(避免上一次处于隐藏状态导致“看起来没重置”)
|
||||
// 确保剖切可见(避免上一次处于隐藏状态导致"看起来没重置")
|
||||
this.engineComponent?.recoverSection();
|
||||
},
|
||||
onRangeChange: (range) => {
|
||||
|
||||
@@ -91,6 +91,10 @@ export class SectionDockManager extends BaseManager {
|
||||
},
|
||||
onFitToModel: () => {
|
||||
this.engineComponent?.scaleSectionBox();
|
||||
},
|
||||
defaultFill: this.engineComponent?.getFillCutFace() ?? false,
|
||||
onFillToggle: (isFilled) => {
|
||||
this.engineComponent?.setFillCutFace(isFilled);
|
||||
}
|
||||
});
|
||||
this.panel.init();
|
||||
|
||||
@@ -53,6 +53,7 @@ export class SectionPlaneDialogManager extends BaseDialogManager {
|
||||
protected createContent(): HTMLElement {
|
||||
this.panel = new SectionPlanePanel({
|
||||
defaultHidden: false,
|
||||
defaultFill: this.engineComponent?.getFillCutFace() ?? false,
|
||||
onHideToggle: (isHidden) => {
|
||||
console.log('[SectionPlaneDialogManager] 隐藏切换:', isHidden);
|
||||
if (isHidden) {
|
||||
@@ -61,6 +62,9 @@ export class SectionPlaneDialogManager extends BaseDialogManager {
|
||||
this.engineComponent?.recoverSection();
|
||||
}
|
||||
},
|
||||
onFillToggle: (isFilled) => {
|
||||
this.engineComponent?.setFillCutFace(isFilled);
|
||||
},
|
||||
onReverse: () => {
|
||||
this.engineComponent?.reverseSection();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user