feat(clipping): add hideSection and recoverSection methods

Add new methods for temporary section plane visibility control:
- hideSection(): Hide section plane temporarily (calls engine.clipping.disabled())
- recoverSection(): Recover hidden section plane (calls engine.clipping.recover())

Update SectionPlaneDialogManager to use hideSection() instead of direct API call.
This commit is contained in:
yuding
2026-02-02 16:32:22 +08:00
parent 6db24d23bb
commit 41abd9ed67
3 changed files with 69 additions and 4 deletions

View File

@@ -302,6 +302,28 @@ export class EngineManager extends BaseManager {
this.engineInstance.setSectionBoxRange(range);
}
/**
* 隐藏剖切面(临时隐藏,可恢复)
* @remarks 配合 recoverSection() 使用
*/
public hideSection(): void {
if (!this.engineInstance) {
return;
}
this.engineInstance.hideSection();
}
/**
* 恢复剖切面(从隐藏状态恢复)
* @remarks 恢复被 hideSection() 隐藏的剖切面
*/
public recoverSection(): void {
if (!this.engineInstance) {
return;
}
this.engineInstance.recoverSection();
}
/** 激活框选放大功能 */
public activateZoomBox(): void {
if (!this.engineInstance) {

View File

@@ -48,10 +48,8 @@ export class SectionPlaneDialogManager extends BaseDialogManager {
protected createContent(): HTMLElement {
this.panel = new SectionPlanePanel({
onHide: () => {
console.log('[SectionPlaneDialogManager] 隐藏');
if (this.registry.engine3d) {
(this.registry.engine3d as any).engine?.clipping?.disabled();
}
console.log('[SectionPlaneDialogManager] 隐藏剖切面');
this.registry.engine3d?.hideSection();
},
onReverse: () => {
console.log('[SectionPlaneDialogManager] 反向 (not supported in new API)');