[vtkusers] vtk+wxWindows+Diffpack: Rendering at each step of a simulation.

Gopalakrishnan, Gowri Gowri.Gopalakrishnan at inteq.com
Wed Dec 5 07:13:17 EST 2001


I dont know if it is of any help, I had tried the following at some point.
I have a timer and in the timer function i update my vtkPolyDataReader 
every few seconds. I do a polydatareader -> Modified();
and then a ploydatareader -> Update();
This updates the entire chain of rest of the mappers and actors. This worked
for me. I am not however sure that calling modified is essential to update.
But it is worth a try....

Gowri


-----Original Message-----
From: stefano mininel [mailto:mininel.ml at gnbts.univ.trieste.it]
Sent: Tuesday, December 04, 2001 2:27 PM
To: vtkusers at public.kitware.com
Subject: [vtkusers] vtk+wxWindows+Diffpack: Rendering at each step of a
simulation.


Trying to create a framework for partial differences equations solution
(Diffpack libraries) with wxWindows (for portability) and vtk
(visualization of results) with VC++ on Win2000.
First example: 2D wave equation solution.
In the MyApp::OnInit() I call myFrame->InitialConfiguration() in which I
create initial conditions in an array u[nx,ny], copy data in a
vtkStructuredGrid and visualize them in a wxVTKWindow linked to a panel
in myFrame. Everything OK.
Then, after adjusting camera for best visualization, a menu event may
call myFrame->OnSimulation(), that has a cycle:

while (t <= tstop) {
  t +=dt;
  ... //calculating with wave equation situation in next temporal step
and replacin values in array u[] ...
  ... //recalculating points and scalars values from u[] ...
  ... //re-assigning to the vtkStructuredGrid object with:
grid->SetPoints(points);
grid->GetPointData()->SetScalars(scalars);
...
... //TRYING (in vain) to visualize situation after each step of the
simulation with:
gridMapper->SetInput(grid);
gridMapper->Update();
gridActor->SetMapper(gridMapper);
gridActor->Update(); //no need to say what kind of objects they are!
 pRenderer->Render();
} //end time-while

The visualization remains in the initial state and I'm no able to obtain
rendering of the subsequent steps. Did I forget something apparently
trivial but important? Or is it a more complicated matter and I need,
for example, to send a message to the main frame to force its update or
.... what??? Please, ANY help will be greatly appreciated!

    Stefano Mininel

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



More information about the vtkusers mailing list