Changeset 4419 for trunk/gui


Ignore:
Timestamp:
Jun 24, 2014, 1:37:46 PM (10 years ago)
Author:
ldelgass
Message:

Add bbox outline to mesh viewer

File:
1 edited

Legend:

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

    r4344 r4419  
    6969    protected method DoRotate {}
    7070    protected method AdjustSetting {what {value ""}}
    71     protected method FixSettings { args  }
     71    protected method InitSettings { args  }
    7272    protected method Pan {option x y}
    7373    protected method Pick {x y}
     
    201201    }]
    202202    array set _settings [subst {
     203        outline                 0
    203204        polydata-edges          0
    204205        polydata-lighting       1
     
    831832        $_arcball resize $w $h
    832833        DoResize
    833         FixSettings axis-xgrid axis-ygrid axis-zgrid axis-mode \
    834             axis-visible axis-labels polydata-edges polydata-lighting polydata-opacity \
    835             polydata-visible polydata-wireframe
     834        InitSettings axis-xgrid axis-ygrid axis-zgrid axis-mode \
     835            axis-visible axis-labels
    836836 
    837837        StopBufferingCommands
     
    896896        }
    897897    }
     898    InitSettings outline
    898899    if { $_reset } {
     900        # These are settings that rely on a dataset being loaded.
     901        InitSettings polydata-edges polydata-lighting polydata-opacity \
     902            polydata-visible polydata-wireframe
     903 
    899904        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    900905        $_arcball quaternion $q
     
    11231128
    11241129# ----------------------------------------------------------------------
    1125 # USAGE: FixSettings <what> ?<value>?
     1130# USAGE: InitSettings <what> ?<value>?
    11261131#
    11271132# Used internally to update rendering settings whenever parameters
     
    11291134# to the back end.
    11301135# ----------------------------------------------------------------------
    1131 itcl::body Rappture::VtkMeshViewer::FixSettings { args } {
     1136itcl::body Rappture::VtkMeshViewer::InitSettings { args } {
    11321137    foreach setting $args {
    11331138        AdjustSetting $setting
     
    11471152    }
    11481153    switch -- $what {
     1154        "outline" {
     1155            set bool $_settings(outline)
     1156            foreach dataset [CurrentDatasets -visible $_first] {
     1157                SendCmd "outline visible $bool $dataset"
     1158            }
     1159        }
    11491160        "polydata-opacity" {
    11501161            foreach dataset [CurrentDatasets -visible $_first] {
     
    13101321        -font "Arial 9" -anchor w
    13111322
     1323    checkbutton $inner.outline \
     1324        -text "Show Outline" \
     1325        -variable [itcl::scope _settings(outline)] \
     1326        -command [itcl::code $this AdjustSetting outline] \
     1327        -font "Arial 9" -anchor w
     1328
    13121329    checkbutton $inner.wireframe \
    13131330        -text "Show Wireframe" \
     
    13491366    blt::table $inner \
    13501367        0,0 $inner.mesh      -cspan 2  -anchor w -pady 2 \
    1351         1,0 $inner.wireframe -cspan 2  -anchor w -pady 2 \
    1352         2,0 $inner.lighting  -cspan 2  -anchor w -pady 2 \
    1353         3,0 $inner.edges     -cspan 2  -anchor w -pady 2 \
    1354         4,0 $inner.opacity_l -anchor w -pady 2 \
    1355         4,1 $inner.opacity   -fill x   -pady 2
     1368        1,0 $inner.outline   -cspan 2  -anchor w -pady 2 \
     1369        2,0 $inner.wireframe -cspan 2  -anchor w -pady 2 \
     1370        3,0 $inner.lighting  -cspan 2  -anchor w -pady 2 \
     1371        4,0 $inner.edges     -cspan 2  -anchor w -pady 2 \
     1372        5,0 $inner.opacity_l -anchor w -pady 2 \
     1373        5,1 $inner.opacity   -fill x   -pady 2
    13561374
    13571375    blt::table configure $inner r* c* -resize none
    1358     blt::table configure $inner r6 c1 -resize expand
     1376    blt::table configure $inner r7 c1 -resize expand
    13591377}
    13601378
     
    17291747        -linewidth 1.0
    17301748        -opacity 1.0
     1749        -outline 0
    17311750        -visible 1
    17321751        -wireframe 0
     
    17411760        set settings(-color) $color
    17421761    }
     1762    SendCmd "outline add $tag"
     1763    SendCmd "outline color [Color2RGB $settings(-color)] $tag"
     1764    SendCmd "outline visible $settings(-outline) $tag"
     1765    set _settings(outline) $settings(-outline)
     1766
    17431767    SendCmd "polydata add $tag"
    17441768    SendCmd "polydata visible $settings(-visible) $tag"
Note: See TracChangeset for help on using the changeset viewer.