Ignore:
Timestamp:
Nov 26, 2014, 4:45:43 PM (10 years ago)
Author:
gah
Message:

sync with 1.4-pre

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/uq/gui/scripts/field.tcl

    r4520 r4797  
    427427    set min ""
    428428    set max ""
    429     blt::vector tmp zero
    430429
    431430    foreach cname [array names _comp2dims] {
     
    453452
    454453                if {$log} {
    455                     # on a log scale, use abs value and ignore 0's
     454                    blt::vector tmp zero
     455                    # on a log scale, use abs value and ignore zeros
    456456                    $vname dup tmp
    457457                    $vname dup zero
    458                     zero expr {tmp == 0}            ;# find the 0's
     458                    zero expr {tmp == 0}            ;# find the zeros
    459459                    tmp expr {abs(tmp)}             ;# get the abs value
    460                     tmp expr {tmp + zero*max(tmp)}  ;# replace 0's with abs max
     460                    tmp expr {tmp + zero*max(tmp)}  ;# replace 0s with abs max
    461461                    set axisMin [blt::vector expr min(tmp)]
    462462                    set axisMax [blt::vector expr max(tmp)]
     463                    blt::vector destroy tmp zero
    463464                } else {
    464465                    set axisMin [$vname min]
     
    477478                }
    478479            }
    479             2D - 3D {
     480            default {
    480481                if {[info exists _comp2limits($cname)]} {
    481482                    array set limits $_comp2limits($cname)
     
    519520        }
    520521    }
    521     blt::vector destroy tmp zero
    522522    set val [$_field get "${axis}axis.min"]
    523523    if {"" != $val && "" != $min} {
     
    536536    return [list $min $max]
    537537}
    538 
    539538
    540539# ----------------------------------------------------------------------
     
    15131512        set dim 0
    15141513        foreach axis {x y z} {
    1515             foreach {min max} [$mesh limits $axis] { 
     1514            foreach {min max} [$mesh limits $axis] {
    15161515                if { $min < $max } {
    15171516                    incr dim
     
    17021701    }
    17031702
    1704     foreach key [array names data] {
    1705         if {$key == "vtkdata"} {
    1706             if {1} {
    1707                 set f [open /tmp/$cname.vtk "w"]
    1708                 fconfigure $f -translation binary -encoding binary
    1709                 puts -nonewline $f $data(vtkdata)
    1710                 close $f
    1711             }
    1712         } else {
    1713             puts stderr "$key = \"$data($key)\""
     1703    if 0 {
     1704        foreach key [array names data] {
     1705            if {$key == "vtkdata"} {
     1706                if 0 {
     1707                    set f [open /tmp/$cname.vtk "w"]
     1708                    fconfigure $f -translation binary -encoding binary
     1709                    puts -nonewline $f $data(vtkdata)
     1710                    close $f
     1711                }
     1712            } else {
     1713                puts stderr "$key = \"$data($key)\""
     1714            }
    17141715        }
    17151716    }
Note: See TracChangeset for help on using the changeset viewer.