Browse Source

提交四个自定义设备

dev
刘向辉 3 years ago
parent
commit
ce849b2348
  1. 2
      src/app/babylon/controller/config-manager.ts
  2. 10
      src/app/babylon/controller/data-manager.ts
  3. 57
      src/app/babylon/model/data/institution/facility/all-facility-data.ts
  4. 37
      src/app/babylon/view/building-window/building-window.ts
  5. 2
      src/app/babylon/view/facility-window/facility-window.ts
  6. 16
      src/app/babylon/view/toolbar-window/toobar-window.ts
  7. BIN
      src/assets/images/facility/DWBZ.png
  8. BIN
      src/assets/images/facility/JJQ.png
  9. BIN
      src/assets/images/facility/PL.png
  10. BIN
      src/assets/images/facility/TPBZ.png
  11. BIN
      src/assets/mesh/facilities/dwbz/DWBZ.bin
  12. 174
      src/assets/mesh/facilities/dwbz/DWBZ.gltf
  13. 5
      src/assets/mesh/facilities/dwbz/DWBZ.gltf.manifest
  14. BIN
      src/assets/mesh/facilities/dwbz/DWBZ.jpg
  15. BIN
      src/assets/mesh/facilities/pl/PL.bin
  16. 174
      src/assets/mesh/facilities/pl/PL.gltf
  17. 5
      src/assets/mesh/facilities/pl/PL.gltf.manifest
  18. BIN
      src/assets/mesh/facilities/pl/PL.png
  19. BIN
      src/assets/mesh/facilities/tpbz/TPBZ.bin
  20. 174
      src/assets/mesh/facilities/tpbz/TPBZ.gltf
  21. 5
      src/assets/mesh/facilities/tpbz/TPBZ.gltf.manifest
  22. BIN
      src/assets/mesh/facilities/tpbz/TPBZ.jpg

2
src/app/babylon/controller/config-manager.ts

