huangxingxing 1 miesiąc temu
rodzic
commit
30b05ad1de
1 zmienionych plików z 28 dodań i 26 usunięć
  1. 28 26
      src/control/vtkModel.js

+ 28 - 26
src/control/vtkModel.js

@@ -1151,41 +1151,43 @@ safetypathremove(){
     this.clearArrow();
     this.arrowActors = [];
     velocitys.forEach(velocity => {
-      velocity.points.forEach(point => {
-        // const initialValues = { 
-        //   base:0,
-        //   shape: 'arrow4points',
-        //   center: [point.x,point.y,point.z],
-        //   direction:[
-        //     velocity.vector[2],
-        //     velocity.vector[0],
-        //     velocity.vector[1]
-        //   ],
-        //   height: 10.0,
-        //   thickness: 1.5,
-        //   width: 3,
-        //  };
-        // const vtk2d = vtk2DShape.newInstance(initialValues);
-
+      // velocity.points.forEach(point => {
+      //   const initialValues = {
+      //     center: [point.x, point.y, point.z],
+      //     height: 10.0,
+      //     radius:2,
+      //     resolution: 6,
+      //     direction: [
+      //       velocity.vector[0],
+      //       velocity.vector[1],
+      //       velocity.vector[2]
+      //     ],
+      //     capping: true,
+
+      //   };
+      //   const vtk2d = vtkConeSource.newInstance(initialValues);
+
+      //   const mapper = vtkMapper.newInstance();
+      //   mapper.setInputConnection(vtk2d.getOutputPort());
+      //   const actor = vtkActor.newInstance();
+      //   actor.setMapper(mapper);
+      //   actor.getProperty().setColor(REA);
+      //   this.arrowActors.push(actor);
+      //   // this.renderer.addActor(actor);
+      // })
+      if(velocity.points&&velocity.points.length>0){
+        let point = velocity.points[0];
         const initialValues = {
-          // base: 0,
           center: [point.x, point.y, point.z],
-          // height: 10,
-          // radius: 3,
-          // resolution: 6,
           height: 10.0,
           radius:2,
           resolution: 6,
           direction: [
-            // velocity.vector[2],
-            // velocity.vector[0],
-            // velocity.vector[1]
             velocity.vector[0],
             velocity.vector[1],
             velocity.vector[2]
           ],
           capping: true,
-
         };
         const vtk2d = vtkConeSource.newInstance(initialValues);
 
@@ -1195,8 +1197,8 @@ safetypathremove(){
         actor.setMapper(mapper);
         actor.getProperty().setColor(REA);
         this.arrowActors.push(actor);
-        // this.renderer.addActor(actor);
-      })
+        this.renderer.addActor(actor)
+      }
     });
     for (let index = 0; index < this.arrowActors.length; index=index+30) {
       let actor =this.arrowActors[index];