[vtkusers] Trying to use vtkChartXY with Tcl
David Gobbi
david.gobbi at gmail.com
Tue Dec 15 18:52:12 EST 2015
Hi Mario,
The fact that you are using Tcl actually validates our continuing
support for Tcl, so in a way it is a good thing.
The best way to get a fully-functional VTK window with Tcl is to
use Tk. Take a look at these two examples:
Examples/GUI/Tcl/vtkTkRenderWidgetDemo.tcl
Examples/GUI/Tcl/MaceTk.tcl
The MaceTk example provides a window close operation, using
this call to the window manager:
wm protocol . WM_DELETE_WINDOW <callback function>
For more information, see the tk documentation, e.g.:
https://www.tcl.tk/man/tcl8.4/TkCmd/wm.htm
- David
On Tue, Dec 15, 2015 at 4:24 PM, Mario Rodriguez <biomates at telefonica.net>
wrote:
>
>
> El 15/12/15 a las 21:51, David Gobbi escribió:
>
> Hi Mario,
>
>
> Thanks for your kind and quick response.
>
> Tcl syntax a mixture of lisp and shell script. The code will look like
> this:
>
> set line [chart AddPlot 0]
> $line SetInputData table 0 2
>
>
> Now I see where I was wrong. I forgot the dollar symbol.
>
> After writing:
>
> [view GetRenderWindow] SetMultiSamples 0
> [view GetRenderWindow] Render
>
> where view was created by
>
> vtkContextView view
>
> I successfully get the expected plot.
>
> The problem now is how to close the window with a mouse click. Any hints?
>
>
> Are you really sure that you want to use Tcl?
>
>
> Yes, it is mandatory. We have the system Lisp -> Tcl -> Vtk for drawing 3D
> scenes from Computer Algebra System Maxima:
>
> http://riotorto.users.sourceforge.net/vtk/
>
> Tcl is a dependency to be satisfied by Maxima, which is also used for
> other purposes.
>
> I am trying to know how far we can go with Vtk for plotting 2D scenes, in
> order to extend the Maxima-Vtk interface.
>
>
> Many of the VTK classes
> and methods that you can use with Python cannot be used from Tcl, so
> it might not even be possible to convert that example into working Tcl
> code. You're welcome to try, though.
>
> - David
>
>
> Thanks again for your help.
>
> --
> Mario
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151215/15a0c2e9/attachment.html>
More information about the vtkusers
mailing list