[vtkusers] vtkChartXY + setTitle + Tcl

Jorge Perez josp.jorge at gmail.com
Fri Dec 25 18:08:06 EST 2015


Hello Mario, not all method are exported (wrapped) to Tcl. The Tcl wrapping
capability is not receiving attention (only python). The method SetTitle
that you are mentioning is one of those methods.

When I need to invoke a method which is not wrapped what I usually do is
implement (in C++) a helper procedure to invoke that method. Attached you
can find an example which expose the SetTitle method for an object of class
vtkAxis.

For instance if you have an object of class vtkAxis:

  set axisX [chart GetAxis 1]

instead of invoking:

  $axisX SetTitle "Seconds"

I should invoke:

  vtkAxisAddon $axisX SetTitle "Seconds"

(vtkAxisAddon is the proc implemented in C++)

If you find this approach useful, I can provide you a full code (based on
CMake) to create the tcl library to expose the method you are needing.

best regards,
Jorge


2015-12-25 11:00 GMT+01:00 Mario Rodriguez <biomates at telefonica.net>:

> Hello,
>
> In my efforts to use vtkChartXY from Tcl scripts I write:
>
> vtkChartXY chart
>
> Now, if I want to set a title, or change the label of an axis, things like
>
> chart SetTitle "Chart"
> [chart GetAxis 1] SetTitle "Time"
>
> always throw the following error:
>
> Object named: chart, could not find requested method: SetTitle
> or the method was called with incorrect arguments.
>
> From documentation, seems that the origin of the problem is that SetTitle
> expects as argument an object of class vtkStdString, but all my attempts to
> make use of it were successless.
>
> Any help would be greatly appreciated.
>
> I am using vtk 6.3.
>
> --
> Mario
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151226/298fcf48/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkChartAddon.cxx
Type: text/x-c
Size: 1836 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151226/298fcf48/attachment.bin>


More information about the vtkusers mailing list