Changeset 2450 for trunk


Ignore:
Timestamp:
Aug 30, 2011, 10:11:26 AM (13 years ago)
Author:
ldelgass
Message:

Dataset getscalar fixes, pick testing for vtkcontourviewer

File:
1 edited

Legend:

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

    r2425 r2450  
    7272    protected method FixSettings {what {value ""}}
    7373    protected method Pan {option x y}
     74    protected method Pick {x y}
    7475    protected method Rebuild {}
    7576    protected method ReceiveDataset { args }
     
    314315    bind $itk_component(view) <ButtonRelease-2> \
    315316        [itcl::code $this Pan release %x %y]
     317
     318    bind $itk_component(view) <ButtonRelease-3> \
     319        [itcl::code $this Pick %x %y]
    316320
    317321    # Bindings for panning via keyboard
     
    803807    set option [lindex $args 0]
    804808    switch -- $option {
    805         "value" {
     809        "scalar" {
    806810            set option [lindex $args 1]
    807811            switch -- $option {
    808812                "world" {
    809                     foreach { x y z value } [lrange $args 2 end] break
    810                     puts stderr "world x=$x y=$y z=$z value=$value"
     813                    foreach { x y z value tag } [lrange $args 2 end] break
     814                    puts stderr "world x=$x y=$y z=$z value=$value tag=$tag"
    811815                }
    812816                "pixel" {
    813                     foreach { x y value } [lrange $args 2 end] break
    814                     puts stderr "pixel x=$x y=$y value=$value"
     817                    foreach { x y value tag } [lrange $args 2 end] break
     818                    puts stderr "pixel x=$x y=$y value=$value tag=$tag"
    815819                }
    816820            }
     821        }
     822        "vector" {
     823            set option [lindex $args 1]
     824            switch -- $option {
     825                "world" {
     826                    foreach { x y z vx vy vz tag } [lrange $args 2 end] break
     827                    puts stderr "world x=$x y=$y z=$z value=$vx $xy $vz tag=$tag"
     828                }
     829                "pixel" {
     830                    foreach { x y vx vy vz tag } [lrange $args 2 end] break
     831                    puts stderr "pixel x=$x y=$y value=$vx $xy $vz tag=$tag"
     832                }
     833            }
     834        }
     835        "names" {
     836            foreach { name } [lindex $args 1] {
     837                puts stderr "Dataset: $name"
     838            }
    817839        }
    818840        default {
     
    10351057        }
    10361058    }
     1059}
     1060
     1061itcl::body Rappture::VtkContourViewer::Pick {x y} {
     1062    foreach tag [CurrentDatasets -visible] {
     1063        SendCmd "dataset getscalar pixel $x $y $tag"
     1064    }
    10371065}
    10381066
Note: See TracChangeset for help on using the changeset viewer.