[vtk-developers] is vtkSelectionSource::SetInverse broken?

David E DeMarle dave.demarle at kitware.com
Thu Feb 3 11:20:55 EST 2011


I am guessing that vtkExtractSelectedRows() has a bug and does not
respect the inverse flag.

David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109



On Thu, Feb 3, 2011 at 11:13 AM, William McLendon <wcmclen at sandia.gov> wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list