陈鹏飞 3 years ago
parent
commit
c247fbce11
  1. 2
      src/app/babylon/model/data/mark/all-mark-data.ts
  2. 5
      src/app/babylon/model/data/mark/mark-plan-data.ts
  3. 11
      src/app/babylon/tool/speaking-tool.ts
  4. 24
      src/app/babylon/view/building-window/building-window.ts
  5. 27
      src/app/babylon/view/mark-window/mark-window.ts

2
src/app/babylon/model/data/mark/all-mark-data.ts

@ -16,7 +16,7 @@ export class AllMarkData {
marks_Disaster: MarkData[] = []; marks_Disaster: MarkData[] = [];
/** /**
* *
*/ */
@Type(() => MarkData) @Type(() => MarkData)
marks_Outside: MarkData[] = []; marks_Outside: MarkData[] = [];

5
src/app/babylon/model/data/mark/mark-plan-data.ts

@ -213,6 +213,11 @@ export class MarkNodeData {
@Type(() => ArcRotateCameraData) @Type(() => ArcRotateCameraData)
cameraData: ArcRotateCameraData; cameraData: ArcRotateCameraData;
/**
*
*/
showZP: boolean;
/** /**
* *
*/ */

11
src/app/babylon/tool/speaking-tool.ts

@ -16,6 +16,7 @@ export class SpeakingTool {
/** /**
* *
*
* @param msg * @param msg
*/ */
speak(msg: string) { speak(msg: string) {
@ -23,6 +24,9 @@ export class SpeakingTool {
} }
else { else {
this.clear();
let speakMsg = new SpeechSynthesisUtterance(msg); let speakMsg = new SpeechSynthesisUtterance(msg);
speakMsg.lang = "zh-CN"; speakMsg.lang = "zh-CN";
speakMsg.rate = 1; speakMsg.rate = 1;
@ -47,6 +51,13 @@ export class SpeakingTool {
window.speechSynthesis.resume(); window.speechSynthesis.resume();
} }
/**
*
*/
clear() {
window.speechSynthesis.cancel();
}
/** /**
* IE浏览器 * IE浏览器
*/ */

24
src/app/babylon/view/building-window/building-window.ts

@ -9,6 +9,7 @@ import { SceneManager } from "../../controller/scene-manager";
import { ServeManager } from "../../controller/serve-manager"; import { ServeManager } from "../../controller/serve-manager";
import { BuildingStatus } from "../../controller/status/building-status"; import { BuildingStatus } from "../../controller/status/building-status";
import { StatusManager } from "../../controller/status/status-manager"; import { StatusManager } from "../../controller/status/status-manager";
import { ArcRotateCameraData } from "../../model/data/camera-data";
import { BuildingData, BuildingData_ChemicalPlant, BuildingData_Environment, BuildingData_Normal, BuildingType } from "../../model/data/institution/building/building-data"; import { BuildingData, BuildingData_ChemicalPlant, BuildingData_Environment, BuildingData_Normal, BuildingType } from "../../model/data/institution/building/building-data";
import { JYZInfoMoudleType, JYZShowData } from "../../model/data/institution/jyz-show-data"; import { JYZInfoMoudleType, JYZShowData } from "../../model/data/institution/jyz-show-data";
import { ModelType } from "../../model/data/model-data/model-data"; import { ModelType } from "../../model/data/model-data/model-data";
@ -264,16 +265,31 @@ export class BuildingWindow extends UIBase {
recoverMoudleShow(type: JYZInfoMoudleType) { recoverMoudleShow(type: JYZInfoMoudleType) {
let showData = DataManager.institutionData.getMoudleShowData(type); let showData = DataManager.institutionData.getMoudleShowData(type);
if (showData != null) { if (showData != null) {
let camera = SceneManager.Instance.defaultCamera; //let camera = SceneManager.Instance.defaultCamera;
//showData.cameraData.setDataToCamera(camera); //showData.cameraData.setDataToCamera(camera);
let cameraData = showData.cameraData; let cameraData = showData.cameraData;
BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta); // BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
this.showZP(showData.showZP); // this.showZP(showData.showZP);
PlanComponent.instance.isOpenAwning = showData.showZP; // PlanComponent.instance.isOpenAwning = showData.showZP;
this.revoverCamera(cameraData, showData.showZP);
} }
} }
/**
*
* @param cameraData
* @param showZP
*/
revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean) {
this.showZP(showZP);
PlanComponent.instance.isOpenAwning = showZP;
let camera = SceneManager.Instance.defaultCamera;
if (cameraData != null) {
BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
}
}
//#endregion //#endregion

27
src/app/babylon/view/mark-window/mark-window.ts

@ -1,5 +1,5 @@
import { AbstractMesh, Mesh, MeshBuilder, ParticleHelper, ThinEngine, Tools, Vector3 } from "@babylonjs/core"; import { AbstractMesh, Vector3 } from "@babylonjs/core";
import { PointerEventTypes, PointerInfo } from "@babylonjs/core/Events/pointerEvents"; import { PointerEventTypes, PointerInfo } from "@babylonjs/core/Events/pointerEvents";
import { EventState, Observer } from "@babylonjs/core/Misc/observable"; import { EventState, Observer } from "@babylonjs/core/Misc/observable";
import { classToClass } from "class-transformer"; import { classToClass } from "class-transformer";
@ -24,10 +24,12 @@ import { MarkNodeInfo } from "../../model/info/mark/mark-plan-info";
import { ModelInfo_mark } from "../../model/info/mark/model-info-mark"; import { ModelInfo_mark } from "../../model/info/mark/model-info-mark";
import { ModelInfo_building } from "../../model/info/model/model-info-building"; import { ModelInfo_building } from "../../model/info/model/model-info-building";
import { ModelInfo_facility } from "../../model/info/model/model-info-facility"; import { ModelInfo_facility } from "../../model/info/model/model-info-facility";
import { BabylonTool } from "../../tool/babylon-tool";
import { LoadTool } from "../../tool/load-tool"; import { LoadTool } from "../../tool/load-tool";
import { MeshPool, MeshPoolInfo } from "../../tool/mesh-pool"; import { MeshPool, MeshPoolInfo } from "../../tool/mesh-pool";
import { ParticleSystemTool } from "../../tool/particle-system-tool"; import { ParticleSystemTool } from "../../tool/particle-system-tool";
import { BuildingUIItem } from "../building-window/building-ui-item"; import { BuildingUIItem } from "../building-window/building-ui-item";
import { BuildingWindow } from "../building-window/building-window";
import { IndoorFloorUIItem } from "../indoor-window/indoor-floorui-item"; import { IndoorFloorUIItem } from "../indoor-window/indoor-floorui-item";
import { UIBase } from "../window-base/ui-base"; import { UIBase } from "../window-base/ui-base";
import { WeatherTool } from "./weather-tool"; import { WeatherTool } from "./weather-tool";
@ -322,10 +324,15 @@ export class MarkWindow extends UIBase {
nodeCopy = classToClass(this.currentMarkNodeInfo.nodeData); nodeCopy = classToClass(this.currentMarkNodeInfo.nodeData);
} }
} }
this.clearNodeInfo();
let markPlanData: MarkPlanData = null;
if (DataManager.allMarkPlanData == null) {
return;
}
//更新新节点 //更新新节点
let markPlanData = DataManager.allMarkPlanData.getMarkPlanById(planId); markPlanData = DataManager.allMarkPlanData.getMarkPlanById(planId);
this.clearNodeInfo();
if (markPlanData != null) { //表示不是取消选中 if (markPlanData != null) { //表示不是取消选中
if (nodeCopy == null) { if (nodeCopy == null) {
nodeCopy = classToClass(markPlanData.getNodeById(nodeId)); nodeCopy = classToClass(markPlanData.getNodeById(nodeId));
@ -1020,7 +1027,8 @@ export class MarkWindow extends UIBase {
} }
markNodeData.cameraData.getDataFromCamera(SceneManager.Instance.defaultCamera); markNodeData.cameraData.getDataFromCamera(SceneManager.Instance.defaultCamera);
console.log("保存", markNodeData); markNodeData.showZP = BuildingWindow.instance.currentZPShow;
console.log("记录节点", markNodeData);
} }
/** /**
@ -1145,6 +1153,7 @@ export class MarkWindow extends UIBase {
updateNodeInfo() { updateNodeInfo() {
let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData(); let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData();
let cameraData = this.currentMarkNodeInfo.nodeData.cameraData; let cameraData = this.currentMarkNodeInfo.nodeData.cameraData;
let showZP = this.currentMarkNodeInfo.nodeData.showZP;
let instance = this; let instance = this;
if (environmentData.isOutdoor) //要在室外 if (environmentData.isOutdoor) //要在室外
{ {
@ -1164,7 +1173,15 @@ export class MarkWindow extends UIBase {
StatusManager.s_currentStatus.indoorWindow.onBtnToOutDoor(false); StatusManager.s_currentStatus.indoorWindow.onBtnToOutDoor(false);
} }
else if (StatusManager.s_currentStatus instanceof BuildingStatus) { else if (StatusManager.s_currentStatus instanceof BuildingStatus) {
this.currentMarkNodeInfo.nodeData.cameraData.setDataToCamera(SceneManager.Instance.defaultCamera); //this.currentMarkNodeInfo.nodeData.cameraData.setDataToCamera(SceneManager.Instance.defaultCamera);
// let camera = SceneManager.Instance.defaultCamera;
// if (cameraData != null) {
// BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
// }
//仅此分支生效
BuildingWindow.instance.revoverCamera(cameraData, showZP);
instance.clearEnterObserver(true); instance.clearEnterObserver(true);
for (let i = 0; i < StatusManager.s_currentStatus.buildingWindow.buildingUIItems.length; i++) { for (let i = 0; i < StatusManager.s_currentStatus.buildingWindow.buildingUIItems.length; i++) {

Loading…
Cancel
Save