Combining Tcl/Tk with C++

Kenneth Wang kenwang at leland.Stanford.EDU
Tue Nov 2 14:15:08 EST 1999


Hi Jordi,

I asked a similar question a little while back, and with James
Miller's help, I found that it's quite simple to take vtk objects from
Tcl and import them into your C/C++ code.  Take a look at
common/vtkTclUtil.cxx.  In particular, look at
vtkTclGetPointerFromObject.  Using this function, and given an
object's Tcl name and vtk type, you can just look up the pointer to
that object.

Going the other way, i.e. exporting a vtk object from your C/C++ code
back to the vtk table of Tcl objects, is something which appears a
bit more complicated, and I haven't figured this out yet.  Does anyone
out there have any tips for doing this?

-Ken



> Date: Tue, 02 Nov 1999 18:26:33 +0100
> From: Jordi Cabot <cabot at tele.ucl.ac.be>
> To: vtkusers at gsao.med.ge.com
> Subject: Combining Tcl/Tk with C++
> 
> 
> Hello, due to the fact that some classes do not provide all the methods
> when wrapped to Tcl/Tk (as for example occurs with the IntersectWithLine
> method of vtkCellLocator) I would like to execute a C++ vtk code from my
> Tcl/tk vtk interface. Sorry if it is an obvious question but ..
> 
> how can I use a vtk object created in the Tcl/Tk interface with the C++
> code?
> 
> If I have a polydata object created with Tcl/Tk, how can I manipulate
> its data with the C++ code?
> 
> Thanks in advance,
> 
> Jordi



------------------------------------------------------------------------
Kenneth C. Wang			E-mail: kenwang at stanford.edu
Electrical Engineering Dept.	Voice:  (650) 725-0458
Stanford University		Fax:    (650) 725-7731
CIS 214, Stanford, CA 94305	Web:    http://www.stanford.edu/~kenwang
------------------------------------------------------------------------


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list