[vtkusers] Real Time Visualization by VTK??

Bryan VanDeVen bryanv at arlut.utexas.edu
Wed Jun 7 13:18:41 EDT 2000


I had success along these lines awhile back.  Under X, I used 
XtAppAddInput(...) to a callback for reads on an open socket. 

XtAppContext app;
XtSetLanguageProc( NULL, NULL, NULL);
Widget toplevel = XtVaAppInitialize( &app, "SE Visualization",
                                     NULL, 0,
                                     &argc, argv,
                                     NULL, NULL );                 

Widget vtk = XtVaCreateManagedWidget( "vtk",
                                      xmPrimitiveWidgetClass,  form,
                                      XmNwidth, 600,
                                      XmNheight, 600,
                                      XmNleftAttachment, XmATTACH_FORM,
                                      XmNrightAttachment, XmATTACH_FORM,
                                      XmNtopAttachment, XmATTACH_WIDGET,
                                      XmNtopWidget, menubar,
                                      NULL ); 

iren->SetWidget(vtk);
iren->Initialize(app);
XtAppMainLoop(app);                  


Then in my callback, I could do things like:


contour->SetValue( 0,
                   newIsoValue );
renWin->Render( );      

or whatever, to update and immedaitely return to the interactor.

This is only a very rough sketch with a few snippets of code, I hope it
wasn't to vague.  A look at the vtkInteractor code might be
enlightening.

Note that this is essentially no different than adding callback for GUI
elements like buttons (see the XMace examples) except that I added a
callback for a readable socket instead, so that I could have another app
pump updated data to my vis app on a regular basis.  

I don't know how this would map to a Win32 environment but I would
assume it could be done.

Regards,

Ntfs wrote:
> 
> I've studied vtk by over 2 months by I still can't implement it
> into my simulation program.
> To be frank, vtk is the best visualiztion software that I can
> find in the web. The most important is that it's free!!
> 
> But I want to raise the point that, can it carry out real time
> visualiztion of data??
> For my simulation program, it's something like that
> for (x=0;x<max_iteration;x++)
> {
>    do simulation
>    ....
> }


-- 
Bryan Van de Ven
Applied Research Labs
University of Texas, Austin




More information about the vtkusers mailing list