[vtkusers] socket communication

jean-michel.rouet at philips.com jean-michel.rouet at philips.com
Wed Feb 2 09:28:59 EST 2005


Hi all,

I'm trying to do the following.

A vtk application A (the server) that renders a scene and has an 
interactor
an other vtk application B (the client) that renders an onther scene and 
has also an interactor 

(in fact A and B are the same program ran twice)

What I'd like to achieve is this:
Whenever the user changes the camera in application A, the camera of the 
application B is updated accordingly.
but when the user moves the camera in B, the camera is not changed in A.

I managed to do almost what I want using a socket communication.
a callback that reacts on camera modifed events in A sends through the 
socket the position of the camera, the focal point and the viewup vector.

application B listens to the socket and updates its own camera.
Unfortunately, this listening is blocking the interface of B.

Then I tried to set the socket listenner of B in a spawned thread so that 
the main interaction loop continues to occur.
But then, the renderer->Render() call in the thread fails saying that: "
vtkWin32OpenGLRenderWindow (018F0F40): wglMakeCurrent failed in 
MakeCurrent(), error: resource in use" (translation from french La 
ressource demandée est en cours d'utilisation).

What is the solution then ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050202/759e3921/attachment.htm>


More information about the vtkusers mailing list