[vtkusers] updating an actor

David E DeMarle dave.demarle at kitware.com
Fri Feb 12 09:18:33 EST 2010


"act" is a pointer, and thus only a few bytes. The structure "act" refers to
will not be duplicated by your keeping hold of the pointer.

You may also want to study reference counting, and then after that
smartpointers. They are how VTK makes sure that as long as you want to keep
your pointer, the structure on the other side of the pointer will still be
valid.

David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109


On Fri, Feb 12, 2010 at 9:08 AM, Giancarlo Amati <ilferraresebono at hotmail.it
> wrote:

>  Hello VTkers,
>
> let's say that I have this function
>
>
> vtkRenderer *renderer = vtkRenderer::New();
>
> void createScene(...) {
>
> vtkActor *act = vtkActor::New();
>
> renderer->AddActor();
>
> }
>
> I have the need of update an actor associated to a particular element of
> the scene.
> The AddRenderer() adds the actor in the pipeline which I believe is an
> overall innner VTK datastructure.
>
> So, I know that the GetActors() in the renderer returns the
> vtkActorsCollection.
> If I want to change/update something in a pre-allocated actor shall I save
> the variable act and the nperform a research in that collection returned by
> GetActors()?
>
> But saving the variable *act in a global data structure wouldn't it mean
> duplicating information (and so more memory usage) about that actor? and If
> I modify *act, am I actually modifing the same in the pipeline?
>
> Thanks  a lot for  any advice you can give me!.
>
> Giancarlo
>
> ------------------------------
> Troppe caselle di posta? Gestiscile da Hotmail!<http://www.windowslive.it/hotmail/GestisciAltriAccount.aspx>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100212/e6811143/attachment.htm>


More information about the vtkusers mailing list