[vtkusers] vtkProgressBar attached to an actor

David Gobbi david.gobbi at gmail.com
Mon Dec 3 11:34:33 EST 2018


Hi Andrea,

A generic way of doing this is to write a callback for vtkRenderer's
StartEvent.  Then every time the renderer is preparing to render the scene,
it will call your callback, and your callback can set the position of the
2D actors.  The vtkCoordinate class provides a convenient way of converting
from 3D to 2D coordinates.

Other than callbacks, I don't think there's any way to do it.  The VTK
label actors can be used to automatically position text at 3D locations,
but there don't seem to be any classes for placing an arbitrary 2D actor at
a 3D location.

  David

On Mon, Dec 3, 2018 at 9:09 AM Andrea Gavana <andrea.gavana at gmail.com>
wrote:

> Hello everyone,
>
>     I’ve been googling around without much success until now, so I am
> turning to this kind mailing list for suggestions.
>
> I have a 3D scene with multiple unstructured grids and some STL actors at
> defined positions (in 3D). I would like to be able to “attach” a progress
> bar to each of these STL actors - as my scene in rendered in a time
> dependent way, with the user able to go back and forth in time, it would
> make a nice touch for what I’m showing.
>
> Now, it seems to me vtkProgressBarWidget is a 2D animal, so I’m unclear
> how I can place it below the STL actor and anche it there even if the user
> zooms/pans the 3D window.
>
> Maybe what I’m trying to accomplish is simply not possible, but I’m open
> to all suggestions you may have.
>
> Thank you in advance.
>
> Andrea.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181203/9a452fe7/attachment.html>


More information about the vtkusers mailing list