[vtk-developers] is vtkSelectionSource::SetInverse broken?
William McLendon
wcmclen at sandia.gov
Thu Feb 3 11:13:11 EST 2011
Anyone else seeing this? I'm trying to filter out edges in a table that
are really close or equal to zero using code like this:
> # filter out rows that have 0 area.
> areaRowSelection = vtkSelectionSource()
> areaRowSelection.SetContentType(vtkSelectionNode.THRESHOLDS)
> areaRowSelection.SetFieldType(vtkSelectionNode.ROW)
> areaRowSelection.SetInverse(1) # selection should exclude these rows
> areaRowSelection.SetArrayName('area')
> areaRowSelection.AddThreshold(-1E-15, 1E-15) # non-matches=0,
> matches=1
>
> filteredTable = vtkExtractSelectedRows()
> filteredTable.SetInputConnection(0, vert_source_csv.GetOutputPort() )
> filteredTable.SetInputConnection(1, areaRowSelection.GetOutputPort() )
> filteredTable.Update()
If I understand the selectionsource filter properly, then adding
SetInverse(1) should have the threshold filter select rows that are not
in the threshold range, right? But this is the result I'm getting:
> +-------------+-------------+-------------+-------------+
> | area | boundary are| centroid x | centroid y |
> +-------------+-------------+-------------+-------------+
> | 0 | 0 | -72.8572 | 41.2743 |
> | 0 | 0 | -73.8846 | 33.2743 |
> | 0 | 0 | -71.8381 | 36.2743 |
> | 0 | 0 | -72.8288 | 31.2743 |
Am I missing something? I'm going from the doxygen api at:
http://www.vtk.org/doc/nightly/html/classvtkSelectionSource.html#accd91cdb84f1c13c020a736d521f2686
Thanks!
-William
More information about the vtk-developers
mailing list