Changeset 4187


Ignore:
Timestamp:
Feb 20, 2014, 3:18:27 PM (11 years ago)
Author:
ldelgass
Message:

merge trunk version of glyph viewer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/vtkglyphviewer.tcl

    r3844 r4187  
    230230        cutplaneEdges           0
    231231        cutplaneLighting        1
    232         cutplanePreinterp       0
     232        cutplanePreinterp       1
    233233        cutplaneOpacity         100
    234234        cutplaneVisible         0
     
    765765        if { $_reportClientInfo }  {
    766766            # Tell the server the viewer, hub, user and session.
    767             # Do this immediately on connect before buffing any commands
     767            # Do this immediately on connect before buffering any commands
    768768            global env
    769769
     
    868868        set _hardcopy($tag) $bytes
    869869    }
    870     EventuallyRequestLegend
    871870}
    872871
     
    971970            if { ![info exists _datasets($tag)] } {
    972971                set bytes [$dataobj vtkdata $comp]
    973                 if 1 {
     972                if 0 {
    974973                    set f [open "/tmp/glyph.vtk" "w"]
    975974                    puts $f $bytes
     
    14861485    set font "Arial 8"
    14871486    set lineht [font metrics $font -linespace]
    1488     set c $itk_component(view)
    14891487    set w 12
    14901488    set h [expr {$_height - 2 * ($lineht + 2)}]
    1491     if { $h < 1} {
     1489    if { $h < 1 } {
    14921490        return
    14931491    }
     
    17191717        "static_triad"    "static" \
    17201718        "closest_triad"   "closest" \
    1721         "furthest_triad"  "furthest" \
     1719        "furthest_triad"  "farthest" \
    17221720        "outer_edges"     "outer"         
    17231721    $itk_component(axisMode) value "static"
     
    20522050    array set style {
    20532051        -color BCGYR
     2052        -edgecolor black
    20542053        -edges 0
    2055         -edgecolor black
     2054        -gscale 1
     2055        -lighting 1
    20562056        -linewidth 1.0
     2057        -normscale 1
    20572058        -opacity 1.0
     2059        -orientGlyphs 1
     2060        -outline 0
     2061        -ptsize 1.0
     2062        -quality 1
     2063        -scaleMode "vmag"
     2064        -shape "arrow"
    20582065        -wireframe 0
    2059         -lighting 1
    2060         -outline 0
    2061         -levels 10
     2066    }
     2067    set numComponents [$dataobj numComponents $comp]
     2068    if {$numComponents == 3} {
     2069        set style(-shape) "arrow"
     2070        set style(-orientGlyphs) 1
     2071        set style(-scaleMode) "vmag"
     2072    } else {
     2073        set style(-shape) "sphere"
     2074        set style(-orientGlyphs) 0
     2075        set style(-scaleMode) "scalar"
    20622076    }
    20632077    array set style [$dataobj style $comp]
     
    20652079        set style(-opacity) 1
    20662080    }
    2067     if { $_currentColormap == "" } {
    2068         set stylelist [$dataobj style $comp]
    2069         if { $stylelist != "" } {
    2070             array set style $stylelist
    2071             set stylelist [array get style]
    2072             SetCurrentColormap $stylelist
    2073         }
    2074         $itk_component(colormap) value $style(-color)
    2075     }
    20762081    if 0 {
    20772082    SendCmd "cutplane add $tag"
    2078     SendCmd "cutplane edges 0 $tag"
    2079     SendCmd "cutplane wireframe 0 $tag"
    2080     SendCmd "cutplane lighting 1 $tag"
    2081     SendCmd "cutplane linewidth 1 $tag"
    2082 
    2083     foreach axis { x y z } {
    2084         SendCmd "cutplane slice $axis 0.5 $tag"
    2085         SendCmd "cutplane axis $axis 0 $tag"
    2086     }
     2083    SendCmd "cutplane visible 0 $tag"
    20872084    }
    20882085    # This is too complicated.  We want to set the colormap, number of
     
    21052102    }
    21062103    set _currentOpacity $style(-opacity)
    2107     SendCmd "glyphs add arrow $tag"
     2104    SendCmd "glyphs add $style(-shape) $tag"
    21082105    SendCmd "glyphs edges $style(-edges) $tag"
    21092106    # normscale=1 and gscale=1 are defaults
    2110     #SendCmd "glyphs normscale 1 $tag"
    2111     #SendCmd "glyphs gscale 1 $tag"
    2112 
     2107    if {$style(-normscale) != 1} {
     2108        SendCmd "glyphs normscale $style(-normscale) $tag"
     2109    }
     2110    if {$style(-gscale) != 1} {
     2111        SendCmd "glyphs gscale $style(-gscale) $tag"
     2112    }
    21132113    SendCmd "outline add $tag"
    21142114    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
     
    21162116    set _settings(glyphOutline) $style(-outline)
    21172117    set _settings(glyphEdges) $style(-edges)
    2118     #SendCmd "glyphs color [Color2RGB $settings(-color)] $tag"
     2118    # constant color only used if colormode set to constant
     2119    SendCmd "glyphs color [Color2RGB $itk_option(-plotforeground)] $tag"
     2120    # Omitting field name for gorient and smode commands
     2121    # defaults to active scalars or vectors depending on mode
     2122    SendCmd "glyphs gorient $style(-orientGlyphs) {} $tag"
     2123    SendCmd "glyphs smode $style(-scaleMode) {} $tag"
     2124    SendCmd "glyphs quality $style(-quality) $tag"
    21192125    SendCmd "glyphs lighting $style(-lighting) $tag"
    21202126    set _settings(glyphLighting) $style(-lighting)
    21212127    SendCmd "glyphs linecolor [Color2RGB $style(-edgecolor)] $tag"
    21222128    SendCmd "glyphs linewidth $style(-linewidth) $tag"
     2129    SendCmd "glyphs ptsize $style(-ptsize) $tag"
    21232130    SendCmd "glyphs opacity $_currentOpacity $tag"
    21242131    set _settings(glyphOpacity) $style(-opacity)
     
    22342241        "move" {
    22352242            set axis [lindex $args 0]
    2236             set a [string toupper $axis]
    2237             set oldval $_settings(cutplane${a}Position)
    22382243            set newval [lindex $args 1]
    22392244            if {[llength $args] != 2} {
Note: See TracChangeset for help on using the changeset viewer.