陈鹏飞 3 years ago
parent
commit
9fcb748dfe
  1. 1
      src/app/babylon/controller/config-manager.ts
  2. 1
      src/app/babylon/controller/inputController.ts
  3. 6
      src/app/babylon/controller/scene-manager.ts
  4. 6
      src/app/babylon/model/data/mark/all-mark-data.ts
  5. 4
      src/app/babylon/model/data/mark/mark-data.ts
  6. 170
      src/app/babylon/model/info/mark/other/mark-plan-syg-info.ts
  7. 16
      src/app/babylon/view/mark-window/mark-window.ts
  8. 3
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
  9. 3
      src/app/pages/criminal-records/criminal-records.component.ts
  10. BIN
      src/assets/images/mark/inside/syg.png
  11. BIN
      src/assets/mesh/mark/inside/ygc/YGC.bin
  12. 32
      src/assets/mesh/mark/inside/ygc/YGC.gltf

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

@ -174,6 +174,7 @@ export class ConfigManager {
[MarkType.JYY, "加油员"], [MarkType.JYY, "加油员"],
[MarkType.XYY, "卸油员"], [MarkType.XYY, "卸油员"],
[MarkType.YGC, "油罐车"], [MarkType.YGC, "油罐车"],
[MarkType.SYG, "输油管"],
[MarkType.YGCSJ, "油罐车司机"], [MarkType.YGCSJ, "油罐车司机"],
[MarkType.XFSD, "消防沙(堆)"], [MarkType.XFSD, "消防沙(堆)"],
[MarkType.XFSQ, "消防沙(圈)"], [MarkType.XFSQ, "消防沙(圈)"],

1
src/app/babylon/controller/inputController.ts

@ -296,6 +296,7 @@ export class InputController {
&& this.markType != MarkType.YWA && this.markType != MarkType.YWA
&& this.markType != MarkType.YWB && this.markType != MarkType.YWB
&& this.markType != MarkType.JJX && this.markType != MarkType.JJX
&& this.markType != MarkType.SYG
// && this.markType != MarkType.SD // && this.markType != MarkType.SD
&& this.markType != MarkType.JGLX && this.markType != MarkType.JGLX
&& this.markType != MarkType.CT && this.markType != MarkType.CT

6
src/app/babylon/controller/scene-manager.ts

@ -59,6 +59,8 @@ import { ModelInfo_mark_particle } from '../model/info/mark/other/mark-plan-part
import { FacilityPosType, ModelData_facility } from '../model/data/model-data/model-data-facility'; import { FacilityPosType, ModelData_facility } from '../model/data/model-data/model-data-facility';
import { LoadTool } from '../tool/load-tool'; import { LoadTool } from '../tool/load-tool';
import { flatten } from 'earcut'; import { flatten } from 'earcut';
import { MarkData_multiLine } from '../model/data/mark/other/mark-data-multi-line';
import { MarkPlanSYGInfo } from '../model/info/mark/other/mark-plan-syg-info';
//场景管理器 //场景管理器
@ -557,6 +559,10 @@ export class SceneManager {
modelData = plainToClass(MarkData_multiArrow_CT, modelData); modelData = plainToClass(MarkData_multiArrow_CT, modelData);
modelInfo = new ModelInfo_mark_multiArrow(modelData as MarkData, null, defaultMesh, null, isNew); modelInfo = new ModelInfo_mark_multiArrow(modelData as MarkData, null, defaultMesh, null, isNew);
break; break;
case MarkType.SYG:
modelData = plainToClass(MarkData_multiLine, modelData);
modelInfo = new MarkPlanSYGInfo(modelData as MarkData, null, defaultMesh, null, isNew);
break;
case MarkType.H: case MarkType.H:
case MarkType.SNH: case MarkType.SNH:
case MarkType.YWA: case MarkType.YWA:

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

@ -70,6 +70,7 @@ export class AllMarkData {
AllMarkData.newMarkData(MarkType.JYY, MarkKindType.Persion, tagPos, result); AllMarkData.newMarkData(MarkType.JYY, MarkKindType.Persion, tagPos, result);
AllMarkData.newMarkData(MarkType.XYY, MarkKindType.Persion, tagPos, result); AllMarkData.newMarkData(MarkType.XYY, MarkKindType.Persion, tagPos, result);
AllMarkData.newMarkData(MarkType.YGC, MarkKindType.Car, tagPos, result); AllMarkData.newMarkData(MarkType.YGC, MarkKindType.Car, tagPos, result);
AllMarkData.newMarkData(MarkType.SYG, MarkKindType.Virtual, tagPos, result, undefined, false);
AllMarkData.newMarkData(MarkType.YGCSJ, MarkKindType.Persion, tagPos, result); AllMarkData.newMarkData(MarkType.YGCSJ, MarkKindType.Persion, tagPos, result);
AllMarkData.newMarkData(MarkType.XFSD, MarkKindType.Goods, tagPos, result); AllMarkData.newMarkData(MarkType.XFSD, MarkKindType.Goods, tagPos, result);
AllMarkData.newMarkData(MarkType.XFSQ, MarkKindType.Goods, tagPos, result); AllMarkData.newMarkData(MarkType.XFSQ, MarkKindType.Goods, tagPos, result);
@ -163,6 +164,11 @@ export class AllMarkData {
case MarkType.CT: case MarkType.CT:
result = new MarkData_multiArrow_CT(type.toString(), type, tagPos, kindType, icon, modelPath, modelName, taskType, isModel); result = new MarkData_multiArrow_CT(type.toString(), type, tagPos, kindType, icon, modelPath, modelName, taskType, isModel);
break; break;
case MarkType.SYG:
result = new MarkData_multiLine(type.toString(), type, tagPos, kindType, icon, modelPath, modelName, taskType, isModel)
result.color = "#6B6060"
result.radius = 0.07
break;
default: default:
result = new MarkData(type.toString(), type, tagPos, kindType, icon, modelPath, modelName, taskType, isModel); result = new MarkData(type.toString(), type, tagPos, kindType, icon, modelPath, modelName, taskType, isModel);
break; break;

4
src/app/babylon/model/data/mark/mark-data.ts

@ -265,6 +265,10 @@ export enum MarkType {
*/ */
YGC = "YGC", YGC = "YGC",
/**
*
*/
SYG = "SYG",
/** /**
* *
*/ */

170
src/app/babylon/model/info/mark/other/mark-plan-syg-info.ts

@ -0,0 +1,170 @@
import { AbstractMesh, Color3, EventState, Mesh, MeshBuilder, Observer, PointerEventTypes, PointerInfo, StandardMaterial, Vector3 } from "@babylonjs/core";
import { classToClass, plainToClass } from "class-transformer";
import { SceneManager } from "src/app/babylon/controller/scene-manager";
import { BabylonTool } from "src/app/babylon/tool/babylon-tool";
import { MarkWindow } from "src/app/babylon/view/mark-window/mark-window";
import { MarkData } from "../../../data/mark/mark-data";
import { MarkData_multiLine } from "../../../data/mark/other/mark-data-multi-line";
import { ModelInfo_mark } from "../model-info-mark";
export class MarkPlanSYGInfo extends ModelInfo_mark {
lineData: MarkData_multiLine;
onPointObserver: Observer<PointerInfo>;
lineMesh: Mesh;
mat: StandardMaterial;
onCreate(isNew: boolean) {
let instance = this;
instance.lineData = this.markData as MarkData_multiLine;
this.mat = new StandardMaterial("mat_multiLine", SceneManager.Instance.scene);
this.mat.emissiveColor = Color3.FromHexString(this.lineData.color);
this.mat.disableLighting = true;
if (isNew) {
instance.lineData.pointData = [];
instance.addPoint(this.modelBox.absolutePosition.clone());
setTimeout(() => {
instance.onPointObserver = SceneManager.Instance.scene.onPointerObservable.add((eventData: PointerInfo, eventState: EventState) => {
instance.onPointerObservable(eventData, eventState);
}
);
}, 300);
}
else {
instance.lineData.pointData = plainToClass(Vector3, instance.lineData.pointData);
}
instance.updateRender();
}
/**
*
*/
updateRender() {
if (this.lineData.pointData != null && this.lineData.pointData.length > 1) {
this.lineMesh = MeshBuilder.CreateTube("tube", { path: this.lineData.pointData, radius: this.lineData.radius, sideOrientation: Mesh.DOUBLESIDE, updatable: true, cap: Mesh.CAP_ALL }, SceneManager.Instance.scene);
this.lineMesh.setParent(this.modelBox);
this.lineMesh.position = Vector3.Zero();
this.lineMesh.material = this.mat;
}
}
/**
*
* @param point
*/
addPoint(point: Vector3) {
point.y = point.y + this.lineData.yPos;
this.lineData.pointData.push(point.subtract(this.modelBox.absolutePosition));
//更新表现
if (this.lineData.pointData.length > 1) {
this.updateRender();
}
}
/**
*
*/
removeEvent() {
if (this.onPointObserver != null) {
SceneManager.Instance.scene.onPointerObservable.remove(this.onPointObserver);
this.onPointObserver = null;
}
}
/**
*
*/
cancelCreate() {
if (this.lineData.pointData.length < 2) {
MarkWindow.instance.deleteMarkInfo(this);
}
// MarkWindow.instance.mulLineIsBreak_SD = -1;
}
onPointerObservable(eventData: PointerInfo, eventState: EventState) {
let instance = this;
// if (MarkWindow.instance.mulLineIsBreak_SD < 0) {
// instance.cancelCreate();
// instance.removeEvent();
// return;
// }
switch (eventData.type) {
case PointerEventTypes.POINTERUP:
if (eventData.event.button == 0) { //左键正常
if (eventData.pickInfo.hit && !SceneManager.s_isPointerDrag) {
instance.addPoint(eventData.pickInfo.pickedPoint);
}
}
else if (eventData.event.button == 2) { //右键取消
instance.cancelCreate();
instance.removeEvent();
}
break;
}
}
onSelect(select: boolean) {
super.onSelect(select);
if (select = false) {
this.cancelCreate();
}
}
/**
*
*/
clone(markData?: MarkData, isNew: boolean = true): ModelInfo_mark {
let l_markData: MarkData = null;
if (markData == null) {
l_markData = classToClass(this.modelData) as MarkData;
}
else {
l_markData = markData;
}
let childMeshes = null;
let modelBox = null;
modelBox = BabylonTool.cloneMesh(this.modelBox as Mesh, null, (childMesh: AbstractMesh[]) => {
childMeshes = childMesh;
});
let info = new MarkPlanSYGInfo(l_markData, childMeshes, modelBox, null, isNew);
this.cloneAnimTo(info);
return info;
}
dispose() {
if (this.mat != null) {
this.mat.dispose();
}
this.removeEvent();
super.dispose();
}
}

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

@ -87,6 +87,10 @@ export class MarkWindow extends UIBase {
* 退线 0-1--1 * 退线 0-1--1
*/ */
mulArrowIsBreak_CT: number = -1; mulArrowIsBreak_CT: number = -1;
/**
* 0-1--1
*/
mulLineIsBreak_SYG: number = -1;
/** /**
* *
@ -517,6 +521,7 @@ export class MarkWindow extends UIBase {
this.markLineIsBreak = -1; this.markLineIsBreak = -1;
this.mulArrowIsBreak_JG = -1; this.mulArrowIsBreak_JG = -1;
this.mulArrowIsBreak_CT = -1; this.mulArrowIsBreak_CT = -1;
this.mulLineIsBreak_SYG = -1;
} }
} }
@ -844,6 +849,15 @@ export class MarkWindow extends UIBase {
instance.mulArrowIsBreak_CT = 1; instance.mulArrowIsBreak_CT = 1;
} }
}
else if (instance.currentMarkDataPrefab.type == MarkType.SYG) {
if (instance.mulLineIsBreak_SYG > 0) {
return;
}
else {
instance.mulLineIsBreak_SYG = 1;
}
} }
readyCreateMark = true; readyCreateMark = true;
pickPos = worldPos; pickPos = worldPos;
@ -893,7 +907,7 @@ export class MarkWindow extends UIBase {
let l_markInfo = instance.getMarkInfoFromMesh(eventData.pickInfo.pickedMesh); let l_markInfo = instance.getMarkInfoFromMesh(eventData.pickInfo.pickedMesh);
if (l_markInfo != null) { if (l_markInfo != null) {
if (instance.currentMarkDataPrefab != null && instance.currentMarkDataPrefab.markKindType != MarkKindType.Effect if (instance.currentMarkDataPrefab != null && instance.currentMarkDataPrefab.markKindType != MarkKindType.Effect
&& instance.currentMarkDataPrefab.type != MarkType.MHTK) //特效可以放在标绘物上 && instance.currentMarkDataPrefab.type != MarkType.MHTK && instance.currentMarkDataPrefab.type != MarkType.SYG) //特效可以放在标绘物上
{ {
readyCreateMark = false; readyCreateMark = false;
} }

3
src/app/pages/criminal-records-admin/criminal-records-admin.component.ts

@ -639,6 +639,9 @@ export class CriminalRecordsAdminComponent implements OnInit {
if (!e) { if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningTypes = this.warningTypesCopy this.warningTypes = this.warningTypesCopy
this.validateForm.patchValue({
type: null,
});
return return
} }
this.warningLevels.forEach(element => { this.warningLevels.forEach(element => {

3
src/app/pages/criminal-records/criminal-records.component.ts

@ -576,6 +576,9 @@ export class CriminalRecordsComponent implements OnInit {
if (!e) { if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningTypes = this.warningTypesCopy this.warningTypes = this.warningTypesCopy
this.validateForm.patchValue({
type: null,
});
return return
} }
this.warningLevels.forEach(element => { this.warningLevels.forEach(element => {

BIN
src/assets/images/mark/inside/syg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
src/assets/mesh/mark/inside/ygc/YGC.bin

Binary file not shown.

32
src/assets/mesh/mark/inside/ygc/YGC.gltf

@ -1,6 +1,6 @@
{ {
"asset" : { "asset" : {
"generator" : "Khronos glTF Blender I/O v1.6.16", "generator" : "Khronos glTF Blender I/O v1.8.19",
"version" : "2.0" "version" : "2.0"
}, },
"extensionsUsed" : [ "extensionsUsed" : [
@ -67,7 +67,7 @@
}, },
{ {
"mesh" : 10, "mesh" : 10,
"name" : "YouXiang" "name" : "YouXiang.002"
}, },
{ {
"children" : [ "children" : [
@ -514,7 +514,7 @@
] ]
}, },
{ {
"name" : "Object083", "name" : "Object083.002",
"primitives" : [ "primitives" : [
{ {
"attributes" : { "attributes" : {
@ -975,12 +975,12 @@
"componentType" : 5126, "componentType" : 5126,
"count" : 3028, "count" : 3028,
"max" : [ "max" : [
0.930234968662262, 1.0429768562316895,
0.9678786993026733, 0.9093518257141113,
1.6651370525360107 1.6651370525360107
], ],
"min" : [ "min" : [
-0.9589369893074036, -1.0429768562316895,
0.4841155409812927, 0.4841155409812927,
-0.7362931966781616 -0.7362931966781616
], ],
@ -1003,7 +1003,7 @@
}, },
{ {
"componentType" : 5126, "componentType" : 5126,
"count" : 12414, "count" : 12010,
"max" : [ "max" : [
1.1273759603500366, 1.1273759603500366,
2.7106683254241943, 2.7106683254241943,
@ -1011,24 +1011,24 @@
], ],
"min" : [ "min" : [
-1.1218620538711548, -1.1218620538711548,
0.3482356071472168, 0.46230417490005493,
-4.180373191833496 -4.180373191833496
], ],
"type" : "VEC3" "type" : "VEC3"
}, },
{ {
"componentType" : 5126, "componentType" : 5126,
"count" : 12414, "count" : 12010,
"type" : "VEC3" "type" : "VEC3"
}, },
{ {
"componentType" : 5126, "componentType" : 5126,
"count" : 12414, "count" : 12010,
"type" : "VEC2" "type" : "VEC2"
}, },
{ {
"componentType" : 5123, "componentType" : 5123,
"count" : 52836, "count" : 51528,
"type" : "SCALAR" "type" : "SCALAR"
} }
], ],
@ -1040,7 +1040,7 @@
}, },
{ {
"buffer" : 0, "buffer" : 0,
"byteLength" : 38625, "byteLength" : 38628,
"byteOffset" : 6180 "byteOffset" : 6180
}, },
{ {
@ -1090,13 +1090,13 @@
}, },
{ {
"buffer" : 0, "buffer" : 0,
"byteLength" : 15572, "byteLength" : 15700,
"byteOffset" : 168464 "byteOffset" : 168464
}, },
{ {
"buffer" : 0, "buffer" : 0,
"byteLength" : 49230, "byteLength" : 46892,
"byteOffset" : 184036 "byteOffset" : 184164
} }
], ],
"samplers" : [ "samplers" : [
@ -1107,7 +1107,7 @@
], ],
"buffers" : [ "buffers" : [
{ {
"byteLength" : 233268, "byteLength" : 231056,
"uri" : "YGC.bin" "uri" : "YGC.bin"
} }
] ]

Loading…
Cancel
Save