- Timestamp:
- Apr 14, 2015 1:44:58 PM (9 years ago)
- Location:
- branches/1.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/field.tcl
r5180 r5215 77 77 private variable _hints 78 78 private variable _viewer ""; # Hints which viewer to use 79 private variable _xv ""; # For 1D meshes only. Holds the points80 79 private variable _isValid 0; # Indicates if the field contains 81 80 # valid data. … … 148 147 private variable _type "" 149 148 private variable _comp2flowhints 150 private variable _comp2mesh 149 private variable _comp2mesh ;# list of: mesh object, BLT vector of values 150 private variable _values "" ;# Only used for unirect2d - list of values 151 151 private common _counter 0 ;# counter for unique vector names 152 152 … … 161 161 private method VerifyVtkDataSet { contents } 162 162 private method VectorLimits { vector vectorsize {comp -1} } 163 private variable _values ""164 163 } 165 164 … … 302 301 # USAGE: mesh ?<name>? 303 302 # 304 # Returns a list {xvec yvec} for the specified field component <name>. 305 # If the name is not specified, then it returns the vectors for the 306 # overall field (sum of all components). 303 # For 1D data (curve), returns a BLT vector of x values for the field 304 # component <name>. Otherwise, this method is unused 307 305 # ---------------------------------------------------------------------- 308 306 itcl::body Rappture::Field::mesh {{cname -overall}} { … … 313 311 return [lindex $_comp2xy($cname) 0] ;# return xv 314 312 } 315 if { [info exists _comp2vtk($cname)]} {313 if {[info exists _comp2vtk($cname)]} { 316 314 # FIXME: extract mesh from VTK file data. 317 if { $_comp2dims($cname) == "1D" } {318 return $_xv319 }320 315 error "method \"mesh\" is not implemented for VTK file data" 321 316 } 322 317 if {[info exists _comp2dx($cname)]} { 323 return "" ;# no mesh -- it's embedded in the blob data318 error "method \"mesh\" is not implemented for DX file data" 324 319 } 325 320 if {[info exists _comp2mesh($cname)]} { 326 return "" ;# no mesh -- it's embedded in the value data 321 # FIXME: This only works for cloud 322 set mesh [lindex $_comp2mesh($cname) 0] 323 return [$mesh points] 327 324 } 328 325 if {[info exists _comp2unirect2d($cname)]} { 329 set mobj [lindex $_comp2unirect2d($cname) 0]330 return [$ mobjmesh]326 # FIXME: unirect2d mesh is a list: xMin xMax xNum yMin yMax yNum 327 return [$_comp2unirect2d($cname) mesh] 331 328 } 332 329 if {[info exists _comp2unirect3d($cname)]} { 333 set mobj [lindex $_comp2unirect3d($cname) 0]334 return [$ mobjmesh]330 # This returns a list of x,y,z points 331 return [$_comp2unirect3d($cname) mesh] 335 332 } 336 333 error "can't get field mesh: Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]" … … 340 337 # USAGE: values ?<name>? 341 338 # 342 # Returns a list {xvec yvec} for the specified field component <name>. 343 # If the name is not specified, then it returns the vectors for the 344 # overall field (sum of all components). 339 # For 1D data (curve), returns a BLT vector of field values (y coords) 340 # for the field component <name>. Otherwise, this method is unused 345 341 # ---------------------------------------------------------------------- 346 342 itcl::body Rappture::Field::values {cname} { … … 351 347 return [lindex $_comp2xy($cname) 1] ;# return yv 352 348 } 353 # VTK file data354 349 if { [info exists _comp2vtk($cname)] } { 355 350 # FIXME: extract the values from the VTK file data 356 if { $_comp2dims($cname) == "1D" } { 357 return $_values 358 } 359 error "method \"values\" is not implemented for vtk file data" 360 } 361 # Points-on-mesh 351 error "method \"values\" is not implemented for VTK file data" 352 } 353 if {[info exists _comp2dx($cname)]} { 354 error "method \"values\" is not implemented for DX file data" 355 } 362 356 if { [info exists _comp2mesh($cname)] } { 363 357 set vector [lindex $_comp2mesh($cname) 1] 364 358 return [$vector range 0 end] 365 359 } 366 if {[info exists _comp2dx($cname)]} {367 error "method \"values\" is not implemented for dx file data"368 }369 360 if {[info exists _comp2unirect2d($cname)]} { 370 361 return $_values 371 362 } 372 363 if {[info exists _comp2unirect3d($cname)]} { 373 return [$_comp2unirect3d($cname) blob]374 } 375 error "can't get field values. Unknown component \"$cname\": should be [join [lsort [array names _comp2dims]] {, }]"364 return [$_comp2unirect3d($cname) values] 365 } 366 error "can't get field values. Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]" 376 367 } 377 368 … … 1323 1314 return [Rappture::DxToVtk $data] 1324 1315 } 1325 # Unirect3d: isosurface1326 if {[info exists _comp2unirect3d($cname)]} {1327 return [$_comp2unirect3d($cname) vtkdata]1328 }1329 1316 # VTK file data: 1330 1317 if { [info exists _comp2vtk($cname)] } { … … 1447 1434 } 1448 1435 # Get the data limits 1449 set vector [$_comp2unirect3d($cname) values Obj]1436 set vector [$_comp2unirect3d($cname) values] 1450 1437 set minmax [VectorLimits $vector $vectorsize] 1451 1438 lappend limits $cname $minmax -
branches/1.3/gui/scripts/unirect3d.tcl
r4790 r5215 27 27 public method mesh {} 28 28 public method values {} 29 public method valuesObj {}30 29 public method units { axis } 31 30 public method label { axis } … … 141 140 # ---------------------------------------------------------------------- 142 141 # method mesh 143 # Returns a Tcl list that represents the points 144 # grid. 142 # Returns a Tcl list that represents the points of the uniform 143 # grid. Each point has x,y and z values in the list. 145 144 # ---------------------------------------------------------------------- 146 145 itcl::body Rappture::Unirect3d::mesh {} { … … 163 162 164 163 # ---------------------------------------------------------------------- 165 # method values 166 # Returns a Tcl listthat represents the field values164 # method values 165 # Returns a BLT vector that represents the field values 167 166 # ---------------------------------------------------------------------- 168 167 itcl::body Rappture::Unirect3d::values {} { 169 if { [$_values length] > 0 } {170 return [$_values range 0 end]171 }172 return ""173 }174 175 # ----------------------------------------------------------------------176 # method valuesObj177 # Returns a BLT vector that represents the field values178 # ----------------------------------------------------------------------179 itcl::body Rappture::Unirect3d::valuesObj {} {180 168 return $_values 181 169 }
Note: See TracChangeset
for help on using the changeset viewer.