[vtkusers] VTK Python + GLSL shaders type casting and methods overloading

Charl P. Botha cpbotha at cpbotha.net
Sun Aug 26 04:43:04 EDT 2007


Dear all,

On 8/24/07, Charl P. Botha <cpbotha at cpbotha.net> wrote:
> What's the best way to fix this?  I can think of a few solutions with
> explicit helper funcitons in vtkProperty (AddShaderVariableFloat,
> AddShaderVariableInt OR AddShaderVariable("name", VTK type spec,
> value)) that should help the wrapper generator to do the right thing.
>
> Does anyone else have other suggestions (or the time to implement a workaround)?

I've made a patch (attached) that adds some methods with the type as
part of the method name for int, float and double.  I'm now able to
use shaders + variables in Python.

It _seems_ that the Python wrapping code can distinguish between
overloaded methods on the basis of number of parameters, but not on
type of parameter.  I vaguely remember something like this, but I
couldn't find explicit mention of it anywhere.

In anycase, if nobody objects, I'd like to apply this patch in a week
or two.  I'd also very much like to hear if I'm just being daft. :)

Thanks,
Charl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkProperty_PyShaderVar.diff
Type: application/octet-stream
Size: 2015 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070826/4dd62865/attachment.obj>


More information about the vtkusers mailing list