[vtkusers] python vtkSelection problem

Olivier Feys pytkvtk at gmail.com
Wed Feb 3 03:54:29 EST 2010


Here is the print of the vtkSelection.
I have only one actor in the scene
Is it the vtkHardware Selector that attributes a different propid each time
a cell has been identified?
So all these PROP_ID's should refer to the same prop ?
Either there is a problem in the PROP_ID generation, or I miss something ?

Selection vtkSelection (0x7cb4270)
  Debug: Off
  Modified Time: 142381
  Reference Count: 2
  Registered Events: (none)
  Source: (none)
  Information: 0x7bb3310
  Data Released: False
  Global Release Data: Off
  UpdateTime: 0
  Field Data:
    Debug: Off
    Modified Time: 141896
    Reference Count: 1
    Registered Events: (none)
    Number Of Arrays: 0
    Number Of Components: 0
    Number Of Tuples: 0
  Number of nodes: 32
  Nodes:
  Node #0
    Debug: Off
    Modified Time: 141915
    Reference Count: 1
    Registered Events: (none)
    ContentType: INDICES
    FieldType: CELL
    Properties:
      Debug: Off
      Modified Time: 141909
      Reference Count: 1
      Registered Events: (none)
      FIELD_TYPE: 0
      PROP_ID: 2883583
      CONTENT_TYPE: 4
      PIXEL_COUNT: 865
    SelectionData:
      Debug: Off
      Modified Time: 141915
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 1
      Array 0 name = SelectedIds
      Number Of Components: 1
      Number Of Tuples: 1
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
  Node #1
    Debug: Off
    Modified Time: 141930
    Reference Count: 1
    Registered Events: (none)
    ContentType: INDICES
    FieldType: CELL
    Properties:
      Debug: Off
      Modified Time: 141924
      Reference Count: 1
      Registered Events: (none)
      FIELD_TYPE: 0
      PROP_ID: 2949119
      CONTENT_TYPE: 4
      PIXEL_COUNT: 1543
    SelectionData:
      Debug: Off
      Modified Time: 141930
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 1
      Array 0 name = SelectedIds
      Number Of Components: 1
      Number Of Tuples: 1
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
  Node #2
    Debug: Off
    Modified Time: 141945
    Reference Count: 1
    Registered Events: (none)
    ContentType: INDICES
    FieldType: CELL
    Properties:
      Debug: Off
      Modified Time: 141939
      Reference Count: 1
      Registered Events: (none)
      FIELD_TYPE: 0
      PROP_ID: 3014655
      CONTENT_TYPE: 4
      PIXEL_COUNT: 1290
    SelectionData:
      Debug: Off
      Modified Time: 141945
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 1
      Array 0 name = SelectedIds
      Number Of Components: 1
      Number Of Tuples: 1
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
  Node #3
    Debug: Off
    Modified Time: 141960
    Reference Count: 1
    Registered Events: (none)
    ContentType: INDICES
    FieldType: CELL
    Properties:
      Debug: Off
      Modified Time: 141954
      Reference Count: 1
      Registered Events: (none)
      FIELD_TYPE: 0
      PROP_ID: 3080191
      CONTENT_TYPE: 4
      PIXEL_COUNT: 1548
    SelectionData:
      Debug: Off
      Modified Time: 141960
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 1
      Array 0 name = SelectedIds
      Number Of Components: 1
      Number Of Tuples: 1
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
  Node #4
    Debug: Off
    Modified Time: 141975
    Reference Count: 1
    Registered Events: (none)
    ContentType: INDICES
    FieldType: CELL
    Properties:
      Debug: Off
      Modified Time: 141969
      Reference Count: 1
      Registered Events: (none)
      FIELD_TYPE: 0
      PROP_ID: 3145727
      CONTENT_TYPE: 4
      PIXEL_COUNT: 1290
    SelectionData:
      Debug: Off
      Modified Time: 141975
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 1
      Array 0 name = SelectedIds
      Number Of Components: 1
      Number Of Tuples: 1
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)


