- Timestamp:
- Feb 8, 2013 2:20:22 PM (11 years ago)
- Location:
- branches/Rappture 1.2/gui/scripts
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Rappture 1.2/gui/scripts/Makefile.in
r3246 r3288 133 133 $(srcdir)/visviewer.tcl \ 134 134 $(srcdir)/vtkviewer.tcl \ 135 $(srcdir)/vtk contourviewer.tcl \135 $(srcdir)/vtkisosurfaceviewer.tcl \ 136 136 $(srcdir)/vtkstreamlinesviewer.tcl \ 137 137 $(srcdir)/vtkvolumeviewer.tcl \ -
branches/Rappture 1.2/gui/scripts/cloud.tcl
r3201 r3288 43 43 private variable _numPoints 0 44 44 private variable _vtkdata "" 45 private variable _vtkpoints "" 45 46 private variable _points "" 47 private variable _dim 0 46 48 } 47 49 … … 112 114 } 113 115 116 set data [$xmlobj get $path.points] 117 Rappture::ReadPoints $data _dim values 118 114 119 foreach lim {xmin xmax ymin ymax zmin zmax} { 115 120 set _limits($lim) "" … … 146 151 incr _numPoints 147 152 } 153 if { $_dim == 3 } { 154 set _vtkpoints [vtkPoints $this-vtkpoints] 155 foreach { x y z } $_points { 156 $_vtkpoints InsertNextPoint $x $y $z 157 } 158 } 159 parray _limits 148 160 append out "DATASET POLYDATA\n" 149 161 append out "POINTS $_numPoints float\n" … … 176 188 # ---------------------------------------------------------------------- 177 189 itcl::body Rappture::Cloud::mesh {} { 190 if { $_dim == 3 } { 191 return $_vtkpoints 192 } 178 193 return $_points 179 194 } … … 194 209 # ---------------------------------------------------------------------- 195 210 itcl::body Rappture::Cloud::dimensions {} { 211 return $_dim 196 212 # count the dimensions with real limits 197 213 set dims 0 -
branches/Rappture 1.2/gui/scripts/contourresult.tcl
r3177 r3288 590 590 return 591 591 } 592 puts stderr "ContourResult: dataobj=$dataobj mesh=$mesh " 592 593 switch -- [$mesh GetClassName] { 593 594 vtkPoints { -
branches/Rappture 1.2/gui/scripts/field.tcl
r3272 r3288 58 58 private variable _comp2vtk ;# maps component name => vtkFloatArray 59 59 private variable _comp2vtkstreamlines ;# maps component name => vtkFloatArray 60 private variable _comp2isosurface ;# maps component name => vtkFloatArray 60 61 private variable _comp2vtkcontour ;# maps component name => vtkFloatArray 61 62 private variable _comp2vtkvolume ;# maps component name => vtkFloatArray … … 151 152 itcl::delete object $_comp2flowhints($name) 152 153 } 154 foreach name [array names _comp2isosurface] { 155 set mesh [lindex $_comp2isosurface($name) 0] 156 set class [$mesh info class] 157 ${class}::release $mesh 158 set vtkarray [lindex $_comp2isosurface($name) 1] 159 rename $vtkarray "" 160 } 153 161 foreach name [array names _comp2heightmap] { 154 162 set mesh [lindex $_comp2heightmap($name) 0] … … 216 224 } 217 225 if {[info exists _comp2xy($cname)]} { 226 puts stderr "comp2xy" 218 227 return [lindex $_comp2xy($cname) 0] ;# return xv 219 228 } 220 229 if { [info exists _comp2vtkstreamlines($cname)] } { 230 puts stderr "comp2vtkstreamlines" 221 231 error "mesh: not implemented for streamlines" 222 232 return [$mobj mesh] 223 233 } 224 234 if { [info exists _comp2vtkcontour($cname)] } { 235 puts stderr "comp2vtkcontour" 225 236 error "method \"mesh\" is not implemented for vtkcontour" 226 237 } 227 238 if { [info exists _comp2vtk($cname)] } { 228 239 set mobj [lindex $_comp2vtk($cname) 0] 240 puts stderr "comp2vtk mobj=$mobj mesh=[$mobj mesh]" 229 241 return [$mobj mesh] 230 242 } 231 243 if {[info exists _comp2dx($cname)]} { 244 puts stderr "comp2dx" 232 245 return "" ;# no mesh -- it's embedded in the value data 233 246 } 234 247 if {[info exists _comp2heightmap($cname)]} { 248 puts stderr "comp2heightmap" 235 249 return "" ;# no mesh -- it's embedded in the value data 236 250 } 251 if {[info exists _comp2isosurface($cname)]} { 252 puts stderr "comp2isosurface" 253 return "" ;# no mesh -- it's embedded in the value data 254 } 237 255 if {[info exists _comp2vtkvolume($cname)]} { 256 puts stderr "comp2vtkvolume" 238 257 return "" ;# no mesh -- it's embedded in the value data 239 258 } 240 259 if {[info exists _comp2unirect2d($cname)]} { 260 puts stderr "comp2unirect2d" 241 261 set mobj [lindex $_comp2unirect2d($cname) 0] 242 262 return [$mobj mesh] 243 263 } 244 264 if {[info exists _comp2unirect3d($cname)]} { 265 puts stderr "comp2unirect3d" 245 266 set mobj [lindex $_comp2unirect3d($cname) 0] 246 267 return [$mobj mesh] … … 267 288 } 268 289 if { [info exists _comp2heightmap($cname)] } { 290 return $_values 291 } 292 if { [info exists _comp2isosurface($cname)] } { 269 293 return $_values 270 294 } … … 690 714 array unset _comp2volume 691 715 array unset _comp2vtkstreamlines 692 array unset _comp2vtkcontour693 716 array unset _comp2unirect2d 694 717 array unset _comp2unirect3d … … 736 759 set type "dx" 737 760 } 738 761 } 739 762 set _comp2style($cname) "" 740 763 … … 746 769 } 747 770 set _comp2extents($cname) $extents 771 puts stderr "type=$type" 748 772 set _type $type 749 773 if {$type == "1D"} { … … 1055 1079 default { 1056 1080 set mesh [$dataobj mesh $cname] 1081 puts stderr "dataobj=$dataobj, mesh=$mesh" 1057 1082 switch -- [$mesh GetClassName] { 1058 1083 vtkPoints { … … 1194 1219 return $_comp2vtkcontour($cname) 1195 1220 } 1196 if { [info exists _comp2vtk($cname)] && $_dim == 2} {1221 if { [info exists _comp2vtk($cname)] } { 1197 1222 return $_comp2vtk($cname) 1198 1223 } … … 1205 1230 } 1206 1231 foreach {mesh vector} $_comp2heightmap($cname) break 1232 append out "# vtk DataFile Version 3.0\n" 1233 append out "[hints label]\n" 1234 append out "ASCII\n" 1235 append out [$mesh vtkdata] 1236 append out "SCALARS $label float\n" 1237 append out "LOOKUP_TABLE default\n" 1238 append out "[$vector range 0 end]\n" 1239 return $out 1240 } 1241 if { [info exists _comp2isosurface($cname)] } { 1242 set label [hints zlabel] 1243 if { $label == "" } { 1244 set label $cname 1245 } else { 1246 regsub -all { } $label {_} label 1247 } 1248 foreach {mesh vector} $_comp2isosurface($cname) break 1207 1249 append out "# vtk DataFile Version 3.0\n" 1208 1250 append out "[hints label]\n" … … 1239 1281 set extents 1 1240 1282 } 1283 set _dim 3 1241 1284 set _comp2dims($cname) "3D" 1242 1285 set _comp2unirect3d($cname) \ … … 1256 1299 set extents 1 1257 1300 } 1301 set _dim 2 1258 1302 set _comp2dims($cname) "2D" 1259 1303 set _comp2unirect2d($cname) \ … … 1278 1322 } 1279 1323 } 1280 if {[$mesh dimensions] == 1} { 1324 set _dim [$mesh dimensions] 1325 puts stderr "mesh=$mesh dim=[$mesh dimensions]" 1326 if {$_dim == 1} { 1281 1327 # Is this used anywhere? 1282 1328 # … … 1287 1333 set yv [blt::vector create y$_counter] 1288 1334 1289 set points [$mesh points] 1290 set max [$points GetNumberOfPoints] 1291 for {set i 0} {$i < $max} {incr i} { 1292 $xv append [lindex [$points GetPoint $i] 0] 1293 } 1294 set class [$mesh info class] 1295 ${class}::release $mesh 1296 1297 set values [$_field get $cname.values] 1298 foreach y $values { 1299 if {"" != $_units} { 1300 set y [Rappture::Units::convert $y \ 1301 -context $_units -to $_units -units off] 1302 } 1303 $yv append $y 1304 } 1335 $yv set [$mesh points] 1336 $xv seq 0 1 [$yv length] 1305 1337 # sort x-coords in increasing order 1306 1338 $xv sort $yv … … 1310 1342 incr _counter 1311 1343 return 1312 } 1313 1314 if {[$mesh dimensions] == 3} { 1344 } elseif {$_dim == 3} { 1315 1345 # 1316 1346 # 3D data: Store cloud/field as components … … 1325 1355 $farray InsertNextValue $v 1326 1356 } 1357 set _viewer "vtkisosurface" 1358 set _type "vtkisosurface" 1359 set vector [blt::vector create \#auto] 1360 $vector set [$_field get $cname.values] 1327 1361 set _comp2dims($cname) "[$mesh dimensions]D" 1328 set _comp2 vtk($cname) [list $mobj $farray]1362 set _comp2isosurface($cname) [list $mesh $vector] 1329 1363 set _comp2style($cname) [$_field get $cname.style] 1330 1364 incr _counter 1365 set label [hints zlabel] 1366 if { $label != "" } { 1367 set _fieldNames $label 1368 regsub -all { } $_fieldNames {_} _fieldNames 1369 set _fieldLabels $label 1370 } 1371 set units [hints zunits] 1372 if { $units != "" } { 1373 set _fieldUnits $units 1374 } 1331 1375 return 1332 } 1333 if {[$mesh dimensions] == 2} { 1334 1335 # 2D data: Convert field data to vtkFloatArray 1336 1376 } elseif {$_dim == 2} { 1377 set _type "vtkheightmap" 1337 1378 set vector [blt::vector create \#auto] 1338 1379 $vector set [$_field get $cname.values] -
branches/Rappture 1.2/gui/scripts/field3dresult.tcl
r3177 r3288 59 59 set servers [Rappture::VisViewer::GetServerList "nanovis"] 60 60 } 61 "vtk contour" - "vtkheightmap" - "vtkstreamlines" - "vtkviewer" - "vtkvolume" {61 "vtkisosurface" - "vtkheightmap" - "vtkstreamlines" - "vtkviewer" - "vtkvolume" { 62 62 set servers [Rappture::VisViewer::GetServerList "vtkvis"] 63 63 } … … 82 82 } 83 83 } 84 "vtkcontour" {84 "vtkcontour" - "vtkheightmap" { 85 85 itk_component add renderer { 86 Rappture::Vtk ContourViewer $itk_interior.ren $servers86 Rappture::VtkHeightmapViewer $itk_interior.ren $servers 87 87 } 88 88 } 89 "vtk heightmap" {89 "vtkisosurface" { 90 90 itk_component add renderer { 91 Rappture::Vtk HeightmapViewer $itk_interior.ren $servers91 Rappture::VtkIsosurfaceViewer $itk_interior.ren $servers 92 92 } 93 93 } … … 125 125 pack $itk_component(renderer) -expand yes -fill both 126 126 } 127 128 127 eval itk_initialize $args 129 128 } -
branches/Rappture 1.2/gui/scripts/mesh.tcl
r3271 r3288 65 65 private common _xp2obj ; # used for fetch/release ref counting 66 66 private common _obj2ref ; # used for fetch/release ref counting 67 67 private variable _isValid 0 68 68 private variable _vtkoutput "" 69 69 private variable _vtkreader "" … … 77 77 private variable _yValues ""; # For the blt contour only 78 78 79 private method GetDimension {} 80 private method GetDouble { path } 81 private method GetInt { path } 82 private method ReadBltCloudMesh { path } 83 private method ReadBltGridMesh { path } 84 private method ReadBltMesh { path } 85 private method ReadBltTriangleMesh { path } 86 private method ReadCells { xmlobj path } 79 87 private method ReadCloud { xmlobj path } 80 88 private method ReadGrid { xmlobj path } 81 89 private method ReadTriangles { xmlobj path } 82 90 private method ReadVtk { xmlobj path } 83 private method GetBltCloudMesh { path }84 private method GetBltGridMesh { path }85 private method GetBltTriangleMesh { path }86 private method GetBltMesh { path }87 private method GetDouble { path }88 private method GetInt { path }89 private method GetDimension {}90 91 private method _buildNodesElements {xmlobj path} 91 92 } … … 171 172 # <element> + <node> definitions 172 173 # <cloud> x,y coordinates or x,y,z coordinates 173 # <unirect> uniform rectangular grid (2D) or cubes (3D) 174 # <rectangle> non-uniform rectangular mesh 174 # <grid> rectangular mesh 175 # <triangles> triangular mesh 176 # <cells> homogeneous cell type mesh. 177 178 # Check that only one mesh type was defined. 179 set subcount 0 180 foreach cname [$_mesh children] { 181 foreach type { vtk cloud grid triangles cells } { 182 if { [$_mesh element $type] != "" } { 183 incr subcount 184 break 185 } 186 } 187 } 188 set elemcount 0 189 foreach cname [$_mesh children] { 190 foreach type { node element } { 191 if { [$_mesh element $type] != "" } { 192 incr elemcount 193 break 194 } 195 } 196 } 197 if { $elemcount > 0 } { 198 incr $subcount 199 } 200 if { $subcount > 1 } { 201 puts stderr "too many mesh types specified: picking first found." 202 } 175 203 if { [$_mesh element vtk] != ""} { 176 204 ReadVtk $xmlobj $path … … 181 209 } elseif {[$_mesh element triangles] != "" } { 182 210 ReadTriangles $xmlobj $path 211 } elseif {[$_mesh element cells] != "" } { 212 ReadCells $xmlobj $path 183 213 } elseif {[$_mesh element node] != "" && [$_mesh element element] != ""} { 184 214 ReadNodesElements $xmlobj $path 185 } else {186 error "can't find mesh data in $path"187 215 } 188 216 } … … 296 324 "blt" { 297 325 if { $_bltmesh == "" } { 298 GetBltMesh326 ReadBltMesh 299 327 return $_bltmesh 300 328 } … … 558 586 set _vtkdata $out 559 587 foreach axis {x y z} { 560 set vector [set ${axis}v]588 set vector [set ${axis}v] 561 589 set _limits(${axis}min) [${vector} min] 562 590 set _limits(${axis}max) [${vector} max] … … 587 615 set _vtkpoints [$_vtkoutput GetPointData] 588 616 file delete $tmpfile 617 set _isValid 1 589 618 } 590 619 … … 614 643 } 615 644 if { $numNonUniform == 0 && $numUniform > 0 } { 616 # Specially handle the case where all axes are uniform. 617 # This means we can use a vtkImageData to represent the data 618 # instead of a vtkRectlinearGrid. 619 # Vtk points are always 3D 645 # Specially handle the case where all axes are uniform. This means we 646 # can use a vtkImageData to represent the data instead of a 647 # vtkRectlinearGrid. Vtk points are always 3D 620 648 if { $_dim == 2 } { 621 649 append out "DATASET STRUCTURED_POINTS\n" … … 650 678 error "bad dimension of mesh \"$_dim\"" 651 679 } 680 set _isValid 1 652 681 return 1 653 682 } … … 729 758 } 730 759 blt::vector destroy $xv $yv $zv 760 set _isValid 1 731 761 return 1 762 } 763 764 itcl::body Rappture::Mesh::ReadCells { xmlobj path } { 765 set _type "cells" 766 set celltype [$xmlobj get $path.cells.celltype] 767 array set type2vertices { 768 triangle 3 769 quad 4 770 tetraheadron 4 771 voxel 8 772 hexaheadron 8 773 wedge 6 774 pyramid 5 775 } 776 array set type2dim { 777 triangle 2 778 quad 2 779 tetraheadron 3 780 voxel 3 781 hexaheadron 3 782 wedge 3 783 pyramid 3 784 } 785 array set type2vtkid { 786 triangle 5 787 quad 9 788 tetraheadron 10 789 voxel 11 790 hexaheadron 12 791 wedge 13 792 pyramid 14 793 } 794 if { ![info exists type2vertices($celltype)] } { 795 puts stderr "unknown celltype \"$celltype\"" 796 return 0 797 } 798 set numVertices $type2vertices($celltype) 799 set _dim $type2dim($celltype) 800 set vtkid $type2vtkid($celltype) 801 802 set points [$xmlobj get $path.cells.points] 803 set xvalues [$xmlobj get $path.cells.xvalues] 804 set yvalues [$xmlobj get $path.cells.yvalues] 805 if { $_dim == 2 } { 806 if { $xvalues != "" && $yvalues != "" } { 807 set xv [blt::vector create \#auto] 808 set yv [blt::vector create \#auto] 809 $xv set $xvalues 810 $yx set $yvalues 811 } elseif { $points != "" } { 812 set all [blt::vector create \#auto] 813 $all set $points 814 set xv [blt::vector create \#auto] 815 set yv [blt::vector create \#auto] 816 $all split $xv $yv 817 } else { 818 puts stderr "missing either xvalues, yvalues, or points for $celltype cell mesh" 819 return 0 820 } 821 set _numPoints [$xv length] 822 set numIndices 0 823 set data {} 824 set indices [$xmlobj get $path.cells.indices] 825 foreach { a b c } $indices { 826 append data " $numVertices $a $b $c\n" 827 incr numIndices 828 } 829 set celltypes {} 830 for { set i 0 } { $i < $numIndices } { incr i } { 831 append celltypes "$vtkid\n" 832 } 833 append out "DATASET UNSTRUCTURED_GRID\n" 834 append out "POINTS $_numPoints float\n" 835 foreach x [$xv range 0 end] y [$yv range 0 end] { 836 append out " $x $y 0\n" 837 } 838 append out "CELLS $numIndices [expr $numIndices * 4]\n" 839 append out $data 840 append out "CELL_TYPES $numIndices\n" 841 append out $celltypes 842 append out "POINT_DATA $_numPoints\n" 843 set _limits(xmin) [$xv min] 844 set _limits(xmax) [$xv max] 845 set _limits(ymin) [$yv min] 846 set _limits(ymax) [$yv max] 847 } else { 848 set zvalues [$xmlobj get $path.cells.zvalues] 849 if { $xvalues != "" && $yvalues != "" && $zvalues != "" } { 850 set xv [blt::vector create \#auto] 851 set yv [blt::vector create \#auto] 852 set zv [blt::vector create \#auto] 853 $xv set $xvalues 854 $yx set $yvalues 855 $zx set $yvalues 856 } elseif { $points != "" } { 857 set all [blt::vector create \#auto] 858 $all set $points 859 set xv [blt::vector create \#auto] 860 set yv [blt::vector create \#auto] 861 set zv [blt::vector create \#auto] 862 $all split $xv $yv $zv 863 } else { 864 puts stderr "missing either xvalues, yvalues, zvalues, or points for $celltype cell mesh" 865 return 0 866 } 867 set _numPoints [$xv length] 868 set data {} 869 set indices [$xmlobj get $path.cells.indices] 870 set numIndices 0 871 foreach { a b c } $indices { 872 append data " $numVertices $a $b $c\n" 873 incr numIndices 874 } 875 set celltypes {} 876 for { set i 0 } { $i < $numIndices } { incr i } { 877 append celltypes "$vtkid\n" 878 } 879 append out "DATASET UNSTRUCTURED_GRID\n" 880 append out "POINTS $_numPoints float\n" 881 foreach x [$xv range 0 end] y [$yv range 0 end] z [$zv range 0 end] { 882 append out " $x $y $z\n" 883 } 884 append out "CELLS $numIndices [expr $numIndices * 4]\n" 885 append out $data 886 append out "CELL_TYPES $numIndices\n" 887 append out $celltypes 888 append out "POINT_DATA $_numPoints\n" 889 set _limits(xmin) [$xv min] 890 set _limits(xmax) [$xv max] 891 set _limits(ymin) [$yv min] 892 set _limits(ymax) [$yv max] 893 set _limits(zmin) [$zv min] 894 set _limits(zmax) [$zv max] 895 } 896 set _vtkdata $out 897 set _isValid 1 732 898 } 733 899 … … 784 950 set _limits(ymax) [$yv max] 785 951 set _vtkdata $out 786 } 787 788 itcl::body Rappture::Mesh::GetBltGridMesh { path } { 952 set _isValid 1 953 } 954 955 itcl::body Rappture::Mesh::ReadBltGridMesh { path } { 789 956 if { $_dim != 2 } { 790 957 error "must be 2D mesh for BLT" … … 841 1008 } 842 1009 843 itcl::body Rappture::Mesh:: GetBltTriangleMesh { path } {1010 itcl::body Rappture::Mesh::ReadBltTriangleMesh { path } { 844 1011 set _xv [blt::vector create \#auto] 845 1012 set _yv [blt::vector create \#auto] … … 856 1023 } 857 1024 858 itcl::body Rappture::Mesh:: GetBltCloudMesh { path } {1025 itcl::body Rappture::Mesh::ReadBltCloudMesh { path } { 859 1026 # Read the points into a vector and split them into individual coordinate 860 1027 # arrays. … … 883 1050 } 884 1051 885 itcl::body Rappture::Mesh:: GetBltMesh { path } {1052 itcl::body Rappture::Mesh::ReadBltMesh { path } { 886 1053 if { $_dim != 2 } { 887 1054 error "dimension of mesh $_dim is not 2" … … 889 1056 switch -- $_type { 890 1057 "cloud" { 891 set _bltmesh [ GetBltCloudMesh $path ]1058 set _bltmesh [ReadBltCloudMesh $path ] 892 1059 } 893 1060 "unirect" { 894 set _bltmesh [ GetBltRegularMesh $path]1061 set _bltmesh [ReadBltRegularMesh $path] 895 1062 } 896 1063 "rectangle" { 897 set _bltmesh [ GetBltIrregularMesh $path]1064 set _bltmesh [ReadBltIrregularMesh $path] 898 1065 } 899 1066 "triangle" { 900 set _bltmesh [ GetBltTriangleMesh $path]1067 set _bltmesh [ReadBltTriangleMesh $path] 901 1068 } 902 1069 default { … … 989 1156 } 990 1157 set _vtkdata $out 991 } 1158 set _isValid 1 1159 } -
branches/Rappture 1.2/gui/scripts/resultviewer.tcl
r3210 r3288 336 336 set fmt "vtkstreamlines" 337 337 } 338 "vtkisosurface" { 339 set fmt "vtkisosurface" 340 } 338 341 } 339 342 set w $itk_interior.field3D -
branches/Rappture 1.2/gui/scripts/xyresult.tcl
r3236 r3288 749 749 # Create text/line markers for each *axis.marker specified. 750 750 # 751 foreach m [$dataobj xmarkers] { 752 foreach {at label style} $m break 753 set id [$g marker create line -coords [list $at $ymin $at $ymax]] 754 $g marker bind $id <Enter> \ 755 [itcl::code $this EnterMarker $g x-$label $at $ymin $at] 756 $g marker bind $id <Leave> \ 757 [itcl::code $this LeaveMarker $g x-$label] 758 set options [GetLineMarkerOptions $style] 759 if { $options != "" } { 760 eval $g marker configure $id $options 761 } 762 if { $label != "" } { 763 set id [$g marker create text -anchor nw \ 764 -text $label -coords [list $at $ymax]] 765 set options [GetTextMarkerOptions $style] 766 if { $options != "" } { 767 eval $g marker configure $id $options 768 } 769 } 770 } 771 foreach m [$dataobj ymarkers] { 772 foreach {at label style} $m break 773 set id [$g marker create line -coords [list $xmin $at $xmax $at]] 774 $g marker bind $id <Enter> \ 775 [itcl::code $this EnterMarker $g y-$label $at $xmin $at] 776 $g marker bind $id <Leave> \ 777 [itcl::code $this LeaveMarker $g y-$label] 778 set options [GetLineMarkerOptions $style] 779 if { $options != "" } { 780 eval $g marker configure $id $options 781 } 782 if { $label != "" } { 783 set id [$g marker create text -anchor se \ 784 -text $label -coords [list $xmax $at]] 785 set options [GetTextMarkerOptions $style] 786 if { $options != "" } { 787 eval $g marker configure $id $options 788 } 789 } 790 } 751 if { [$dataobj info class] == "Rappture::Curve" } { 752 foreach m [$dataobj xmarkers] { 753 foreach {at label style} $m break 754 set id [$g marker create line \ 755 -coords [list $at $ymin $at $ymax]] 756 $g marker bind $id <Enter> \ 757 [itcl::code $this EnterMarker $g x-$label $at $ymin $at] 758 $g marker bind $id <Leave> \ 759 [itcl::code $this LeaveMarker $g x-$label] 760 set options [GetLineMarkerOptions $style] 761 if { $options != "" } { 762 eval $g marker configure $id $options 763 } 764 if { $label != "" } { 765 set id [$g marker create text -anchor nw \ 766 -text $label -coords [list $at $ymax]] 767 set options [GetTextMarkerOptions $style] 768 if { $options != "" } { 769 eval $g marker configure $id $options 770 } 771 } 772 } 773 foreach m [$dataobj ymarkers] { 774 foreach {at label style} $m break 775 set id [$g marker create line \ 776 -coords [list $xmin $at $xmax $at]] 777 $g marker bind $id <Enter> \ 778 [itcl::code $this EnterMarker $g y-$label $at $xmin $at] 779 $g marker bind $id <Leave> \ 780 [itcl::code $this LeaveMarker $g y-$label] 781 set options [GetLineMarkerOptions $style] 782 if { $options != "" } { 783 eval $g marker configure $id $options 784 } 785 if { $label != "" } { 786 set id [$g marker create text -anchor se \ 787 -text $label -coords [list $xmax $at]] 788 set options [GetTextMarkerOptions $style] 789 if { $options != "" } { 790 eval $g marker configure $id $options 791 } 792 } 793 } 794 } 791 795 } 792 796 $itk_component(legend) reset
Note: See TracChangeset
for help on using the changeset viewer.