From 32be8c948aaf1db048120f2cc023895d929921dd Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Wed, 1 Dec 2021 11:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=95=9C=E5=A4=B4=E6=97=8B?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/controller/mode-manager.ts | 2 +- src/app/babylon/tool/babylon-tool.ts | 2 +- .../babylon/view/mark-window/mark-window.ts | 18 +++++++++++++----- src/app/pages/plan/plan.component.ts | 11 ++++++++++- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/app/babylon/controller/mode-manager.ts b/src/app/babylon/controller/mode-manager.ts index 146f793..49ab662 100644 --- a/src/app/babylon/controller/mode-manager.ts +++ b/src/app/babylon/controller/mode-manager.ts @@ -23,7 +23,7 @@ export class ModeManager { /** * 制作模式代表内部编辑人员,可新增单位、上传模型,查看模式代表交付的模式 */ - public static s_isMakeMode = false; + public static s_isMakeMode = true; /** * 调试模式 diff --git a/src/app/babylon/tool/babylon-tool.ts b/src/app/babylon/tool/babylon-tool.ts index 6f49c77..f5b43c5 100644 --- a/src/app/babylon/tool/babylon-tool.ts +++ b/src/app/babylon/tool/babylon-tool.ts @@ -433,7 +433,7 @@ export class BabylonTool { public static limitPI(value: number) { let result = value; - while (result < 0) { + while (result < - Math.PI) { result += Math.PI * 2; } diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index cc3e42a..f670dd4 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/src/app/babylon/view/mark-window/mark-window.ts @@ -40,9 +40,9 @@ import { WeatherTool } from "./weather-tool"; export class MarkWindow extends UIBase { /** - * 游离节点特殊Key + * 游离节点特殊名称 */ - readonly c_leaveNode: string = "node_leave_"; + readonly c_leaveNodeName: string = ""; static instance: MarkWindow; @@ -255,10 +255,16 @@ export class MarkWindow extends UIBase { let copyNodeData = classToClass(this.currentMarkNodeDataCopy);//覆盖数据 copyNodeData.id = oldNodeData.id; copyNodeData.index = oldNodeData.index; - if (newName != null && newName != this.c_leaveNode) { + if (newName != null && newName != this.c_leaveNodeName) { copyNodeData.name = newName; } - // copyNodeData.name = oldNodeData.name; + if (copyNodeData.name == this.c_leaveNodeName) //如果来自空节点,则保留原名 + { + copyNodeData.name = oldNodeData.name; + } + + console.log("记录的数据", copyNodeData.texture, this.currentMarkNodeInfo.nodeData.texture); + markPlaneData.setNodeData(nodeId, copyNodeData);//覆盖数据 this.saveAllMarkPlanData(); @@ -368,8 +374,10 @@ export class MarkWindow extends UIBase { //清空 this.currentMarkNodeDataCopy = nodeCopy;//更新备份数据 this.currentMarkNodeInfo = new MarkNodeInfo(markPlanData, this.currentMarkNodeDataCopy); + //this.currentMarkNodeDataCopy = classToClass(this.currentMarkNodeInfo.nodeData); //更新备份数据 this.updateNodeInfo(readDescribe); + PlanComponent.instance.updateBeforePlanNode(); // let instance = this; // if (readDescribe) { //镜头移动完,开始说话 // setTimeout(() => { @@ -1022,7 +1030,7 @@ export class MarkWindow extends UIBase { * 创建一个游离的节点,用于没有选中已经创建的节点时,存放标绘信息 */ createLeaveNode() { - let result = new MarkNodeData(0, this.c_leaveNode); + let result = new MarkNodeData(0, this.c_leaveNodeName); return result; } diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 3f90992..b81a63e 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -475,13 +475,19 @@ export class PlanComponent implements OnInit { this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id : null this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectNodeId = this.beforePlanNode.id : null MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true) - this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData this.initViewer() this.updateProgress() //更新进度条 resolve(true) }) } + /** + * 更新BeforePlanNode,与三维同步 + */ + updateBeforePlanNode() { + this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData + } + //选中 底部一级节点 开启自动播放 selectChildNode(item: MarkPlanData) { if (item.nodes.length) { @@ -696,6 +702,9 @@ export class PlanComponent implements OnInit { ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传 if (!isVideo) { //img this.beforePlanNode.texture = ObjectsService.getFullPath(path + name) + + console.log("上传图片保存数据", this.beforePlanNode); + this.initViewer() } else { //video this.beforePlanNode.video = ObjectsService.getFullPath(path + name)