Changeset 5157 for trunk


Ignore:
Timestamp:
Mar 21, 2015 2:27:41 AM (9 years ago)
Author:
ldelgass
Message:

Surface viewer fixes (based on changes from isosurface viewer)

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r5156 r5157  
    15551555                    SendCmd "contour3d visible $bool $tag"
    15561556                }
    1557             }
    1558             if { $bool } {
    15591557                Rappture::Tooltip::for $itk_component(contour) \
    15601558                    "Hide the isosurface"
  • trunk/gui/scripts/vtksurfaceviewer.tcl

    r5156 r5157  
    216216        -legendvisible              1
    217217        -numcontours                10
     218        -outline                    0
    218219        -surfaceedges               0
    219220        -surfacelighting            1
    220221        -surfaceopacity             100
    221         -outline                    0
    222222        -surfacevisible             1
    223223        -surfacewireframe           0
     
    228228    array set _changed {
    229229        -colormap                0
     230        -isolinecolor            0
     231        -isolinesvisible         0
    230232        -numcontours             0
     233        -outline                 0
     234        -surfaceedges            0
     235        -surfacelighting         0
    231236        -surfaceopacity          0
     237        -surfacevisible          0
     238        -surfacewireframe        0
    232239    }
    233240
     
    952959            lappend _obj2datasets($dataobj) $tag
    953960            if { [info exists _obj2ovride($dataobj-raise)] } {
    954                 # Setting dataset visible enables outline
    955                 # and contour2d
    956                 SendCmd "dataset visible 1 $tag"
     961                SendCmd "polydata visible 1 $tag"
    957962            }
    958963        }
     
    13561361        }
    13571362        "-isolinecolor" {
     1363            set _changed($what) 1
    13581364            set color [$itk_component(isolineColor) value]
    13591365            set _settings($what) $color
     
    13621368        }
    13631369        "-isolinesvisible" {
     1370            set _changed($what) 1
    13641371            set bool $_settings($what)
    1365             SendCmd "contour2d visible $bool"
     1372            SendCmd "contour2d visible 0"
     1373            if { $bool } {
     1374                foreach tag [CurrentDatasets -visible] {
     1375                    SendCmd "contour2d visible $bool $tag"
     1376                }
     1377            }
    13661378            DrawLegend
    13671379        }
     
    13871399        }
    13881400        "-outline" {
     1401            set _changed($what) 1
    13891402            set bool $_settings($what)
    1390             SendCmd "outline visible $bool"
     1403            SendCmd "outline visible 0"
     1404            if { $bool } {
     1405                foreach tag [CurrentDatasets -visible] {
     1406                    SendCmd "outline visible $bool $tag"
     1407                }
     1408            }
    13911409        }
    13921410        "-surfaceedges" {
     1411            set _changed($what) 1
    13931412            set bool $_settings($what)
    13941413            SendCmd "polydata edges $bool"
    13951414        }
    13961415        "-surfacelighting" {
     1416            set _changed($what) 1
    13971417            set bool $_settings($what)
    13981418            SendCmd "polydata lighting $bool"
    13991419        }
    14001420        "-surfaceopacity" {
     1421            set _changed($what) 1
    14011422            set val $_settings($what)
    14021423            set sval [expr { 0.01 * double($val) }]
     
    14041425        }
    14051426        "-surfacevisible" {
     1427            set _changed($what) 1
    14061428            set bool $_settings($what)
    1407             SendCmd "polydata visible $bool"
     1429            SendCmd "polydata visible 0"
    14081430            if { $bool } {
     1431                foreach tag [CurrentDatasets -visible] {
     1432                    SendCmd "polydata visible $bool $tag"
     1433                }
    14091434                Rappture::Tooltip::for $itk_component(surface) \
    14101435                    "Hide the surface"
     
    14161441        }
    14171442        "-surfacewireframe" {
     1443            set _changed($what) 1
    14181444            set bool $_settings($what)
    14191445            SendCmd "polydata wireframe $bool"
     
    19151941    # the code to handle aberrant cases.
    19161942
     1943    if { $_changed(-surfaceedges) } {
     1944        set style(-edges) $_settings(-surfaceedges)
     1945    }
     1946    if { $_changed(-surfacelighting) } {
     1947        set style(-lighting) $_settings(-surfacelighting)
     1948    }
    19171949    if { $_changed(-surfaceopacity) } {
    19181950        set style(-opacity) [expr $_settings(-surfaceopacity) * 0.01]
     1951    }
     1952    if { $_changed(-surfacewireframe) } {
     1953        set style(-wireframe) $_settings(-surfacewireframe)
    19191954    }
    19201955    if { $_changed(-numcontours) } {
     
    19351970        DrawLegend
    19361971    }
    1937     set _settings(-isolinesvisible) $style(-isolinesvisible)
    1938     set _settings(-surfacevisible) $style(-surfacevisible)
     1972    foreach setting {-outline -isolinesvisible -surfacevisible -isolinecolor} {
     1973        if {$_changed($setting)} {
     1974            # User-modified UI setting overrides style
     1975            set style($setting) $_settings($setting)
     1976        } else {
     1977            # Set UI control to style setting (tool provided or default)
     1978            set _settings($setting) $style($setting)
     1979        }
     1980    }
    19391981
    19401982    SendCmd "outline add $tag"
    19411983    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
    19421984    SendCmd "outline visible $style(-outline) $tag"
    1943     set _settings(-outline) $style(-outline)
    19441985
    19451986    SendCmd "polydata add $tag"
Note: See TracChangeset for help on using the changeset viewer.