[vtkusers] vtkPointPicker peter_piper

Claudia Goenner goenner at techinfo.rwth-aachen.de
Thu Jun 29 07:10:39 EDT 2000


Hi Erik,

    I recently wrote a small tcl function which displays the original world coordinates. You
have to get the picked data set and then the
point's position (or any other information associated with the point). I use a vtkPointPicker
for picking points and a vtkCellPicker for picking cells.

Claudia

My function for displaying a point's coordinates:

proc annotatePtPick {} {

    set id [ptPicker GetPointId]
    if { $id < 0 } {
 pickTxtActor VisibilityOff
    } else {
 set selPt [ptPicker GetSelectionPoint]

 #current coordinates
 #set pickPos [picker GetPickPosition]

 #input coordinates
 set data [ptPicker GetDataSet]
 set pickPos [$data GetPoint $id]

 pickTxtMapper SetInput \
 "$id: ([lindex $pickPos 0], [lindex $pickPos 1], [lindex $pickPos 2])"
 pickTxtActor SetPosition [lindex $selPt 0] [lindex $selPt 1]
 pickTxtActor VisibilityOn
    }
    renWin Render
}



Erik Sobel wrote:

> Does anyone know how to convert a display point (x,y) to a world point?
>
> I've tried...
>         ren1  SetDisplayPoint $x $y 0
>         ren1 DisplayToWorld
>         set wp [ren1 GetWorldPoint]
> This sort of worked until I moved the camera then the values were screwy.
>
> I've tried
>         vtkPointPicker pp
>         pp Pick $x $y 0 ren1
> (hmmm, ok now how do I get the world coords out of this confounded object ????)
>
> What's the difference between a vtkPointPicker and a vtkWorldPointPicker?
> vtkNitPicker? vtkNosePicker?
>
> vtkPointPicker peter_piper
> proc  Pick_Pickled_Peppers {} {
>         if  { [ peter_piper Pick $x $y 0 renP ] == $PECK } {
>                 return $NUM_PICKLED_PEPPERS
>         }
> }
>
> -Erik
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> vtkusers mailing list
> vtkusers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list