[vtkusers] Mix Tcl and C++

Johanna pettersson.johanna at home.se
Fri Jul 25 02:26:10 EDT 2003


Thank you for your help.

What I have is a number of tcl scripts that read and process image data (The Visible Human dataset), and create a number of actors. 

Now I would like to display these images in a VR environment consisting of three displays. For this purpose I will use Performer, and I have found a class called vtkActorToPF who can translate the vtkActor into a node in Performer and then use Performer to render the scene. 

The Performer file will be written in C++ and this is the file in which I would like to use vtkActorToPF, i.e. make the translation from vtk to pf. Therefore I have to access the actors created in the tcl script from a c++ file, to be able to use vtkActorToPF.

Johanna

> Does anyone have an idea of how to access a tcl script from a 
> c++ file? Is it a complicated procedure? 
> 
> I am creating a lot of actors in a tcl script but I would 
> like to use them in a file written in c++.

>Generally, you can access a tcl script from C by using >the Tcl_EvalFile function, but it sounds like you want >to access things that you have stored in Tcl.  If >that's the case, the easiest way to do that, if its >possible for your application, is to have the Tcl >script be the main driver, and have it call C >functions and pass down your actor objects.  If you >give more information about what you're doing >specifically, I could be more exact.
>
>Hope that's some help.
>Kevin.

F, i.e. make the translation from vtk to pf. Therefore I have to access the actors created in the tcl script from a c++ file, to be able to use vtkActorToPF.

Johanna

> Does anyone have an idea of how to access a tcl script from a 
> c++ file? Is it a complicated procedure? 
> 
> I am creating a lot of actors in a tcl script but I would 
> like to use them in a file writt




More information about the vtkusers mailing list