How do I label points in 3d space with arbitrary strings?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I label points in 3d space with arbitrary strings?

Gaiajack
I have some particles moving around in 3d space, and I want to draw labels next to them that can display arbitrary data. The behavior in this example seems like what I need:


I tried having a look at vtkLabeledDataMapper, but I don't see any way to tell it what to display. It just seems to automatically display... coordinates? Or "field data", whatever that is? In any case I couldn't see any way to just directly assign strings to point IDs or something like that. Is this not the right class for the job? How can I get the behavior I'm looking for?

_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How do I label points in 3d space with arbitrary strings?

Aron Helser
FieldData is what you want. Essentially, you add a 'field' to your dataset, with an entry for each point, that contains the string you want to display. 

This example https://github.com/Kitware/VTK/blob/master/Examples/DataManipulation/Python/Arrays.py shows one way to add scalar data to a polydata, but I'm not sure it's what you want - I'm sure there's an appropriate example somewhere :)

HTH, 
Aron

On Thu, Jul 5, 2018 at 6:11 AM J. <[hidden email]> wrote:
I have some particles moving around in 3d space, and I want to draw labels next to them that can display arbitrary data. The behavior in this example seems like what I need:


I tried having a look at vtkLabeledDataMapper, but I don't see any way to tell it what to display. It just seems to automatically display... coordinates? Or "field data", whatever that is? In any case I couldn't see any way to just directly assign strings to point IDs or something like that. Is this not the right class for the job? How can I get the behavior I'm looking for?
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers