[vtkusers] get Point-Data from vtkPolyData*

Martin Baumann mailsgetlost at web.de
Fri Apr 7 11:06:23 EDT 2006


Hi,

I use a vtkStreamLine to create a particle trace.

Now I need to get the last point (x,y,z) from the data that vtkStreamTrace creates during integration.

I tried the following:

vtkStreamTracer* streamline = vtkStreamTracer::New();
streamline->SetInput(_vector_grid);
streamline->SetStartPosition(_start_points[i][0], _start_points[i][1], _start_points[i][2] );
streamline->SetMaximumPropagationUnitToTimeUnit();
streamline->SetMaximumPropagation(1);
streamline->SetMaximumNumberOfSteps(1);
streamline->SetInitialIntegrationStepUnitToTimeUnit();
streamline->SetInitialIntegrationStep((_options->delta_t).value());
streamline->SetIntegrationDirectionToForward();
streamline->SetIntegrator(_rk4);
streamline->Update();

_pd_list.push_back(streamline->GetOutput());
_apd->AddInput(streamline->GetOutput());

double _stop_position[3]; // this vector should hold the last point of vtkStreamTracer-Output
std::cout << "_pd_list.size()=" << _pd_list.size() << std::endl;
std::cout << "N_Cells = " << _pd_list.back()->GetLines()->GetNumberOfCells() << std::endl;
std::cout << "N_Verts = " << _pd_list.back()->GetNumberOfVerts() << std::endl;

_pd_list.size() holds some data, but
N_Cells is 0
N_Verts is 0

When I print the last entry of _pb_list.back():
vtkIndent ind(0);
_pd_list.back()->PrintSelf(std::cout,ind);
The following is plotted:

Debug: Off
Modified Time: 3329464
Reference Count: 1
Registered Events: (none)
Source: (none)
Information: 0xa2cd8a0
Data Released: False
Global Release Data: Off
UpdateTime: 3329467
Release Data: Off
UpdateExtent: Not Initialized
Update Number Of Pieces: 1
Update Piece: 0
Update Ghost Level: 0
MaximumNumberOfPieces: 1
RequestExactExtent: Off
 Field Data:
  Debug: Off
  Modified Time: 3329331
  Reference Count: 1
  Registered Events: (none)
  Number Of Arrays: 0
  Number Of Components: 0
  Number Of Tuples: 0
Number Of Points: 0
Number Of Cells: 0
Cell Data:
  Debug: Off
  Modified Time: 3329333
  Reference Count: 1
  Registered Events: (none)
  Number Of Arrays: 0
  Number Of Components: 0
  Number Of Tuples: 0
  Copy Flags: ( 1 1 1 1 1 )
  Scalars: (none)
  Vectors: (none)
  Normals: (none)
  TCoords: (none)
  Tensors: (none)
Point Data:
  Debug: Off
  Modified Time: 3329464
  Reference Count: 1
  Registered Events: (none)
  Number Of Arrays: 6
  Array 0 name = u_x
  Array 1 name = NULL
  Array 2 name = IntegrationTime
  Array 3 name = Vorticity
  Array 4 name = Rotation
  Array 5 name = AngularVelocity
  Number Of Components: 10
  Number Of Tuples: 0
  Copy Flags: ( 1 1 1 1 1 )
  Scalars:
    Debug: Off
    Modified Time: 3329412
    Reference Count: 1
    Registered Events: (none)
    Name: u_x
    Number Of Components: 1
    Number Of Tuples: 0
    Size: 0
    MaxId: -1
    LookupTable: (none)
    Array: (null)
  Vectors:
    Debug: Off
    Modified Time: 3329417
    Reference Count: 1
    Registered Events: (none)
    Name: (none)
    Number Of Components: 3
    Number Of Tuples: 0
    Size: 0
    MaxId: -1
    LookupTable: (none)
    Array: (null)
  Normals: (none)
  TCoords: (none)
  Tensors: (none)
Bounds:
  Xmin,Xmax: (1, -1)
  Ymin,Ymax: (1, -1)
  Zmin,Zmax: (1, -1)
Compute Time: 3329476
Number Of Points: 0
Point Coordinates: 0xa3298d8
Locator: 0
Number Of Vertices: 0
Number Of Lines: 0
Number Of Polygons: 0
Number Of Triangle Strips: 0
Number Of Pieces: 1
Piece: 0
Ghost Level: 0

How is the data stored in the vtkPolyData? How can I get point-coordinates from vtkPolyData?

Thanks, M.B.
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192




More information about the vtkusers mailing list