[vtkusers] Incremental mesh rendering question
Shannon Whitmore
swhitmor at cs.uiuc.edu
Wed Dec 20 15:08:49 EST 2000
Greetings,
I am in the beginning stages of modifying an existing mesh visualization
code for my research. I'm trying to change the code so that meshes are
incrementally loaded and displayed when the system is idle.
My problem is that the mesh rendering code is becoming a performance
issue because it rerenders all meshes displayed to the window every time
the Render method is called (which occurs every time I load a new grid
and display it). If 1000 meshes have already been rendered
and 5 new ones have been loaded, I would like to only render the 5 new
ones. Is it possible to do this?
The code for the Render method is shown below:
void vtkSMGPolyDataMapper::Render(vtkRenderer *ren, vtkActor *a)
{
vtkSMGPolyData *input=(vtkSMGPolyData *)(this->GetInput());
this->Update();
realmapper->ShallowCopy((vtkMapper *)this);
for (int ii=0;ii<input->GetNumberOfEntries();ii++)
{
if (input->GetPolyData(ii)!=NULL){
realmapper->SetInput(input->GetPolyData(ii));
realmapper->Render(ren, a);
}
realmapper->SetInput(NULL);
}
}
I was hoping to call realmapper->Render for each mesh only once, but
so far I have been unable to make this work. Does anyone have any ideas on
what I need to do to render only the newest meshes? I'm rather new to the VTK
world and have searched the VTK documentation and email list for ideas but
I'm not finding anything. Any tips, hints, or tricks would be much
appreciated. :-)
Thanks in advance,
Shannon Whitmore
Pablo Research Group
Department of Computer Science
University of Illinois
swhitmor at cs.uiuc.edu
More information about the vtkusers
mailing list