Changeset 5774 for branches


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

Merge r5758:r5722 from trunk (but remove streamlines length slider for now)

Location:
branches/1.3
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/gui/scripts/drawing.tcl

    r5661 r5774  
    9393    }
    9494    foreach {key path} {
     95        camera  about.camera
     96        color   about.color
    9597        group   about.group
    9698        label   about.label
    97         color   about.color
    98         camera  about.camera
    9999        type    about.type
     100        xdesc   xaxis.description
     101        ydesc   yaxis.description
     102        zdesc   zaxis.description
    100103        xlabel  xaxis.label
    101         xdesc   xaxis.description
     104        ylabel  yaxis.label
     105        zlabel  zaxis.label
     106        xscale  xaxis.scale
     107        yscale  yaxis.scale
     108        zscale  zaxis.scale
    102109        xunits  xaxis.units
    103         xscale  xaxis.scale
     110        yunits  yaxis.units
     111        zunits  zaxis.units
    104112        xmin    xaxis.min
    105113        xmax    xaxis.max
    106         ylabel  yaxis.label
    107         ydesc   yaxis.description
    108         yunits  yaxis.units
    109         yscale  yaxis.scale
    110114        ymin    yaxis.min
    111115        ymax    yaxis.max
    112         zlabel  zaxis.label
    113         zdesc   zaxis.description
    114         zunits  zaxis.units
    115         zscale  zaxis.scale
    116116        zmin    zaxis.min
    117117        zmax    zaxis.max
  • branches/1.3/gui/scripts/field.tcl

    r5759 r5774  
    659659        camera          about.camera
    660660        color           about.color
    661         default         about.default
    662661        group           about.group
    663662        label           about.label
  • branches/1.3/gui/scripts/vtkglyphviewer.tcl

    r5661 r5774  
    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.3/gui/scripts/vtkheightmapviewer.tcl

    r5755 r5774  
    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.3/gui/scripts/vtkimageviewer.tcl

    r5348 r5774  
    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.3/gui/scripts/vtkisosurfaceviewer.tcl

    r5437 r5774  
    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.3/gui/scripts/vtkmeshviewer.tcl

    r5661 r5774  
    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.3/gui/scripts/vtkstreamlinesviewer.tcl

    r5437 r5774  
    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 }
    7171    private method BuildStreamsTab {}
    72     private method BuildVolumeTab {}
     72    private method BuildSurfaceTab {}
    7373    private method DrawLegend {}
    7474    private method Combo { option }
     
    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
     
    135132    private variable _title ""
    136133    private variable _seeds
    137 
    138     private common _downloadPopup;      # download options from popup
    139     private common _hardcopy
    140134    private variable _width 0
    141135    private variable _height 0
     
    145139    private variable _cutplanePending 0
    146140    private variable _legendPending 0
    147     private variable _vectorFields
    148     private variable _scalarFields
    149141    private variable _fields
    150142    private variable _curFldName ""
     
    153145    private variable _numSeeds 200
    154146    private variable _colorMode "vmag";#  Mode of colormap (vmag or scalar)
     147
     148    private common _downloadPopup;      # download options from popup
     149    private common _hardcopy
    155150}
    156151
     
    245240        -streamlinesnumseeds        200
    246241        -streamlinesopacity         100
    247         -streamlinesscale           1
     242        -streamlineslength          70
    248243        -streamlinesseedsvisible    0
    249244        -streamlinesvisible         1
    250         -volumeedges                0
    251         -volumelighting             1
    252         -volumeopacity              40
    253         -volumevisible              1
    254         -volumewireframe            0
     245        -surfaceedges               0
     246        -surfacelighting            1
     247        -surfaceopacity             40
     248        -surfacevisible             1
     249        -surfacewireframe           0
    255250        -xgrid                      0
    256251        -ygrid                      0
     
    330325    Rappture::Tooltip::for $itk_component(zoomout) "Zoom out"
    331326
    332     itk_component add volume {
    333         Rappture::PushButton $f.volume \
     327    itk_component add surface {
     328        Rappture::PushButton $f.surface \
    334329            -onimage [Rappture::icon volume-on] \
    335330            -offimage [Rappture::icon volume-off] \
    336             -variable [itcl::scope _settings(-volumevisible)] \
    337             -command [itcl::code $this AdjustSetting -volumevisible]
    338     }
    339     $itk_component(volume) select
    340     Rappture::Tooltip::for $itk_component(volume) \
    341         "Don't display the volume"
    342     pack $itk_component(volume) -padx 2 -pady 2
     331            -variable [itcl::scope _settings(-surfacevisible)] \
     332            -command [itcl::code $this AdjustSetting -surfacevisible]
     333    }
     334    $itk_component(surface) select
     335    Rappture::Tooltip::for $itk_component(surface) \
     336        "Show/Hide the boundary surface"
     337    pack $itk_component(surface) -padx 2 -pady 2
    343338
    344339    itk_component add streamlines {
     
    351346    $itk_component(streamlines) select
    352347    Rappture::Tooltip::for $itk_component(streamlines) \
    353         "Toggle the streamlines on/off"
     348        "Show/Hide the streamlines"
    354349    pack $itk_component(streamlines) -padx 2 -pady 2
    355350
     
    362357    }
    363358    Rappture::Tooltip::for $itk_component(cutplane) \
    364         "Show/Hide cutplanes"
     359        "Show/Hide the cutplanes"
    365360    pack $itk_component(cutplane) -padx 2 -pady 2
    366361
    367 
    368362    if { [catch {
    369         BuildVolumeTab
     363        BuildSurfaceTab
    370364        BuildStreamsTab
    371365        BuildCutplaneTab
     
    852846    array unset _colormaps
    853847    array unset _seeds
    854     array unset _dataset2style
    855848}
    856849
     
    10131006    }
    10141007    if {"" != $_first} {
    1015         set location [$_first hints camera]
    1016         if { $location != "" } {
    1017             array set view $location
    1018         }
    10191008        foreach axis { x y z } {
    10201009            set label [$_first hints ${axis}label]
     
    10311020        array unset _fields
    10321021        set _curFldName ""
     1022        set _curFldLabel ""
    10331023        foreach cname [$_first components] {
    10341024            foreach fname [$_first fieldnames $cname] {
     
    10471037                    -command [itcl::code $this Combo invoke]
    10481038                set _fields($fname) [list $label $units $components]
    1049                 if { $_curFldName == "" } {
     1039                if { $_curFldName == "" && $components == 3 } {
    10501040                    set _curFldName $fname
    10511041                    set _curFldLabel $label
     
    10611051            -streamlineslighting \
    10621052            -streamlinescolormap -field \
    1063             -volumevisible -volumeedges -volumelighting -volumeopacity \
    1064             -volumewireframe \
     1053            -surfacevisible -surfaceedges -surfacelighting -surfaceopacity \
     1054            -surfacewireframe \
    10651055            -cutplanevisible \
    10661056            -cutplanexposition -cutplaneyposition -cutplanezposition \
     
    13431333            set bool $_settings($what)
    13441334            SendCmd "cutplane visible $bool"
     1335            if { $bool } {
     1336                Rappture::Tooltip::for $itk_component(cutplane) \
     1337                    "Hide the cutplanes"
     1338            } else {
     1339                Rappture::Tooltip::for $itk_component(cutplane) \
     1340                    "Show the cutplanes"
     1341            }
    13451342        }
    13461343        "-cutplanewireframe" {
     
    14391436            set colormap [$itk_component(colormap) value]
    14401437            set _settings($what) $colormap
    1441             foreach dataset [CurrentDatasets -visible $_first] {
    1442                 foreach {dataobj comp} [split $dataset -] break
    1443                 ChangeColormap $dataobj $comp $colormap
    1444             }
     1438            SetCurrentColormap $colormap
    14451439            set _legendPending 1
    14461440        }
     
    14501444            SendCmd "streamlines opacity $sval"
    14511445        }
    1452         "-streamlinesscale" {
     1446        "-streamlineslength" {
    14531447            set val $_settings($what)
    1454             set sval [expr { 0.01 * double($val) }]
    1455             SendCmd "streamlines scale $sval $sval $sval"
     1448            set sval [expr { (0.01 * double($val)) / 0.7 }]
     1449            foreach axis {x y z} {
     1450                foreach {min max} $_limits($axis) break
     1451                set ${axis}len [expr double($max) - double($min)]
     1452            }
     1453            set length [expr { $sval * ($xlen + $ylen + $zlen) } ]
     1454            SendCmd "streamlines length $length"
    14561455        }
    14571456        "-streamlineslighting" {
     
    14591458            SendCmd "streamlines lighting $bool"
    14601459        }
    1461         "-volumeopacity" {
     1460        "-surfaceopacity" {
    14621461            set val $_settings($what)
    14631462            set sval [expr { 0.01 * double($val) }]
    14641463            SendCmd "polydata opacity $sval"
    14651464        }
    1466         "-volumewireframe" {
     1465        "-surfacewireframe" {
    14671466            set bool $_settings($what)
    14681467            SendCmd "polydata wireframe $bool"
    14691468        }
    1470         "-volumevisible" {
     1469        "-surfacevisible" {
    14711470            set bool $_settings($what)
    14721471            SendCmd "polydata visible $bool"
    14731472            if { $bool } {
    1474                 Rappture::Tooltip::for $itk_component(volume) \
    1475                     "Hide the volume"
     1473                Rappture::Tooltip::for $itk_component(surface) \
     1474                    "Hide the boundary surface"
    14761475            } else {
    1477                 Rappture::Tooltip::for $itk_component(volume) \
    1478                     "Show the volume"
    1479             }
    1480         }
    1481         "-volumelighting" {
     1476                Rappture::Tooltip::for $itk_component(surface) \
     1477                    "Show the boundary surface"
     1478            }
     1479        }
     1480        "-surfacelighting" {
    14821481            set bool $_settings($what)
    14831482            SendCmd "polydata lighting $bool"
    14841483        }
    1485         "-volumeedges" {
     1484        "-surfaceedges" {
    14861485            set bool $_settings($what)
    14871486            SendCmd "polydata edges $bool"
     
    15141513    }
    15151514    # Set the legend on the first streamlines dataset.
    1516     foreach dataset [CurrentDatasets -visible $_first] {
    1517         foreach {dataobj comp} [split $dataset -] break
    1518         if { [info exists _dataset2style($dataset)] } {
    1519             SendCmd \
    1520                 "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
    1521             break;
    1522         }
    1523     }
    1524 }
    1525 
    1526 #
    1527 # ChangeColormap --
    1528 #
    1529 itcl::body Rappture::VtkStreamlinesViewer::ChangeColormap {dataobj comp color} {
    1530     set tag $dataobj-$comp
    1531     if { ![info exist _style($tag)] } {
    1532         error "no initial colormap"
    1533     }
    1534     array set style $_style($tag)
    1535     set style(-color) $color
    1536     set _style($tag) [array get style]
    1537     SetColormap $dataobj $comp
    1538 }
    1539 
    1540 #
    1541 # SetColormap --
    1542 #
    1543 itcl::body Rappture::VtkStreamlinesViewer::SetColormap { dataobj comp } {
    1544     array set style {
    1545         -color BCGYR
    1546         -levels 6
    1547         -opacity 1.0
    1548     }
    1549     set tag $dataobj-$comp
    1550     if { ![info exists _initialStyle($tag)] } {
    1551         # Save the initial component style.
    1552         set _initialStyle($tag) [$dataobj style $comp]
    1553     }
    1554 
    1555     # Override defaults with initial style defined in xml.
    1556     array set style $_initialStyle($tag)
    1557 
    1558     if { ![info exists _style($tag)] } {
    1559         set _style($tag) [array get style]
    1560     }
    1561     # Override initial style with current style.
    1562     array set style $_style($tag)
    1563 
    1564     set name "$style(-color):$style(-levels):$style(-opacity)"
     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.
    15651531    if { ![info exists _colormaps($name)] } {
    1566         BuildColormap $name [array get style]
     1532        BuildColormap $name
    15671533        set _colormaps($name) 1
    15681534    }
    1569     if { ![info exists _dataset2style($tag)] ||
    1570          $_dataset2style($tag) != $name } {
    1571         SendCmd "streamlines colormap $name $tag"
    1572         SendCmd "cutplane colormap $name $tag"
    1573         set _dataset2style($tag) $name
    1574     }
     1535    set _currentColormap $name
     1536    SendCmd "streamlines colormap $_currentColormap"
     1537    SendCmd "cutplane colormap $_currentColormap"
    15751538}
    15761539
     
    15781541# BuildColormap --
    15791542#
    1580 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name styles } {
    1581     array set style $styles
    1582     set cmap [ColorsToColormap $style(-color)]
     1543itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name } {
     1544    set cmap [ColorsToColormap $name]
    15831545    if { [llength $cmap] == 0 } {
    15841546        set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
    15851547    }
    1586     if { ![info exists _settings(-volumeopacity)] } {
    1587         set _settings(-volumeopacity) $style(-opacity)
    1588     }
    1589     set max $_settings(-volumeopacity)
    1590 
    15911548    set amap "0.0 1.0 1.0 1.0"
    15921549    SendCmd "colormap add $name { $cmap } { $amap }"
     
    16151572}
    16161573
    1617 itcl::body Rappture::VtkStreamlinesViewer::BuildVolumeTab {} {
     1574itcl::body Rappture::VtkStreamlinesViewer::BuildSurfaceTab {} {
    16181575
    16191576    set fg [option get $itk_component(hull) font Font]
     
    16211578
    16221579    set inner [$itk_component(main) insert end \
    1623         -title "Volume Settings" \
     1580        -title "Boundary Surface Settings" \
    16241581        -icon [Rappture::icon volume-on]]
    16251582    $inner configure -borderwidth 4
    16261583
    1627     checkbutton $inner.volume \
    1628         -text "Show Volume" \
    1629         -variable [itcl::scope _settings(-volumevisible)] \
    1630         -command [itcl::code $this AdjustSetting -volumevisible] \
     1584    checkbutton $inner.surface \
     1585        -text "Show Surface" \
     1586        -variable [itcl::scope _settings(-surfacevisible)] \
     1587        -command [itcl::code $this AdjustSetting -surfacevisible] \
    16311588        -font "Arial 9"
    16321589
    16331590    checkbutton $inner.wireframe \
    16341591        -text "Show Wireframe" \
    1635         -variable [itcl::scope _settings(-volumewireframe)] \
    1636         -command [itcl::code $this AdjustSetting -volumewireframe] \
     1592        -variable [itcl::scope _settings(-surfacewireframe)] \
     1593        -command [itcl::code $this AdjustSetting -surfacewireframe] \
    16371594        -font "Arial 9"
    16381595
    16391596    checkbutton $inner.lighting \
    16401597        -text "Enable Lighting" \
    1641         -variable [itcl::scope _settings(-volumelighting)] \
    1642         -command [itcl::code $this AdjustSetting -volumelighting] \
     1598        -variable [itcl::scope _settings(-surfacelighting)] \
     1599        -command [itcl::code $this AdjustSetting -surfacelighting] \
    16431600        -font "Arial 9"
    16441601
    16451602    checkbutton $inner.edges \
    16461603        -text "Show Edges" \
    1647         -variable [itcl::scope _settings(-volumeedges)] \
    1648         -command [itcl::code $this AdjustSetting -volumeedges] \
     1604        -variable [itcl::scope _settings(-surfaceedges)] \
     1605        -command [itcl::code $this AdjustSetting -surfaceedges] \
    16491606        -font "Arial 9"
    16501607
    16511608    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    16521609    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1653         -variable [itcl::scope _settings(-volumeopacity)] \
     1610        -variable [itcl::scope _settings(-surfaceopacity)] \
    16541611        -width 10 \
    16551612        -showvalue off \
    1656         -command [itcl::code $this AdjustSetting -volumeopacity]
     1613        -command [itcl::code $this AdjustSetting -surfaceopacity]
    16571614
    16581615    blt::table $inner \
     
    17201677        -command [itcl::code $this AdjustSetting -streamlinesnumseeds]
    17211678
    1722     label $inner.scale_l -text "Scale" -font "Arial 9"
     1679    label $inner.scale_l -text "Length" -font "Arial 9"
    17231680    ::scale $inner.scale -from 1 -to 100 -orient horizontal \
    1724         -variable [itcl::scope _settings(-streamlinesscale)] \
     1681        -variable [itcl::scope _settings(-streamlineslength)] \
    17251682        -width 10 \
    17261683        -showvalue off \
    1727         -command [itcl::code $this AdjustSetting -streamlinesscale]
     1684        -command [itcl::code $this AdjustSetting -streamlineslength]
    17281685
    17291686    label $inner.field_l -text "Color by" -font "Arial 9"
     
    17531710        3,0 $inner.opacity_l   -anchor w -pady 2  \
    17541711        3,1 $inner.opacity     -fill x -pady 2 \
    1755         5,0 $inner.lighting    -anchor w -pady 2 -cspan 2 \
    1756         6,0 $inner.seeds       -anchor w -pady 2 -cspan 2 \
    1757         7,0 $inner.density_l   -anchor w -pady 2  \
    1758         7,1 $inner.density     -fill x   -pady 2  \
     1712        4,0 $inner.lighting    -anchor w -pady 2 -cspan 2 \
     1713        5,0 $inner.seeds       -anchor w -pady 2 -cspan 2 \
     1714        6,0 $inner.density_l   -anchor w -pady 2  \
     1715        6,1 $inner.density     -fill x   -pady 2  \
    17591716
    17601717    blt::table configure $inner r* c* -resize none
    1761     blt::table configure $inner r10 c1 c2 -resize expand
     1718    blt::table configure $inner r7 c1 c2 -resize expand
    17621719}
    17631720
     
    21352092    # Parse style string.
    21362093    set tag $dataobj-$comp
    2137     set style [$dataobj style $comp]
    2138     array set settings {
    2139         -color \#808080
     2094    array set style {
     2095        -color BCGYR
     2096        -constcolor white
     2097        -edgecolor black
    21402098        -edges 0
    2141         -edgecolor black
     2099        -lighting 1
    21422100        -linewidth 1.0
    2143         -opacity 0.4
    2144         -wireframe 0
    2145         -lighting 1
     2101        -mode lines
     2102        -numseeds 200
     2103        -opacity 1.0
    21462104        -seeds 1
    21472105        -seedcolor white
     2106        -streamlineslength 0.7
     2107        -surfacecolor white
     2108        -surfaceedgecolor black
     2109        -surfaceedges 0
     2110        -surfacelighting 1
     2111        -surfaceopacity 0.4
     2112        -surfacevisible 1
     2113        -surfacewireframe 0
    21482114        -visible 1
    21492115    }
     2116    array set style [$dataobj style $comp]
    21502117    if { $dataobj != $_first } {
    2151         set settings(-opacity) 1
    2152     }
    2153     array set settings $style
     2118        set style(-opacity) 1.0
     2119    }
    21542120    StartBufferingCommands
    21552121    SendCmd "streamlines add $tag"
    2156     SendCmd "streamlines seed visible off $tag"
     2122    SendCmd "streamlines color [Color2RGB $style(-constcolor)] $tag"
     2123    SendCmd "streamlines edges $style(-edges) $tag"
     2124    SendCmd "streamlines linecolor [Color2RGB $style(-edgecolor)] $tag"
     2125    SendCmd "streamlines linewidth $style(-linewidth) $tag"
     2126    SendCmd "streamlines lighting $style(-lighting) $tag"
     2127    SendCmd "streamlines opacity $style(-opacity) $tag"
     2128    SendCmd "streamlines seed color [Color2RGB $style(-seedcolor)] $tag"
     2129    SendCmd "streamlines seed visible $style(-seeds) $tag"
     2130    SendCmd "streamlines visible $style(-visible) $tag"
    21572131    set seeds [$dataobj hints seeds]
    21582132    if { $seeds != "" && ![info exists _seeds($dataobj)] } {
    21592133        set length [string length $seeds]
    2160         SendCmd "streamlines seed fmesh 200 data follows $length $tag"
     2134        SendCmd "streamlines seed fmesh $style(-numseeds) data follows $length $tag"
    21612135        SendData $seeds
    21622136        set _seeds($dataobj) 1
    21632137    }
     2138    set _settings(-streamlineslighting) $style(-lighting)
     2139    $itk_component(streammode) value $style(-mode)
     2140    AdjustSetting -streamlinesmode
     2141    set _settings(-streamlinesnumseeds) $style(-numseeds)
     2142    set _settings(-streamlinesopacity) [expr $style(-opacity) * 100.0]
     2143    set _settings(-streamlineslength) [expr $style(-streamlineslength) * 100.0]
     2144    set _settings(-streamlinesseedsvisible) $style(-seeds)
     2145    set _settings(-streamlinesvisible) $style(-visible)
     2146
    21642147    SendCmd "cutplane add $tag"
     2148
    21652149    SendCmd "polydata add $tag"
     2150    SendCmd "polydata color [Color2RGB $style(-surfacecolor)] $tag"
    21662151    SendCmd "polydata colormode constant {} $tag"
    2167     set _settings(-volumeedges) $settings(-edges)
    2168     set _settings(-volumelighting) $settings(-lighting)
    2169     set _settings(-volumeopacity) $settings(-opacity)
    2170     set _settings(-volumewireframe) $settings(-wireframe)
    2171     set _settings(-volumeopacity) [expr $settings(-opacity) * 100.0]
     2152    SendCmd "polydata edges $style(-surfaceedges) $tag"
     2153    SendCmd "polydata linecolor [Color2RGB $style(-surfaceedgecolor)] $tag"
     2154    SendCmd "polydata lighting $style(-surfacelighting) $tag"
     2155    SendCmd "polydata opacity $style(-surfaceopacity) $tag"
     2156    SendCmd "polydata wireframe $style(-surfacewireframe) $tag"
     2157    SendCmd "polydata visible $style(-surfacevisible) $tag"
     2158    set _settings(-surfaceedges) $style(-surfaceedges)
     2159    set _settings(-surfacelighting) $style(-surfacelighting)
     2160    set _settings(-surfaceopacity) [expr $style(-surfaceopacity) * 100.0]
     2161    set _settings(-surfacewireframe) $style(-surfacewireframe)
     2162    set _settings(-surfacevisible) $style(-surfacevisible)
    21722163    StopBufferingCommands
    2173     SetColormap $dataobj $comp
     2164    SetCurrentColormap $style(-color)
     2165    $itk_component(colormap) value $style(-color)
    21742166}
    21752167
  • branches/1.3/gui/scripts/vtksurfaceviewer.tcl

    r5364 r5774  
    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.3/gui/scripts/vtkviewer.tcl

    r5735 r5774  
    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.3/gui/scripts/vtkvolumeviewer.tcl

    r5470 r5774  
    10291029    }
    10301030    if {"" != $_first} {
    1031         set location [$_first hints camera]
    1032         if { $location != "" } {
    1033             array set view $location
    1034         }
    1035 
    10361031        foreach axis { x y z } {
    10371032            set label [$_first hints ${axis}label]
Note: See TracChangeset for help on using the changeset viewer.