<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 13, 2016 at 7:54 AM, Olivier Ameline <span dir="ltr"><<a href="mailto:olivameline@gmail.com" target="_blank">olivameline@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks, it's working with vtkGlyph3D : I can position and orientate the 300<br>
arrows with only one actor.<br>
<br>
But now, I'm trying to add labels that follow the arrows.<br>
I was doing this with vtkVectorTexts, but this requires to define 300<br>
vtkFollowers.<br>
<br>
Is there also a way to define only one vtkFollower ?<br>
<br>
I tried to put the vtkVectorTexts in a vtkGlyph3D, and define ony one<br>
follower for the entire vtkGlyph3D,<br>
but only the first vtkVectorText follows its arrow.<br></blockquote><div><br></div><div>Sounds like vtkLabeledDataMapper could do what you want:</div><div><br></div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkLabeledDataMapper.html#details">http://www.vtk.org/doc/nightly/html/classvtkLabeledDataMapper.html#details</a><br></div><div><br></div><div>It looks like it can take a 3D dataset and render arbitrary strings at each point. So you should be able to:</div><div><br></div><div>1) Create a dataset that has points where you want the labels.</div><div>2) Create a vtkStringArray containing the labels (in the same order as the points) and add this to the dataset via dataset->GetFieldData()->AddArray() (be sure to give the array a unique name with SetName).</div><div>3) Set:</div><div>- labeledDataMapper->SetLabelModeToLabelFieldData()</div><div>- labeledDataMapper->SetFieldDataName(labelArray->GetName())</div><div><br></div><div>The vtkLabeledDataMapper is then connected to a single vtkActor2D, and will render the text in the overlay plane on top of the geometry, no vtkFollower needed. You can use a vtkSelectVisiblePoints filter if you want to hide labels on occluded points.</div><div><br></div><div>HTH,</div><div>Dave</div></div></div></div>