- Timestamp:
- Dec 6, 2011, 2:27:25 PM (13 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/field.tcl
r2711 r2718 35 35 public method flowhints { cname } 36 36 public method type {} 37 public method vtkdata {{what -overall}} 37 38 38 39 protected method _build {} … … 50 51 private variable _comp2vtk ;# maps component name => vtkFloatArray 51 52 private variable _comp2vtkstreamlines ;# maps component name => vtkFloatArray 53 private variable _comp2volume ;# maps component name => vtkFloatArray 52 54 private variable _comp2dx ;# maps component name => OpenDX data 53 55 private variable _comp2unirect2d ;# maps component name => unirect2d obj … … 967 969 return $_comp2extents($what) 968 970 } 971 972 # ---------------------------------------------------------------------- 973 # USAGE: blob ?<name>? 974 # 975 # Returns a string representing the blob of data for the mesh and values. 976 # ---------------------------------------------------------------------- 977 itcl::body Rappture::Field::vtkdata {{what -overall}} { 978 if {$what == "component0"} { 979 set what "component" 980 } 981 if {[info exists _comp2xy($what)]} { 982 return "" 983 } 984 if { [info exists _comp2vtk($what)] } { 985 return "" 986 } 987 if { [info exists _comp2vtkstreamlines($what)] } { 988 # Return the contents of the vtk file. 989 return $_comp2vtkstreamlines($what) 990 } 991 if { [info exists _comp2vtkvolume($what)] } { 992 # Return the contents of the vtk file. 993 return $_comp2vtkvolume($what) 994 } 995 if {[info exists _comp2dx($what)]} { 996 set data $_comp2dx($what) 997 if { $data == "" } { 998 return "" 999 } 1000 set data [$_field get -decode yes $data] 1001 set data [Rappture::ConvertDxToVtk $data] 1002 return $data 1003 } 1004 if {[info exists _comp2unirect2d($what)]} { 1005 return [$_comp2unirect2d($what) blob] 1006 } 1007 if {[info exists _comp2unirect3d($what)]} { 1008 return [$_comp2unirect3d($what) blob] 1009 } 1010 error "bad option \"$what\": should be [join [lsort [array names _comp2dims]] {, }]" 1011 }
Note: See TracChangeset
for help on using the changeset viewer.