Changeset 3755 for trunk/gui/apps/vtkstreamlines-test
- Timestamp:
- Jul 6, 2013, 5:50:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/apps/vtkstreamlines-test
r3177 r3755 78 78 } { 79 79 set _data [lindex $args 0] 80 GetTypeAndSize $_cname 81 GetAssociation $_cname 82 ReadVtkDataSet $_cname $_data 80 83 set _type [lindex $args 1] 81 84 } 82 85 83 86 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 } 84 98 if {[llength $args] == 0} { 85 return "one"99 return $_cname 86 100 } 87 101 return "" 88 102 } 89 public method blob {args} {90 return $_data103 public method isvalid {} { 104 return 1 91 105 } 92 106 public method data {args} { 93 107 return $_data 94 108 } 109 public method vtkdata {args} { 110 return $_data 111 } 95 112 public method values {args} { 96 113 return $_data 97 114 } 115 public method style {args} { 116 return "" 117 } 98 118 public method hints {args} { 99 119 return "" 100 120 } 101 public method style {args} {102 return ""103 }104 121 public method type {args} { 105 122 return $_type 106 123 } 107 124 public method viewer {args} { 125 return "streamlines" 126 } 127 128 private variable _cname "one" 108 129 private variable _data "" 109 130 private variable _type "" … … 128 149 set obj [visData #auto $info "vtk"] 129 150 $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 151 152 } 152 153 } … … 348 349 menu .mbar.file 349 350 .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_file351 351 .mbar.file add command -label "Load script..." -underline 0 -command load_script 352 352 .mbar.file add command -label "Reset" -underline 0 -command reset
Note: See TracChangeset
for help on using the changeset viewer.