|
@@ -161,12 +161,14 @@ export class VtkModel {
|
|
|
|
|
|
this.sensorobj={};
|
|
this.sensorobj={};
|
|
|
|
|
|
-
|
|
|
|
|
|
+ // 用于管道上位置移动(点)
|
|
this.actorpipsites=[];
|
|
this.actorpipsites=[];
|
|
|
|
|
|
|
|
+ // 用于管道上位置移动(传感器)
|
|
|
|
+ this.actorpipsensors=[];
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ // 用于管道上位置移动(监测点)
|
|
|
|
+ this.actorpipjcs=[];
|
|
|
|
|
|
this.jcdActors = []; //检测点数据
|
|
this.jcdActors = []; //检测点数据
|
|
this.jcreader = vtkPLYReader.newInstance();
|
|
this.jcreader = vtkPLYReader.newInstance();
|
|
@@ -294,11 +296,7 @@ removePname(){
|
|
this.renderWindow.render();
|
|
this.renderWindow.render();
|
|
}
|
|
}
|
|
|
|
|
|
-//清空灾源
|
|
|
|
-delSoures(){
|
|
|
|
- this.removeSoure();
|
|
|
|
- this.soureActors=[];
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
//水泵/风门、风机添加
|
|
//水泵/风门、风机添加
|
|
addpump(pid,site){
|
|
addpump(pid,site){
|
|
|
|
|
|
@@ -387,7 +385,6 @@ removeSensor(){
|
|
}
|
|
}
|
|
delSensor(){
|
|
delSensor(){
|
|
this.removeSensor();
|
|
this.removeSensor();
|
|
- this.cgqActors=[];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//添加一个灾源点
|
|
//添加一个灾源点
|
|
@@ -431,6 +428,12 @@ removeSoure(){
|
|
this.renderWindow.render();
|
|
this.renderWindow.render();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//清空灾源
|
|
|
|
+delSoures(){
|
|
|
|
+ this.removeSoure();
|
|
|
|
+ this.soureActors=[];
|
|
|
|
+}
|
|
|
|
+
|
|
//初始化监测点
|
|
//初始化监测点
|
|
initCheckNodes(checkNodes){
|
|
initCheckNodes(checkNodes){
|
|
checkNodes.forEach((checkNode) => {
|
|
checkNodes.forEach((checkNode) => {
|
|
@@ -478,6 +481,10 @@ removejc(){
|
|
this.renderWindow.render();
|
|
this.renderWindow.render();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+deljc() {
|
|
|
|
+ this.removejc();
|
|
|
|
+}
|
|
|
|
+
|
|
//显示所选择巷道位置
|
|
//显示所选择巷道位置
|
|
addpipsite(pid,site){
|
|
addpipsite(pid,site){
|
|
console.log(1111)
|
|
console.log(1111)
|
|
@@ -514,7 +521,7 @@ removejc(){
|
|
addpipsite2(pid,site){
|
|
addpipsite2(pid,site){
|
|
let pipe =this.pipeByPid(pid);
|
|
let pipe =this.pipeByPid(pid);
|
|
if(this.actorpipsites.length==0){
|
|
if(this.actorpipsites.length==0){
|
|
- addpipsite(pid,site);
|
|
|
|
|
|
+ this.addpipsite(pid,site);
|
|
}
|
|
}
|
|
if(this.actorpipsites.length==1){
|
|
if(this.actorpipsites.length==1){
|
|
const actorpipsite= vtkActor.newInstance();
|
|
const actorpipsite= vtkActor.newInstance();
|
|
@@ -548,6 +555,76 @@ removejc(){
|
|
this.renderer.removeActor(actor);
|
|
this.renderer.removeActor(actor);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+// 显示所选管道传感器位置
|
|
|
|
+addpipsensor(pid,site){
|
|
|
|
+ console.log(1111)
|
|
|
|
+ let pipe =this.pipeByPid(pid);
|
|
|
|
+ console.log("管道数据",pipe)
|
|
|
|
+ if(this.actorpipsensors.length==0){
|
|
|
|
+ const actorpipsensor = vtkActor.newInstance();
|
|
|
|
+ const pipsensorMapper = vtkMapper.newInstance();
|
|
|
|
+ pipsensorMapper.setInputConnection(this.cgqreader.getOutputPort());
|
|
|
|
+ actorpipsensor.setMapper(pipsensorMapper);
|
|
|
|
+ actorpipsensor.setScale(0.1,0.1,0.1);//放大
|
|
|
|
+ actorpipsensor.getProperty().setColor(SOURECOLOR);
|
|
|
|
+ this.actorpipsensors.push(actorpipsensor);
|
|
|
|
+ }
|
|
|
|
+ const actorpipsensor =this.actorpipsensors[0];
|
|
|
|
+ let point1 = this.pointByPipeNodeId(pipe.snId);
|
|
|
|
+ let point2 = this.pointByPipeNodeId(pipe.enId);
|
|
|
|
+ let py = site/(1.01-site);
|
|
|
|
+ let pipsite_point=[
|
|
|
|
+ (point1[0]+py*point2[0])/(1+py),
|
|
|
|
+ (point1[1]+py*point2[1])/(1+py),
|
|
|
|
+ (point1[2]+py*point2[2])/(1+py),
|
|
|
|
+ ]
|
|
|
|
+ actorpipsensor.setPosition(pipsite_point);
|
|
|
|
+ this.renderer.addActor(actorpipsensor);
|
|
|
|
+ this.renderWindow.render();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+//移除传感器在所选择的巷道中的位置
|
|
|
|
+clearpipsensor(){
|
|
|
|
+ this.actorpipsensors.forEach((actor) => {
|
|
|
|
+ this.renderer.removeActor(actor);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 显示所选管道监测点位置
|
|
|
|
+addpipjc(pid,site){
|
|
|
|
+ console.log(1111)
|
|
|
|
+ let pipe =this.pipeByPid(pid);
|
|
|
|
+ console.log("管道数据",pipe)
|
|
|
|
+ if(this.actorpipjcs.length==0){
|
|
|
|
+ const actorpipjc = vtkActor.newInstance();
|
|
|
|
+ const pipjcMapper = vtkMapper.newInstance();
|
|
|
|
+ pipjcMapper.setInputConnection(this.jcreader.getOutputPort());
|
|
|
|
+ actorpipjc.setMapper(pipjcMapper);
|
|
|
|
+ actorpipjc.setScale(0.2,0.2,0.2);//放大
|
|
|
|
+ actorpipjc.getProperty().setColor(JCDCOLOR);
|
|
|
|
+ this.actorpipjcs.push(actorpipjc);
|
|
|
|
+ }
|
|
|
|
+ const actorpipjc =this.actorpipjcs[0];
|
|
|
|
+ let point1 = this.pointByPipeNodeId(pipe.snId);
|
|
|
|
+ let point2 = this.pointByPipeNodeId(pipe.enId);
|
|
|
|
+ let py = site/(1.01-site);
|
|
|
|
+ let pipsite_point=[
|
|
|
|
+ (point1[0]+py*point2[0])/(1+py),
|
|
|
|
+ (point1[1]+py*point2[1])/(1+py),
|
|
|
|
+ (point1[2]+py*point2[2])/(1+py),
|
|
|
|
+ ]
|
|
|
|
+ actorpipjc.setPosition(pipsite_point);
|
|
|
|
+ this.renderer.addActor(actorpipjc);
|
|
|
|
+ this.renderWindow.render();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+//移除监测点在所选择的巷道中的位置
|
|
|
|
+clearpipjc(){
|
|
|
|
+ this.actorpipjcs.forEach((actor) => {
|
|
|
|
+ this.renderer.removeActor(actor);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
// 安全路径显示
|
|
// 安全路径显示
|
|
safetypath(rows){
|
|
safetypath(rows){
|
|
this.renderWindowWith.resize();
|
|
this.renderWindowWith.resize();
|
|
@@ -1153,6 +1230,13 @@ safetypathremove(){
|
|
this.renderWindow.render();
|
|
this.renderWindow.render();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ delAll() {
|
|
|
|
+ this.deljc();
|
|
|
|
+ this.delSensor();
|
|
|
|
+ this.delSoures();
|
|
|
|
+ this.delpump();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//选中指定点
|
|
//选中指定点
|
|
selectByNodeId(nid) {
|
|
selectByNodeId(nid) {
|