[vtkusers] timer events

Charl P. Botha c.p.botha at its.tudelft.nl
Tue Apr 1 08:25:55 EST 2003


Hello Nico,

Please fix your mailer.  It's not line-breaking.

On Tue, 2003-04-01 at 15:14, Nico Vermaas wrote:
> 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).

It would become one application and you would have to write some code to
wrap the C++ with the Pascal calling convention compliant thunks.  I had
forgotten that Kylix could mean Object Pascal.  This solution is still
an elegant one, but may be too involved and not suitable to your
purposes.

> (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).

1. man select
2. http://www.opengroup.org/onlinepubs/007908799/xsh/pthread.h.html
3.
http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN.html
 
Be VERY careful with threading and calling into VTK code.  You could
break your application easily.

I have a much better idea: You could also code your VTK application with
a TCP/IP interface that your client app (Kylix, a web-based PHP app or
just a stupid CGI, etc) can connect to and talk to in XML.  It could
then drive the visualisation application in a clean and standard way, no
stupid hacks.  Python, along with a library such as Twisted (IIRC),
would be ideal for this.  This solution satisfies all your requirements
and has a large number of advantages over your current idea.

In short: you're going to have to spend much time reading and learning
in the next few days. :)

Good luck,
Charl

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



More information about the vtkusers mailing list