Possibly a dumb question, but...

Lisa S. Avila lisa.avila at kitware.com
Tue Sep 28 23:29:35 EDT 1999


Hello Lawrence,

Keep in mind that filters do not update until forced to do so (either you
do filter->Update() yourself, or you render some data that needs (directly
or indirectly) the output of the filter which causes Update() methods to
propagate back down the pipeline. So you seem to be deleting the filter
before you have caused it to execute, so the output that you have is empty.

Lisa


At 07:04 PM 9/28/99 -0600, Lawrence Werner wrote:
>Is there any way to get the output of a filter and copy it to a separate
object so you can then delete the filter and use the newly created object
instead?
>
>Like for example...
>
>vtkPolyData* pSourceData = vtkPolyData::New();
>vtkTriangleFilter* pTriFilter = vtkTriangleFilter::New();
>vtkPolyData* pOutData = vtkPolyData::New();
>vtkPolyDataMapper* pMapper = vtkPolyDataMapper::New();
>vtkActor* pActor = vtkActor::New();
>
>pTriFilter->SetInput( pSourceData );
>////////////////////////////////////////////////////////////////////////
>// Below does not seem to work
>//I've tried both
>	pOutData = pTriFilter->GetOutput();
>// and 
>	pOutData->CopyStructure(pTriFilter->GetOutput());
>// and then put it in the mapper
>	pTriFilter->Delete();	
>	pMapper->SetInput( pOutData );
>	pActor->SetMapper( pMapper );
>// but when the view is rendered, no data is displayed
>//////////////////////////////////////////////////////////////////////////
>// The following does work
>	pMapper->SetInput( pTriFilter->GetOutput() );
>	pActor->SetMapper( pMapper );
>// but now I need to keep the vtkTriangleFilter around in order to render
the data
>/////////////////////////////////////////////////////////////////////////
>
>What I'd like to be able to do is use a filter to get a vtkPolyData object
and then be able to delete the filter to free up memory.
>
>
>Lawrence "Renny" Werner
>20324 North Turkey Creek Rd, Morrison, CO 80465
>voice : (303) 697-7656
>email :   rendawg at plinet.com
>
>
>
>
>-----------------------------------------------------------------------------
>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.
>-----------------------------------------------------------------------------
> 



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





More information about the vtkusers mailing list