[vtkusers] how to clean dataset?

Gennady Khokhorin gok at aerometric-ak.com
Wed Mar 19 16:27:01 EDT 2008


Hello, all.
I'm wonder what is a right way to clean data in mapper?
For each new opening data set execution chain looks like that:

	pcvtkSDIView->GetRenderer()->RemoveActor(this->m_pDotActor);
..
	// read data
	vtkPolyData* polyData = vtkPolyData::New();
	vtkPoints *points = vtkPoints::New();
	polyData->SetPoints(points);
	points->Delete();
..
	vtkElevationFilter* colorIt = vtkElevationFilter::New();
	colorIt->SetInput(polyData);
	vtkElevationFilter* colorIt = vtkElevationFilter::New();
	vtkDataSetMapper *pDataSetMapper;
	pDataSetMapper  = vtkDataSetMapper::New();	
..
	pDataSetMapper->SetInput(colorIt->GetOutput());		 
..
	this->m_pDotActor->SetMapper(pDataSetMapper);
..
	pcvtkSDIView->GetRenderer()->AddActor(this->m_pDotActor);
	// clear data
	polyData->Delete();
	pDataSetMapper->Delete();

Every opening is increasing significantly app's used memory.

Thank you in advance for suggestions.

gok



More information about the vtkusers mailing list