vtkProgressBar attached to an actor

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

vtkProgressBar attached to an actor

Andrea Gavana
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.


_______________________________________________
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: vtkProgressBar attached to an actor

David Gobbi
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 <[hidden email]> 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.

_______________________________________________
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: vtkProgressBar attached to an actor

Andrea Gavana
Hi David,

On Mon, 3 Dec 2018 at 17.34, David Gobbi <[hidden email]> wrote:
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.


Thank you for your answer. I’ll give it a go and see if I can make it work.

Andrea.



  David

On Mon, Dec 3, 2018 at 9:09 AM Andrea Gavana <[hidden email]> 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.

_______________________________________________
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