[vtkusers] how to pass cellpicker location to vtkAngleWidget in 3D?

Ocean Spring meancity at gmail.com
Sun Mar 7 05:32:45 EST 2010


Dear all,

i have some problem in procedure below
first i want to pick 3 points on an isosurface and then i want to measure
the angle formed by these 3 points.
but it does not seem to work when i want to pass the location generated by
cellpicker to the points of angle widget.
below are some fragments of my tcl code. can someone advice me how to
archieve this ?


vtkAngleRepresentation3D rep

vtkAngleWidget widget
    widget SetInteractor rwi


vtkCellPicker picker

set AnglePointCounter 1

proc OnLeftButtonDown { } {

# if angle measurement is enabled

if {$:: angle == 1} {
 if { $::AnglePointCounter >= 4 } { set $::AnglePointCounter 1 }
 if { $::AnglePointCounter == 1 } {

  set apt1 [picker GetPickPosition]
  set apt1x [lindex $apt1 0]
  set apt1y [lindex $apt1 1]
  set apt1z [lindex $apt1 2]

  rep SetPoint1DisplayPosition $apt1x $apt1y $apt1z
 }
 if { $::AnglePointCounter == 2 } {
     set apt2 [picker GetPickPosition]
     set apt2x [lindex $apt2 0]
     set apt2y [lindex $apt2 1]
     set apt2z [lindex $apt2 2]

  rep SetCenterDisplayPosition $apt2x $apt2y $apt2z
 }
 if { $::AnglePointCounter == 3 } {
         set apt3 [picker GetPickPosition]
         set apt3x [lindex $apt3 0]
         set apt3y [lindex $apt3 1]
         set apt3z [lindex $apt3 2]

  rep SetPoint2DisplayPosition  $apt3x $apt3y $apt3z
 }

 widget SetRepresentation rep
 widget On

incr ::AnglePointCounter
}
}; # end function

thank you

regards

O.S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100307/974f1e22/attachment.htm>


More information about the vtkusers mailing list