[vtkusers] pick and update

Boris Avdeev borisaqua at gmail.com
Mon Jan 30 12:36:55 EST 2006


Hello,
I am trying to make my pipeline to update as I pick and had no luck so far.
Here is the pipeline:
<pre>
      Modify on a pick event
       |
       V
Reader -> Filter -> Mapper
</pre>
I modify the reader's output. Is it not a good idea? Where have I messed up?
Here is some python code:

    picksR = vtkPolyDataReader()
    picksR.SetFileName(fname)
    proxy = vtkSurfaceReconstructionFilter()
    proxy.SetInput(picksR.GetOutput())
    surf = vtkContourFilter()
    surf.SetValue(0,0.0)
    surf.SetInput(proxy.GetOutput())

    surfMap = vtkPolyDataMapper()
    surfMap.SetInput(surf.GetOutput())
    surfAct = vtkActor()
    surfAct.SetMapper(surfMap)
    ren.AddActor(surfAct)

    def PickingFunction(obj, event):
        global picksR, renWin
        pt = obj.GetPicker().GetPickPosition()
        picksR.GetOutput().GetPoints().InsertNextPoint(pt)
        renWin.Render()

    iact.AddObserver("EndPickEvent", PickingFunction)


Thanks,
Boris



More information about the vtkusers mailing list