Performance decrease in vtk 4.5 when using large number of actors.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
//On a PIV3.06HT //When using vtk 4.4, n_actors can go up to 30000 //and still maintain interactive refresh rates.
//In vtk 4.5, the refresh rate with values around //600 are comparable to values 30000 in 4.4.
int r_verts[4]; const int n_actors = 600; double dz=30./n_actors; for(double z=0; z<30; z+=dz) { r_points = vtkPoints::New(); r_polys = vtkCellArray::New(); r_pdata = vtkPolyData::New(); r_mapper = vtkPolyDataMapper::New(); r_actor = vtkActor::New();
r_points->InsertNextPoint( 0., 0., z);
r_points->InsertNextPoint(10., 0., z);
r_points->InsertNextPoint(10., 10., z);
r_points->InsertNextPoint( 0., 10., z);
r_points->InsertNextPoint( 0., 0., z+dz); r_points->InsertNextPoint(10., 0., z+dz); r_points->InsertNextPoint(10., 10., z+dz); r_points->InsertNextPoint( 0., 10., z+dz);
r_verts[0] = 0; r_verts[1] = 1;
r_verts[2] = 5; r_verts[3] = 4;
r_polys->InsertNextCell(4, r_verts);
r_verts[0] = 1; r_verts[1] = 2; r_verts[2] = 6; r_verts[3] = 5; r_polys->InsertNextCell(4, r_verts);
r_verts[0] = 2; r_verts[1] = 3;
r_verts[2] = 7; r_verts[3] = 6;
r_polys->InsertNextCell(4, r_verts);
r_verts[0] = 3; r_verts[1] = 0; r_verts[2] = 4; r_verts[3] = 7; r_polys->InsertNextCell(4, r_verts);
r_pdata->SetPoints(r_points); r_pdata->SetPolys(r_polys); r_mapper->SetInput(r_pdata); r_actor->SetMapper(r_mapper); r_actor->GetProperty()->SetRepresentationToWireframe();
renderer->AddActor(r_actor);
r_points->Delete(); r_polys->Delete(); r_pdata->Delete(); r_mapper->Delete(); r_actor->Delete(); }