Possibly a dumb question, but...

Lawrence Werner rendawg at plinet.com
Tue Sep 28 21:04:10 EDT 1999


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





More information about the vtkusers mailing list