<div dir="ltr">Sounds like vtkCaptionActor2D is what you're looking for:<div><br></div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkCaptionActor2D.html">http://www.vtk.org/doc/nightly/html/classvtkCaptionActor2D.html</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 23, 2015 at 9:32 AM, joaoroberto88 <span dir="ltr"><<a href="mailto:joaorobertojr88@gmail.com" target="_blank">joaorobertojr88@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 Cory,<br>
<br>
Thanks for your reply. I tried to use vtkTextActor, but I'm having some<br>
issue about positioning it near to the station icon actor (see attached<br>
image and code below). As you can see I'm using the same station icon<br>
coordinate and the label "Station #1" isn't positioned correctly. Do you<br>
have any clues? Also, since vtkTextActor is two-dimesional I think the text<br>
won't follow the image actor while the user interacts with the rendered map.<br>
<br>
Here is the main code that creates both actors:<br>
<br>
    vtkSmartPointer<vtkPNGReader> iconReader =<br>
vtkSmartPointer<vtkPNGReader>::New();<br>
    iconReader->SetFileName("~/station.png");<br>
    iconReader->Update();<br>
<br>
    vtkSmartPointer<vtkImageData> imageData = iconReader->GetOutput();<br>
    imageData->SetOrigin(station->getUtmX(), station->getUtmY(), 0);  // the<br>
UTM-X and UTM-Y from UI<br>
<br>
    vtkSmartPointer<vtkImageChangeInformation> imageResize =<br>
vtkSmartPointer<vtkImageChangeInformation>::New();<br>
    imageResize->SetInputData(imageData);<br>
    imageResize->SetOutputSpacing(2, 2, 1); // Resizes the image<br>
    imageResize->Update();<br>
<br>
    vtkSmartPointer<vtkDataSetMapper> iconMapper =<br>
vtkSmartPointer<vtkDataSetMapper>::New();<br>
    iconMapper->SetInputData(imageResize->GetOutput());<br>
<br>
    vtkSmartPointer<vtkActor> iconActor = vtkSmartPointer<vtkActor>::New();<br>
    iconActor->SetMapper(iconMapper);<br>
<br>
    vtkSmartPointer<vtkTextActor> textActor =<br>
vtkSmartPointer<vtkTextActor>::New();<br>
    textActor->GetTextProperty()->SetFontSize ( 12 );<br>
    textActor->SetPosition2 ( iconActor->GetPosition()[0],<br>
iconActor->GetPosition()[1] - 20 );<br>
    renderer->AddActor2D ( textActor );<br>
    textActor->SetInput( station->getName().toStdString().c_str() );<br>
    textActor->GetTextProperty()->SetColor ( 1.0,0.0,0.0 );<br>
<br>
    renderer->AddActor(textActor);<br>
    renderer->AddActor(iconActor);<br>
<br>
Thanks,<br>
<br>
Joao.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Label-vtkActor-tp5734069p5734072.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Label-vtkActor-tp5734069p5734072.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>