Changeset 6147 for trunk/gui/scripts/vtksurfaceviewer.tcl
- Timestamp:
- Mar 19, 2016, 11:24:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtksurfaceviewer.tcl
r6142 r6147 3 3 # COMPONENT: vtksurfaceviewer - Vtk 3D boundary surface viewer 4 4 # 5 # It connects to the Vtk server running on a rendering farm,5 # It connects to the Vtkvis server running on a rendering farm, 6 6 # transmits data, and displays the results. 7 7 # ====================================================================== 8 8 # AUTHOR: Michael McLennan, Purdue University 9 # Copyright (c) 2004-201 4HUBzero Foundation, LLC9 # Copyright (c) 2004-2016 HUBzero Foundation, LLC 10 10 # 11 11 # See the file "license.terms" for information on usage and … … 82 82 private method GetImage { args } 83 83 private method GetVtkData { args } 84 private method InitSettings { args 84 private method InitSettings { args } 85 85 private method IsValidObject { dataobj } 86 86 private method LeaveLegend {} … … 137 137 private variable _height 0 138 138 private variable _resizePending 0 139 private variable _legendPending 0 139 140 private variable _rotatePending 0 140 private variable _legendPending 0141 141 private variable _field "" 142 142 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) … … 159 159 itcl::body Rappture::VtkSurfaceViewer::constructor {args} { 160 160 set _serverType "vtkvis" 161 #DebugOn 161 162 162 163 # Rebuild event … … 168 169 $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list" 169 170 171 # Legend event 172 $_dispatcher register !legend 173 $_dispatcher dispatch $this !legend "[itcl::code $this RequestLegend]; list" 174 170 175 # Rotate event 171 176 $_dispatcher register !rotate 172 177 $_dispatcher dispatch $this !rotate "[itcl::code $this DoRotate]; list" 173 174 # Legend event175 $_dispatcher register !legend176 $_dispatcher dispatch $this !legend "[itcl::code $this RequestLegend]; list"177 178 178 179 # … … 185 186 # Initialize the view to some default parameters. 186 187 array set _view { 187 -ortho 188 -qw 189 -qx 190 -qy 191 -qz 192 -xpan 193 -ypan 194 -zoom 188 -ortho 0 189 -qw 0.853553 190 -qx -0.353553 191 -qy 0.353553 192 -qz 0.146447 193 -xpan 0 194 -ypan 0 195 -zoom 1.0 195 196 } 196 197 set _arcball [blt::arcball create 100 100] … … 198 199 199 200 array set _settings { 200 -axesvisible 201 -axislabels 202 -axisminorticks 203 -axismode 204 -background 205 -colormap 206 -colormapvisible 207 -field 208 -isolinecolor 209 -isolinesvisible 210 -legendvisible 211 -numcontours 212 -outline 213 -surfaceedges 214 -surfacelighting 215 -surfaceopacity 216 -surfacevisible 217 -surfacewireframe 218 -xgrid 219 -ygrid 220 -zgrid 201 -axesvisible 1 202 -axislabels 1 203 -axisminorticks 1 204 -axismode "static" 205 -background black 206 -colormap BCGYR 207 -colormapvisible 1 208 -field "Default" 209 -isolinecolor white 210 -isolinesvisible 0 211 -legendvisible 1 212 -numcontours 10 213 -outline 0 214 -surfaceedges 0 215 -surfacelighting 1 216 -surfaceopacity 100 217 -surfacevisible 1 218 -surfacewireframe 0 219 -xgrid 0 220 -ygrid 0 221 -zgrid 0 221 222 } 222 223 array set _changed { 223 -colormap 224 -isolinecolor 225 -isolinesvisible 226 -numcontours 227 -outline 228 -surfaceedges 229 -surfacelighting 230 -surfaceopacity 231 -surfacevisible 232 -surfacewireframe 224 -colormap 0 225 -isolinecolor 0 226 -isolinesvisible 0 227 -numcontours 0 228 -outline 0 229 -surfaceedges 0 230 -surfacelighting 0 231 -surfaceopacity 0 232 -surfacevisible 0 233 -surfacewireframe 0 233 234 } 234 235 … … 238 239 } { 239 240 usual 240 ignore -highlightthickness -borderwidth 241 ignore -highlightthickness -borderwidth -background 241 242 } 242 243 … … 756 757 # isconnected -- 757 758 # 758 # 759 # Indicates if we are currently connected to the visualization server. 759 760 # 760 761 itcl::body Rappture::VtkSurfaceViewer::isconnected {} { … … 773 774 # Disconnect -- 774 775 # 775 # Clients use this method to disconnect from the current rendering 776 # server. 776 # Clients use this method to disconnect from the current rendering server. 777 777 # 778 778 itcl::body Rappture::VtkSurfaceViewer::Disconnect {} { … … 1203 1203 itcl::body Rappture::VtkSurfaceViewer::InitSettings { args } { 1204 1204 foreach spec $args { 1205 if { [info exists _settings($_first -$spec)] } {1205 if { [info exists _settings($_first${spec})] } { 1206 1206 # Reset global setting with dataobj specific setting 1207 set _settings($spec) $_settings($_first -$spec)1207 set _settings($spec) $_settings($_first${spec}) 1208 1208 } 1209 1209 AdjustSetting $spec … … 1214 1214 # AdjustSetting -- 1215 1215 # 1216 # 1217 # 1218 # 1216 # Changes/updates a specific setting in the widget. There are 1217 # usually user-setable option. Commands are sent to the render 1218 # server. 1219 1219 # 1220 1220 itcl::body Rappture::VtkSurfaceViewer::AdjustSetting {what {value ""}} { … … 1424 1424 # RequestLegend -- 1425 1425 # 1426 # 1427 # 1426 # Request a new legend from the server. The size of the legend 1427 # is determined from the height of the canvas. 1428 1428 # 1429 1429 # This should be called when 1430 # 1431 # 1432 # 1433 # 1434 # 1430 # 1. A new current colormap is set. 1431 # 2. Window is resized. 1432 # 3. The limits of the data have changed. (Just need a redraw). 1433 # 4. Number of isolines have changed. (Just need a redraw). 1434 # 5. Legend becomes visible (Just need a redraw). 1435 1435 # 1436 1436 itcl::body Rappture::VtkSurfaceViewer::RequestLegend {} { … … 1463 1463 incr h -$lineht 1464 1464 } 1465 # Set the legend on the first heightmapdataset.1465 # Set the legend on the first dataset. 1466 1466 if { $_currentColormap != "" } { 1467 1467 set cmap $_currentColormap … … 1773 1773 1774 1774 # 1775 # 1775 # camera -- 1776 1776 # 1777 1777 itcl::body Rappture::VtkSurfaceViewer::camera {option args} { … … 2067 2067 # ReceiveLegend -- 2068 2068 # 2069 # 2070 # 2071 # 2069 # Invoked automatically whenever the "legend" command comes in from 2070 # the rendering server. Indicates that binary image data with the 2071 # specified <size> will follow. 2072 2072 # 2073 2073 itcl::body Rappture::VtkSurfaceViewer::ReceiveLegend { colormap title min max size } { … … 2092 2092 # DrawLegend -- 2093 2093 # 2094 # 2094 # Draws the legend in the own canvas on the right side of the plot area. 2095 2095 # 2096 2096 itcl::body Rappture::VtkSurfaceViewer::DrawLegend {} { … … 2261 2261 # BuildColormap -- 2262 2262 # 2263 # 2263 # Build the designated colormap on the server. 2264 2264 # 2265 2265 itcl::body Rappture::VtkSurfaceViewer::BuildColormap { name } {
Note: See TracChangeset
for help on using the changeset viewer.