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:
@@ -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) {
|
||||
|
||||
@@ -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)');
|
||||
|
||||
Reference in New Issue
Block a user