docs(code): add JSDoc comments for clipping API methods
Add comprehensive documentation for: - activeSection(mode): Unified activation API with mode descriptions - getCurrentSectionMode(): Current mode getter - setSectionBoxRange(range): Box range setter with percentage format - deactivateSection(): Unified deactivation Includes @param, @returns, @remarks, and @example sections in Chinese.
This commit is contained in:
@@ -255,8 +255,9 @@ export class EngineManager extends BaseManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活轴向剖切
|
||||
* @param axis 要激活的轴向 ('x' | 'y' | 'z')
|
||||
* 激活剖切功能(统一入口)
|
||||
* @param mode 剖切模式: 'x' | 'y' | 'z' (轴向剖切) | 'box' (剖切盒) | 'face' (拾取面剖切)
|
||||
* @remarks 代理调用 Engine.activeSection(mode)
|
||||
*/
|
||||
public activeSection(mode: 'x' | 'y' | 'z' | 'box' | 'face'): void {
|
||||
if (!this.engineInstance) {
|
||||
@@ -266,6 +267,10 @@ export class EngineManager extends BaseManager {
|
||||
this.engineInstance.activeSection(mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前激活的剖切模式
|
||||
* @returns 当前剖切模式,未激活时返回 null
|
||||
*/
|
||||
public getCurrentSectionMode(): 'x' | 'y' | 'z' | 'box' | 'face' | null {
|
||||
if (!this.engineInstance) {
|
||||
return null;
|
||||
@@ -273,6 +278,10 @@ export class EngineManager extends BaseManager {
|
||||
return this.engineInstance.getCurrentSectionMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用所有剖切功能
|
||||
* @remarks 关闭剖切对话框时调用
|
||||
*/
|
||||
public deactivateSection(): void {
|
||||
if (!this.engineInstance) {
|
||||
return;
|
||||
@@ -280,6 +289,11 @@ export class EngineManager extends BaseManager {
|
||||
this.engineInstance.deactivateSection();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置剖切盒范围
|
||||
* @param range 各轴的剖切范围 (百分比 0-100)
|
||||
* @remarks 仅在 'box' 模式下有效
|
||||
*/
|
||||
public setSectionBoxRange(range: SectionBoxRange): void {
|
||||
if (!this.engineInstance) {
|
||||
console.warn('[EngineManager] 3D Engine not initialized.');
|
||||
|
||||
Reference in New Issue
Block a user