[vtkusers] How to change data through Actor

Rakesh Patil rakeshthp at in.com
Thu Apr 8 02:56:32 EDT 2010


Hi Darshan,I hope you remember few days back i had posted theremove cell filter class which i had written.when i usethisfilter, i get a new unstructured grid as the output from this filter(newgrid which has one cell lesscompared to the previous grid).. Soinstead of creating a new mapper and actor for this grid, i need toinsert this grid into the same old actor..I mean update the gridexisting in the actor in question.so, vtkUnstructuredGrid*uGrid =vtkUnstructuredGrid::SafeDownCast(selactor>GetMapper()>GetInput());MyRemoveFilter*rmfil = MyRemoveFilter::New();rmfil>setInput(uGrid);rmfil>RemoveCell(2);rmfil>Update();vtkUnstructuredGrid*gd = rmfil>GetOutput();selactor>GetMapper()>GetInput()>ShallowCopy(gd);selactor>Modified();pRenderer>Refresh();Sowill this block of code work..??ThanksRegardsRakeshPatil Original message From:DarshanPai< darshanpai at gmail.com >Date: 06 Apr 10 20:31:08Subject: Re: [vtkusers] How to change data through ActorTo: Rakesh Patil Actuallyyou are not suppose
 d to do the ShallowCopy unless you are creating aentirely new grid. Can you post your code here so can get a idea whatexactly are you doing .RegardsDarshan On Tue, Apr 6, 2010 at 5:08 AM, Rakesh Patilwrote:Hi Darshan,That i have done.. Buthow do i set the updated datato the actor..??I mean, for example, I get the Unstructured gridfrom the actor as follows:vtkUnstructuredGrid *grid =vtkUnstructuredGrid::SafeCast( actor>GetMapper()>GetInput() );vtkPoints *pts = grid>GetPoints();// Assign new values to ptsNext how do I connect this pts to actor "actor" so that the actor clears theold display and renders new display..??I mean after i set ptsto grid, how do i set this grid to actor..? I tried doing this...actor>GetMapper()>GetInput()>ShallowCopy(grid);actor>Modified();But i found no change.. It is showing same old display.. Anysuggestions..??ThanksRegardsRakesh PatilOriginal message From:Darshan Pai< darshanpai at gmail.com> Date: 04 Apr 10 01:22:24Subject: Re:[vtkusers] How to chan
 ge data through ActorTo: Rakesh Patil Youcan always get your data back from the actor usingActor>GetMapper()>GetInput(). Then you can change your data . On Sat, Apr 3, 2010 at 5:30 AM,Rakesh Patilwrote: Hello Users,I came to know that it is possibleto change the data of a grid using actors. for example, I have alreadydisplayed a polyline. Now using this polyline actor, is it possible tochange the number of points in this polyline..?? Changing means i want it to reflect back on the render window..Anyidea how to do this..??ThanksRakesh PatilDear vtkusers ! Get Yourselfa cool, short @in.com Email ID now!  Powered by www.kitware.comVisit other Kitware opensource projects at http://www.kitware.com/opensource/opensource.htmlPlease keep messages ontopic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTKFAQFollow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers Get Yourself a cool, short @in.com Email ID now!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100408/d86f34d4/attachment.htm>


More information about the vtkusers mailing list