<div class="gmail_quote">On Tue, Feb 26, 2013 at 1:09 PM, matheus_viana <span dir="ltr"><<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys. Does anyone know if it is possible to save a polydata file with text<br>
embedded? Basically, I have a graph in 3D and I'd like to save also the<br>
label of each node. I know that there exist the vtkTextActor that is very<br>
useful to display texts in the scene, but I'm not sure if it might be useful<br>
for my purpose.<br>
<br>
Many thanks,<br>
Matheus<br></blockquote><div><br>A PolyData (.vtp) file simply stores a list of coordinates/points and
their connectivity, along with any other information you want to store
with each point/cell. So you cannot store the text as it would be seen
with a vtkTextActor, but you can store the label in the PointData
associated with the points in the PolyData. Something like this:
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars">http://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars</a> where you
would use some kind of a string array instead of the numeric arrays in
that example. You would then be responsible for displaying those values
yourself when you open the vtp file at a later time.<br clear="all"><div><br>David</div> </div></div>