Changeset 4076 for trunk/gui


Ignore:
Timestamp:
Dec 16, 2013, 11:23:44 PM (11 years ago)
Author:
ldelgass
Message:

Use simple X/Y/Z axis labels for image viewer. Also, use native aspect ratio
in 3D mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/vtkimageviewer.tcl

    r4075 r4076  
    10251025       
    10261026        foreach axis { x y z } {
    1027             if { $axis == "z" } {
    1028                 set label [$_first hints label]
    1029             } else {
    1030                 set label [$_first hints ${axis}label]
    1031             }
     1027            set label [$_first hints ${axis}label]
    10321028            if { $label == "" } {
    1033                 if {$axis == "z"} {
    1034                     if { [string match "component*" $_curFldName] } {
    1035                         set label [string toupper $axis]
    1036                     } else {
    1037                         set label $_curFldLabel
    1038                     }
    1039                 } else {
    1040                     set label [string toupper $axis]
    1041                 }
     1029                set label [string toupper $axis]
    10421030            }
    10431031            # May be a space in the axis label.
     
    14211409                return
    14221410            }
    1423             set label [$_first hints label]
    1424             if { $label == "" } {
    1425                 if { [string match "component*" $_curFldName] } {
    1426                     set label Z
    1427                 } else {
    1428                     set label $_curFldLabel
    1429                 }
    1430             }
    1431             # May be a space in the axis label.
    1432             SendCmd [list axis name z $label]
    1433 
    1434             if { [$_first hints zunits] == "" } {
    1435                 set units [lindex $_fields($_curFldName) 1]
    1436             } else {
    1437                 set units [$_first hints zunits]
    1438             }
    1439             if { $units != "" } {
    1440                 # May be a space in the axis units.
    1441                 SendCmd [list axis units z $units]
    1442             }
     1411
    14431412            # Get the new limits because the field changed.
    14441413            SendCmd "dataset scalar $_curFldName"
     
    14661435                    SendCmd "camera mode persp"
    14671436                }
     1437                SendCmd "camera aspect native"
    14681438            } else {
    14691439                $itk_component(opacity) configure -state disabled
    14701440                $itk_component(opacity_l) configure -state disabled
    14711441                SendCmd "camera mode image"
    1472             }
    1473             if {$_settings(stretchToFit)} {
    1474                 if {$scale == 0} {
     1442                if {$_settings(stretchToFit)} {
    14751443                    SendCmd "camera aspect window"
    1476                 } else {
    1477                     SendCmd "camera aspect square"
    14781444                }
    14791445            }
     
    15341500            if { $bool } {
    15351501                if { $_settings(view3D) } {
    1536                     SendCmd "camera aspect square"
     1502                    SendCmd "camera aspect native"
    15371503                } else {
    15381504                    SendCmd "camera aspect window"
Note: See TracChangeset for help on using the changeset viewer.