Changeset 4151


Ignore:
Timestamp:
Jan 27, 2014 7:53:06 PM (7 years ago)
Author:
ldelgass
Message:

Add style options to vtk glyph viewer for e.g. setting shape for glyphing non-
vector data. Also disable writing debug vtk file.

File:
1 edited

Legend:

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

    r4075 r4151  
    970970            if { ![info exists _datasets($tag)] } {
    971971                set bytes [$dataobj vtkdata $comp]
    972                 if 1 {
     972                if 0 {
    973973                    set f [open "/tmp/glyph.vtk" "w"]
    974974                    puts $f $bytes
     
    20532053        -edgecolor black
    20542054        -linewidth 1.0
     2055        -ptsize 1.0
    20552056        -opacity 1.0
    20562057        -wireframe 0
    20572058        -lighting 1
    20582059        -outline 0
    2059         -levels 10
     2060        -shape "arrow"
     2061        -orientGlyphs 1
     2062        -scaleMode "vmag"
     2063        -quality 1
     2064    }
     2065    set numComponents [$dataobj numComponents $comp]
     2066    if {$numComponents == 3} {
     2067        set style(-shape) "arrow"
     2068        set style(-orientGlyphs) 1
     2069        set style(-scaleMode) "vmag"
     2070    } else {
     2071        set style(-shape) "sphere"
     2072        set style(-orientGlyphs) 0
     2073        set style(-scaleMode) "scalar"
    20602074    }
    20612075    array set style [$dataobj style $comp]
    20622076    if { $dataobj != $_first } {
    20632077        set style(-opacity) 1
    2064     }
    2065     if { $_currentColormap == "" } {
    2066         set stylelist [$dataobj style $comp]
    2067         if { $stylelist != "" } {
    2068             array set style $stylelist
    2069             set stylelist [array get style]
    2070             SetCurrentColormap $stylelist
    2071         }
    2072         $itk_component(colormap) value $style(-color)
    20732078    }
    20742079    if 0 {
     
    20952100    }
    20962101    set _currentOpacity $style(-opacity)
    2097     SendCmd "glyphs add arrow $tag"
     2102    SendCmd "glyphs add $style(-shape) $tag"
    20982103    SendCmd "glyphs edges $style(-edges) $tag"
    20992104    # normscale=1 and gscale=1 are defaults
     
    21072112    set _settings(glyphEdges) $style(-edges)
    21082113    #SendCmd "glyphs color [Color2RGB $settings(-color)] $tag"
     2114    # Omitting field name for gorient and smode commands
     2115    # defaults to active scalars or vectors depending on mode
     2116    SendCmd "glyphs gorient $style(-orientGlyphs) {} $tag"
     2117    SendCmd "glyphs smode $style(-scaleMode) {} $tag"
     2118    SendCmd "glyphs quality $style(-quality) $tag"
    21092119    SendCmd "glyphs lighting $style(-lighting) $tag"
    21102120    set _settings(glyphLighting) $style(-lighting)
    21112121    SendCmd "glyphs linecolor [Color2RGB $style(-edgecolor)] $tag"
    21122122    SendCmd "glyphs linewidth $style(-linewidth) $tag"
     2123    SendCmd "glyphs ptsize $style(-ptsize) $tag"
    21132124    SendCmd "glyphs opacity $_currentOpacity $tag"
    21142125    set _settings(glyphOpacity) $style(-opacity)
Note: See TracChangeset for help on using the changeset viewer.