Ignore:
Timestamp:
Jul 27, 2012, 12:46:47 PM (12 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

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

    r3121 r3122  
    8888    private method BuildCutawayTab {}
    8989    private method BuildDownloadPopup { widget command }
    90     private method BuildVolumeTab {}
     90    private method BuildMeshTab {}
    9191    private method BuildMoleculeTab {}
    9292    private method ConvertToVtkData { dataobj comp }
     
    242242        molecule-wireframe       0
    243243        molecule-palette        rainbow
    244         volume-edges           0
    245         volume-lighting        1
    246         volume-opacity         40
    247         volume-visible         1
    248         volume-wireframe       0
    249         volume-palette          rainbow
     244        mesh-edges           0
     245        mesh-lighting        1
     246        mesh-opacity         40
     247        mesh-visible         1
     248        mesh-wireframe       0
     249        mesh-palette            rainbow
    250250    }]
    251251
     
    315315    Rappture::Tooltip::for $itk_component(zoomout) "Zoom out"
    316316
    317     puts stderr "BuildVolumeTab"
    318     if { [catch { BuildVolumeTab } errs ]  != 0 } {
     317    puts stderr "BuildMeshTab"
     318    if { [catch { BuildMeshTab } errs ]  != 0 } {
    319319        puts stderr "errs=$errs"
    320320    }
     
    927927    FixSettings axis-xgrid axis-ygrid axis-zgrid axis-mode \
    928928        axis-visible axis-labels \
    929         volume-edges volume-lighting volume-opacity volume-visible \
    930         volume-wireframe
     929        mesh-edges mesh-lighting mesh-opacity mesh-visible \
     930        mesh-wireframe
    931931
    932932    #SendCmd "imgflush"
     
    12221222    }
    12231223    switch -- $what {
    1224         "volume-opacity" {
    1225             set val $_settings(volume-opacity)
     1224        "mesh-opacity" {
     1225            set val $_settings(mesh-opacity)
    12261226            set sval [expr { 0.01 * double($val) }]
    12271227            foreach dataset [CurrentDatasets -visible $_first] {
     
    12331233            }
    12341234        }
    1235         "volume-wireframe" {
    1236             set bool $_settings(volume-wireframe)
     1235        "mesh-wireframe" {
     1236            set bool $_settings(mesh-wireframe)
    12371237            foreach dataset [CurrentDatasets -visible $_first] {
    12381238                foreach { dataobj comp } [split $dataset -] break
     
    12431243            }
    12441244        }
    1245         "volume-visible" {
    1246             set bool $_settings(volume-visible)
     1245        "mesh-visible" {
     1246            set bool $_settings(mesh-visible)
    12471247            foreach dataset [CurrentDatasets -visible $_first] {
    12481248                foreach { dataobj comp } [split $dataset -] break
     
    12531253            }
    12541254        }
    1255         "volume-lighting" {
    1256             set bool $_settings(volume-lighting)
     1255        "mesh-lighting" {
     1256            set bool $_settings(mesh-lighting)
    12571257            foreach dataset [CurrentDatasets -visible $_first] {
    12581258                foreach { dataobj comp } [split $dataset -] break
     
    12631263            }
    12641264        }
    1265         "volume-edges" {
    1266             set bool $_settings(volume-edges)
     1265        "mesh-edges" {
     1266            set bool $_settings(mesh-edges)
    12671267            foreach dataset [CurrentDatasets -visible $_first] {
    12681268                foreach { dataobj comp } [split $dataset -] break
     
    12731273            }
    12741274        }
    1275         "volume-palette" {
    1276             set palette [$itk_component(palette) value]
    1277             set _settings(volume-palette) $palette
     1275        "mesh-palette" {
     1276            set palette [$itk_component(meshpalette) value]
     1277            set _settings(mesh-palette) $palette
    12781278            foreach dataset [CurrentDatasets -visible $_first] {
    12791279                foreach {dataobj comp} [split $dataset -] break
     
    17461746        set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
    17471747    }
    1748     if { ![info exists _settings(volume-opacity)] } {
    1749         set _settings(volume-opacity) $style(-opacity)
    1750     }
    1751     set max $_settings(volume-opacity)
     1748    if { ![info exists _settings(mesh-opacity)] } {
     1749        set _settings(mesh-opacity) $style(-opacity)
     1750    }
     1751    set max $_settings(mesh-opacity)
    17521752
    17531753    set wmap "0.0 1.0 1.0 1.0"
     
    18461846}
    18471847
    1848 itcl::body Rappture::VtkViewer::BuildVolumeTab {} {
     1848itcl::body Rappture::VtkViewer::BuildMeshTab {} {
    18491849
    18501850    set fg [option get $itk_component(hull) font Font]
     
    18521852
    18531853    set inner [$itk_component(main) insert end \
    1854         -title "Volume Settings" \
    1855         -icon [Rappture::icon volume-on]]
     1854        -title "Mesh Settings" \
     1855        -icon [Rappture::icon mesh]]
    18561856    $inner configure -borderwidth 4
    18571857
    1858     checkbutton $inner.volume \
    1859         -text "Show Volume" \
    1860         -variable [itcl::scope _settings(volume-visible)] \
    1861         -command [itcl::code $this AdjustSetting volume-visible] \
     1858    checkbutton $inner.mesh \
     1859        -text "Show Mesh" \
     1860        -variable [itcl::scope _settings(mesh-visible)] \
     1861        -command [itcl::code $this AdjustSetting mesh-visible] \
    18621862        -font "Arial 9"
    18631863
    18641864    checkbutton $inner.wireframe \
    18651865        -text "Show Wireframe" \
    1866         -variable [itcl::scope _settings(volume-wireframe)] \
    1867         -command [itcl::code $this AdjustSetting volume-wireframe] \
     1866        -variable [itcl::scope _settings(mesh-wireframe)] \
     1867        -command [itcl::code $this AdjustSetting mesh-wireframe] \
    18681868        -font "Arial 9"
    18691869
    18701870    checkbutton $inner.lighting \
    18711871        -text "Enable Lighting" \
    1872         -variable [itcl::scope _settings(volume-lighting)] \
    1873         -command [itcl::code $this AdjustSetting volume-lighting] \
     1872        -variable [itcl::scope _settings(mesh-lighting)] \
     1873        -command [itcl::code $this AdjustSetting mesh-lighting] \
    18741874        -font "Arial 9"
    18751875
    18761876    checkbutton $inner.edges \
    18771877        -text "Show Edges" \
    1878         -variable [itcl::scope _settings(volume-edges)] \
    1879         -command [itcl::code $this AdjustSetting volume-edges] \
     1878        -variable [itcl::scope _settings(mesh-edges)] \
     1879        -command [itcl::code $this AdjustSetting mesh-edges] \
    18801880        -font "Arial 9"
    18811881
    18821882    label $inner.palette_l -text "Palette" -font "Arial 9"
    1883     itk_component add volumepalette {
     1883    itk_component add meshpalette {
    18841884        Rappture::Combobox $inner.palette -width 10 -editable no
    18851885    }
     
    19021902        "orange-to-blue"     "orange-to-blue"   
    19031903
    1904     $itk_component(volumepalette) value "BCGYR"
     1904    $itk_component(meshpalette) value "BCGYR"
    19051905    bind $inner.palette <<Value>> \
    1906         [itcl::code $this AdjustSetting volume-palette]
     1906        [itcl::code $this AdjustSetting mesh-palette]
    19071907
    19081908    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    19091909    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1910         -variable [itcl::scope _settings(volume-opacity)] \
     1910        -variable [itcl::scope _settings(mesh-opacity)] \
    19111911        -width 10 \
    19121912        -showvalue off \
    1913         -command [itcl::code $this AdjustSetting volume-opacity]
     1913        -command [itcl::code $this AdjustSetting mesh-opacity]
    19141914
    19151915    blt::table $inner \
    1916         0,0 $inner.volume    -cspan 2 -anchor w -pady 2 \
     1916        0,0 $inner.mesh    -cspan 2 -anchor w -pady 2 \
    19171917        1,0 $inner.wireframe -cspan 2 -anchor w -pady 2 \
    19181918        2,0 $inner.lighting  -cspan 2 -anchor w -pady 2 \
     
    22972297    $inner.atomradius value "Van der Waals"
    22982298    label $inner.spacer
     2299
     2300    label $inner.opacity_l -text "Opacity" -font "Arial 9"
     2301    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
     2302        -variable [itcl::scope _settings(molecule-opacity)] \
     2303        -width 10 \
     2304        -showvalue off \
     2305        -command [itcl::code $this AdjustSetting molecule-opacity]
     2306
    22992307    blt::table $inner \
    23002308        0,0 $inner.molecule -anchor w -pady {1 0} \
     
    23082316        12,0 $inner.bondscale -fill x -pady {1 0} \
    23092317        13,0 $inner.palette_l -anchor w -pady 2 \
    2310         14,0 $inner.palette   -fill x   -pady 2 
    2311 
     2318        14,0 $inner.palette   -fill x   -pady 2  \
     2319        15,0 $inner.opacity_l -anchor w -pady 2 \
     2320        16,0 $inner.opacity   -fill x   -pady 2
     2321   
    23122322    blt::table configure $inner r* -resize none
    2313     blt::table configure $inner r15 -resize expand
     2323    blt::table configure $inner r17 -resize expand
    23142324}
    23152325
     
    25042514        SendCmd "polydata add $tag"
    25052515        SendCmd "polydata visible $settings(-visible) $tag"
    2506         set _settings(volume-visible) $settings(-visible)
     2516        set _settings(mesh-visible) $settings(-visible)
    25072517        SendCmd "polydata edges $settings(-edges) $tag"
    2508         set _settings(volume-edges) $settings(-edges)
     2518        set _settings(mesh-edges) $settings(-edges)
    25092519        SendCmd "polydata color [Color2RGB $settings(-color)] $tag"
    25102520        SendCmd "polydata lighting $settings(-lighting) $tag"
    2511         set _settings(volume-lighting) $settings(-lighting)
     2521        set _settings(mesh-lighting) $settings(-lighting)
    25122522        SendCmd "polydata linecolor [Color2RGB $settings(-edgecolor)] $tag"
    25132523        SendCmd "polydata linewidth $settings(-linewidth) $tag"
    25142524        SendCmd "polydata opacity $settings(-opacity) $tag"
    2515         set _settings(volume-opacity) $settings(-opacity)
     2525        set _settings(mesh-opacity) $settings(-opacity)
    25162526        SendCmd "polydata wireframe $settings(-wireframe) $tag"
    2517         set _settings(volume-wireframe) $settings(-wireframe)
    2518     }
    2519     set _settings(volume-opacity) [expr $settings(-opacity) * 100.0]
     2527        set _settings(mesh-wireframe) $settings(-wireframe)
     2528    }
     2529    set _settings(mesh-opacity) [expr $settings(-opacity) * 100.0]
    25202530    SetColormap $dataobj $comp
    25212531}
Note: See TracChangeset for help on using the changeset viewer.