[vtkusers] timer events

Nico Vermaas vermaas at astron.nl
Tue Apr 1 08:14:16 EST 2003


Hi Charl,

Mmm... the idea is to keep the two app's separated, because in a later stage I want to use other ways of controlling the C++/VTK app. Now it is a simple Delphi GUI, but later it can be anything. Even a text editor or a website. As long as the interface is simple, clear and standard. (and that's what the ascii file is for, it doesn't come much simpeler and more standard than ascii I think).

(Q1):
When I connect the window to a windowID in Delphi, could I then still be able to those two applications work side-by-side or would I have to do everything in Delphi then? (I am using the pascal language, not the c++ language in Kylix).

(Q2): 
What is a 'select()' loop? And how do I create a VTK app with an extra thread? (I'm quite new to this as you might guess).

Nico

>>> "Charl P. Botha" <c.p.botha at its.tudelft.nl> 04/01/03 02:58pm >>>
The Right Way(tm) to do what you want to do would be to integrate VTK
with your Kylix application.  This comes down to setting the WindowId of
the RenderWindow to the WindowId (handle, whatever) of a window in your
Kylix application.  Have a look at some of the VTK to widget set glue
code, e.g. http://cpbotha.net/vtkFlRenderWindowInteractor.html 

If you REALLY want to do it by polling a text file (ugh) then create a
VTK application with an extra thread that consists of a select() loop on
your file.  This extra thread can then notify the VTK logic in your
primary thread when something changes.  Alternatively, you could create
a VTK/some widget set (e.g. FLTK, QT) application that polls the file in
its idle loop.  The simple VTK event loop doesn't support an idle event
itself.

HTH,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/




More information about the vtkusers mailing list