|
|
|
@ -39,6 +39,12 @@ import { WeatherTool } from "./weather-tool";
|
|
|
|
|
|
|
|
|
|
export class MarkWindow extends UIBase { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 游离节点特殊Key |
|
|
|
|
*/ |
|
|
|
|
readonly c_leaveNode: string = "node_leave_"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static instance: MarkWindow; |
|
|
|
|
static s_cameraData: ArcRotateCameraData = null;//预定义的相机数据
|
|
|
|
|
static s_preLoadMesh: boolean = false;//预加载所有标绘物(如果是false,则在选中每个标绘物的时候,进行预加载单个)
|
|
|
|
@ -236,6 +242,7 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
* 保存至已有节点 |
|
|
|
|
* @param markPlanId 方案id,一级节点ID |
|
|
|
|
* @param nodeId 节点id,二级节点id |
|
|
|
|
* @param newName 是否要覆盖原有的名字 |
|
|
|
|
*/ |
|
|
|
|
saveToOldNode(markPlanId: number, nodeId: number, newName?: string) { |
|
|
|
|
let markPlaneData = DataManager.allMarkPlanData.getMarkPlanById(markPlanId); |
|
|
|
@ -248,7 +255,7 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
let copyNodeData = classToClass(this.currentMarkNodeDataCopy);//覆盖数据
|
|
|
|
|
copyNodeData.id = oldNodeData.id; |
|
|
|
|
copyNodeData.index = oldNodeData.index; |
|
|
|
|
if (newName != null) { |
|
|
|
|
if (newName != null && newName != this.c_leaveNode) { |
|
|
|
|
copyNodeData.name = newName; |
|
|
|
|
} |
|
|
|
|
// copyNodeData.name = oldNodeData.name;
|
|
|
|
@ -321,10 +328,10 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
let nodeCopy: MarkNodeData; |
|
|
|
|
if (changeBuildingByUI) //从ui点击切层,
|
|
|
|
|
{ |
|
|
|
|
console.log(this.currentMarkNodeInfo); |
|
|
|
|
// console.log(this.currentMarkNodeInfo);
|
|
|
|
|
if (this.currentMarkNodeInfo == null)//没有当前的markInfo,创建一个游离的节点
|
|
|
|
|
{ |
|
|
|
|
console.log("拷贝游离节点"); |
|
|
|
|
// console.log("拷贝游离节点");
|
|
|
|
|
nodeCopy = this.createLeaveNode(); |
|
|
|
|
this.savCurrentNodeData(nodeCopy); |
|
|
|
|
} |
|
|
|
@ -362,10 +369,14 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
this.currentMarkNodeDataCopy = nodeCopy;//更新备份数据
|
|
|
|
|
this.currentMarkNodeInfo = new MarkNodeInfo(markPlanData, this.currentMarkNodeDataCopy); |
|
|
|
|
//this.currentMarkNodeDataCopy = classToClass(this.currentMarkNodeInfo.nodeData); //更新备份数据
|
|
|
|
|
this.updateNodeInfo(); |
|
|
|
|
if (readDescribe) { |
|
|
|
|
this.readDescribe(nodeCopy.describe); |
|
|
|
|
} |
|
|
|
|
this.updateNodeInfo(readDescribe); |
|
|
|
|
// let instance = this;
|
|
|
|
|
// if (readDescribe) { //镜头移动完,开始说话
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// instance.readDescribe(nodeCopy.describe);
|
|
|
|
|
// }, MarkNodeData.speakWaitTime * 1000);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -936,6 +947,8 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
//#region 查询类
|
|
|
|
@ -1009,7 +1022,7 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
* 创建一个游离的节点,用于没有选中已经创建的节点时,存放标绘信息 |
|
|
|
|
*/ |
|
|
|
|
createLeaveNode() { |
|
|
|
|
let result = new MarkNodeData(0, "leave"); |
|
|
|
|
let result = new MarkNodeData(0, this.c_leaveNode); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1167,8 +1180,9 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
* 更新节点数据至表现层 |
|
|
|
|
* 摄像机、楼层、室内外的更新 |
|
|
|
|
* 标记物的重新创建 |
|
|
|
|
* @param readDescribe: 是否阅读介绍 |
|
|
|
|
*/ |
|
|
|
|
updateNodeInfo() { |
|
|
|
|
updateNodeInfo(readDescribe = false) { |
|
|
|
|
let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData(); |
|
|
|
|
let cameraData = this.currentMarkNodeInfo.nodeData.cameraData; |
|
|
|
|
let showZP = this.currentMarkNodeInfo.nodeData.showZP; |
|
|
|
@ -1198,7 +1212,13 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//仅此分支生效
|
|
|
|
|
BuildingWindow.instance.revoverCamera(cameraData, showZP); |
|
|
|
|
|
|
|
|
|
//动画还原相机,结束后开始阅读
|
|
|
|
|
BuildingWindow.instance.revoverCamera(cameraData, showZP, (() => { |
|
|
|
|
if (readDescribe) { |
|
|
|
|
instance.readDescribe(instance.currentMarkNodeInfo.nodeData.describe); |
|
|
|
|
} |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
instance.clearEnterObserver(true); |
|
|
|
|
|
|
|
|
|