[vtkusers] Python interface of vtkCellLocator does not match C++ interface
Rodrigo Valiña Gutiérrez
rodrigo.valina at usc.es
Mon Apr 12 10:23:27 EDT 2010
Hi, Eric.
Using FindCell from vtk.vtkCellLocator in Python ( the only method I found
useful in Python interface ) prints this:
..\archive\VTK\Filtering\vtkAbstractCellLocator.cxx, line 197
vtkCellLocator (01EEEF90): vtkCellLocator Does not implement FindCell
Reverting to slow DataSet implementation
and few times returns a cell_id != -1.
I want to highlight some points or cells, and put labels with their scalar
or vector value. With pointdata I have done, but it remains celldata.
With pointdata I use a vtk.vtkPropPicker() and vtk.vtkPointLocator()'s
method .FindClosestPoint(pos).
With celldata I am trying with vtk.vtkCellLocator()'s method
.FindCell(pos)'s since .FindClosestPoint(pos) is not available in Python.
At the moment labeling clicked points with their pointdata value works, but
celldata does not.
On Fri, Apr 9, 2010 at 3:37 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
> Hello Rodrigo,
>
> Someone with more knowledge about the Python wrapping process will have to
> explain why some methods are wrapped and some aren't -- it's frustrating for
> me, too, sometimes.
>
> But, since you see FindCell, but it does not work, please explain in more
> detail what is going wrong when you try to use it so people can help with
> that.
>
> Talk to you later,
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
> On Apr 9, 2010, at 7:45 AM, Rodrigo Valiña Gutiérrez wrote:
>
> > Hi,
> >
> > I am using Python interface of VTK 5.4.2 and was using a
> > vtk.vtkPointLocator, which works well.
> >
> > But now I want to use vtk.vtkCellLocator, and there is a problem:
> > there are methods (specially FindClosestPoint) that I want to use and
> > they appear in documentation and in source of vtkCellLocator, but not
> > in Python interface. Also FindCell does not seem to work.
> >
> > vtkCellLocator:
> > http://www.vtk.org/doc/release/5.4/html/a00250.html
> >
> > The methods defined in Python are:
> >
> > a = vtk.vtkPointLocator()
> > dir(a)
> > ['AddObserver', 'AutomaticOff', 'AutomaticOn', 'BreakOnError',
> > 'BuildLocator', 'DebugOff', 'DebugOn', 'FastDelete',
> > 'FindClosestInsertedPoint', 'FindClosestNPoints', 'FindClosestPoint',
> > 'FindDistributedPoints', 'FindPointsWithinRadius',
> > 'FreeSearchStructure', 'GenerateRepresentation', 'GetAddressAsString',
> > 'GetAutomatic', 'GetBuildTime', 'GetClassName', 'GetDataSet',
> > 'GetDebug', 'GetDivisions', 'GetGlobalWarningDisplay', 'GetLevel',
> > 'GetMTime', 'GetMaxLevel', 'GetMaxLevelMaxValue',
> > 'GetMaxLevelMinValue', 'GetNumberOfPointsPerBucket',
> > 'GetNumberOfPointsPerBucketMaxValue',
> > 'GetNumberOfPointsPerBucketMinValue', 'GetPoints',
> > 'GetPointsInBucket', 'GetReferenceCount', 'GetTolerance',
> > 'GetToleranceMaxValue', 'GetToleranceMinValue',
> > 'GlobalWarningDisplayOff', 'GlobalWarningDisplayOn', 'HasObserver',
> > 'InitPointInsertion', 'Initialize', 'InsertNextPoint', 'InsertPoint',
> > 'InvokeEvent', 'IsA', 'IsInsertedPoint', 'IsTypeOf', 'Modified',
> > 'NewInstance', 'PrintRevisions', 'Register', 'RemoveAllObservers',
> > 'RemoveObserver', 'RemoveObservers', 'SafeDownCast', 'SetAutomatic',
> > 'SetDataSet', 'SetDebug', 'SetDivisions', 'SetGlobalWarningDisplay',
> > 'SetMaxLevel', 'SetNumberOfPointsPerBucket', 'SetReferenceCount',
> > 'SetTolerance', 'UnRegister', 'Update']
> >
> > b = vtk.vtkCellLocator()
> > dir(b)
> > ['AddObserver', 'AutomaticOff', 'AutomaticOn', 'BreakOnError',
> > 'BuildLocator', 'CacheCellBoundsOff', 'CacheCellBoundsOn', 'DebugOff',
> > 'DebugOn', 'FastDelete', 'FindCell', 'FindCellsAlongLine',
> > 'FreeSearchStructure', 'GenerateRepresentation', 'GetAddressAsString',
> > 'GetAutomatic', 'GetBuildTime', 'GetCacheCellBounds', 'GetCells',
> > 'GetClassName', 'GetDataSet', 'GetDebug', 'GetGlobalWarningDisplay',
> > 'GetLazyEvaluation', 'GetLevel', 'GetMTime', 'GetMaxLevel',
> > 'GetMaxLevelMaxValue', 'GetMaxLevelMinValue', 'GetNumberOfBuckets',
> > 'GetNumberOfCellsPerBucket', 'GetNumberOfCellsPerNode',
> > 'GetNumberOfCellsPerNodeMaxValue', 'GetNumberOfCellsPerNodeMinValue',
> > 'GetReferenceCount', 'GetRetainCellLists', 'GetTolerance',
> > 'GetToleranceMaxValue', 'GetToleranceMinValue',
> > 'GetUseExistingSearchStructure', 'GlobalWarningDisplayOff',
> > 'GlobalWarningDisplayOn', 'HasObserver', 'Initialize',
> > 'InsideCellBounds', 'IntersectWithLine', 'InvokeEvent', 'IsA',
> > 'IsTypeOf', 'LazyEvaluationOff', 'LazyEvaluationOn', 'Modified',
> > 'NewInstance', 'PrintRevisions', 'Register', 'RemoveAllObservers',
> > 'RemoveObserver', 'RemoveObservers', 'RetainCellListsOff',
> > 'RetainCellListsOn', 'SafeDownCast', 'SetAutomatic',
> > 'SetCacheCellBounds', 'SetDataSet', 'SetDebug',
> > 'SetGlobalWarningDisplay', 'SetLazyEvaluation', 'SetMaxLevel',
> > 'SetNumberOfCellsPerBucket', 'SetNumberOfCellsPerNode',
> > 'SetReferenceCount', 'SetRetainCellLists', 'SetTolerance',
> > 'SetUseExistingSearchStructure', 'UnRegister', 'Update',
> > 'UseExistingSearchStructureOff', 'UseExistingSearchStructureOn']
> >
> > is it a bug ?
> >
> > am I missing something ?
> > _______________________________________________
> > 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
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100412/38ddde10/attachment.htm>
More information about the vtkusers
mailing list