Ignore:
Timestamp:
Jul 6, 2012, 1:18:47 PM (12 years ago)
Author:
ldelgass
Message:

Add molecule file loading to vtkviewer-test, fix missing bracket in vtkviewer,
caused error on toggling molecule visibility, fix haveGlyphs/Molecules flag
setting (flag currently unused).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/vtkviewer-test

    r3069 r3084  
    174174
    175175# ----------------------------------------------------------------------
     176# USAGE: send_molecule_file
     177#
     178# Prompts the user for a text file, and then sends the text within
     179# that file along to the rendering widget.
     180# ----------------------------------------------------------------------
     181proc send_molecule_file {} {
     182    global widgets
     183
     184    set file [tk_getOpenFile -title "Open VTK File as Molecule"]
     185    if {"" != $file && [catch {
     186            set fid [open $file r]
     187            fconfigure $fid -translation binary
     188            set info [read $fid]
     189            close $fid
     190          }] == 0} {
     191        set obj [visData #auto $info "molecule"]
     192        $widgets(vtkviewer) add $obj
     193    }
     194}
     195
     196# ----------------------------------------------------------------------
    176197# USAGE: load_script
    177198#
     
    371392.mbar.file add command -label "Send VTK File as Streamlines..." -underline 0 -command send_streamlines_file
    372393.mbar.file add command -label "Send VTK File as Glyphs..." -underline 0 -command send_glyphs_file
     394.mbar.file add command -label "Send VTK File as Molecule..." -underline 0 -command send_molecule_file
    373395.mbar.file add command -label "Load script..." -underline 0 -command load_script
    374396.mbar.file add command -label "Reset" -underline 0 -command reset
Note: See TracChangeset for help on using the changeset viewer.