@ -23,7 +23,7 @@ export class ConfigManager {
*/
static getFacilityIconUrl(type: FacilityType, pos: FacilityPosType): string {
let result = ConfigManager.c_resPath_assetsRoot + "images/facility/" + pos + "/" + type + ".png";
let result = ConfigManager.c_resPath_assetsRoot + "images/facility/" + type + ".png";
return result;
}

10
src/app/babylon/controller/data-manager.ts

@ -76,9 +76,9 @@ export class DataManager {
//本地捏造消防设备列表信息
DataManager.initDebugData_facility();
if (ModeManager.currentMode == ModeType.Look) {
DataManager.initDebugData_mark();
}
//if (ModeManager.currentMode == ModeType.Look) {
DataManager.initDebugData_mark();
// }
let dataFromServe = true;//true-表示数据来自服务器,false-表示来自本地捏造
@ -315,9 +315,9 @@ export class DataManager {
//获取设备资源完整路径
static getResPath_facility(facilityPosType: FacilityPosType, type: FacilityType): string {
let result = "facilities/";
let result = "mesh/facilities/";
result += facilityPosType.toString() + "/";
// result += facilityPosType.toString() + "/";
result += DataManager.getResName_facility(type).toLocaleLowerCase();
result += "/";

57
src/app/babylon/model/data/institution/facility/all-facility-data.ts

@ -17,45 +17,44 @@ export class AllFacilityData {
static CreateAllFacilityData(): AllFacilityData {
let result = new AllFacilityData();
AllFacilityData.newFacilityData(FacilityType.AQCK, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.DSXHS, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.DXXHS, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.SZDSXHS, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.SZDXXHS, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.DSSBJHQ, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.DXSBJHQ, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.QBSBJHQ, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.DGNSBJHQ, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.GD, FacilityPosType.Outdoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.AQCK, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.DSXHS, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.DXXHS, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.SZDSXHS, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.SZDXXHS, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.DSSBJHQ, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.DXSBJHQ, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.QBSBJHQ, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.DGNSBJHQ, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.GD, FacilityPosType.Outdoor, result, false);
AllFacilityData.newFacilityData(FacilityType.PL, FacilityPosType.Outdoor, result);
AllFacilityData.newFacilityData(FacilityType.JTQ, FacilityPosType.Outdoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.JTQ, FacilityPosType.Outdoor, result, false);
AllFacilityData.newFacilityData(FacilityType.JJQ, FacilityPosType.Outdoor, result, false);
AllFacilityData.newFacilityData(FacilityType.TPBZ, FacilityPosType.Outdoor, result, true);
AllFacilityData.newFacilityData(FacilityType.DWBZ, FacilityPosType.Outdoor, result);
// AllFacilityData.newFacilityData(FacilityType.XKS, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.BF, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.SX, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.LSXFB, FacilityPosType.Indoor, result);
// AllFacilityData.newFacilityData(FacilityType.WSXFB, FacilityPosType.Indoor, result);
// AllFacilityData.newFacilityData(FacilityType.CYXFB, FacilityPosType.Indoor, result);
// AllFacilityData.newFacilityData(FacilityType.FHFQ, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.SNXHS, FacilityPosType.Indoor, result);
// AllFacilityData.newFacilityData(FacilityType.FHM, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.FHJL, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.SSLT, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.XFDT, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.PTDT, FacilityPosType.Indoor, result, false);
// AllFacilityData.newFacilityData(FacilityType.HT, FacilityPosType.Indoor, result, false);
/// AllFacilityData.newFacilityData(FacilityType.WXY, FacilityPosType.Public, result);
// AllFacilityData.newFacilityData(FacilityType.ZDQY, FacilityPosType.Public, result);
AllFacilityData.newFacilityData(FacilityType.XKS, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.BF, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.SX, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.LSXFB, FacilityPosType.Indoor, result);
AllFacilityData.newFacilityData(FacilityType.WSXFB, FacilityPosType.Indoor, result);
AllFacilityData.newFacilityData(FacilityType.CYXFB, FacilityPosType.Indoor, result);
AllFacilityData.newFacilityData(FacilityType.FHFQ, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.SNXHS, FacilityPosType.Indoor, result);
AllFacilityData.newFacilityData(FacilityType.FHM, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.FHJL, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.SSLT, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.XFDT, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.PTDT, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.HT, FacilityPosType.Indoor, result, false);
AllFacilityData.newFacilityData(FacilityType.WXY, FacilityPosType.Public, result);
AllFacilityData.newFacilityData(FacilityType.ZDQY, FacilityPosType.Public, result);
AllFacilityData.newFacilityData(FacilityType.DWBZ, FacilityPosType.Public, result);
return result;
}
//新建设备信息
static newFacilityData(type: FacilityType, posType: FacilityPosType, allFacilityData: AllFacilityData, isModel: boolean = true): ModelData_facility {
return;
let name = ConfigManager.getFacilityTypeName(type);
let result = new ModelData_facility(type.toString(), type, name, DataManager.getResName_facility(type) + ".gltf", new TransformData(), posType, isModel);
switch (posType) {

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

@ -21,6 +21,9 @@ import { BuildingUIItem } from "./building-ui-item";
//建筑界面
export class BuildingWindow extends UIBase {
static instance: BuildingWindow;
buldingStatus: BuildingStatus;
buildingUIItems: BuildingUIItem[] = [];//所有建筑UI
@ -211,7 +214,7 @@ export class BuildingWindow extends UIBase {
this.initBuildings();//创建每一个建筑buildingItem
BuildingWindow.instance = this;
this.three = PlanComponent.instance;
// this.three.getAllBuilding(this);
@ -348,6 +351,38 @@ export class BuildingWindow extends UIBase {
}
});
}
/**
*
*/
public clearHomeLessFacilityData() {
}
/**
*
*/
public getModelAndCreateFacilityData() {
if (this.currentBuidngItem != null) {
//获取所有transformNodes
let allNode = this.currentBuidngItem.buildingInfo.ModelInfo.modelBox.getChildTransformNodes(false);
for (let i = 0; i < allNode.length; i++) {
let nodeName = allNode[i].name;
// switch (nodeName) {
// case "消火栓":
// break;
// case "消火栓1": break;
// }
}
}
}
//#endregion

2
src/app/babylon/view/facility-window/facility-window.ts

@ -169,6 +169,8 @@ export class FacilityWindow extends UIBase {
instance.allFacilityUIItemes.push(facilityUIItem);
}
console.log("所有可用的设备", instance.allFacilityUIItemes);
// ThreeDimensionalHomeComponent.instance.getAllIcons(instance)

16
src/app/babylon/view/toolbar-window/toobar-window.ts

@ -11,6 +11,7 @@ import { UIManager } from "../../controller/ui-manager";
import { BabylonUIStyleTool } from "../../tool/babylon-ui-style-tool";
import { GizmoTool, TransformUIType } from "../../tool/gizmo-tool";
import { MeasureTool, MeasureType } from "../../tool/measure-tool";
import { BuildingWindow } from "../building-window/building-window";
import { FacilityWindow } from "../facility-window/facility-window";
import { CopyFacilityInfo, FacilityInfoInSceneWindow } from "../facilityinfoinscene-window/facilityinfoinscene-window";
@ -89,6 +90,21 @@ export class ToolbarWindow extends UIBase {
//#endregion
/**
*
*/
clearHomeLessFacilityData() {
BuildingWindow.instance.clearHomeLessFacilityData();
}
/**
*
*/
getModelAndCreateFacilityData() {
BuildingWindow.instance.getModelAndCreateFacilityData();
}
onInit() {
super.onInit();
ToolbarWindow.instance = this;

BIN
src/assets/images/facility/DWBZ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/images/facility/JJQ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/images/facility/PL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/assets/images/facility/TPBZ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/assets/mesh/facilities/dwbz/DWBZ.bin

Binary file not shown.

174
src/assets/mesh/facilities/dwbz/DWBZ.gltf

@ -0,0 +1,174 @@
{
"asset": {
"version": "2.0",
"generator": "babylon.js glTF exporter for 3dsmax 2020 v20201214.2"
},
"scene": 0,
"scenes": [
{
"nodes": [
0
]
}
],
"nodes": [
{
"mesh": 0,
"rotation": [
0.7071068,
0,
0,
0.7071067
],
"name": "DWBZ",
"translation": [
0,
0,
0
],
"scale": [
1,
1,
1
]
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 1,
"TANGENT": 2,
"NORMAL": 3,
"TEXCOORD_0": 4
},
"indices": 0,
"material": 0,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 0,
"attributes": {
"POSITION": 0,
"TANGENT": 1,
"NORMAL": 2,
"TEXCOORD_0": 3
}
}
}
}
],
"name": "DWBZ"
}
],
"accessors": [
{
"componentType": 5123,
"count": 1068,
"type": "SCALAR",
"name": "accessorIndices"
},
{
"componentType": 5126,
"count": 1068,
"max": [
0.2237389352940401,
0.23126999538265758,
0.0024346969171470945
],
"min": [
-0.04925561481714704,
-0.044022137017147044,
-0.4255422221171471
],
"type": "VEC3",
"name": "accessorPositions"
},
{
"componentType": 5126,
"count": 1068,
"type": "VEC4",
"name": "accessorTangents"
},
{
"componentType": 5126,
"count": 1068,
"type": "VEC3",
"name": "accessorNormals"
},
{
"componentType": 5126,
"count": 1068,
"type": "VEC2",
"name": "accessorUVs"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 18614
}
],
"buffers": [
{
"name": "DWBZ",
"byteLength": 18616,
"uri": "DWBZ.bin"
}
],
"materials": [
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 0,
"texCoord": 0
},
"metallicFactor": 0,
"roughnessFactor": 0.450053632,
"baseColorFactor": [
1,
1,
1,
1
]
},
"name": "DWBZ",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
}
],
"textures": [
{
"sampler": 0,
"source": 0,
"name": "DWBZ.jpg"
}
],
"images": [
{
"name": "DWBZ",
"uri": "DWBZ.jpg"
}
],
"samplers": [
{
"magFilter": 9729,
"minFilter": 9987,
"wrapS": 10497,
"wrapT": 10497
}
],
"extensionsRequired": [
"KHR_draco_mesh_compression"
],
"extensionsUsed": [
"KHR_draco_mesh_compression"
]
}

