Changeset 5610 for trunk/gui/scripts/field.tcl
- Timestamp:
- May 27, 2015, 1:17:43 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/field.tcl
r5608 r5610 306 306 # 307 307 # For 1D data (curve), returns a BLT vector of x values for the field 308 # component <name>. Otherwise, this method is unused 308 # component <name>. Otherwise, this method is unused. 309 309 # ---------------------------------------------------------------------- 310 310 itcl::body Rappture::Field::mesh {{cname -overall}} { … … 316 316 } 317 317 if {[info exists _comp2vtk($cname)]} { 318 # FIXME: extract mesh from VTK file data.319 318 error "method \"mesh\" is not implemented for VTK file data" 320 319 } … … 323 322 } 324 323 if {[info exists _comp2mesh($cname)]} { 325 # FIXME: This only works for cloud 326 set mesh [lindex $_comp2mesh($cname) 0] 327 return [$mesh points] 324 error "method \"mesh\" is not implemented for Rappture::Mesh" 328 325 } 329 326 if {[info exists _comp2unirect2d($cname)]} { 330 # FIXME: unirect2d mesh is a list: xMin xMax xNum yMin yMax yNum 331 return [$_comp2unirect2d($cname) mesh] 327 error "method \"mesh\" is not implemented for unirect2d" 332 328 } 333 329 if {[info exists _comp2unirect3d($cname)]} { 334 # This returns a list of x,y,z points 335 return [$_comp2unirect3d($cname) mesh] 330 error "method \"mesh\" is not implemented for unirect3d" 336 331 } 337 332 error "can't get field mesh: Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]" … … 342 337 # 343 338 # For 1D data (curve), returns a BLT vector of field values (y coords) 344 # for the field component <name>. Otherwise, this method is unused 339 # for the field component <name>. Otherwise, this method is unused. 340 # The number of elements in the vector should be a multiple of the 341 # return value of [numComponents] 345 342 # ---------------------------------------------------------------------- 346 343 itcl::body Rappture::Field::values {cname} { … … 351 348 return [lindex $_comp2xy($cname) 1] ;# return yv 352 349 } 353 if { [info exists _comp2vtk($cname)] } { 354 # FIXME: extract the values from the VTK file data 350 if {[info exists _comp2vtk($cname)]} { 355 351 error "method \"values\" is not implemented for VTK file data" 356 352 } … … 358 354 error "method \"values\" is not implemented for DX file data" 359 355 } 360 if { [info exists _comp2mesh($cname)] } { 361 set vector [lindex $_comp2mesh($cname) 1] 362 return [$vector range 0 end] 356 if {[info exists _comp2mesh($cname)]} { 357 return [lindex $_comp2mesh($cname) 1] ;# return vector 363 358 } 364 359 if {[info exists _comp2unirect2d($cname)]} { 365 return $_values360 error "method \"values\" is not implemented for unirect2d" 366 361 } 367 362 if {[info exists _comp2unirect3d($cname)]} { 368 return [$_comp2unirect3d($cname) values]363 error "method \"values\" is not implemented for unirect3d" 369 364 } 370 365 error "can't get field values. Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]" … … 391 386 return [$_comp2unirect3d($cname) blob] 392 387 } 388 if {[info exists _comp2mesh($cname)]} { 389 error "method \"blob\" not implemented for Rappture::Mesh" 390 } 393 391 if { [info exists _comp2vtk($cname)] } { 394 error " blobnot implemented for VTK file data"392 error "method \"blob\" not implemented for VTK file data" 395 393 } 396 394 if {[info exists _comp2xy($cname)]} { 397 error " blobnot implemented for XY data"395 error "method \"blob\" not implemented for XY data" 398 396 } 399 397 error "can't get field blob: Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]"
Note: See TracChangeset
for help on using the changeset viewer.