[vtkusers] Show/hide actors efficiently
Nicolas Rannou
Nicolas_Rannou at hms.harvard.edu
Thu Sep 9 15:15:45 EDT 2010
Thanks,
Using the distance to the plane/box appears to be efficient enough.
For information, the main issue was that I was calling the Render()
method after updating the visibility of each mesh (2000 call to
Render()...! ) instead of calling it one time after updating the
visibility of all the meshes.....
Thanks again,
Nicolas
On Sep 7, 2010, at 9:32 AM, (Samuel) Byeongjun Park wrote:
> Hi,
> This is just a suggestion that I haven’t implemented it before with
> VTK.
>
> You may build a bidirectional list sorted by the distance from the
> plane.
> If you utilize insertion sort algorithm and binary search tree based
> on the sorted list, the computation will not be that heavy when you
> move the plane or an object.
> You should be able to search the plane’s position at most in 10
> operations with binary search tree when you use 1,000 actors.
>
> Good luck.
>
> Sam.
>
> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
> Behalf Of Nicolas Rannou
> Sent: Wednesday, September 01, 2010 6:20 PM
> To: Bertrand de Boisdeffre
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Show/hide actors efficiently
>
> Thanks I will dig a little bit into that and let you know how it
> works.
>
> It could be a solution but I guess that the next question is:
> How do you update each assembly efficiently when you move the plane/
> box..?
>
> Let's say that while moving the plane/box an actor moves from in
> front of the plane to behind the plane. (hide->show)
> How would you just move this single actor from an assembly to the
> other without going through the whole assemblies?
>
> How long does it take to show/hide an assembly of 1000 actors?
>
> I couldn't find any solution yet to only update the visibility of
> the actors that the "state" is changing.
>
> Thanks
>
> Nicolas
>
> On Sep 1, 2010, at 4:29 PM, Bertrand de Boisdeffre wrote:
>
>
> If you know at the beginning where actors are positionned ( behind
> or in front of plane ) , so you can divide your actors in 2
> assemblies. In this case, look at this class : "vtkAssembly". This
> class allows to change properties for all actors belonging to the
> assembly.
> If you try to check if the actor is behind/front of a plane and then
> change the properties, I don't have solution.
>
> 2010/8/31 Nicolas Rannou <nicolas_rannou at hms.harvard.edu>
> Hi all,
>
> I would like to show/hide actors which are:
> - behind or in front of a plane widget
> - inside or outside a box widget
> and to be able to interact with the widgets in real time to modify
> the visibility of the actors.
>
> My main issue is that I am working with thousands of actors and
> checking the bounding box of each actor appears not to be efficient
> enough...
>
> Would somebody know a good way to deal with high number of actors?
>
> Thanks,
>
> Nicolas
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> --
> Bertrand de Boisdeffre
> Etudiant 2A SICOM Phelma Grenoble-INP
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100909/261a99e3/attachment.htm>
More information about the vtkusers
mailing list