5
src/assets/mesh/facilities/dwbz/DWBZ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

BIN
src/assets/mesh/facilities/dwbz/DWBZ.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/assets/mesh/facilities/pl/PL.bin

Binary file not shown.

174
src/assets/mesh/facilities/pl/PL.gltf

@ -0,0 +1,174 @@
{
"asset": {
"version": "2.0",
"generator": "babylon.js glTF exporter for 3dsmax 2020 v20201214.2"
},
"scene": 0,
"scenes": [
{
"nodes": [
0
]
}
],
"nodes": [
{
"mesh": 0,
"translation": [
0,
0,
6.10351549e-7
],
"rotation": [
0.7071068,
0,
0,
0.7071067
],
"name": "PL",
"scale": [
1,
1,
1
]
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 1,
"TANGENT": 2,
"NORMAL": 3,
"TEXCOORD_0": 4
},
"indices": 0,
"material": 0,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 0,
"attributes": {
"POSITION": 0,
"TANGENT": 1,
"NORMAL": 2,
"TEXCOORD_0": 3
}
}
}
}
],
"name": "PL"
}
],
"accessors": [
{
"componentType": 5123,
"count": 1446,
"type": "SCALAR",
"name": "accessorIndices"
},
{
"componentType": 5126,
"count": 1302,
"max": [
9.994759744015631,
9.942144559843674,
0.01258431331265264
],
"min": [
-9.994759744015633,
-9.940061744015633,
-0.19228631101563265
],
"type": "VEC3",
"name": "accessorPositions"
},
{
"componentType": 5126,
"count": 1302,
"type": "VEC4",
"name": "accessorTangents"
},
{
"componentType": 5126,
"count": 1302,
"type": "VEC3",
"name": "accessorNormals"
},
{
"componentType": 5126,
"count": 1302,
"type": "VEC2",
"name": "accessorUVs"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 23001
}
],
"buffers": [
{
"name": "PL",
"byteLength": 23004,
"uri": "PL.bin"
}
],
"materials": [
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 0,
"texCoord": 0
},
"metallicFactor": 0,
"roughnessFactor": 0.450053632,
"baseColorFactor": [
1,
1,
1,
1
]
},
"alphaMode": "BLEND",
"name": "PL",
"emissiveFactor": [
0,
0,
0
],
"doubleSided": false
}
],
"textures": [
{
"sampler": 0,
"source": 0,
"name": "PL.png"
}
],
"images": [
{
"name": "PL",
"uri": "PL.png"
}
],
"samplers": [
{
"magFilter": 9729,
"minFilter": 9987,
"wrapS": 10497,
"wrapT": 10497
}
],
"extensionsRequired": [
"KHR_draco_mesh_compression"
],
"extensionsUsed": [
"KHR_draco_mesh_compression"
]
}

