Ignore:
Timestamp:
Mar 19, 2016, 11:24:07 PM (9 years ago)
Author:
ldelgass
Message:

More cleanups and syncing viewers

File:
1 edited

Legend:

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

    r6142 r6147  
    33#  COMPONENT: vtksurfaceviewer - Vtk 3D boundary surface viewer
    44#
    5 #  It connects to the Vtk server running on a rendering farm,
     5#  It connects to the Vtkvis server running on a rendering farm,
    66#  transmits data, and displays the results.
    77# ======================================================================
    88#  AUTHOR:  Michael McLennan, Purdue University
    9 #  Copyright (c) 2004-2014  HUBzero Foundation, LLC
     9#  Copyright (c) 2004-2016  HUBzero Foundation, LLC
    1010#
    1111#  See the file "license.terms" for information on usage and
     
    8282    private method GetImage { args }
    8383    private method GetVtkData { args }
    84     private method InitSettings { args  }
     84    private method InitSettings { args }
    8585    private method IsValidObject { dataobj }
    8686    private method LeaveLegend {}
     
    137137    private variable _height 0
    138138    private variable _resizePending 0
     139    private variable _legendPending 0
    139140    private variable _rotatePending 0
    140     private variable _legendPending 0
    141141    private variable _field      ""
    142142    private variable _colorMode "scalar"; #  Mode of colormap (vmag or scalar)
     
    159159itcl::body Rappture::VtkSurfaceViewer::constructor {args} {
    160160    set _serverType "vtkvis"
     161    #DebugOn
    161162
    162163    # Rebuild event
     
    168169    $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list"
    169170
     171    # Legend event
     172    $_dispatcher register !legend
     173    $_dispatcher dispatch $this !legend "[itcl::code $this RequestLegend]; list"
     174
    170175    # Rotate event
    171176    $_dispatcher register !rotate
    172177    $_dispatcher dispatch $this !rotate "[itcl::code $this DoRotate]; list"
    173 
    174     # Legend event
    175     $_dispatcher register !legend
    176     $_dispatcher dispatch $this !legend "[itcl::code $this RequestLegend]; list"
    177178
    178179    #
     
    185186    # Initialize the view to some default parameters.
    186187    array set _view {
    187         -ortho           0
    188         -qw              0.853553
    189         -qx              -0.353553
    190         -qy              0.353553
    191         -qz              0.146447
    192         -xpan            0
    193         -ypan            0
    194         -zoom            1.0
     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
    195196    }
    196197    set _arcball [blt::arcball create 100 100]
     
    198199
    199200    array set _settings {
    200         -axesvisible                1
    201         -axislabels                 1
    202         -axisminorticks             1
    203         -axismode                   "static"
    204         -background                 black
    205         -colormap                   BCGYR
    206         -colormapvisible            1
    207         -field                      "Default"
    208         -isolinecolor               white
    209         -isolinesvisible            0
    210         -legendvisible              1
    211         -numcontours                10
    212         -outline                    0
    213         -surfaceedges               0
    214         -surfacelighting            1
    215         -surfaceopacity             100
    216         -surfacevisible             1
    217         -surfacewireframe           0
    218         -xgrid                      0
    219         -ygrid                      0
    220         -zgrid                      0
     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
    221222    }
    222223    array set _changed {
    223         -colormap                0
    224         -isolinecolor            0
    225         -isolinesvisible         0
    226         -numcontours             0
    227         -outline                 0
    228         -surfaceedges            0
    229         -surfacelighting         0
    230         -surfaceopacity          0
    231         -surfacevisible          0
    232         -surfacewireframe        0
     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
    233234    }
    234235
     
    238239    } {
    239240        usual
    240         ignore -highlightthickness -borderwidth  -background
     241        ignore -highlightthickness -borderwidth -background
    241242    }
    242243
     
    756757# isconnected --
    757758#
    758 #       Indicates if we are currently connected to the visualization server.
     759# Indicates if we are currently connected to the visualization server.
    759760#
    760761itcl::body Rappture::VtkSurfaceViewer::isconnected {} {
     
    773774# Disconnect --
    774775#
    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.
    777777#
    778778itcl::body Rappture::VtkSurfaceViewer::Disconnect {} {
     
    12031203itcl::body Rappture::VtkSurfaceViewer::InitSettings { args } {
    12041204    foreach spec $args {
    1205         if { [info exists _settings($_first-$spec)] } {
     1205        if { [info exists _settings($_first${spec})] } {
    12061206            # Reset global setting with dataobj specific setting
    1207             set _settings($spec) $_settings($_first-$spec)
     1207            set _settings($spec) $_settings($_first${spec})
    12081208        }
    12091209        AdjustSetting $spec
     
    12141214# AdjustSetting --
    12151215#
    1216 #       Changes/updates a specific setting in the widget.  There are
    1217 #       usually user-setable option.  Commands are sent to the render
    1218 #       server.
     1216# Changes/updates a specific setting in the widget.  There are
     1217# usually user-setable option.  Commands are sent to the render
     1218# server.
    12191219#
    12201220itcl::body Rappture::VtkSurfaceViewer::AdjustSetting {what {value ""}} {
     
    14241424# RequestLegend --
    14251425#
    1426 #       Request a new legend from the server.  The size of the legend
    1427 #       is determined from the height of the canvas.
     1426# Request a new legend from the server.  The size of the legend
     1427# is determined from the height of the canvas.
    14281428#
    14291429# This should be called when
    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).
     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).
    14351435#
    14361436itcl::body Rappture::VtkSurfaceViewer::RequestLegend {} {
     
    14631463        incr h -$lineht
    14641464    }
    1465     # Set the legend on the first heightmap dataset.
     1465    # Set the legend on the first dataset.
    14661466    if { $_currentColormap != "" } {
    14671467        set cmap $_currentColormap
     
    17731773
    17741774#
    1775 #  camera --
     1775# camera --
    17761776#
    17771777itcl::body Rappture::VtkSurfaceViewer::camera {option args} {
     
    20672067# ReceiveLegend --
    20682068#
    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.
     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.
    20722072#
    20732073itcl::body Rappture::VtkSurfaceViewer::ReceiveLegend { colormap title min max size } {
     
    20922092# DrawLegend --
    20932093#
    2094 #       Draws the legend in the own canvas on the right side of the plot area.
     2094# Draws the legend in the own canvas on the right side of the plot area.
    20952095#
    20962096itcl::body Rappture::VtkSurfaceViewer::DrawLegend {} {
     
    22612261# BuildColormap --
    22622262#
    2263 #       Build the designated colormap on the server.
     2263# Build the designated colormap on the server.
    22642264#
    22652265itcl::body Rappture::VtkSurfaceViewer::BuildColormap { name } {
Note: See TracChangeset for help on using the changeset viewer.