[vtkusers] vtkParticleReader and vtkGlyph3D

Sebastien Jourdain sebastien.jourdain at kitware.com
Tue Apr 3 14:53:46 EDT 2018


Tom,

Just make sure that reader->Update(); was called before
glyph3D->SetInputData(reader->GetOutput());
But it would be better to use the connection instead of the dataset
directly.

Seb

On Tue, Apr 3, 2018 at 12:27 PM, Sgouros, Thomas <thomas_sgouros at brown.edu>
wrote:

> Hello all:
>
> Can someone help me understand why this code works:
>
>   vtkSmartPointer<vtkGlyph3D> glyph3D = vtkSmartPointer<vtkGlyph3D>::
> New();
>   glyph3D->SetSourceConnection(cubeSource->GetOutputPort());
>   glyph3D->SetInputData(polydata);
>   glyph3D->Update();
>
> And this does not (nothing displayed)?
>
>   vtkSmartPointer<vtkGlyph3D> glyph3D =  vtkSmartPointer<vtkGlyph3D>::
> New();
>   glyph3D->SetSourceConnection(cubeSource->GetOutputPort());
>   glyph3D->SetInputData(reader->GetOutput());
>   glyph3D->Update();
>
> The first clip is from https://www.vtk.org/Wiki/
> VTK/Examples/Cxx/Filtering/Glyph3D
>
> The 'reader' object is stolen from the ParticleReader example:
>
>   vtkSmartPointer<vtkParticleReader> reader = vtkSmartPointer<
> vtkParticleReader>::New();
>   reader->SetFileName ( filePath.c_str() );
>   reader->SetDataByteOrderToBigEndian();
>   reader->Update();
>
> The program compiles, but no data appears. It works fine (data appears) in
> the context of the ParticleReader example, where it shows all the data
> points. But I want to see them as glyphs, not little squares. I seem to be
> misunderstanding something fundamental, but not seeing what it could be.
>
> Many thanks,
>
>  -Tom
>
>
>
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180403/1e2ddc1e/attachment.html>


More information about the vtkusers mailing list