On Tue, Feb 2, 2010 at 3:03 PM, Jeff Baumes <jeff.baumes at kitware.com> wrote:

> If you print each selection, the combination of PROP_ID and PROCESS_ID
> should be different for each selection. Is this true? If so, what
> changes, the PROP_ID or PROCESS_ID?
>
> Jeff
>
> On Tue, Feb 2, 2010 at 8:57 AM, Olivier Feys <pytkvtk at gmail.com> wrote:
> > Many thanks Jeff,
> >
> > For the moment I use the same revision as in the latest release version
> of
> > paraview, I will updata my revision then
> > Can you explain why, when there is only a single actor(from
> > vtkUnstructuredGrid), the returned vtkSelection contains a lot of
> > vtkSelectionNode objects, with only a single tuple in their selection
> data ?
> >
> > Olivier
> >
> > On Tue, Feb 2, 2010 at 2:43 PM, Jeff Baumes <jeff.baumes at kitware.com>
> wrote:
> >>
> >> This needs a wrapper-friendly API. In C++ you would do
> >>
> >> vtkProp* p =
> >>
> vtkProp::SafeDownCast(node->GetProperties()->Get(vtkSelectionNode::PROP()));
> >>
> >> It would be nice to be able to do the following
> >>
> >> vtkProp* p = node->GetProp();
> >>
> >> which would be accessible from wrapped languages.
> >>
> >> ...
> >>
> >> I've added GetProp, SetProp to vtkSelectionNode in CVS head.
> >>
> >> Patch title (first comment line): ENH: Adding Get/SetProp to
> >> vtkSelectionNode.
> >> Autocommit
> >>  cvs commit -F .msg 'Filtering/vtkSelectionNode.cxx'
> >> 'Filtering/vtkSelectionNode.h'
> >> Committer: Jeffrey Baumes <jeff.baumes at kitware.com>
> >> /cvsroot/VTK/VTK/Filtering/vtkSelectionNode.cxx,v  <--
> >> Filtering/vtkSelectionNode.cxx
> >> new revision: 1.5; previous revision: 1.4
> >> /cvsroot/VTK/VTK/Filtering/vtkSelectionNode.h,v  <--
> >> Filtering/vtkSelectionNode.h
> >> new revision: 1.6; previous revision: 1.5
> >> Committed successfully to CVS
> >>
> >> Jeff
> >>
> >> On Tue, Feb 2, 2010 at 4:09 AM, Olivier Feys <pytkvtk at gmail.com> wrote:
> >> > I want to handle selection through multiple vtkUnstructuredGrids by
> >> > picking
> >> > a particular cell or by making a selection with a rubberband
> interactor.
> >> > I can easily create a vtkSelectionNode from a picked cell and add a
> >> > vtkSelectionNode to a vtkSelection.
> >> >
> >> > The problem is when I get a vtkSelection made on several actors.props.
> I
> >> > can't find any example where the prop/actor is got from the
> >> > vtkSelectionNode
> >> > object.
> >> > How can I, from a selection returned by the vtkHardwareSelector, get,
> >> > for
> >> > each vtkSelectionNode, the actor that it belongs to ?
> >> > When I print the vtkSelectionNode, I can see the property PROP_ID but
> I
> >> > can't use it.
> >> > By the way, if I have only one actor, the returned vtkSelection
> contains
> >> > always more than one vtkSelectionNode. Why is that ?
> >> >
> >> > _______________________________________________
> >> > 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
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Jeff Baumes, Ph.D.
> >> R&D Engineer, Kitware Inc.
> >> (518) 881-4932
> >> jeff.baumes at kitware.com
> >
> >
>
>
>
> --
> Jeff Baumes, Ph.D.
> R&D Engineer, Kitware Inc.
> (518) 881-4932
> jeff.baumes at kitware.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100203/d22e8b02/attachment.htm>


More information about the vtkusers mailing list