Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
display.tcl
00001 # $Id$ #
00002 
00003 #
00004 #/** macro to draw on 2D display. \file display.tcl  \ingroup slam */
00005 #
00006 
00007 namespace eval slam {
00008 
00009     proc displayOmniZones {img omniImageManager} {
00010   # display selection zone of omniImageManager on img
00011 
00012   set camera [$omniImageManager cget -camera]
00013 
00014   # draw circles
00015   set radiusStep [expr ([$camera cget -imageRadius] - [$camera cget -maskRadius] - 2*[$omniImageManager cget -imageMargin]) / [$omniImageManager cget -nbZonesInRadius]]
00016   set radius [expr [$camera cget -maskRadius] + [$omniImageManager cget -imageMargin]]
00017   for {set i 0} {$i <= [$omniImageManager cget -nbZonesInRadius]} {incr i} {
00018       display::drawCircle $img  [$camera cget -mirrorCenterU]  [$camera cget -mirrorCenterV] $radius 2 "blue" "zone"
00019       set radius [expr $radius + $radiusStep]
00020   }
00021 
00022   # draw radius
00023   set 2pi [expr 2*3.14159265358979323846]
00024   set thetaStep [expr $2pi / [$omniImageManager cget -nbZonesInPeriphery]]
00025   set theta 0
00026   set radius1 [expr [$camera cget -maskRadius] + [$omniImageManager cget -imageMargin]]
00027   set radius2 [expr [$camera cget -imageRadius] - [$omniImageManager cget -imageMargin]]
00028   for {set i 0} {$i <= [$omniImageManager cget -nbZonesInPeriphery]} {incr i} {
00029       set u1 [expr [$camera cget -mirrorCenterU] + cos($theta)*$radius1]
00030       set v1 [expr [$camera cget -mirrorCenterV] + sin($theta)*$radius1]
00031       set u2 [expr [$camera cget -mirrorCenterU] + cos($theta)*$radius2]
00032       set v2 [expr [$camera cget -mirrorCenterV] + sin($theta)*$radius2]
00033 
00034       display::drawLine $img $u1 $v1 $u2 $v2 2 "blue" "zone"
00035   
00036       set theta [expr $theta + $thetaStep]
00037   }
00038     }
00039 
00040 }
00041 
00042 package provide slam 2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:17 for Jafar by doxygen 1.7.6.1
LAAS-CNRS