[vtkusers] FunctionValues is missing from the Python binding of vtk-5.10??

David Gobbi david.gobbi at gmail.com
Wed May 28 16:43:54 EDT 2014


Hi Guillaume,

The FunctionValues() method is not available in Python unless you
upgrade to VTK 6.1.

  David

On Wed, May 28, 2014 at 11:21 AM, Guillaume Jacquenot
<guillaume.jacquenot at gmail.com> wrote:
> Dear VTK users,
>
> I would like to use an instance of class
> vtkCellLocatorInterpolatedVelocityField with Python.
>
> I manage to create an instance, but I can' access the main function
> FunctionValues
>
> I guess it is possible since I succeeded doing it with C++.
>
> Any help appreciated!!
>
> I know this problem was already reported by Yifei Li on VTK mailing list
> with VTK 5.8, but I found no answer.
>
> http://www.vtk.org/pipermail/vtkusers/2011-November/070977.html
>
> I am working on Windows with Python 2.7 and the package VTK compiled by
> Christoph Gohlke
> http://www.lfd.uci.edu/~gohlke/pythonlibs/#vtk
>
> Below is the function I use to create an instance of
> vtkCellLocatorInterpolatedVelocityField from a vtkMultiBlockDataSet
>
> def createVtkCellLocatorInterpolatedVelocityField(multiBlockDataSet, field =
> 'Velocity'):
>     cl = vtk.vtkCellLocator()
>     clivf = vtk.vtkCellLocatorInterpolatedVelocityField()
>     clivf.SetCellLocatorPrototype(cl)
>     if VTKMajorVersion <= 5:
>         clivf.SelectVectors(field)
>     else:
>         # clivf.SelectVectors(vtkDataObject::FIELD_ASSOCIATION_POINTS,
> vMBDS_getFieldArrayName(multiBlockDataSet));
>         pass
>     iter = multiBlockDataSet.NewIterator()
>     iter.InitTraversal()
>     while iter.IsDoneWithTraversal() == 0:
>         dataObj = iter.GetCurrentDataObject()
>         if dataObj.GetNumberOfCells() > 0:
>             cdTPD = vtk.vtkCellDataToPointData()
>             cdTPD.RemoveAllInputs()
>             if VTKMajorVersion <= 5:
>                 cdTPD.SetInput(dataObj)
>             else:
>                 cdTPD.SetInputData(dataObj)
>             cdTPD.Update()
>             clivf.AddDataSet(cdTPD.GetOutput())
>         iter.GoToNextItem()
>     del iter
>     return clivf


More information about the vtkusers mailing list