Access to waves XOP

Hi,
I'm currently working on my own 3D plotting program in C++ with OpenGL. I would like to use XOP to generate a surface plot with waves that are updated periodically (AFM scan). I would like my plotting app to work in background. Do you have a simple implementation to achieve this goal?
Thank you very much.
It's not entirely clear to me what you would like to do. I'm guessing that this is the workflow you have in mind:

- Igor controls an AFM which periodically saves its output in one or more waves
- You would like to generate your own visualisation of the data, so whenever a scan is completed you want your OpenGL program to run with the generated wave(s) as input.
- This program would then generate the image and either save it to file, show it in its own window, or have Igor display it.

Is this more or less right?

Questions:
1) Is your program completely separate (i.e. it runs as its own process) or will you turn the program into an XOP?
2) Should Igor display the results?

Here is what I'm thinking:
- turn your program in an XOP that Igor can call directly. Add an operation (MakeMyFancyAFMImage or whatever) that takes the wave(s) created by the AFM and a bunch of flags/settings that control the output.
- Your operation creates an MxNx3 image wave which Igor displays in an image plot.
- If the calculation is fast, run the calculation synchronously (from the main Igor thread). If it is slow, call the calculation from a background thread. The background thread is created when the experiment starts. New AFM images are passed to the thread using ThreadGroupPutDF, the resulting images are fetched by the main thread using ThreadGroupGetDFR. Note that the asynchronous model is much more difficult but not impossible by any means.

If your program is separate then your Igor code or your XOP will need to invoke it from a script, using e.g. ExecuteScriptText from Igor or a system() or popen() call from your XOP.
You are right. I want to display the waves that my AFM generates with my own program.

1-2) My program currently runs separately. I have the feeling I'll need to implement it in Igor(XOP) to have a smooth integration.

The plotting part is not a big issue. It already works fine with GLUT (OpenGL). I am having trouble to get the waves from Igor to my XOP. Moreover my program needs to update the image pretty fast (approx. 100ms).

I could send waves from IGOR by using 'ThreadGroupPutDF' and then getting them from the XOP. Do you think it could work?