[vtkusers] AngleWidget.tcl GetPoint1DisplayPosition problem.

Ocean Spring meancity at gmail.com
Tue Mar 9 06:51:39 EST 2010


Dear All,

i have modified the AngleWidget.tcl in the VTK examples by adding following
lines:


vtkAngleRepresentation2D rep  ;#defined in original example, not modified
.....
.....


vtkAngleWidget widget ;#defined in original example, not modified
.....
.....
widget AddObserver PlacePointEvent OnLeftButtonDown


set counter 1

proc OnLeftButtonDown { } {
if { $::counter == 1 } {
set apt1 [rep GetPoint1DisplayPosition]
puts " 1st point coordinates: [lindex $apt1 0] [lindex $apt1 1] [lindex
$apt1 2] "

}
if { $::counter == 2 } {
set apt2 [rep GetCenterDisplayPosition]
puts " 2nd point coordinates: [lindex $apt2 0] [lindex $apt2 1] [lindex
$apt2 2] "
}
if { $::counter == 3 } {
set apt3 [rep GetPoint2DisplayPosition]
puts " 3rd point coordinates: [lindex $apt3 0] [lindex $apt3 1] [lindex
$apt3 2]"
}
incr ::counter
}



basically it will get the initial positions of the 3 points of the angle
and print them in the tcl console windows.

however it return errors as
Generic Warning: In ..\..\vtk.source\Common\vtkTclUtil.cxx, line 726
Error returned from vtk/tcl callback:
OnLeftButtonDown
Object named: rep, could not find requested method: GetPoint1DisplayPosition
or the method was called with incorrect arguments.
    while executing
"rep GetPoint1DisplayPosition"
    (procedure "OnLeftButtonDown" line 5)
    invoked from within
"OnLeftButtonDown" at line number 1



if anyone has ideas of what is going wrong, please kindly give suggestions
on this error.

thank you

regards

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


More information about the vtkusers mailing list