Ignore:
Timestamp:
Mar 5, 2015, 9:06:27 AM (5 years ago)
Author:
dkearney
Message:

merging from trunk to uvv branch

Location:
branches/uiuc_vtk_viewers
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/uiuc_vtk_viewers

  • branches/uiuc_vtk_viewers/gui/scripts/images/ask.png

    • Property svn:executable deleted
  • branches/uiuc_vtk_viewers/gui/scripts/images/folder.gif

    • Property svn:executable deleted
  • branches/uiuc_vtk_viewers/gui/scripts/images/molvis-3dorth.gif

    • Property svn:executable deleted
  • branches/uiuc_vtk_viewers/gui/scripts/images/molvis-3dpers.gif

    • Property svn:executable deleted
  • branches/uiuc_vtk_viewers/gui/scripts/images/popup.png

    • Property svn:executable deleted
  • branches/uiuc_vtk_viewers/gui/scripts/panes.tcl

    r5053 r5083  
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    12# ----------------------------------------------------------------------
    23#  COMPONENT: Panes - creates a series of adjustable panes
  • branches/uiuc_vtk_viewers/gui/scripts/visviewer.tcl

    r5053 r5083  
    6060    protected variable _debugConsole 0
    6161    protected variable _reportClientInfo 1
     62    # Number of milliscends to wait for server reply before displaying wait
     63    # dialog.  If set to 0, dialog is never displayed.
    6264    protected variable _waitTimeout 0
    6365
     
    99101    protected method SendBytes { bytes }
    100102    protected method SendCmd {string}
    101     protected method SendCmdNoWait {string}
    102103    protected method SendEcho { channel {data ""} }
    103104    protected method StartBufferingCommands {}
     
    487488# StartWaiting --
    488489#
    489 #    Read some number of bytes from the visualization server.
    490 #
    491 
     490#    Display a waiting dialog after a timeout has passed
     491#
    492492itcl::body Rappture::VisViewer::StartWaiting {} {
    493493    if { $_waitTimeout > 0 } {
     
    497497}
    498498
     499#
     500# StopWaiting --
     501#
     502#    Take down waiting dialog
     503#
    499504itcl::body Rappture::VisViewer::StopWaiting {} {
    500505    if { $_waitTimeout > 0 } {
     
    12011206    }
    12021207}
    1203 
    1204 #
    1205 # SendCmdNoWait
    1206 #
    1207 #       Send commands off to the rendering server.  If we're currently
    1208 #       sending data objects to the server, buffer the commands to be
    1209 #       sent later.
    1210 #
    1211 itcl::body Rappture::VisViewer::SendCmdNoWait {string} {
    1212     incr _cmdSeq
    1213     if {$_trace} {
    1214         puts stderr "$_cmdSeq>>[string range $string 0 70]"
    1215     }
    1216     if { $_buffering } {
    1217         append _outbuf $string "\n"
    1218     } else {
    1219         SendBytes "$string\n"
    1220     }
    1221 }
  • branches/uiuc_vtk_viewers/gui/scripts/vtkglyphviewer.tcl

    r4767 r5083  
    15621562    if { $_currentColormap != ""  } {
    15631563        set cmap $_currentColormap
    1564         SendCmdNoWait "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1564        SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
    15651565    }
    15661566}
  • branches/uiuc_vtk_viewers/gui/scripts/vtkisosurfaceviewer.tcl

    r5052 r5083  
    8787    private method GetImage { args }
    8888    private method GetVtkData { args }
    89     private method InitSettings { args  }
     89    private method InitSettings { args }
    9090    private method IsValidObject { dataobj }
    9191    private method LeaveLegend {}
     
    293293    array set _changed {
    294294        -colormap                0
     295        -cutplaneedges           0
     296        -cutplanelighting        0
     297        -cutplaneopacity         0
     298        -cutplanepreinterp       0
     299        -cutplanesvisible        0
     300        -cutplanewireframe       0
     301        -isosurfaceedges         0
     302        -isosurfacelighting      0
    295303        -isosurfaceopacity       0
    296         -cutplaneopacity         0
     304        -isosurfacevisible       0
     305        -isosurfacewireframe     0
    297306        -numcontours             0
     307        -outline                 0
     308        -xcutplaneposition       0
     309        -xcutplanevisible        0
     310        -ycutplaneposition       0
     311        -ycutplanevisible        0
     312        -zcutplaneposition       0
     313        -zcutplanevisible        0
    298314    }
    299315    array set _widget {
     
    14161432        }
    14171433        "-cutplaneedges" {
     1434            set _changed($what) 1
    14181435            set bool $_settings($what)
    14191436            SendCmd "cutplane edges $bool"
    14201437        }
    14211438        "-cutplanelighting" {
     1439            set _changed($what) 1
    14221440            set bool $_settings($what)
    14231441            SendCmd "cutplane lighting $bool"
    14241442        }
    14251443        "-cutplaneopacity" {
     1444            set _changed($what) 1
    14261445            set _settings($what) [expr $_widget($what) * 0.01]
    14271446            SendCmd "cutplane opacity $_settings($what)"
    14281447        }
    14291448        "-cutplanepreinterp" {
     1449            set _changed($what) 1
    14301450            set bool $_settings($what)
    14311451            SendCmd "cutplane preinterp $bool"
    14321452        }
    14331453        "-cutplanesvisible" {
     1454            set _changed($what) 1
    14341455            set bool $_settings($what)
    14351456            SendCmd "cutplane visible 0"
     
    14481469        }
    14491470        "-cutplanewireframe" {
     1471            set _changed($what) 1
    14501472            set bool $_settings($what)
    14511473            SendCmd "cutplane wireframe $bool"
     
    15161538        }
    15171539        "-isosurfaceedges" {
     1540            set _changed($what) 1
    15181541            set bool $_settings($what)
    15191542            SendCmd "contour3d edges $bool"
    15201543        }
    15211544        "-isosurfacelighting" {
     1545            set _changed($what) 1
    15221546            set bool $_settings($what)
    15231547            SendCmd "contour3d lighting $bool"
    15241548        }
    15251549        "-isosurfaceopacity" {
     1550            set _changed($what) 1
    15261551            set _settings($what) [expr $_widget($what) * 0.01]
    15271552            SendCmd "contour3d opacity $_settings($what)"
    15281553        }
    15291554        "-isosurfacevisible" {
     1555            set _changed($what) 1
    15301556            set bool $_settings($what)
    15311557            SendCmd "contour3d visible 0"
     
    15441570        }
    15451571        "-isosurfacewireframe" {
     1572            set _changed($what) 1
    15461573            set bool $_settings($what)
    15471574            SendCmd "contour3d wireframe $bool"
     
    15541581        }
    15551582        "-numcontours" {
     1583            set _changed($what) 1
    15561584            set _settings($what) [$itk_component(numcontours) value]
    15571585            if { $_contourList(numLevels) != $_settings($what) } {
     
    15691597        }
    15701598        "-outline" {
     1599            set _changed($what) 1
    15711600            set bool $_settings($what)
    15721601            SendCmd "outline visible 0"
     
    15901619        }
    15911620        "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" {
     1621            set _changed($what) 1
    15921622            set axis [string tolower [string range $what 1 1]]
    15931623            set bool $_settings($what)
     
    16021632        }
    16031633        "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" {
     1634            set _changed($what) 1
    16041635            set axis [string tolower [string range $what 1 1]]
    16051636            set pos [expr $_settings($what) * 0.01]
     
    16631694    if { $_currentColormap != ""  } {
    16641695        set cmap $_currentColormap
    1665         SendCmdNoWait "legend $cmap scalar $_curFldName {} $w $h 0"
     1696        SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
    16661697    }
    16671698}
     
    18211852    }
    18221853    itk_component add min {
    1823         Rappture::Gauge $inner.min \
     1854        Rappture::Gauge $inner.min -font "Arial 9" \
    18241855            -validatecommand [itcl::code $this LegendRangeValidate "" vmin]
    18251856    }
     
    18311862    }
    18321863    itk_component add max {
    1833         Rappture::Gauge $inner.max \
     1864        Rappture::Gauge $inner.max -font "Arial 9" \
    18341865            -validatecommand [itcl::code $this LegendRangeValidate "" vmax]
    18351866    }
     
    22572288    array set style {
    22582289        -color                  BCGYR
     2290        -cutplaneedges          0
     2291        -cutplanelighting       1
     2292        -cutplaneopacity        1.0
     2293        -cutplanepreinterp      1
    22592294        -cutplanesvisible       0
     2295        -cutplanewireframe      0
    22602296        -edgecolor              black
    22612297        -edges                  0
     
    22882324    # the code to handle aberrant cases.
    22892325
     2326    if { $_changed(-isosurfaceedges) } {
     2327        set style(-edges) $_settings(-isosurfaceedges)
     2328    }
     2329    if { $_changed(-isosurfacelighting) } {
     2330        set style(-lighting) $_settings(-isosurfacelighting)
     2331    }
    22902332    if { $_changed(-isosurfaceopacity) } {
    22912333        set style(-opacity) $_settings(-isosurfaceopacity)
     2334    }
     2335    if { $_changed(-isosurfacewireframe) } {
     2336        set style(-wireframe) $_settings(-isosurfacewireframe)
    22922337    }
    22932338    if { $_changed(-numcontours) } {
     
    23112356        EventuallyChangeContourLevels
    23122357    }
    2313     set _settings(-isosurfacevisible) $style(-isosurfacevisible)
    2314     set _settings(-cutplanesvisible)  $style(-cutplanesvisible)
    2315     set _settings(-xcutplanevisible)  $style(-xcutplanevisible)
    2316     set _settings(-ycutplanevisible)  $style(-ycutplanevisible)
    2317     set _settings(-zcutplanevisible)  $style(-zcutplanevisible)
    2318     set _settings(-xcutplaneposition) $style(-xcutplaneposition)
    2319     set _settings(-ycutplaneposition) $style(-ycutplaneposition)
    2320     set _settings(-zcutplaneposition) $style(-zcutplaneposition)
     2358    foreach setting {-outline -isosurfacevisible -cutplanesvisible \
     2359                     -xcutplanevisible -ycutplanevisible -zcutplanevisible \
     2360                     -xcutplaneposition -ycutplaneposition -zcutplaneposition \
     2361                     -cutplaneedges -cutplanelighting -cutplaneopacity \
     2362                     -cutplanepreinterp -cutplanewireframe} {
     2363        if {$_changed($setting)} {
     2364            # User-modified UI setting overrides style
     2365            set style($setting) $_settings($setting)
     2366        } else {
     2367            # Set UI control to style setting (tool provided or default)
     2368            set _settings($setting) $style($setting)
     2369        }
     2370    }
    23212371
    23222372    SendCmd "cutplane add $tag"
    23232373    SendCmd "cutplane color [Color2RGB $itk_option(-plotforeground)] $tag"
    23242374    foreach axis {x y z} {
    2325         set pos [expr $_settings(-${axis}cutplaneposition) * 0.01]
    2326         set visible $_settings(-${axis}cutplanevisible)
     2375        set pos [expr $style(-${axis}cutplaneposition) * 0.01]
     2376        set visible $style(-${axis}cutplanevisible)
    23272377        SendCmd "cutplane slice $axis $pos $tag"
    23282378        SendCmd "cutplane axis $axis $visible $tag"
    23292379    }
     2380    SendCmd "cutplane edges $style(-cutplaneedges) $tag"
     2381    SendCmd "cutplane lighting $style(-cutplanelighting) $tag"
     2382    SendCmd "cutplane opacity $style(-cutplaneopacity) $tag"
     2383    SendCmd "cutplane preinterp $style(-cutplanepreinterp) $tag"
     2384    SendCmd "cutplane wireframe $style(-cutplanewireframe) $tag"
    23302385    SendCmd "cutplane visible $style(-cutplanesvisible) $tag"
    23312386
     
    23332388    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
    23342389    SendCmd "outline visible $style(-outline) $tag"
    2335     set _settings(-outline) $style(-outline)
    23362390
    23372391    GenerateContourList
     
    23402394    SendCmd "contour3d edges $style(-edges) $tag"
    23412395    set _settings(-isosurfaceedges) $style(-edges)
    2342     #SendCmd "contour3d color [Color2RGB $settings(-color)] $tag"
     2396    #SendCmd "contour3d color [Color2RGB $style(-color)] $tag"
    23432397    SendCmd "contour3d lighting $style(-lighting) $tag"
    23442398    set _settings(-isosurfacelighting) $style(-lighting)
     
    24172471}
    24182472
    2419 
    24202473# ----------------------------------------------------------------------
    24212474# USAGE: LegendPointToValue <x> <y>
     
    24492502}
    24502503
    2451 
    24522504# ----------------------------------------------------------------------
    24532505# USAGE: LegendProbeSingleContour <x> <y>
     
    24612513    SendCmd [list contour3d contourlist $value]
    24622514}
    2463 
    24642515
    24652516#
     
    28192870}
    28202871
    2821 
    28222872itcl::body Rappture::VtkIsosurfaceViewer::MouseOver2Which {} {
    28232873    switch -- $_mouseOver {
     
    28342884    return $which
    28352885}
    2836 
    28372886
    28382887# ----------------------------------------------------------------------
     
    29262975}
    29272976
    2928 
    29292977# ----------------------------------------------------------------------
    29302978# USAGE: ToggleCustomRange
     
    29833031    AdjustSetting -range
    29843032}
    2985 
    29863033
    29873034# ----------------------------------------------------------------------
     
    30193066}
    30203067
    3021 
    30223068#
    30233069# SetCurrentColormap --
     
    30823128        set values $_contourList(reqValues)
    30833129    } else {
    3084         # use the field limits to calculate the contour list values
    3085         foreach { vmin vmax } $_limits($_curFldName) break
    3086 
    3087         # if custom range has been set and are within the field's
    3088         # range, use the custom min and max to generate contour list values
     3130        # if custom range has been set, use the custom min and max
     3131        # to generate contour list values
    30893132        if { $_settings(-customrange) } {
    3090             if { [$itk_component(min) value] > $vmin } {
    3091                 set vmin [$itk_component(min) value]
    3092             }
    3093             if { [$itk_component(max) value] < $vmax } {
    3094                 set vmax [$itk_component(max) value]
    3095             }
     3133            set vmin [$itk_component(min) value]
     3134            set vmax [$itk_component(max) value]
     3135        } else {
     3136            # use the field limits to calculate the contour list values
     3137            foreach { vmin vmax } $_limits($_curFldName) break
    30963138        }
    30973139
     
    31343176    }
    31353177    $itk_component(field) value $_curFldLabel
    3136     if { ![info exists _limits($_curFldName)] } {
    3137         SendCmd "dataset maprange all"
    3138     } else {
    3139         set limits $_limits($_curFldName)
     3178    if { $_settings(-customrange) } {
     3179        set limits [list [$itk_component(min) value] [$itk_component(max) value]]
    31403180        SendCmd "dataset maprange explicit $limits $_curFldName"
    31413181        if { $limits != $_currentLimits } {
     
    31433183            EventuallyChangeContourLevels
    31443184        }
    3145     }
    3146 }
     3185    } else {
     3186        if { ![info exists _limits($_curFldName)] } {
     3187            SendCmd "dataset maprange all"
     3188        } else {
     3189            set limits $_limits($_curFldName)
     3190            SendCmd "dataset maprange explicit $limits $_curFldName"
     3191            if { $limits != $_currentLimits } {
     3192                set _currentLimits $limits
     3193                EventuallyChangeContourLevels
     3194            }
     3195        }
     3196    }
     3197}
  • branches/uiuc_vtk_viewers/gui/scripts/vtkstreamlinesviewer.tcl

    r5053 r5083  
    12381238itcl::body Rappture::VtkStreamlinesViewer::Pick {x y} {
    12391239    foreach tag [CurrentDatasets -visible] {
    1240         SendCmdNoWait "dataset getscalar pixel $x $y $tag"
     1240        SendCmd "dataset getscalar pixel $x $y $tag"
    12411241    }
    12421242}
     
    15221522        foreach {dataobj comp} [split $dataset -] break
    15231523        if { [info exists _dataset2style($dataset)] } {
    1524             SendCmdNoWait \
     1524            SendCmd \
    15251525                "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
    15261526            break;
  • branches/uiuc_vtk_viewers/gui/scripts/vtksurfaceviewer.tcl

    r5053 r5083  
    14751475    if { $_currentColormap != ""  } {
    14761476        set cmap $_currentColormap
    1477         SendCmdNoWait "legend $cmap scalar $_curFldName {} $w $h 0"
     1477        SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
    14781478    }
    14791479}
  • branches/uiuc_vtk_viewers/gui/scripts/vtkvolumeviewer.tcl

    r5053 r5083  
    16401640        foreach {dataobj comp} [split $dataset -] break
    16411641        if { [info exists _dataset2style($dataset)] } {
    1642             SendCmdNoWait \
     1642            SendCmd \
    16431643                "legend2 $_dataset2style($dataset) $w $h"
    16441644                #"legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
Note: See TracChangeset for help on using the changeset viewer.