- Timestamp:
- Feb 11, 2015, 1:56:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/field.tcl
r4997 r4998 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: unirec2d 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 … … 373 364 return [$_comp2unirect3d($cname) values] 374 365 } 375 error "can't get field values. Unknown component \"$cname\": should be [join [lsort [array names _comp2dims]] {, }]"366 error "can't get field values. Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]" 376 367 } 377 368 … … 1384 1375 return $out 1385 1376 } 1386 error "can't find vtkdata for $cname . This method should only be called by the vtkheightmap widget"1377 error "can't find vtkdata for $cname" 1387 1378 } 1388 1379
Note: See TracChangeset
for help on using the changeset viewer.