5
src/assets/mesh/facilities/pl/PL.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

BIN
src/assets/mesh/facilities/pl/PL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
src/assets/mesh/facilities/tpbz/TPBZ.bin

Binary file not shown.

174
src/assets/mesh/facilities/tpbz/TPBZ.gltf

@ -0,0 +1,174 @@
{
"asset": {
"version": "2.0",
"generator": "babylon.js glTF exporter for 3dsmax 2020 v20201214.2"
},
"scene": 0,
"scenes": [
{
"nodes": [
0
]
}
],
"nodes": [
{
"mesh": 0,
"rotation": [
0.7071068,
0,
0,
0.7071067
],
"name": "TPBZ",
"translation": [
0,
0,
0
],
"scale": [
1,
1,
1
]
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 1,
"TANGENT": 2,
"NORMAL": 3,
"TEXCOORD_0": 4
},
"indices": 0,
"material": 0,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 0,
"attributes": {
"POSITION": 0,
"TANGENT": 1,
"NORMAL": 2,
"TEXCOORD_0": 3
}
}
}
}
],
"name": "TPBZ"
}
],
"accessors": [
{
"componentType": 5123,
"count": 4908,
"type": "SCALAR",
"name": "accessorIndices"
},
{
"componentType": 5126,
"count": 4908,
"max": [
0.17296450471910108,
0.17046235425842693,
0.00027006055056177924
],
"min": [
-0.1729830605505618,
-0.17035406055056182,
-0.5530840075505618
],
"type": "VEC3",
"name": "accessorPositions"
},
{
"componentType": 5126,
"count": 4908,
"type": "VEC4",
"name": "accessorTangents"
},
{
"componentType": 5126,
"count": 4908,
"type": "VEC3",
"name": "accessorNormals"
},
{
"componentType": 5126,
"count": 4908,
"type": "VEC2",
"name": "accessorUVs"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 82936
}
],
"buffers": [
{
"name": "TPBZ",
"byteLength": 82936,
"uri": "TPBZ.bin"
}
],
"materials": [
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 0,
"texCoord": 0
},
"metallicFactor": 0,
"roughnessFactor": 0.450053632,
"baseColorFactor": [
1,
1,
1,
1
]
},
"name": "TPBZ",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
}
],
"textures": [
{
"sampler": 0,
"source": 0,
"name": "TPBZ.jpg"
}
],
"images": [
{
"name": "TPBZ",
"uri": "TPBZ.jpg"
}
],
"samplers": [
{
"magFilter": 9729,
"minFilter": 9987,
"wrapS": 10497,
"wrapT": 10497
}
],
"extensionsRequired": [
"KHR_draco_mesh_compression"
],
"extensionsUsed": [
"KHR_draco_mesh_compression"
]
}

5
src/assets/mesh/facilities/tpbz/TPBZ.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

BIN
src/assets/mesh/facilities/tpbz/TPBZ.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Loading…
Cancel
Save