فهرست منبع

选中点 巷道

huangxingxing 8 ماه پیش
والد
کامیت
e89c0735a4
1فایلهای تغییر یافته به همراه11 افزوده شده و 10 حذف شده
  1. 11 10
      src/control/vtkModel.js

+ 11 - 10
src/control/vtkModel.js

@@ -1094,40 +1094,41 @@ safetypathremove(){
   //选中指定点
   selectByNodeId(nid) {
     console.log("selectByNodeId", nid);
-    if (this.isSelectNode) {
+    // if (this.isSelectNode) {
       if (this.lastActor != null) {
-        this.lastActor.getProperty().setColor(WHITE);
+        this.renderer.removeActor(this.lastActor);
       }
       this.nodeActors.forEach(nodeActor => {
         if (nid == nodeActor.node.id) {
-          nodeActor.actor.getProperty().setColor(GREEN);
-
-          this.renderWindow.render();
+          nodeActor.actor.getProperty().setColor(GREEN);      
           this.lastActor = nodeActor.actor;
           this.selectObj = nodeActor.node;
+          this.renderer.addActor(this.lastActor);
+          this.renderWindow.render();
           return;
         }
       });
-    }
+    // }
   }
   //选中指定管道
   selectByPipeId(pid) {
     console.log("selectByPipeId", pid);
-    if (this.isSelectPipe) {
+    // if (this.isSelectPipe) {
       if (this.lastActor != null) {
-        this.lastActor.getProperty().setColor(WHITE);
+        this.renderer.removeActor(this.lastActor);
       }
       this.pipeActors.forEach(pipeActor => {
         if (pid == pipeActor.pipe.id) {
           pipeActor.actor.getProperty().setColor(GREEN);
-          this.renderWindow.render();
           this.lastActor = pipeActor.actor;
           this.selectObj = pipeActor.node;
+          this.renderer.addActor(this.lastActor);
+          this.renderWindow.render();
           return;
         }
       });
     }
-  }
+  // }
 }
 function createRGBStringFromRGBValues(rgb) {
   if (rgb.length !== 3) {