[vtkusers] FunctionValues is missing from the Python binding of vtk-5.10??
Guillaume Jacquenot
guillaume.jacquenot at gmail.com
Wed May 28 13:21:10 EDT 2014
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140528/b54257e3/attachment.html>
More information about the vtkusers
mailing list