- Timestamp:
- May 27, 2015, 1:17:43 PM (9 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/cloud.tcl
r5609 r5610 25 25 } 26 26 public method points {} 27 public method mesh {}28 27 public method units { axis } 29 28 public method label { axis } … … 216 215 217 216 # ---------------------------------------------------------------------- 218 # USAGE: mesh219 #220 # Returns the vtk object representing the mesh.221 # ----------------------------------------------------------------------222 itcl::body Rappture::Cloud::mesh {} {223 return $_points224 }225 226 # ----------------------------------------------------------------------227 217 # USAGE: dimensions 228 218 # -
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]] {, }]" -
trunk/gui/scripts/unirect2d.tcl
r5578 r5610 39 39 public method label { axis } 40 40 public method limits {axis} 41 public method mesh {}42 41 public method numpoints {} { 43 42 return $_numPoints … … 195 194 196 195 # ---------------------------------------------------------------------- 197 # method mesh198 # Returns a Tcl list that represents the mesh limits and dims.199 # ----------------------------------------------------------------------200 itcl::body Rappture::Unirect2d::mesh {} {201 lappend out $_xMin $_xMax $_xNum $_yMin $_yMax $_yNum202 return $out203 }204 205 # ----------------------------------------------------------------------206 196 # method limits <axis> 207 197 # Returns a list {min max} representing the limits for the -
trunk/gui/scripts/unirect3d.tcl
r5578 r5610 37 37 public method label { axis } 38 38 public method limits {axis} 39 public method mesh {}40 39 public method numpoints {} { 41 40 return $_numPoints … … 189 188 190 189 # ---------------------------------------------------------------------- 191 # method mesh192 # Returns a Tcl list that represents the points of the uniform193 # grid. Each point has x,y and z values in the list.194 # ----------------------------------------------------------------------195 itcl::body Rappture::Unirect3d::mesh {} {196 set dx [expr {($_xMax - $_xMin) / double($_xNum - 1)}]197 set dy [expr {($_yMax - $_yMin) / double($_yNum - 1)}]198 set dz [expr {($_zMax - $_zMin) / double($_zNum - 1)}]199 foreach {a b c} $_axisOrder break200 for { set i 0 } { $i < [set _${a}Num] } { incr i } {201 set v1 [expr {[set _${a}Min] + (double($i) * [set d${a}])}]202 for { set j 0 } { $j < [set _${b}Num] } { incr j } {203 set v2 [expr {[set _${b}Min] + (double($i) * [set d${b}])}]204 for { set k 0 } { $k < [set _${c}Num] } { incr k } {205 set v3 [expr {[set _${c}Min] + (double($i) * [set d${c}])}]206 lappend data $v1 $v2 $v3207 }208 }209 }210 return $data211 }212 213 # ----------------------------------------------------------------------214 190 # method values 215 191 # Returns a BLT vector that represents the field values
Note: See TracChangeset
for help on using the changeset viewer.