How can i Copy an vtkActor ( vtkMapper ) ?

Charles Law charles.law at kitware.com
Tue Sep 14 08:07:32 EDT 1999


<x-flowed>Harald,

I do not know why you want to copy the data too.  Copying the actor and its
properties might be enough.  But ...

1: PointData and CellData do have methods called PassData.

2: In VTK3.0 you should be able to create a new vtkPolyData object (or 
vtkImageData...)
and set the last filter in the pipeline before the mapper with:

filter->Update();
oldData = filter->GetOutput();
newData = vtkPolyData::New();
filter->SetOutput(newData);
filter->Update();

Now oldData and newData should have exactly the same data.





At 11:01 AM 9/14/99 +0200, Luebeck, Harald wrote:

>How can create an exact copy of an vtkActor. I need an copy not an refrence
>because i want to modify some Properties without modifing the original
>Actor.
>
>At the moment i use the folloing code :
>
>// Copy Mapper through DataSet
>pDataSet->CopyStructure( pShapeActor->GetMapper()->GetInput() );
>// Set new mapper
>pMapper->SetInput( pDataSet );
>pActor->SetMapper( pMapper );
>
>How can i copy the rest of the data. i.e TCoords, Scalars ... ?
>
>Thanks for any help.



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------


</x-flowed>



More information about the vtkusers mailing list