邵佳豪 3 years ago
parent
commit
80cfcf0208
  1. 21
      README.md
  2. 6
      src/app/babylon/model/info/model/model-info-building.ts
  3. 3
      src/app/babylon/model/info/model/model-info-facility.ts
  4. 11
      src/app/babylon/view/building-window/building-window.ts
  5. 10
      src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts

21
README.md

@ -1,5 +1,26 @@
# 中国石化加油站项目 # 中国石化加油站项目
## 🌼v1.1.1
### 🌻 简介
> 时间:2022、2、24 周四
> 添加阀门模块
### 🌻 详情
> 前端部分
- [🚩 重大变更]
- [🌱 新增]
- [🍀 完善]
> 三维部分
- [🚩 重大变更]
- [🌱 新增] 新增阀门模块
- [🍀 完善]
## 🌼v1.1.0 ## 🌼v1.1.0
### 🌻 简介 ### 🌻 简介

6
src/app/babylon/model/info/model/model-info-building.ts

@ -167,6 +167,12 @@ export class ModelInfo_building extends ModelInfo {
dispose(disposeMesh?: boolean) { dispose(disposeMesh?: boolean) {
if (this.updateObserver != null) {
SceneManager.Instance.scene.onAfterRenderObservable.remove(this.updateObserver);
this.updateObserver = null;
}
this.disposeAllFacility(); this.disposeAllFacility();
super.dispose(disposeMesh); super.dispose(disposeMesh);
} }

3
src/app/babylon/model/info/model/model-info-facility.ts

@ -222,7 +222,8 @@ export class ModelInfo_facility extends ModelInfo {
this.showFollowUI(play); this.showFollowUI(play);
if (this.modelBox != null) { if (this.modelBox != null) {
let facilityType = (this.modelData as ModelData_facility).facilityType; let facilityType = (this.modelData as ModelData_facility).facilityType;
if (play && TsTool.stringContain(facilityType, "XF_")) { //消防 或 阀门 持续高亮
if (play && (TsTool.stringContain(facilityType, "XF_") || facilityType == FacilityType.JY_FM)) {
SceneManager.Instance.addToHighLight(this.modelBox as Mesh, ModelInfo_facility.c_hightLightColor); SceneManager.Instance.addToHighLight(this.modelBox as Mesh, ModelInfo_facility.c_hightLightColor);
} }
else { else {

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

@ -1,5 +1,5 @@
import { AbstractMesh, Material, PBRMaterial, Texture, Animatable } from "@babylonjs/core"; import { AbstractMesh, Material, PBRMaterial, Texture, Animatable, Observable, Scene, Observer } from "@babylonjs/core";
import { PlanComponent } from "src/app/pages/plan/plan.component"; import { PlanComponent } from "src/app/pages/plan/plan.component";
import { ConfigManager } from "../../controller/config-manager"; import { ConfigManager } from "../../controller/config-manager";
import { DataManager } from "../../controller/data-manager"; import { DataManager } from "../../controller/data-manager";
@ -50,6 +50,8 @@ export class BuildingWindow extends UIBase {
three: PlanComponent;//前端组件 three: PlanComponent;//前端组件
onUpdateObserver: Observer<Scene>;
cameraAnim: Animatable;//相机动画 cameraAnim: Animatable;//相机动画
@ -303,6 +305,7 @@ export class BuildingWindow extends UIBase {
//#region 生命周期 //#region 生命周期
onInit() { onInit() {
console.log("初始化building")
super.onInit(); super.onInit();
GizmoTool.changeGizmoOpen(ModeManager.s_isMakeMode); //内部模式才默认打开gizmo GizmoTool.changeGizmoOpen(ModeManager.s_isMakeMode); //内部模式才默认打开gizmo
@ -315,7 +318,7 @@ export class BuildingWindow extends UIBase {
this.three.buildingUIItems = this.buildingUIItems this.three.buildingUIItems = this.buildingUIItems
this.buildingUIItems.length ? this.three.beforeOneBuildingID = this.three.buildingUIItems[0].getBuildingID() : null this.buildingUIItems.length ? this.three.beforeOneBuildingID = this.three.buildingUIItems[0].getBuildingID() : null
let instance = this; let instance = this;
SceneManager.Instance.scene.onBeforeRenderObservable.add(() => { this.onUpdateObserver = SceneManager.Instance.scene.onBeforeRenderObservable.add(() => {
instance.onUpdate(); instance.onUpdate();
}) })
EventManager.addListener<Event_LoadingChange>(Event_LoadingChange, (eventInfo) => { EventManager.addListener<Event_LoadingChange>(Event_LoadingChange, (eventInfo) => {
@ -369,6 +372,10 @@ export class BuildingWindow extends UIBase {
for (let i = 0; i < this.buildingUIItems.length; i++) { for (let i = 0; i < this.buildingUIItems.length; i++) {
this.buildingUIItems[i].dispose(); this.buildingUIItems[i].dispose();
} }
if (this.onUpdateObserver != null) {
SceneManager.Instance.scene.onBeforeRenderObservable.remove(this.onUpdateObserver);
this.onUpdateObserver = null;
}
BuildingWindow.instance = null; BuildingWindow.instance = null;
} }

10
src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts

@ -507,7 +507,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
|| (currentMoudle == null || currentMoudle == JYZInfoMoudleType.YG) && facilityInfosByType[i].type == FacilityType.JY_YG || (currentMoudle == null || currentMoudle == JYZInfoMoudleType.YG) && facilityInfosByType[i].type == FacilityType.JY_YG
|| (currentMoudle == null || currentMoudle == JYZInfoMoudleType.SYG) && facilityInfosByType[i].type == FacilityType.JY_SYGX || (currentMoudle == null || currentMoudle == JYZInfoMoudleType.SYG) && facilityInfosByType[i].type == FacilityType.JY_SYGX
|| (currentMoudle == null || currentMoudle == JYZInfoMoudleType.YQHSGX) && facilityInfosByType[i].type == FacilityType.JY_YQHSGX || (currentMoudle == null || currentMoudle == JYZInfoMoudleType.YQHSGX) && facilityInfosByType[i].type == FacilityType.JY_YQHSGX
|| (currentMoudle == null || currentMoudle == JYZInfoMoudleType.FM) && facilityInfosByType[i].type == FacilityType.JY_FM // || (currentMoudle == null || currentMoudle == JYZInfoMoudleType.FM) && facilityInfosByType[i].type == FacilityType.JY_FM
) { ) {
allJYJInfo = allJYJInfo.concat(facilityInfosByType[i].facilityInfo); allJYJInfo = allJYJInfo.concat(facilityInfosByType[i].facilityInfo);
} }
@ -553,10 +553,10 @@ export class FacilityInfoInSceneWindow extends UIBase {
if (facilityData.facilityType != FacilityType.JY_JYJ && if (facilityData.facilityType != FacilityType.JY_JYJ &&
facilityData.facilityType != FacilityType.JY_YG && facilityData.facilityType != FacilityType.JY_YG &&
facilityData.facilityType != FacilityType.JY_SYGX && facilityData.facilityType != FacilityType.JY_SYGX &&
facilityData.facilityType != FacilityType.JY_YQHSGX && facilityData.facilityType != FacilityType.JY_YQHSGX
facilityData.facilityType != FacilityType.JY_FM // facilityData.facilityType != FacilityType.JY_FM
) { ) {
//只有加油机和油罐和输油管、油气回收、阀门有高亮显示和取消 //只有加油机和油罐和输油管、油气回收有高亮显示和取消
return; return;
} }
//} //}
@ -569,7 +569,7 @@ export class FacilityInfoInSceneWindow extends UIBase {
|| BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YG || BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YG
|| BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.SYG || BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.SYG
|| BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YQHSGX || BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YQHSGX
|| BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.FM // || BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.FM
) { ) {
SceneManager.Instance.removeFromHighLight(facilityInfo.modelBox as Mesh); SceneManager.Instance.removeFromHighLight(facilityInfo.modelBox as Mesh);
} }

Loading…
Cancel
Save