Changeset 5773 for branches


Ignore:
Timestamp:
Jul 21, 2015, 1:06:22 PM (9 years ago)
Author:
ldelgass
Message:

merge r5766:r5772 from trunk

Location:
branches/1.4
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4

  • branches/1.4/gui/scripts/vtkglyphviewer.tcl

    r5666 r5773  
    132132    private variable _start 0
    133133    private variable _title ""
    134 
    135     private common _downloadPopup;      # download options from popup
    136     private common _hardcopy
    137134    private variable _width 0
    138135    private variable _height 0
     
    143140    private variable _field      ""
    144141    private variable _colorMode "vmag"; #  Mode of colormap (vmag or scalar)
    145     private variable _fieldNames {}
    146142    private variable _fields
    147143    private variable _curFldName ""
    148144    private variable _curFldLabel ""
     145
     146    private common _downloadPopup;      # download options from popup
     147    private common _hardcopy
    149148}
    150149
     
    15521551    }
    15531552    # Set the legend on the first heightmap dataset.
    1554     if { $_currentColormap != ""  } {
     1553    if { $_currentColormap != "" } {
    15551554        set cmap $_currentColormap
    15561555        if { ![info exists _colormaps($cmap)] } {
  • branches/1.4/gui/scripts/vtkheightmapviewer.tcl

    r5756 r5773  
    143143    private variable _isolines
    144144    private variable _contourList ""
    145 
    146     private common _downloadPopup;      # download options from popup
    147     private common _hardcopy
    148145    private variable _width 0
    149146    private variable _height 0
     
    153150    private variable _rotatePending 0
    154151    private variable _legendPending 0
    155     private variable _fieldNames {}
    156152    private variable _fields
    157153    private variable _curFldName ""
    158154    private variable _curFldLabel ""
    159155    private variable _colorMode "scalar";#  Mode of colormap (vmag or scalar)
     156
     157    private common _downloadPopup;      # download options from popup
     158    private common _hardcopy
    160159}
    161160
     
    17241723    }
    17251724    # Set the legend on the first heightmap dataset.
    1726     if { $_currentColormap != ""  } {
     1725    if { $_currentColormap != "" } {
    17271726        set cmap $_currentColormap
    17281727        if { ![info exists _colormaps($cmap)] } {
  • branches/1.4/gui/scripts/vtkimageviewer.tcl

    r5349 r5773  
    138138    private variable _isolines
    139139    private variable _contourList ""
    140 
    141     private common _downloadPopup;      # download options from popup
    142     private common _hardcopy
    143140    private variable _width 0
    144141    private variable _height 0
     
    148145    private variable _rotatePending 0
    149146    private variable _legendPending 0
    150     private variable _fieldNames {}
    151147    private variable _fields
    152148    private variable _curFldName ""
    153149    private variable _curFldLabel ""
    154150    private variable _colorMode "scalar";#  Mode of colormap (vmag or scalar)
     151
     152    private common _downloadPopup;      # download options from popup
     153    private common _hardcopy
    155154}
    156155
  • branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl

    r5388 r5773  
    153153    private variable _currentLimits ""
    154154    private variable _widget
    155 
    156     private common _downloadPopup;      # download options from popup
    157     private common _hardcopy
    158155    private variable _width 0
    159156    private variable _height 0
     
    164161    private variable _field      ""
    165162    private variable _colorMode "scalar";   #  Mode of colormap (vmag or scalar)
    166     private variable _fieldNames {}
    167163    private variable _fields
    168164    private variable _curFldName ""
    169165    private variable _curFldLabel ""
    170 
    171166    private variable _mouseOver "";     # what called LegendRangeAction, vmin or vmax
    172167    private variable _customRangeClick 1;   # what called ToggleCustomRange
     168
     169    private common _downloadPopup;      # download options from popup
     170    private common _hardcopy
    173171}
    174172
     
    16701668    }
    16711669    # Set the legend on the first isosurface dataset.
    1672     if { $_currentColormap != ""  } {
     1670    if { $_currentColormap != "" } {
    16731671        set cmap $_currentColormap
    16741672        if { ![info exists _colormaps($cmap)] } {
  • branches/1.4/gui/scripts/vtkmeshviewer.tcl

    r5660 r5773  
    113113    private variable _start 0
    114114    private variable _title ""
    115 
    116     private common _downloadPopup;      # download options from popup
    117     private common _hardcopy
    118115    private variable _width 0
    119116    private variable _height 0
     
    123120    private variable _rotateDelay 150
    124121    private variable _opacityDelay 150
     122
     123    private common _downloadPopup;      # download options from popup
     124    private common _hardcopy
    125125}
    126126
     
    860860    }
    861861    if {"" != $_first} {
    862         set location [$_first hints camera]
    863         if { $location != "" } {
    864             array set view $location
    865         }
    866 
    867862        foreach axis { x y z } {
    868863            set label [$_first label ${axis}]
  • branches/1.4/gui/scripts/vtkstreamlinesviewer.tcl

    r5766 r5773  
    6666    private method BuildAxisTab {}
    6767    private method BuildCameraTab {}
    68     private method BuildColormap { name colors }
     68    private method BuildColormap { name }
    6969    private method BuildCutplaneTab {}
    7070    private method BuildDownloadPopup { widget command }
     
    102102    private method RequestLegend {}
    103103    private method Rotate {option x y}
    104     private method SetColormap { dataobj comp }
    105     private method ChangeColormap { dataobj comp color }
     104    private method SetCurrentColormap { color }
    106105    private method SetLegendTip { x y }
    107106    private method SetObjectStyle { dataobj comp }
     
    121120    private variable _colormaps    ;    # contains all the colormaps
    122121                                   ;    # in the server.
    123     private variable _dataset2style    ;# maps dataobj-component to transfunc
     122    private variable _currentColormap ""
    124123
    125124    private variable _click        ;    # info used for rotate operations
     
    127126    private variable _view         ;    # view params for 3D view
    128127    private variable _settings
    129     private variable _style;            # Array of current component styles.
    130     private variable _initialStyle;     # Array of initial component styles.
    131128    private variable _reset 1;          # Connection to server has been reset.
    132129
     
    849846    array unset _colormaps
    850847    array unset _seeds
    851     array unset _dataset2style
    852848}
    853849
     
    10101006    }
    10111007    if {"" != $_first} {
    1012         set location [$_first hints camera]
    1013         if { $location != "" } {
    1014             array set view $location
    1015         }
    10161008        foreach axis { x y z } {
    10171009            set label [$_first hints ${axis}label]
     
    14441436            set colormap [$itk_component(colormap) value]
    14451437            set _settings($what) $colormap
    1446             foreach dataset [CurrentDatasets -visible $_first] {
    1447                 foreach {dataobj comp} [split $dataset -] break
    1448                 ChangeColormap $dataobj $comp $colormap
    1449             }
     1438            SetCurrentColormap $colormap
    14501439            set _legendPending 1
    14511440        }
     
    15241513    }
    15251514    # Set the legend on the first streamlines dataset.
    1526     foreach dataset [CurrentDatasets -visible $_first] {
    1527         foreach {dataobj comp} [split $dataset -] break
    1528         if { [info exists _dataset2style($dataset)] } {
    1529             SendCmd \
    1530                 "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
    1531             break;
    1532         }
    1533     }
    1534 }
    1535 
    1536 #
    1537 # ChangeColormap --
    1538 #
    1539 itcl::body Rappture::VtkStreamlinesViewer::ChangeColormap {dataobj comp color} {
    1540     set tag $dataobj-$comp
    1541     if { ![info exist _style($tag)] } {
    1542         error "no initial colormap"
    1543     }
    1544     array set style $_style($tag)
    1545     set style(-color) $color
    1546     set _style($tag) [array get style]
    1547     SetColormap $dataobj $comp
    1548 }
    1549 
    1550 #
    1551 # SetColormap --
    1552 #
    1553 itcl::body Rappture::VtkStreamlinesViewer::SetColormap { dataobj comp } {
    1554     array set style {
    1555         -color BCGYR
    1556     }
    1557     set tag $dataobj-$comp
    1558     if { ![info exists _initialStyle($tag)] } {
    1559         # Save the initial component style.
    1560         set _initialStyle($tag) [$dataobj style $comp]
    1561     }
    1562 
    1563     # Override defaults with initial style defined in xml.
    1564     array set style $_initialStyle($tag)
    1565 
    1566     if { ![info exists _style($tag)] } {
    1567         set _style($tag) [array get style]
    1568     }
    1569     # Override initial style with current style.
    1570     array set style $_style($tag)
    1571 
    1572     set name "$style(-color)"
     1515    if { $_currentColormap != "" } {
     1516        set cmap $_currentColormap
     1517        if { ![info exists _colormaps($cmap)] } {
     1518            BuildColormap $cmap
     1519            set _colormaps($cmap) 1
     1520        }
     1521        #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1522        SendCmd "legend2 $cmap $w $h"
     1523    }
     1524}
     1525
     1526#
     1527# SetCurrentColormap --
     1528#
     1529itcl::body Rappture::VtkStreamlinesViewer::SetCurrentColormap { name } {
     1530    # Keep track of the colormaps that we build.
    15731531    if { ![info exists _colormaps($name)] } {
    1574         BuildColormap $name [array get style]
     1532        BuildColormap $name
    15751533        set _colormaps($name) 1
    15761534    }
    1577     if { ![info exists _dataset2style($tag)] ||
    1578          $_dataset2style($tag) != $name } {
    1579         SendCmd "streamlines colormap $name $tag"
    1580         SendCmd "cutplane colormap $name $tag"
    1581         set _dataset2style($tag) $name
    1582     }
     1535    set _currentColormap $name
     1536    SendCmd "streamlines colormap $_currentColormap"
     1537    SendCmd "cutplane colormap $_currentColormap"
    15831538}
    15841539
     
    15861541# BuildColormap --
    15871542#
    1588 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name styles } {
    1589     array set style $styles
    1590     set cmap [ColorsToColormap $style(-color)]
     1543itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name } {
     1544    set cmap [ColorsToColormap $name]
    15911545    if { [llength $cmap] == 0 } {
    15921546        set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
     
    21402094    # Parse style string.
    21412095    set tag $dataobj-$comp
    2142     set style [$dataobj style $comp]
    2143     array set settings {
     2096    array set style {
    21442097        -color BCGYR
    21452098        -constcolor white
     
    21632116        -visible 1
    21642117    }
     2118    array set style [$dataobj style $comp]
    21652119    if { $dataobj != $_first } {
    2166         set settings(-opacity) 1
    2167     }
    2168     array set settings $style
     2120        set style(-opacity) 1.0
     2121    }
    21692122    StartBufferingCommands
    21702123    SendCmd "streamlines add $tag"
    2171     SendCmd "streamlines color [Color2RGB $settings(-constcolor)] $tag"
    2172     SendCmd "streamlines edges $settings(-edges) $tag"
    2173     SendCmd "streamlines linecolor [Color2RGB $settings(-edgecolor)] $tag"
    2174     SendCmd "streamlines linewidth $settings(-linewidth) $tag"
    2175     SendCmd "streamlines lighting $settings(-lighting) $tag"
    2176     SendCmd "streamlines opacity $settings(-opacity) $tag"
    2177     SendCmd "streamlines seed color [Color2RGB $settings(-seedcolor)] $tag"
    2178     SendCmd "streamlines seed visible $settings(-seeds) $tag"
    2179     SendCmd "streamlines visible $settings(-visible) $tag"
     2124    SendCmd "streamlines color [Color2RGB $style(-constcolor)] $tag"
     2125    SendCmd "streamlines edges $style(-edges) $tag"
     2126    SendCmd "streamlines linecolor [Color2RGB $style(-edgecolor)] $tag"
     2127    SendCmd "streamlines linewidth $style(-linewidth) $tag"
     2128    SendCmd "streamlines lighting $style(-lighting) $tag"
     2129    SendCmd "streamlines opacity $style(-opacity) $tag"
     2130    SendCmd "streamlines seed color [Color2RGB $style(-seedcolor)] $tag"
     2131    SendCmd "streamlines seed visible $style(-seeds) $tag"
     2132    SendCmd "streamlines visible $style(-visible) $tag"
    21802133    set seeds [$dataobj hints seeds]
    21812134    if { $seeds != "" && ![info exists _seeds($dataobj)] } {
    21822135        set length [string length $seeds]
    2183         SendCmd "streamlines seed fmesh $settings(-numseeds) data follows $length $tag"
     2136        SendCmd "streamlines seed fmesh $style(-numseeds) data follows $length $tag"
    21842137        SendData $seeds
    21852138        set _seeds($dataobj) 1
    21862139    }
    2187     set _settings(-streamlineslighting) $settings(-lighting)
    2188     $itk_component(streammode) value $settings(-mode)
     2140    set _settings(-streamlineslighting) $style(-lighting)
     2141    $itk_component(streammode) value $style(-mode)
    21892142    AdjustSetting -streamlinesmode
    2190     set _settings(-streamlinesnumseeds) $settings(-numseeds)
    2191     set _settings(-streamlinesopacity) [expr $settings(-opacity) * 100.0]
    2192     set _settings(-streamlineslength) [expr $settings(-streamlineslength) * 100.0]
    2193     set _settings(-streamlinesseedsvisible) $settings(-seeds)
    2194     set _settings(-streamlinesvisible) $settings(-visible)
     2143    set _settings(-streamlinesnumseeds) $style(-numseeds)
     2144    set _settings(-streamlinesopacity) [expr $style(-opacity) * 100.0]
     2145    set _settings(-streamlineslength) [expr $style(-streamlineslength) * 100.0]
     2146    set _settings(-streamlinesseedsvisible) $style(-seeds)
     2147    set _settings(-streamlinesvisible) $style(-visible)
    21952148
    21962149    SendCmd "cutplane add $tag"
    21972150
    21982151    SendCmd "polydata add $tag"
    2199     SendCmd "polydata color [Color2RGB $settings(-surfacecolor)] $tag"
     2152    SendCmd "polydata color [Color2RGB $style(-surfacecolor)] $tag"
    22002153    SendCmd "polydata colormode constant {} $tag"
    2201     SendCmd "polydata edges $settings(-surfaceedges) $tag"
    2202     SendCmd "polydata linecolor [Color2RGB $settings(-surfaceedgecolor)] $tag"
    2203     SendCmd "polydata lighting $settings(-surfacelighting) $tag"
    2204     SendCmd "polydata opacity $settings(-surfaceopacity) $tag"
    2205     SendCmd "polydata wireframe $settings(-surfacewireframe) $tag"
    2206     SendCmd "polydata visible $settings(-surfacevisible) $tag"
    2207     set _settings(-surfaceedges) $settings(-surfaceedges)
    2208     set _settings(-surfacelighting) $settings(-surfacelighting)
    2209     set _settings(-surfaceopacity) [expr $settings(-surfaceopacity) * 100.0]
    2210     set _settings(-surfacewireframe) $settings(-surfacewireframe)
    2211     set _settings(-surfacevisible) $settings(-surfacevisible)
     2154    SendCmd "polydata edges $style(-surfaceedges) $tag"
     2155    SendCmd "polydata linecolor [Color2RGB $style(-surfaceedgecolor)] $tag"
     2156    SendCmd "polydata lighting $style(-surfacelighting) $tag"
     2157    SendCmd "polydata opacity $style(-surfaceopacity) $tag"
     2158    SendCmd "polydata wireframe $style(-surfacewireframe) $tag"
     2159    SendCmd "polydata visible $style(-surfacevisible) $tag"
     2160    set _settings(-surfaceedges) $style(-surfaceedges)
     2161    set _settings(-surfacelighting) $style(-surfacelighting)
     2162    set _settings(-surfaceopacity) [expr $style(-surfaceopacity) * 100.0]
     2163    set _settings(-surfacewireframe) $style(-surfacewireframe)
     2164    set _settings(-surfacevisible) $style(-surfacevisible)
    22122165    StopBufferingCommands
    2213     SetColormap $dataobj $comp
    2214     $itk_component(colormap) value $settings(-color)
     2166    SetCurrentColormap $style(-color)
     2167    $itk_component(colormap) value $style(-color)
    22152168}
    22162169
  • branches/1.4/gui/scripts/vtksurfaceviewer.tcl

    r5349 r5773  
    134134    private variable _isolines
    135135    private variable _contourList ""
    136 
    137     private common _downloadPopup;      # download options from popup
    138     private common _hardcopy
    139136    private variable _width 0
    140137    private variable _height 0
     
    143140    private variable _legendPending 0
    144141    private variable _field      ""
    145     private variable _colorMode "scalar";        #  Mode of colormap (vmag or scalar)
    146     private variable _fieldNames {}
     142    private variable _colorMode "scalar"; #  Mode of colormap (vmag or scalar)
    147143    private variable _fields
    148144    private variable _curFldName ""
    149145    private variable _curFldLabel ""
     146
     147    private common _downloadPopup;      # download options from popup
     148    private common _hardcopy
    150149}
    151150
     
    14651464    }
    14661465    # Set the legend on the first heightmap dataset.
    1467     if { $_currentColormap != ""  } {
     1466    if { $_currentColormap != "" } {
    14681467        set cmap $_currentColormap
    14691468        if { ![info exists _colormaps($cmap)] } {
  • branches/1.4/gui/scripts/vtkviewer.tcl

    r5671 r5773  
    6767    private method BuildAxisTab {}
    6868    private method BuildCameraTab {}
    69     private method BuildColormap { name styles }
     69    private method BuildColormap { name }
    7070    private method BuildCutawayTab {}
    7171    private method BuildDownloadPopup { widget command }
     
    147147    private variable _start 0
    148148    private variable _title ""
    149 
    150     private common _downloadPopup;      # download options from popup
    151     private common _hardcopy
    152149    private variable _width 0
    153150    private variable _height 0
     
    162159    private variable _rotateDelay 150
    163160    private variable _scaleDelay 100
     161
     162    private common _downloadPopup;      # download options from popup
     163    private common _hardcopy
    164164}
    165165
     
    10901090    }
    10911091    if {"" != $_first} {
    1092         set location [$_first hints camera]
    1093         if { $location != "" } {
    1094             array set view $location
    1095         }
    1096 
    10971092        foreach axis { x y z } {
    10981093            set label [$_first hints ${axis}label]
     
    18081803    array set style {
    18091804        -color BCGYR
    1810         -levels 6
    1811         -opacity 1.0
    18121805    }
    18131806    if {[$dataobj type $comp] == "molecule"} {
     
    18291822    array set style $_style($tag)
    18301823
    1831     if { $style(-color) == "elementDefault" } {
    1832         set name "$style(-color)"
    1833     } else {
    1834         set name "$style(-color):$style(-levels):$style(-opacity)"
    1835     }
     1824    set name "$style(-color)"
    18361825    if { ![info exists _colormaps($name)] } {
    1837         BuildColormap $name [array get style]
     1826        BuildColormap $name
    18381827        set _colormaps($name) 1
    18391828    }
     
    18581847# BuildColormap --
    18591848#
    1860 itcl::body Rappture::VtkViewer::BuildColormap { name styles } {
    1861     if { $name ==  "elementDefault" } {
     1849itcl::body Rappture::VtkViewer::BuildColormap { name } {
     1850    if { $name == "elementDefault" } {
    18621851        return
    18631852    }
    1864     array set style $styles
    1865     set cmap [ColorsToColormap $style(-color)]
     1853    set cmap [ColorsToColormap $name]
    18661854    if { [llength $cmap] == 0 } {
    18671855        set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
    18681856    }
    1869     if { ![info exists _settings(polydata-opacity)] } {
    1870         set _settings(polydata-opacity) $style(-opacity)
    1871     }
    1872     set max $_settings(polydata-opacity)
    1873 
    18741857    set amap "0.0 1.0 1.0 1.0"
    18751858    SendCmd "colormap add $name { $cmap } { $amap }"
  • branches/1.4/gui/scripts/vtkvolumeviewer.tcl

    r5733 r5773  
    10351035    }
    10361036    if {"" != $_first} {
    1037         set location [$_first hints camera]
    1038         if { $location != "" } {
    1039             array set view $location
    1040         }
    1041 
    10421037        foreach axis { x y z } {
    10431038            set label [$_first hints ${axis}label]
Note: See TracChangeset for help on using the changeset viewer.