现版本
This commit is contained in:
@@ -302,6 +302,66 @@ export class EngineManager extends BaseManager {
|
||||
return this.engineInstance.jumpToCamera(cameraData);
|
||||
}
|
||||
|
||||
public getConstructTreeData(): { level: any[]; type: any[]; major: any[] } {
|
||||
if (!this.engineInstance) {
|
||||
console.warn('[EngineManager] 3D Engine not initialized.');
|
||||
return { level: [], type: [], major: [] };
|
||||
}
|
||||
return {
|
||||
level: this.engineInstance.getLevelTreeData(),
|
||||
type: this.engineInstance.getTypeTreeData(),
|
||||
major: this.engineInstance.getMajorTreeData(),
|
||||
};
|
||||
}
|
||||
|
||||
public getComponentProperties(url: string, id: string, callback: (data: any) => void): void {
|
||||
if (!this.engineInstance) {
|
||||
console.warn('[EngineManager] 3D Engine not initialized.');
|
||||
return;
|
||||
}
|
||||
this.engineInstance.getComponentProperties(url, id, callback);
|
||||
}
|
||||
|
||||
public registerRightKeyHandler(handler: (e: MouseEvent) => MenuItemConfig[] | null): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.registerHandler(handler);
|
||||
}
|
||||
|
||||
public unregisterRightKeyHandler(handler: (e: MouseEvent) => MenuItemConfig[] | null): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.unregisterHandler(handler);
|
||||
}
|
||||
|
||||
public clearRightKeyHandlers(keepDefault: boolean = true): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.clearHandlers(keepDefault);
|
||||
}
|
||||
|
||||
public showRightKeyMenu(x: number, y: number, items: MenuItemConfig[], groupOrder?: string[]): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.showMenu(x, y, items, groupOrder);
|
||||
}
|
||||
|
||||
public hideRightKeyMenu(): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.hide();
|
||||
}
|
||||
|
||||
/** 销毁引擎管理器 */
|
||||
public destroy(): void {
|
||||
if (this.engineInstance) {
|
||||
|
||||
@@ -46,6 +46,23 @@ export class RightKeyManager extends BaseManager {
|
||||
this.contextHandlers.push(handler);
|
||||
}
|
||||
|
||||
public unregisterHandler(handler: (e: MouseEvent) => MenuItemConfig[] | null): void {
|
||||
this.contextHandlers = this.contextHandlers.filter((item) => item !== handler);
|
||||
}
|
||||
|
||||
public clearHandlers(keepDefault: boolean = true): void {
|
||||
if (!keepDefault) {
|
||||
this.contextHandlers = [];
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.contextHandlers.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.contextHandlers = [this.contextHandlers[0]];
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示菜单
|
||||
* @param x 横坐标
|
||||
|
||||
@@ -64,7 +64,7 @@ export class SectionDockManager extends BaseManager {
|
||||
public getPanelElement(): HTMLElement {
|
||||
if (!this.panel) {
|
||||
this.panel = new SectionDockPanel({
|
||||
defaultType: 'face',
|
||||
defaultType: null,
|
||||
defaultAxis: 'x',
|
||||
defaultHidden: false,
|
||||
onTypeChange: (type, axis) => {
|
||||
|
||||
Reference in New Issue
Block a user