Ignore:
Timestamp:
Nov 23, 2014 12:58:31 AM (9 years ago)
Author:
ldelgass
Message:

sync up camera settings across viewers

File:
1 edited

Legend:

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

    r4764 r4765  
    6363    public method updateTransferFunctions {}
    6464
     65    private method AddNewMarker { x y }
    6566    private method BuildVolumeComponents {}
    6667    private method ComputeAlphamap { cname }
     
    6970    private method GetDatasetsWithComponent { cname }
    7071    private method HideAllMarkers {}
    71     private method AddNewMarker { x y }
    7272    private method InitComponentSettings { cname }
    7373    private method ParseLevelsOption { cname levels }
    7474    private method ParseMarkersOption { cname markers }
     75    private method RemoveMarker { x y }
    7576    private method ResetColormap { cname color }
    7677    private method SendTransferFunctions {}
    7778    private method SetInitialTransferFunction { dataobj cname }
    78     private method SetOrientation { side }
    7979    private method SwitchComponent { cname }
    80     private method RemoveMarker { x y }
    81     private method ViewToQuaternion {} {
    82         return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
    83     }
    84     private method QuaternionToView { q } {
    85         foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
    86     }
    8780
    8881    private variable _alphamap
     
    9891    private variable _transferFunctionEditors
    9992
    100     protected method Connect {}
    101     protected method CurrentDatasets {args}
    102     protected method Disconnect {}
    103     protected method DoResize {}
    104     protected method DoRotate {}
    105     protected method AdjustSetting {what {value ""}}
    106     protected method InitSettings { args  }
    107     protected method Pan {option x y}
    108     protected method Pick {x y}
    109     protected method Rebuild {}
    110     protected method ReceiveDataset { args }
    111     protected method ReceiveImage { args }
    112     protected method ReceiveLegend { colormap title vmin vmax size }
    113     protected method Rotate {option x y}
    114     protected method Zoom {option}
    115 
    11693    # The following methods are only used by this class.
    117 
     94    private method AdjustSetting {what {value ""}}
    11895    private method BuildAxisTab {}
    11996    private method BuildCameraTab {}
     
    125102    private method DrawLegendOld {}
    126103    private method Combo { option }
     104    private method Connect {}
     105    private method CurrentDatasets {args}
     106    private method Disconnect {}
     107    private method DoResize {}
     108    private method DoRotate {}
    127109    private method EnterLegend { x y }
    128110    private method EventuallyResize { w h }
     
    132114    private method GetImage { args }
    133115    private method GetVtkData { args }
     116    private method InitSettings { args  }
    134117    private method IsValidObject { dataobj }
    135118    private method LeaveLegend {}
    136     private method MotionLegend { x y }
     119    private method MotionLegend { x y }
     120    private method Pan {option x y}
    137121    private method PanCamera {}
     122    private method Pick {x y}
     123    private method QuaternionToView { q } {
     124        foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
     125    }
     126    private method Rebuild {}
     127    private method ReceiveDataset { args }
     128    private method ReceiveImage { args }
     129    private method ReceiveLegend { colormap title vmin vmax size }
    138130    private method RequestLegend {}
     131    private method Rotate {option x y}
    139132    private method SetLegendTip { x y }
    140133    private method SetObjectStyle { dataobj comp }
     134    private method SetOrientation { side }
    141135    private method Slice {option args}
     136    private method ViewToQuaternion {} {
     137        return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
     138    }
     139    private method Zoom {option}
    142140
    143141    private variable _arcball ""
     
    234232    # Initialize the view to some default parameters.
    235233    array set _view {
     234        -ortho           0
    236235        -qw              0.853553
    237236        -qx              -0.353553
    238237        -qy              0.353553
    239238        -qz              0.146447
    240         -zoom            1.0
    241239        -xpan            0
    242240        -ypan            0
    243         -ortho           0
     241        -zoom            1.0
    244242    }
    245243    set _arcball [blt::arcball create 100 100]
     
    414412    bind $itk_component(view) <ButtonRelease-1> \
    415413        [itcl::code $this Rotate release %x %y]
    416     bind $itk_component(view) <Configure> \
    417         [itcl::code $this EventuallyResize %w %h]
    418414
    419415    # Bindings for panning via mouse
     
    10571053                    lappend info "dataset_size"  $length
    10581054                    lappend info "dataset_tag"   $tag
    1059                     SendCmd [list "clientinfo" $info]
    1060                 }
    1061                 append _outbuf "dataset add $tag data follows $length\n"
     1055                    SendCmd "clientinfo [list $info]"
     1056                }
     1057                SendCmd "dataset add $tag data follows $length"
    10621058                append _outbuf $bytes
    10631059                set _datasets($tag) 1
     
    12091205                -qy      0.353553
    12101206                -qz      0.146447
     1207                -xpan    0
     1208                -ypan    0
    12111209                -zoom    1.0
    1212                 -xpan   0
    1213                 -ypan   0
    12141210            }
    12151211            if { $_first != "" } {
     
    12311227    SendCmd "camera pan $x $y"
    12321228}
    1233 
    12341229
    12351230# ----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.