Pbs with Streamlines.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Pbs with Streamlines.

galera
I try to build streamline using this code:

vtkPoints points = new vtkPoints();
      points.SetDataTypeToDouble();
      double sizeMaxField = aValue;
   
      vtkDoubleArray vector3DArray = new vtkDoubleArray();
      vector3DArray.SetNumberOfComponents(3);
      vector3DArray.SetName("Vector");
     
      for (int i = 0; i < grid.getCellNumber(); i++) {
        Vector3D fieldValue = (Vector3D) getValue(i);
      
          Point3D p = (Point3D) grid.getCellBarycenter(i);
          points.InsertNextPoint(p.x, p.y, p.z);
          vector3DArray.InsertNextTuple3(fieldValue.x, fieldValue.y, fieldValue.z);
       }
      vtkPolyData polyData = new vtkPolyData();
      polyData.SetPoints(points);
      polyData.GetPointData().SetVectors(vector3DArray);

   
     
   // Create the source points for the streamlines
      vtkPointSource pointSource = new vtkPointSource();
      Point3D center = Point3D.barycenter(grid.getOrigin(), grid.getExtremalPoint());
      pointSource.SetCenter(center.x, center.y, center.z);
      pointSource.SetRadius(grid.getExtremalPoint().distance(grid.getOrigin())/2.);
      pointSource.SetDistributionToUniform();
      pointSource.SetNumberOfPoints(1500);
      pointSource.Update();
     
     
     
      tracer = new vtkStreamTracer();
      tracer.SetSourceData(polyData);
      tracer.SetSourceConnection(pointSource.GetOutputPort());
      tracer.SetMaximumPropagation(100);
      tracer.SetInitialIntegrationStep(1);
      tracer.SetIntegrationDirectionToForward();
      tracer.SetComputeVorticity(false);
      tracer.SetIntegrator(new vtkRungeKutta4());
      tracer.Update();
      streamTube = new vtkRibbonFilter();
      streamTube.SetInputConnection(tracer.GetOutputPort());
      streamTube.SetWidth(5);
      streamTube.SetWidthFactor(5);
      streamTube.Update();


        mapper = new vtkPolyDataMapper();
        mapper.SetInputConnection(streamTube.GetOutputPort());



I don't see nothing!!!! Some body can help me?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers