Ignore:
Timestamp:
Jul 6, 2013, 5:50:14 PM (11 years ago)
Author:
ldelgass
Message:

Fixes for vtkvis test apps, add test for glyph viewer

File:
1 edited

Legend:

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

    r3177 r3755  
    7878    } {
    7979        set _data [lindex $args 0]
     80        GetTypeAndSize $_cname
     81        GetAssociation $_cname
     82        ReadVtkDataSet $_cname $_data
    8083        set _type [lindex $args 1]
    8184    }
    8285
    8386    public method components {args} {
     87        Rappture::getopts args params {
     88            flag what -name default
     89            flag what -dimensions
     90            flag what -style
     91            flag what -particles
     92            flag what -flow
     93            flag what -box
     94        }
     95        if { $params(what) == "-dimensions" } {
     96            return "${_dim}D"
     97        }
    8498        if {[llength $args] == 0} {
    85             return "one"
     99            return $_cname
    86100        }
    87101        return ""
    88102    }
    89     public method blob {args} {
    90         return $_data
     103    public method isvalid {} {
     104        return 1
    91105    }
    92106    public method data {args} {
    93107        return $_data
    94108    }
     109    public method vtkdata {args} {
     110        return $_data
     111    }
    95112    public method values {args} {
    96113        return $_data
    97114    }
     115    public method style {args} {
     116        return ""
     117    }
    98118    public method hints {args} {
    99119        return ""
    100120    }
    101     public method style {args} {
    102         return ""
    103     }
    104121    public method type {args} {
    105122        return $_type
    106123    }
    107 
     124    public method viewer {args} {
     125        return "streamlines"
     126    }
     127
     128    private variable _cname "one"
    108129    private variable _data ""
    109130    private variable _type ""
     
    128149        set obj [visData #auto $info "vtk"]
    129150        $widgets(vtkviewer) add $obj
    130     }
    131 }
    132 
    133 # ----------------------------------------------------------------------
    134 # USAGE: send_streamlines_file
    135 #
    136 # Prompts the user for a text file, and then sends the text within
    137 # that file along to the rendering widget.
    138 # ----------------------------------------------------------------------
    139 proc send_streamlines_file {} {
    140     global widgets
    141 
    142     set file [tk_getOpenFile -title "Open VTK File as Streamlines"]
    143     if {"" != $file && [catch {
    144             set fid [open $file r]
    145             fconfigure $fid -translation binary -encoding binary
    146             set info [read $fid]
    147             close $fid
    148           }] == 0} {
    149         set obj [visData #auto $info "vtkstreamlines"]
    150         $widgets(vtkviewer) add $obj
     151        $widgets(vtkviewer) scale $obj
    151152    }
    152153}
     
    348349menu .mbar.file
    349350.mbar.file add command -label "Send VTK File..." -underline 0 -command send_file
    350 .mbar.file add command -label "Send VTK File as Streamlines..." -underline 0 -command send_streamlines_file
    351351.mbar.file add command -label "Load script..." -underline 0 -command load_script
    352352.mbar.file add command -label "Reset" -underline 0 -command reset
Note: See TracChangeset for help on using the changeset viewer.