Changeset 1228 for trunk


Ignore:
Timestamp:
Nov 24, 2008 9:48:03 AM (15 years ago)
Author:
gah
Message:

Fixes for parallel makes

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r1189 r1228  
    3535
    3636ifneq ($(ENABLE_GUI),)
    37   TARGETS += gui lang examples lib
     37  TARGETS += gui lang lib examples
    3838endif
    3939
     40.NOTPARALLEL:
    4041
    4142.PHONY: $(TARGETS)
     
    4546src:
    4647        $(MAKE) -C src all
    47 gui:
     48gui: 
    4849        $(MAKE) -C gui all
    49 lang:
     50lang: 
    5051        $(MAKE) -C lang all
    51 lib:
     52examples:
     53        $(MAKE) -C examples all
     54lib:
    5255        $(MAKE) -C lib all
    53 examples:
    54         $(MAKE) -C examples all
    55 test:
     56test:
    5657        #$(MAKE) -C test all
    5758
  • trunk/gui/scripts/heightmapviewer.tcl

    r1220 r1228  
    5353        Rappture::VisViewer::SetServerList "nanovis" $namelist
    5454    }
    55     public method isconnected {}
    5655    public method add {dataobj {settings ""}}
    5756    public method get {args}
     
    6766    protected method _send {string}
    6867    protected method _send_dataobjs {}
    69     protected method _receive_image {option size}
    70     protected method ReceiveLegend {ivol vmin vmax size}
     68    protected method ReceiveImage {option size}
     69    private method ReceiveLegend {ivol vmin vmax size}
    7170    protected method _receive_echo {channel {data ""}}
    7271
     
    8180
    8281
    83     private variable _outbuf       ;# buffer for outgoing commands
    84 
    85     private variable _dlist ""     ;# list of data objects
    86     private variable _dims ""      ;# dimensionality of data objects
    87     private variable _obj2style    ;# maps dataobj => style settings
    88     private variable _obj2ovride   ;# maps dataobj => style override
    89     private variable _obj2id       ;# maps dataobj => heightmap ID in server
    90     private variable _id2obj       ;# maps heightmap ID => dataobj in server
    91     private variable _sendobjs ""  ;# list of data objs to send to server
    92     private variable _receiveids   ;# list of data responses from the server
    93     private variable _click        ;# info used for _rotate operations
    94     private variable _limits       ;# autoscale min/max for all axes
    95     private variable _view         ;# view params for 3D view
    96 
    97     private common _settings      ;# Array used for checkbuttons and radiobuttons
     82    private variable outbuf_       ;# buffer for outgoing commands
     83
     84    private variable dlist_ ""     ;# list of data objects
     85    private variable obj2style_    ;# maps dataobj => style settings
     86    private variable obj2ovride_   ;# maps dataobj => style override
     87    private variable obj2id_       ;# maps dataobj => heightmap ID in server
     88    private variable id2obj_       ;# maps heightmap ID => dataobj in server
     89    private variable sendobjs_ ""  ;# list of data objs to send to server
     90    private variable receiveIds_   ;# list of data responses from the server
     91    private variable click_        ;# info used for _rotate operations
     92    private variable limits_       ;# autoscale min/max for all axes
     93    private variable view_         ;# view params for 3D view
     94
     95    private common settings_      ;# Array used for checkbuttons and radiobuttons
    9896                       
    9997}
     
    120118    $_dispatcher dispatch $this !rebuild "[itcl::code $this _rebuild]; list"
    121119
    122     set _outbuf ""
     120    set outbuf_ ""
    123121
    124122    #
    125123    # Populate parser with commands handle incoming requests
    126124    #
    127     $_parser alias image [itcl::code $this _receive_image]
     125    $_parser alias image [itcl::code $this ReceiveImage]
    128126    $_parser alias legend [itcl::code $this ReceiveLegend]
    129127
    130128    # Initialize the view to some default parameters.
    131     array set _view {
     129    array set view_ {
    132130        theta   45
    133131        phi     45
     
    138136        zfocus  0
    139137    }
    140     set _obj2id(count) 0
     138    set obj2id_(count) 0
    141139
    142140    itk_component add zoom {
     
    211209    set fg [option get $itk_component(hull) font Font]
    212210   
    213     set ::Rappture::HeightmapViewer::_settings($this-grid) 1
     211    set ::Rappture::HeightmapViewer::settings_($this-grid) 1
    214212    ::checkbutton $inner.f.grid \
    215213        -text "Grid" \
    216         -variable ::Rappture::HeightmapViewer::_settings($this-grid) \
     214        -variable ::Rappture::HeightmapViewer::settings_($this-grid) \
    217215        -command [itcl::code $this _fixSettings grid]
    218216    grid $inner.f.grid -row 0 -column 0 -sticky w
    219217
    220     set ::Rappture::HeightmapViewer::_settings($this-axes) 0
     218    set ::Rappture::HeightmapViewer::settings_($this-axes) 0
    221219    ::checkbutton $inner.f.axes \
    222220        -text "Axes" \
    223         -variable ::Rappture::HeightmapViewer::_settings($this-axes) \
     221        -variable ::Rappture::HeightmapViewer::settings_($this-axes) \
    224222        -command [itcl::code $this _fixSettings axes]
    225223    grid $inner.f.axes -row 1 -column 0 -sticky w
    226224
    227     set ::Rappture::HeightmapViewer::_settings($this-contourlines) 1
     225    set ::Rappture::HeightmapViewer::settings_($this-contourlines) 1
    228226    ::checkbutton $inner.f.contour \
    229227        -text "Contour Lines" \
    230         -variable ::Rappture::HeightmapViewer::_settings($this-contourlines) \
     228        -variable ::Rappture::HeightmapViewer::settings_($this-contourlines) \
    231229        -command [itcl::code $this _fixSettings contourlines]
    232230    grid $inner.f.contour -row 2 -column 0 -sticky w
    233231
    234     set ::Rappture::HeightmapViewer::_settings($this-wireframe) "fill"
     232    set ::Rappture::HeightmapViewer::settings_($this-wireframe) "fill"
    235233    ::checkbutton $inner.f.wireframe \
    236234        -text "Wireframe" \
    237235        -onvalue "wireframe" -offvalue "fill" \
    238         -variable ::Rappture::HeightmapViewer::_settings($this-wireframe) \
     236        -variable ::Rappture::HeightmapViewer::settings_($this-wireframe) \
    239237        -command [itcl::code $this _fixSettings wireframe]
    240238    grid $inner.f.wireframe -row 3 -column 0 -sticky w
    241239
    242     set ::Rappture::HeightmapViewer::_settings($this-shading) "smooth"
     240    set ::Rappture::HeightmapViewer::settings_($this-shading) "smooth"
    243241    ::checkbutton $inner.f.shading \
    244242        -text "Flat Shading" \
    245243        -onvalue "flat" -offvalue "smooth" \
    246         -variable ::Rappture::HeightmapViewer::_settings($this-shading) \
     244        -variable ::Rappture::HeightmapViewer::settings_($this-shading) \
    247245        -command [itcl::code $this _fixSettings shading]
    248246    grid $inner.f.shading -row 4 -column 0 -sticky w
     
    261259        [list $_dispatcher event -idle !legend]
    262260
    263     # set up bindings for rotation
     261    # Bindings for rotation via mouse
    264262    bind $itk_component(3dview) <ButtonPress-1> \
    265263        [itcl::code $this _rotate click %x %y]
     
    271269        [itcl::code $this _send "screen %w %h"]
    272270
     271    # Bindings for panning via mouse
    273272    bind $itk_component(3dview) <ButtonPress-2> \
    274273        [itcl::code $this _pan click %x %y]
     
    278277        [itcl::code $this _pan release %x %y]
    279278
     279    # Bindings for panning via keyboard
     280    bind $itk_component(3dview) <KeyPress-Left> \
     281        [itcl::code $this _pan set -10 0]
     282    bind $itk_component(3dview) <KeyPress-Right> \
     283        [itcl::code $this _pan set 10 0]
     284    bind $itk_component(3dview) <KeyPress-Up> \
     285        [itcl::code $this _pan set 0 -10]
     286    bind $itk_component(3dview) <KeyPress-Down> \
     287        [itcl::code $this _pan set 0 10]
     288    bind $itk_component(3dview) <Shift-KeyPress-Left> \
     289        [itcl::code $this _pan set -2 0]
     290    bind $itk_component(3dview) <Shift-KeyPress-Right> \
     291        [itcl::code $this _pan set 2 0]
     292    bind $itk_component(3dview) <Shift-KeyPress-Up> \
     293        [itcl::code $this _pan set 0 -2]
     294    bind $itk_component(3dview) <Shift-KeyPress-Down> \
     295        [itcl::code $this _pan set 0 2]
     296
     297    # Bindings for zoom via keyboard
     298    bind $itk_component(3dview) <KeyPress-Prior> \
     299        [itcl::code $this _zoom out]
     300    bind $itk_component(3dview) <KeyPress-Next> \
     301        [itcl::code $this _zoom in]
     302
     303    bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
     304
    280305    if {[string equal "x11" [tk windowingsystem]]} {
     306        # Bindings for zoom via mouse
    281307        bind $itk_component(3dview) <4> [itcl::code $this _zoom out]
    282308        bind $itk_component(3dview) <5> [itcl::code $this _zoom in]
     
    294320# ----------------------------------------------------------------------
    295321itcl::body Rappture::HeightmapViewer::destructor {} {
    296     set _sendobjs ""  ;# stop any send in progress
     322    set sendobjs_ ""  ;# stop any send in progress
    297323    $_dispatcher cancel !rebuild
    298324    $_dispatcher cancel !send_dataobjs
     
    330356    }
    331357
    332     set pos [lsearch -exact $dataobj $_dlist]
     358    set pos [lsearch -exact $dataobj $dlist_]
    333359    if {$pos < 0} {
    334         lappend _dlist $dataobj
    335         set _obj2ovride($dataobj-color) $params(-color)
    336         set _obj2ovride($dataobj-width) $params(-width)
    337         set _obj2ovride($dataobj-raise) $params(-raise)
     360        lappend dlist_ $dataobj
     361        set obj2ovride_($dataobj-color) $params(-color)
     362        set obj2ovride_($dataobj-width) $params(-width)
     363        set obj2ovride_($dataobj-raise) $params(-raise)
    338364        $_dispatcher event -idle !rebuild
    339365    }
     
    357383      -objects {
    358384        # put the dataobj list in order according to -raise options
    359         set dlist $_dlist
     385        set dlist $dlist_
    360386        foreach obj $dlist {
    361             if { [info exists _obj2ovride($obj-raise)] &&
    362                  $_obj2ovride($obj-raise)} {
     387            if { [info exists obj2ovride_($obj-raise)] &&
     388                 $obj2ovride_($obj-raise)} {
    363389                set i [lsearch -exact $dlist $obj]
    364390                if {$i >= 0} {
     
    400426itcl::body Rappture::HeightmapViewer::delete {args} {
    401427    if {[llength $args] == 0} {
    402         set args $_dlist
     428        set args $dlist_
    403429    }
    404430
     
    406432    set changed 0
    407433    foreach dataobj $args {
    408         set pos [lsearch -exact $_dlist $dataobj]
     434        set pos [lsearch -exact $dlist_ $dataobj]
    409435        if {$pos >= 0} {
    410             set _dlist [lreplace $_dlist $pos $pos]
    411             foreach key [array names _obj2ovride $dataobj-*] {
    412                 unset _obj2ovride($key)
     436            set dlist_ [lreplace $dlist_ $pos $pos]
     437            foreach key [array names obj2ovride_ $dataobj-*] {
     438                unset obj2ovride_($key)
    413439            }
    414440            set changed 1
     
    433459itcl::body Rappture::HeightmapViewer::scale {args} {
    434460    foreach val {xmin xmax ymin ymax zmin zmax vmin vmax} {
    435         set _limits($val) ""
     461        set limits_($val) ""
    436462    }
    437463    foreach obj $args {
     
    439465            foreach {min max} [$obj limits $axis] break
    440466            if {"" != $min && "" != $max} {
    441                 if {"" == $_limits(${axis}min)} {
    442                     set _limits(${axis}min) $min
    443                     set _limits(${axis}max) $max
     467                if {"" == $limits_(${axis}min)} {
     468                    set limits_(${axis}min) $min
     469                    set limits_(${axis}max) $max
    444470                } else {
    445                     if {$min < $_limits(${axis}min)} {
    446                         set _limits(${axis}min) $min
     471                    if {$min < $limits_(${axis}min)} {
     472                        set limits_(${axis}min) $min
    447473                    }
    448                     if {$max > $_limits(${axis}max)} {
    449                         set _limits(${axis}max) $max
     474                    if {$max > $limits_(${axis}max)} {
     475                        set limits_(${axis}max) $max
    450476                    }
    451477                }
     
    501527
    502528# ----------------------------------------------------------------------
    503 # USAGE: isconnected
    504 #
    505 # Clients use this method to see if we are currently connected to
    506 # a server.
    507 # ----------------------------------------------------------------------
    508 itcl::body Rappture::HeightmapViewer::isconnected {} {
    509     return [VisViewer::IsConnected]
    510 }
    511 
    512 # ----------------------------------------------------------------------
    513529# USAGE: Connect ?<host:port>,<host:port>...?
    514530#
     
    536552    VisViewer::Disconnect
    537553
    538     set _outbuf ""
     554    set outbuf_ ""
    539555    # disconnected -- no more data sitting on server
    540     catch {unset _obj2id}
    541     array unset _id2obj
    542     set _obj2id(count) 0
    543     set _id2obj(cound) 0
    544     set _sendobjs ""
     556    catch {unset obj2id_}
     557    array unset id2obj_
     558    set obj2id_(count) 0
     559    set id2obj_(cound) 0
     560    set sendobjs_ ""
    545561}
    546562
     
    553569#
    554570itcl::body Rappture::HeightmapViewer::_send {string} {
    555     if {[llength $_sendobjs] > 0} {
    556         append _outbuf $string "\n"
     571    if {[llength $sendobjs_] > 0} {
     572        append outbuf_ $string "\n"
    557573    } else {
    558574        if {[SendBytes $string]} {
     
    575591
    576592    # Reset the overall limits
    577     if { $_sendobjs != "" } {
    578         set _limits(vmin) ""
    579         set _limits(vmax) ""
    580     }
    581     foreach dataobj $_sendobjs {
     593    if { $sendobjs_ != "" } {
     594        set limits_(vmin) ""
     595        set limits_(vmax) ""
     596    }
     597    foreach dataobj $sendobjs_ {
    582598        foreach comp [$dataobj components] {
    583599            set data [$dataobj blob $comp]
    584600
    585601            foreach { vmin vmax }  [$dataobj limits v] break
    586             if { $_limits(vmin) == "" || $vmin < $_limits(vmin) } {
    587                 set _limits(vmin) $vmin
    588             }
    589             if { $_limits(vmax) == "" || $vmax > $_limits(vmax) } {
    590                 set _limits(vmax) $vmax
     602            if { $limits_(vmin) == "" || $vmin < $limits_(vmin) } {
     603                set limits_(vmin) $vmin
     604            }
     605            if { $limits_(vmax) == "" || $vmax > $limits_(vmax) } {
     606                set limits_(vmax) $vmax
    591607            }
    592608
     
    600616                return
    601617            }
    602             set id $_obj2id(count)
    603             incr _obj2id(count)
    604             set _id2obj($id) [list $dataobj $comp]
    605             set _obj2id($dataobj-$comp) $id
    606             set _receiveids($id) 1
     618            set id $obj2id_(count)
     619            incr obj2id_(count)
     620            set id2obj_($id) [list $dataobj $comp]
     621            set obj2id_($dataobj-$comp) $id
     622            set receiveIds_($id) 1
    607623
    608624            #
     
    615631                return
    616632            }
    617             set _obj2style($dataobj-$comp) $sname
    618         }
    619     }
    620     set _sendobjs ""
     633            set obj2style_($dataobj-$comp) $sname
     634        }
     635    }
     636    set sendobjs_ ""
    621637    blt::busy release $itk_component(hull)
    622638
     
    630646    }
    631647
    632     foreach key [array names _obj2id *-*] {
     648    foreach key [array names obj2id_ *-*] {
    633649        set state [string match $first-* $key]
    634         _send "heightmap data visible $state $_obj2id($key)"
    635         if {[info exists _obj2style($key)]} {
    636             _send "heightmap transfunc $_obj2style($key) $_obj2id($key)"
     650        _send "heightmap data visible $state $obj2id_($key)"
     651        if {[info exists obj2style_($key)]} {
     652            _send "heightmap transfunc $obj2style_($key) $obj2id_($key)"
    637653        }
    638654    }
    639655
    640656    # if there are any commands in the buffer, send them now that we're done
    641     SendBytes $_outbuf
    642     set _outbuf ""
     657    SendBytes $outbuf_
     658    set outbuf_ ""
    643659
    644660    $_dispatcher event -idle !legend
     
    646662
    647663# ----------------------------------------------------------------------
    648 # USAGE: _receive_image -bytes <size>
     664# USAGE: ReceiveImage -bytes <size>
    649665#
    650666# Invoked automatically whenever the "image" command comes in from
     
    652668# specified <size> will follow.
    653669# ----------------------------------------------------------------------
    654 itcl::body Rappture::HeightmapViewer::_receive_image {option size} {
    655     if {[isconnected]} {
     670itcl::body Rappture::HeightmapViewer::ReceiveImage {option size} {
     671    if {[IsConnected]} {
    656672        set bytes [ReceiveBytes $size]
    657673        $_image(plot) configure -data $bytes
     
    668684# ----------------------------------------------------------------------
    669685itcl::body Rappture::HeightmapViewer::ReceiveLegend {ivol vmin vmax size} {
    670     if { [isconnected] } {
     686    if { [IsConnected] } {
    671687        set bytes [ReceiveBytes $size]
    672688        $_image(legend) configure -data $bytes
     
    701717itcl::body Rappture::HeightmapViewer::_rebuild {} {
    702718    # in the midst of sending data? then bail out
    703     if {[llength $_sendobjs] > 0} {
     719    if {[llength $sendobjs_] > 0} {
    704720        return
    705721    }
    706722    # Find any new data that needs to be sent to the server.  Queue this up on
    707     # the _sendobjs list, and send it out a little at a time.  Do this first,
     723    # the sendobjs_ list, and send it out a little at a time.  Do this first,
    708724    # before we rebuild the rest.
    709725    foreach dataobj [get] {
    710726        set comp [lindex [$dataobj components] 0]
    711         if {![info exists _obj2id($dataobj-$comp)]} {
    712             set i [lsearch -exact $_sendobjs $dataobj]
     727        if {![info exists obj2id_($dataobj-$comp)]} {
     728            set i [lsearch -exact $sendobjs_ $dataobj]
    713729            if {$i < 0} {
    714                 lappend _sendobjs $dataobj
    715             }
    716         }
    717     }
    718     if {[llength $_sendobjs] > 0} {
     730                lappend sendobjs_ $dataobj
     731            }
     732        }
     733    }
     734    if {[llength $sendobjs_] > 0} {
    719735        # Send off new data objects
    720736        $_dispatcher event -idle !send_dataobjs
     
    728744            }
    729745        }
    730         foreach key [array names _obj2id *-*] {
     746        foreach key [array names obj2id_ *-*] {
    731747            set state [string match $first-* $key]
    732             _send "heightmap data visible $state $_obj2id($key)"
    733             if {[info exists _obj2style($key)]} {
    734                 _send "heightmap transfunc $_obj2style($key) $_obj2id($key)"
     748            _send "heightmap data visible $state $obj2id_($key)"
     749            if {[info exists obj2style_($key)]} {
     750                _send "heightmap transfunc $obj2style_($key) $obj2id_($key)"
    735751            }
    736752        }
     
    744760
    745761    # Reset the camera and other view parameters
    746     set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     762    set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)]
    747763    _send "camera angle $xyz"
    748     _send "camera zoom $_view(zoom)"
     764    _send "camera zoom $view_(zoom)"
    749765
    750766     if {"" == $itk_option(-plotoutline)} {
     
    769785    switch -- $option {
    770786        "in" {
    771             set _view(zoom) [expr {$_view(zoom)*1.25}]
     787            set view_(zoom) [expr {$view_(zoom)*1.25}]
    772788        }
    773789        "out" {
    774             set _view(zoom) [expr {$_view(zoom)*0.8}]
     790            set view_(zoom) [expr {$view_(zoom)*0.8}]
    775791        }
    776792        "reset" {
    777             array set _view {
     793            array set view_ {
    778794                theta   45
    779795                phi     45
     
    781797                zoom    1.0
    782798            }
    783             set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     799            set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)]
    784800            _send "camera angle $xyz"
    785801        }
    786802    }
    787     _send "camera zoom $_view(zoom)"
     803    _send "camera zoom $view_(zoom)"
    788804}
    789805
     
    797813# ----------------------------------------------------------------------
    798814itcl::body Rappture::HeightmapViewer::_pan {option x y} {
     815    return
     816    # Experimental stuff
     817    if { $option == "set" } {
     818        set dx $x
     819        set dy $y
     820        set view_(x) [expr $view_(x) + $dx]
     821        set view_(y) [expr $view_(y) + $dy]
     822        _send "pan $dx $dy"
     823        return
     824    }
    799825    if { $option == "click" } {
    800826        $itk_component(3dview) configure -cursor hand1
    801827    }
    802828    if { $option == "drag" || $option == "release" } {
    803         set _view(x) [expr $_view(x) + $x]
    804         set _view(y) [expr $_view(y) + $y]
    805         _send "camera pan $_view(x) $_view(y) 0"
     829        set view_(x) [expr $view_(x) + $x]
     830        set view_(y) [expr $view_(y) + $y]
     831        _send "camera pan $view_(x) $view_(y) 0"
    806832    }
    807833    if { $option == "release" } {
     
    822848        click {
    823849            $itk_component(3dview) configure -cursor fleur
    824             set _click(x)       $x
    825             set _click(y)       $y
    826             set _click(theta)   $_view(theta)
    827             set _click(phi)     $_view(phi)
     850            array set click [subst {
     851                x       $x
     852                y       $y
     853                theta   $view_(theta)
     854                phi     $view_(phi)
     855            }]
    828856        }
    829857        drag {
    830             if {[array size _click] == 0} {
     858            if {[array size click_] == 0} {
    831859                _rotate click $x $y
    832860            } else {
     
    839867                if {[catch {
    840868                    # this fails sometimes for no apparent reason
    841                     set dx [expr {double($x-$_click(x))/$w}]
    842                     set dy [expr {double($y-$_click(y))/$h}]
     869                    set dx [expr {double($x-$click_(x))/$w}]
     870                    set dy [expr {double($y-$click_(y))/$h}]
    843871                }]} {
    844872                    return
     
    848876                # Rotate the camera in 3D
    849877                #
    850                 if {$_view(psi) > 90 || $_view(psi) < -90} {
     878                if {$view_(psi) > 90 || $view_(psi) < -90} {
    851879                    # when psi is flipped around, theta moves backwards
    852880                    set dy [expr {-$dy}]
    853881                }
    854                 set theta [expr {$_view(theta) - $dy*180}]
     882                set theta [expr {$view_(theta) - $dy*180}]
    855883                while {$theta < 0} { set theta [expr {$theta+180}] }
    856884                while {$theta > 180} { set theta [expr {$theta-180}] }
    857885
    858886                if {abs($theta) >= 30 && abs($theta) <= 160} {
    859                     set phi [expr {$_view(phi) - $dx*360}]
     887                    set phi [expr {$view_(phi) - $dx*360}]
    860888                    while {$phi < 0} { set phi [expr {$phi+360}] }
    861889                    while {$phi > 360} { set phi [expr {$phi-360}] }
    862                     set psi $_view(psi)
     890                    set psi $view_(psi)
    863891                } else {
    864                     set phi $_view(phi)
    865                     set psi [expr {$_view(psi) - $dx*360}]
     892                    set phi $view_(phi)
     893                    set psi [expr {$view_(psi) - $dx*360}]
    866894                    while {$psi < -180} { set psi [expr {$psi+360}] }
    867895                    while {$psi > 180} { set psi [expr {$psi-360}] }
    868896                }
    869897
    870                 set _view(theta)        $theta
    871                 set _view(phi)          $phi
    872                 set _view(psi)          $psi
    873                 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     898                set view_(theta)        $theta
     899                set view_(phi)          $phi
     900                set view_(psi)          $psi
     901                set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)]
    874902                _send "camera angle $xyz"
    875                 set _click(x) $x
    876                 set _click(y) $y
     903                set click_(x) $x
     904                set click_(y) $y
    877905            }
    878906        }
     
    880908            _rotate drag $x $y
    881909            $itk_component(3dview) configure -cursor ""
    882             catch {unset _click}
     910            catch {unset click_}
    883911        }
    884912        default {
     
    920948            if {"" != $dataobj} {
    921949                set comp [lindex [$dataobj components] 0]
    922                 if {[info exists _obj2id($dataobj-$comp)]} {
    923                     set imap $_obj2id($dataobj-$comp)
     950                if {[info exists obj2id_($dataobj-$comp)]} {
     951                    set imap $obj2id_($dataobj-$comp)
    924952                }
    925953            }
     
    931959        }
    932960        "grid" {
    933             if { [isconnected] } {
    934                 _send "grid visible $_settings($this-grid)"
     961            if { [IsConnected] } {
     962                _send "grid visible $settings_($this-grid)"
    935963            }
    936964        }
    937965        "axes" {
    938             if { [isconnected] } {
    939                 _send "axis visible $_settings($this-axes)"
     966            if { [IsConnected] } {
     967                _send "axis visible $settings_($this-axes)"
    940968            }
    941969        }
    942970        "shading" {
    943             if { [isconnected] } {
    944                 _send "heightmap shading $_settings($this-shading)"
     971            if { [IsConnected] } {
     972                _send "heightmap shading $settings_($this-shading)"
    945973            }
    946974        }
    947975        "wireframe" {
    948             if { [isconnected] } {
    949                 _send "heightmap polygon $_settings($this-wireframe)"
     976            if { [IsConnected] } {
     977                _send "heightmap polygon $settings_($this-wireframe)"
    950978            }
    951979        }
    952980        "contourlines" {
    953             if {[isconnected]} {
     981            if {[IsConnected]} {
    954982                set dataobj [lindex [get] 0]
    955983                if {"" != $dataobj} {
    956984                    set comp [lindex [$dataobj components] 0]
    957                     if {[info exists _obj2id($dataobj-$comp)]} {
    958                         set i $_obj2id($dataobj-$comp)
    959                         set bool $_settings($this-contourlines)
     985                    if {[info exists obj2id_($dataobj-$comp)]} {
     986                        set i $obj2id_($dataobj-$comp)
     987                        set bool $settings_($this-contourlines)
    960988                        _send "heightmap linecontour visible $bool $i"
    961989                    }
     
    9911019    set color white
    9921020    set cmap "0.0 [Color2RGB $color] "
    993     set range [expr $_limits(vmax) - $_limits(vmin)]
     1021    set range [expr $limits_(vmax) - $limits_(vmin)]
    9941022    for {set i 0} {$i < [llength $clist]} {incr i} {
    9951023        set xval [expr {double($i+1)/([llength $clist]+1)}]
     
    10491077# ----------------------------------------------------------------------
    10501078itcl::configbody Rappture::HeightmapViewer::plotoutline {
    1051     if {[isconnected]} {
     1079    if {[IsConnected]} {
    10521080        _send "grid linecolor [Color2RGB $itk_option(-plotoutline)]"
    10531081    }
  • trunk/gui/scripts/molvisviewer.tcl

    r1220 r1228  
    103103    private variable _cacheimage ""
    104104    private variable _busy 0
     105
     106    private variable delta1_ 10
     107    private variable delta2_ 2
    105108
    106109    private common _settings  ;# array of settings for all known widgets
     
    320323    bind $itk_component(3dview) <ButtonRelease-2> \
    321324        [itcl::code $this _pan release %x %y]
     325
     326    bind $itk_component(3dview) <KeyPress-Left> \
     327        [itcl::code $this _pan set -10 0]
     328    bind $itk_component(3dview) <KeyPress-Right> \
     329        [itcl::code $this _pan set 10 0]
     330    bind $itk_component(3dview) <KeyPress-Up> \
     331        [itcl::code $this _pan set 0 -10]
     332    bind $itk_component(3dview) <KeyPress-Down> \
     333        [itcl::code $this _pan set 0 10]
     334    bind $itk_component(3dview) <Shift-KeyPress-Left> \
     335        [itcl::code $this _pan set -2 0]
     336    bind $itk_component(3dview) <Shift-KeyPress-Right> \
     337        [itcl::code $this _pan set 2 0]
     338    bind $itk_component(3dview) <Shift-KeyPress-Up> \
     339        [itcl::code $this _pan set 0 -2]
     340    bind $itk_component(3dview) <Shift-KeyPress-Down> \
     341        [itcl::code $this _pan set 0 2]
     342    bind $itk_component(3dview) <KeyPress-Prior> \
     343        [itcl::code $this _zoom out 2]
     344    bind $itk_component(3dview) <KeyPress-Next> \
     345        [itcl::code $this _zoom in 2]
     346
     347    bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
     348
    322349
    323350    if {[string equal "x11" [tk windowingsystem]]} {
     
    683710# ----------------------------------------------------------------------
    684711itcl::body Rappture::MolvisViewer::_pan {option x y} {
     712    if { $option == "set" } {
     713        set dx $x
     714        set dy $y
     715        set view_(x) [expr $view_(x) + $dx]
     716        set view_(y) [expr $view_(y) + $dy]
     717        _send "pan $dx $dy"
     718        return
     719    }
    685720    if { ![info exists _mevent(x)] } {
    686721        set option "click"
  • trunk/gui/scripts/nanovisviewer.tcl

    r1220 r1228  
    100100    private method _ParseLevelsOption { tf ivol levels }
    101101
    102     private variable _outbuf       ;# buffer for outgoing commands
     102    private variable outbuf_       ;# buffer for outgoing commands
    103103
    104104    private variable _dlist ""     ;# list of data objects
     
    114114    private variable _style2ids    ;# maps id => style settings
    115115
    116     private variable _click        ;# info used for _rotate operations
    117     private variable _limits       ;# autoscale min/max for all axes
    118     private variable _view         ;# view params for 3D view
    119     private variable _mevent
    120     private variable _isomarkers    ;# array of isosurface level values 0..1
    121     private variable _styles
    122     private common   _settings
    123     private variable _activeId ""   ;# The currently active volume.  This
     116    private variable click_        ;# info used for _rotate operations
     117    private variable limits_       ;# autoscale min/max for all axes
     118    private variable view_         ;# view params for 3D view
     119    private variable isomarkers_    ;# array of isosurface level values 0..1
     120    private common   settings_
     121    private variable activeId_ ""   ;# The currently active volume.  This
    124122                                    # indicates which isomarkers and transfer
    125123                                    # function to use when changing markers,
     
    153151    $_dispatcher dispatch $this !rebuild "[itcl::code $this _rebuild]; list"
    154152
    155     set _outbuf ""
     153    set outbuf_ ""
    156154
    157155    #
     
    164162
    165163    # Initialize the view to some default parameters.
    166     array set _view {
     164    array set view_ {
    167165        theta   45
    168166        phi     45
     
    175173    set _obj2id(count) 0
    176174    set _id2obj(count) 0
    177     set _limits(vmin) 0.0
    178     set _limits(vmax) 1.0
     175    set limits_(vmin) 0.0
     176    set limits_(vmax) 1.0
    179177
    180178    itk_component add zoom {
     
    422420    $inner.scales.thickness set 350
    423421
    424     set ::Rappture::NanovisViewer::_settings($this-isosurface) 0
     422    set ::Rappture::NanovisViewer::settings_($this-isosurface) 0
    425423    ::checkbutton $inner.scales.isosurface \
    426424        -text "Isosurface shading" \
    427         -variable ::Rappture::NanovisViewer::_settings($this-isosurface) \
     425        -variable ::Rappture::NanovisViewer::settings_($this-isosurface) \
    428426        -command [itcl::code $this _fixSettings isosurface]
    429427    grid $inner.scales.isosurface -row 4 -column 0 -columnspan 2 -sticky w
    430428
    431     set ::Rappture::NanovisViewer::_settings($this-axes) 1
     429    set ::Rappture::NanovisViewer::settings_($this-axes) 1
    432430    ::checkbutton $inner.scales.axes \
    433431        -text "Axes" \
    434         -variable ::Rappture::NanovisViewer::_settings($this-axes) \
     432        -variable ::Rappture::NanovisViewer::settings_($this-axes) \
    435433        -command [itcl::code $this _fixSettings axes]
    436434    grid $inner.scales.axes -row 5 -column 0 -columnspan 2 -sticky w
    437435
    438     set ::Rappture::NanovisViewer::_settings($this-grid) 0
     436    set ::Rappture::NanovisViewer::settings_($this-grid) 0
    439437    ::checkbutton $inner.scales.grid \
    440438        -text "Grid" \
    441         -variable ::Rappture::NanovisViewer::_settings($this-grid) \
     439        -variable ::Rappture::NanovisViewer::settings_($this-grid) \
    442440        -command [itcl::code $this _fixSettings grid]
    443441    grid $inner.scales.grid -row 6 -column 0 -columnspan 2 -sticky w
    444442
    445     set ::Rappture::NanovisViewer::_settings($this-outline) 1
     443    set ::Rappture::NanovisViewer::settings_($this-outline) 1
    446444    ::checkbutton $inner.scales.outline \
    447445        -text "Outline" \
    448         -variable ::Rappture::NanovisViewer::_settings($this-outline) \
     446        -variable ::Rappture::NanovisViewer::settings_($this-outline) \
    449447        -command [itcl::code $this _fixSettings outline]
    450448    grid $inner.scales.outline -row 7 -column 0 -columnspan 2 -sticky w
     
    464462        [list $_dispatcher event -idle !legend]
    465463
    466     # set up bindings for rotation
     464    # Bindings for rotation via mouse
    467465    bind $itk_component(3dview) <ButtonPress-1> \
    468466        [itcl::code $this _rotate click %x %y]
     
    474472        [itcl::code $this _send "screen %w %h"]
    475473
     474    # Bindings for panning via mouse
    476475    bind $itk_component(3dview) <ButtonPress-2> \
    477476        [itcl::code $this _pan click %x %y]
     
    481480        [itcl::code $this _pan release %x %y]
    482481
     482    # Bindings for panning via keyboard
     483    bind $itk_component(3dview) <KeyPress-Left> \
     484        [itcl::code $this _pan set -10 0]
     485    bind $itk_component(3dview) <KeyPress-Right> \
     486        [itcl::code $this _pan set 10 0]
     487    bind $itk_component(3dview) <KeyPress-Up> \
     488        [itcl::code $this _pan set 0 -10]
     489    bind $itk_component(3dview) <KeyPress-Down> \
     490        [itcl::code $this _pan set 0 10]
     491    bind $itk_component(3dview) <Shift-KeyPress-Left> \
     492        [itcl::code $this _pan set -2 0]
     493    bind $itk_component(3dview) <Shift-KeyPress-Right> \
     494        [itcl::code $this _pan set 2 0]
     495    bind $itk_component(3dview) <Shift-KeyPress-Up> \
     496        [itcl::code $this _pan set 0 -2]
     497    bind $itk_component(3dview) <Shift-KeyPress-Down> \
     498        [itcl::code $this _pan set 0 2]
     499
     500    # Bindings for zoom via keyboard
     501    bind $itk_component(3dview) <KeyPress-Prior> \
     502        [itcl::code $this _zoom out]
     503    bind $itk_component(3dview) <KeyPress-Next> \
     504        [itcl::code $this _zoom in]
     505
     506    bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
     507
    483508    if {[string equal "x11" [tk windowingsystem]]} {
     509        # Bindings for zoom via mouse
    484510        bind $itk_component(3dview) <4> [itcl::code $this _zoom out]
    485511        bind $itk_component(3dview) <5> [itcl::code $this _zoom in]
     
    504530    image delete $_image(legend)
    505531    image delete $_image(download)
    506     array unset _settings $this-*
     532    array unset settings_ $this-*
    507533}
    508534
     
    638664itcl::body Rappture::NanovisViewer::scale {args} {
    639665    foreach val {xmin xmax ymin ymax zmin zmax vmin vmax} {
    640         set _limits($val) ""
     666        set limits_($val) ""
    641667    }
    642668    foreach obj $args {
     
    646672
    647673            if {"" != $min && "" != $max} {
    648                 if {"" == $_limits(${axis}min)} {
    649                     set _limits(${axis}min) $min
    650                     set _limits(${axis}max) $max
     674                if {"" == $limits_(${axis}min)} {
     675                    set limits_(${axis}min) $min
     676                    set limits_(${axis}max) $max
    651677                } else {
    652                     if {$min < $_limits(${axis}min)} {
    653                         set _limits(${axis}min) $min
     678                    if {$min < $limits_(${axis}min)} {
     679                        set limits_(${axis}min) $min
    654680                    }
    655                     if {$max > $_limits(${axis}max)} {
    656                         set _limits(${axis}max) $max
     681                    if {$max > $limits_(${axis}max)} {
     682                        set limits_(${axis}max) $max
    657683                    }
    658684                }
     
    737763
    738764    # disconnected -- no more data sitting on server
    739     set _outbuf ""
     765    set outbuf_ ""
    740766    catch {unset _obj2id}
    741767    array unset _id2obj
     
    754780itcl::body Rappture::NanovisViewer::_send {string} {
    755781    if {[llength $_sendobjs] > 0} {
    756         append _outbuf $string "\n"
     782        append outbuf_ $string "\n"
    757783    } else {
    758784        foreach line [split $string \n] {
     
    806832        # transferred.
    807833        set comp [lindex [$first components] 0]
    808         set _activeId $_obj2id($first-$comp)
     834        set activeId_ $_obj2id($first-$comp)
    809835    }
    810836    foreach key [array names _obj2id *-*] {
     
    833859    }
    834860    # if there are any commands in the buffer, send them now that we're done
    835     SendBytes $_outbuf
    836     set _outbuf ""
     861    SendBytes $outbuf_
     862    set outbuf_ ""
    837863
    838864    $_dispatcher event -idle !legend
     
    847873    # Insure that the global opacity and thickness settings (in the slider
    848874    # settings widgets) are used for the transfer-function used by the active
    849     # volume.  Update the values in the _settings varible.
     875    # volume.  Update the values in the settings_ varible.
    850876    set inner [$itk_component(controls).panel component inner]
    851     set tf $_id2style($_activeId)
     877    set tf $_id2style($activeId_)
    852878    set value [$inner.scales.opacity get]
    853879    set opacity [expr { double($value) * 0.01 }]
    854     set _settings($this-$tf-opacity) $opacity
     880    set settings_($this-$tf-opacity) $opacity
    855881    set value [$inner.scales.thickness get]
    856882    # Scale values between 0.00001 and 0.01000
    857883    set thickness [expr {double($value) * 0.0001}]
    858     set _settings($this-$tf-thickness) $thickness
     884    set settings_($this-$tf-thickness) $thickness
    859885
    860886    if { ![info exists $_obj2styles($first)] } {
     
    932958
    933959    # Display the markers used by the active volume.
    934     set tf $_id2style($_activeId)
    935     if { [info exists _isomarkers($tf)] } {
    936         foreach m $_isomarkers($tf) {
     960    set tf $_id2style($activeId_)
     961    if { [info exists isomarkers_($tf)] } {
     962        foreach m $isomarkers_($tf) {
    937963            $m Show
    938964        }
     
    970996    set ivol $info(id);                 # Id of volume created by server.
    971997
    972     set _limits($ivol-min) $info(min);  # Minimum value of the volume.
    973     set _limits($ivol-max) $info(max);  # Maximum value of the volume.
    974     set _limits(vmin)      $info(vmin); # Overall minimum value.
    975     set _limits(vmax)      $info(vmax); # Overall maximum value.
     998    set limits_($ivol-min) $info(min);  # Minimum value of the volume.
     999    set limits_($ivol-max) $info(max);  # Maximum value of the volume.
     1000    set limits_(vmin)      $info(vmin); # Overall minimum value.
     1001    set limits_(vmax)      $info(vmax); # Overall maximum value.
    9761002
    9771003    unset _receiveids($ivol)
     
    10111037    # settings since the user may have created/deleted/moved markers.
    10121038
    1013     foreach tf [array names _isomarkers] {
    1014         foreach m $_isomarkers($tf) {
     1039    foreach tf [array names isomarkers_] {
     1040        foreach m $isomarkers_($tf) {
    10151041            $m Hide
    10161042        }
     
    10411067    # Reset the camera and other view parameters
    10421068    #
    1043     set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     1069    set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)]
    10441070    _send "camera angle $xyz"
    1045     _send "camera zoom $_view(zoom)"
     1071    _send "camera zoom $view_(zoom)"
    10461072   
    10471073    _fixSettings light
     
    11351161    switch -- $option {
    11361162        "in" {
    1137             set _view(zoom) [expr {$_view(zoom)* 1.25}]
     1163            set view_(zoom) [expr {$view_(zoom)* 1.25}]
    11381164        }
    11391165        "out" {
    1140             set _view(zoom) [expr {$_view(zoom)* 0.8}]
     1166            set view_(zoom) [expr {$view_(zoom)* 0.8}]
    11411167        }
    11421168        "reset" {
    1143             array set _view {
     1169            array set view_ {
    11441170                theta 45
    11451171                phi 45
     
    11471173                zoom 1.0
    11481174            }
    1149             set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     1175            set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)]
    11501176            _send "camera angle $xyz"
    11511177        }
    11521178    }
    1153     _send "camera zoom $_view(zoom)"
     1179    _send "camera zoom $view_(zoom)"
    11541180}
    11551181
     
    11661192        click {
    11671193            $itk_component(3dview) configure -cursor fleur
    1168             set _click(x) $x
    1169             set _click(y) $y
    1170             set _click(theta) $_view(theta)
    1171             set _click(phi) $_view(phi)
     1194            set click_(x) $x
     1195            set click_(y) $y
     1196            set click_(theta) $view_(theta)
     1197            set click_(phi) $view_(phi)
    11721198        }
    11731199        drag {
    1174             if {[array size _click] == 0} {
     1200            if {[array size click_] == 0} {
    11751201                _rotate click $x $y
    11761202            } else {
     
    11831209                if {[catch {
    11841210                    # this fails sometimes for no apparent reason
    1185                     set dx [expr {double($x-$_click(x))/$w}]
    1186                     set dy [expr {double($y-$_click(y))/$h}]
     1211                    set dx [expr {double($x-$click_(x))/$w}]
     1212                    set dy [expr {double($y-$click_(y))/$h}]
    11871213                }]} {
    11881214                    return
     
    11921218                # Rotate the camera in 3D
    11931219                #
    1194                 if {$_view(psi) > 90 || $_view(psi) < -90} {
     1220                if {$view_(psi) > 90 || $view_(psi) < -90} {
    11951221                    # when psi is flipped around, theta moves backwards
    11961222                    set dy [expr {-$dy}]
    11971223                }
    1198                 set theta [expr {$_view(theta) - $dy*180}]
     1224                set theta [expr {$view_(theta) - $dy*180}]
    11991225                while {$theta < 0} { set theta [expr {$theta+180}] }
    12001226                while {$theta > 180} { set theta [expr {$theta-180}] }
    12011227
    12021228                if {abs($theta) >= 30 && abs($theta) <= 160} {
    1203                     set phi [expr {$_view(phi) - $dx*360}]
     1229                    set phi [expr {$view_(phi) - $dx*360}]
    12041230                    while {$phi < 0} { set phi [expr {$phi+360}] }
    12051231                    while {$phi > 360} { set phi [expr {$phi-360}] }
    1206                     set psi $_view(psi)
     1232                    set psi $view_(psi)
    12071233                } else {
    1208                     set phi $_view(phi)
    1209                     set psi [expr {$_view(psi) - $dx*360}]
     1234                    set phi $view_(phi)
     1235                    set psi [expr {$view_(psi) - $dx*360}]
    12101236                    while {$psi < -180} { set psi [expr {$psi+360}] }
    12111237                    while {$psi > 180} { set psi [expr {$psi-360}] }
    12121238                }
    12131239
    1214                 array set _view [subst {
     1240                array set view_ [subst {
    12151241                    theta $theta
    12161242                    phi $phi
     
    12191245                set xyz [Euler2XYZ $theta $phi $psi]
    12201246                _send "camera angle $xyz"
    1221                 set _click(x) $x
    1222                 set _click(y) $y
     1247                set click_(x) $x
     1248                set click_(y) $y
    12231249            }
    12241250        }
     
    12261252            _rotate drag $x $y
    12271253            $itk_component(3dview) configure -cursor ""
    1228             catch {unset _click}
     1254            catch {unset click_}
    12291255        }
    12301256        default {
     
    12451271    return
    12461272    # Experimental stuff
     1273    if { $option == "set" } {
     1274        set dx $x
     1275        set dy $y
     1276        set view_(x) [expr $view_(x) + $dx]
     1277        set view_(y) [expr $view_(y) + $dy]
     1278        _send "pan $dx $dy"
     1279        return
     1280    }
    12471281    if { $option == "click" } {
    12481282        $itk_component(3dview) configure -cursor hand1
    12491283    }
    12501284    if { $option == "drag" || $option == "release" } {
    1251         set _view(x) [expr $_view(x) + $x]
    1252         set _view(y) [expr $_view(y) + $y]
    1253         _send "camera pan $_view(x) $_view(y) 0"
     1285        set view_(x) [expr $view_(x) + $x]
     1286        set view_(y) [expr $view_(y) + $y]
     1287        _send "camera pan $view_(x) $view_(y) 0"
    12541288    }
    12551289    if { $option == "release" } {
     
    13011335            set newpos [expr {0.01*$newval}]
    13021336#            set newval [expr {0.01*($newval-50)
    1303 #                *($_limits(${axis}max)-$_limits(${axis}min))
    1304 #                  + 0.5*($_limits(${axis}max)+$_limits(${axis}min))}]
     1337#                *($limits_(${axis}max)-$limits_(${axis}min))
     1338#                  + 0.5*($limits_(${axis}max)+$limits_(${axis}min))}]
    13051339
    13061340            # show the current value in the readout
     
    13451379    set val [$itk_component(${axis}slicer) get]
    13461380#    set val [expr {0.01*($val-50)
    1347 #        *($_limits(${axis}max)-$_limits(${axis}min))
    1348 #          + 0.5*($_limits(${axis}max)+$_limits(${axis}min))}]
     1381#        *($limits_(${axis}max)-$limits_(${axis}min))
     1382#          + 0.5*($limits_(${axis}max)+$limits_(${axis}min))}]
    13491383    return "Move the [string toupper $axis] cut plane.\nCurrently:  $axis = $val%"
    13501384}
     
    13921426        }
    13931427        opacity {
    1394             if {[isconnected] && $_activeId != "" } {
     1428            if {[isconnected] && $activeId_ != "" } {
    13951429                set val [$inner.scales.opacity get]
    13961430                set sval [expr { 0.01 * double($val) }]
    1397                 set tf $_id2style($_activeId)
    1398                 set _settings($this-$tf-opacity) $sval
     1431                set tf $_id2style($activeId_)
     1432                set settings_($this-$tf-opacity) $sval
    13991433                UpdateTransferFunctions
    14001434            }
     
    14021436
    14031437        thickness {
    1404             if {[isconnected] && $_activeId != "" } {
     1438            if {[isconnected] && $activeId_ != "" } {
    14051439                set val [$inner.scales.thickness get]
    14061440                # Scale values between 0.00001 and 0.01000
    14071441                set sval [expr {0.0001*double($val)}]
    1408                 set tf $_id2style($_activeId)
    1409                 set _settings($this-$tf-thickness) $sval
     1442                set tf $_id2style($activeId_)
     1443                set settings_($this-$tf-thickness) $sval
    14101444                UpdateTransferFunctions
    14111445            }
     
    14131447        "outline" {
    14141448            if {[isconnected]} {
    1415                 _send "volume outline state $_settings($this-outline)"
     1449                _send "volume outline state $settings_($this-outline)"
    14161450            }
    14171451        }           
    14181452        "isosurface" {
    14191453            if {[isconnected]} {
    1420                 _send "volume shading isosurface $_settings($this-isosurface)"
     1454                _send "volume shading isosurface $settings_($this-isosurface)"
    14211455            }
    14221456        }           
    14231457        "grid" {
    14241458            if { [isconnected] } {
    1425                 _send "grid visible $_settings($this-grid)"
     1459                _send "grid visible $settings_($this-grid)"
    14261460            }
    14271461        }
    14281462        "axes" {
    14291463            if { [isconnected] } {
    1430                 _send "axis visible $_settings($this-axes)"
     1464                _send "axis visible $settings_($this-axes)"
    14311465            }
    14321466        }
     
    14481482    set w [expr {[winfo width $itk_component(legend)]-20}]
    14491483    set h [expr {[winfo height $itk_component(legend)]-20-$lineht}]
    1450     set ivol $_activeId
     1484    set ivol $activeId_
    14511485    if {$w > 0 && $h > 0 && "" != $ivol} {
    14521486        _send "legend $ivol $w $h"
     
    15221556    #        barn on this one.
    15231557
    1524     if { ![info exists _isomarkers($tf)] } {
     1558    if { ![info exists isomarkers_($tf)] } {
    15251559        # Have to defer creation of isomarkers until we have data limits
    15261560        if { [info exists style(-markers)] } {
     
    15431577
    15441578    set tag $this-$tf
    1545     if { ![info exists _settings($tag-opacity)] } {
    1546         set _settings($tag-opacity) $style(-opacity)
    1547     }
    1548     set max $_settings($tag-opacity)
     1579    if { ![info exists settings_($tag-opacity)] } {
     1580        set settings_($tag-opacity) $style(-opacity)
     1581    }
     1582    set max $settings_($tag-opacity)
    15491583
    15501584    set isovalues {}
    1551     foreach m $_isomarkers($tf) {
     1585    foreach m $isomarkers_($tf) {
    15521586        lappend isovalues [$m GetRelativeValue]
    15531587    }
     
    15551589    set isovalues [lsort -real $isovalues]
    15561590
    1557     if { ![info exists _settings($tag-thickness)]} {
    1558         set _settings($tag-thickness) 0.05
    1559     }
    1560     set delta $_settings($tag-thickness)
     1591    if { ![info exists settings_($tag-thickness)]} {
     1592        set settings_($tag-thickness) 0.05
     1593    }
     1594    set delta $settings_($tag-thickness)
    15611595
    15621596    set first [lindex $isovalues 0]
     
    16571691            set m [IsoMarker \#auto $c $this $ivol]
    16581692            $m SetRelativeValue $x
    1659             lappend _isomarkers($tf) $m
     1693            lappend isomarkers_($tf) $m
    16601694        }
    16611695    } else {
     
    16631697            set m [IsoMarker \#auto $c $this $ivol]
    16641698            $m SetRelativeValue $x
    1665             lappend _isomarkers($tf) $m
     1699            lappend isomarkers_($tf) $m
    16661700        }
    16671701    }
     
    16901724            set m [IsoMarker \#auto $c $this $ivol]
    16911725            $m SetRelativeValue $value
    1692             lappend _isomarkers($tf) $m
     1726            lappend isomarkers_($tf) $m
    16931727        } else {
    16941728            # ${n} : Set absolute value.
    16951729            set m [IsoMarker \#auto $c $this $ivol]
    16961730            $m SetAbsoluteValue $value
    1697             lappend _isomarkers($tf) $m
     1731            lappend isomarkers_($tf) $m
    16981732        }
    16991733    }
     
    17151749
    17161750itcl::body Rappture::NanovisViewer::_AddIsoMarker { x y } {
    1717     if { $_activeId == "" } {
     1751    if { $activeId_ == "" } {
    17181752        error "active volume isn't set"
    17191753    }
    1720     set tf $_id2style($_activeId)
     1754    set tf $_id2style($activeId_)
    17211755    set c $itk_component(legend)
    1722     set m [IsoMarker \#auto $c $this $_activeId]
     1756    set m [IsoMarker \#auto $c $this $activeId_]
    17231757    set w [winfo width $c]
    17241758    $m SetRelativeValue [expr {double($x-10)/($w-20)}]
    1725     lappend _isomarkers($tf) $m
     1759    lappend isomarkers_($tf) $m
    17261760    UpdateTransferFunctions
    17271761    return 1
     
    17321766    set tf $_id2style($ivol)
    17331767    set bool 0
    1734     if { [info exists _isomarkers($tf)] } {
     1768    if { [info exists isomarkers_($tf)] } {
    17351769        set list {}
    17361770        set marker [namespace tail $marker]
    1737         foreach m $_isomarkers($tf) {
     1771        foreach m $isomarkers_($tf) {
    17381772            set sx [$m GetScreenPosition]
    17391773            if { $m != $marker } {
     
    17481782            lappend list $m
    17491783        }
    1750         set _isomarkers($tf) $list
     1784        set isomarkers_($tf) $list
    17511785        UpdateTransferFunctions
    17521786    }
     
    17561790itcl::body Rappture::NanovisViewer::OverIsoMarker { marker x } {
    17571791    set ivol [$marker GetVolume]
    1758     if { [info exists _isomarkers($ivol)] } {
     1792    if { [info exists isomarkers_($ivol)] } {
    17591793        set marker [namespace tail $marker]
    1760         foreach m $_isomarkers($ivol) {
     1794        foreach m $isomarkers_($ivol) {
    17611795            set sx [$m GetScreenPosition]
    17621796            if { $m != $marker } {
     
    17741808    }
    17751809    set tf $_id2style($ivol)
    1776     set _limits(min) ""
    1777     set _limits(max) ""
     1810    set limits_(min) ""
     1811    set limits_(max) ""
    17781812    foreach ivol $_style2ids($tf) {
    1779         if { ![info exists _limits($ivol-min)] } {
     1813        if { ![info exists limits_($ivol-min)] } {
    17801814            error "can't find $ivol limits"
    17811815        }
    1782         if { $_limits(min) == "" || $_limits(min) > $_limits($ivol-min) } {
    1783             set _limits(min) $_limits($ivol-min)
     1816        if { $limits_(min) == "" || $limits_(min) > $limits_($ivol-min) } {
     1817            set limits_(min) $limits_($ivol-min)
    17841818        }
    1785         if { $_limits(max) == "" || $_limits(max) < $_limits($ivol-max) } {
    1786             set _limits(max) $_limits($ivol-max)
     1819        if { $limits_(max) == "" || $limits_(max) < $limits_($ivol-max) } {
     1820            set limits_(max) $limits_($ivol-max)
    17871821        }
    17881822    }
    1789     return [array get _limits]
    1790 }
     1823    return [array get limits_]
     1824}
  • trunk/gui/scripts/visviewer.tcl

    r1221 r1228  
    2323
    2424    private common servers_         ;# array of visualization server lists
    25     set servers_(nanovis) ""
    26     set servers_(pymol)   ""
     25    set servers_(nanovis) "bilby.hubzero.org:2000"
     26    set servers_(pymol)   "bilby.hubzero.org:2020"
    2727
    2828    private variable sid_ ""        ;# socket connection to server
  • trunk/lang/matlab/Makefile.in

    r1121 r1228  
    6868                rpUtilsProgress$(EXT)
    6969
     70# MEX can't be run in parallel since it generates temporary files
     71# that collide with further compilations.
     72.NOTPARALLEL:
     73
    7074all: $(OBJS)
    7175
  • trunk/packages/vizservers/nanovis/Makefile.in

    r1120 r1228  
    169169install: install-nanovis install-resources install-shaders
    170170
    171 mat_lib:
     171mat_lib: $(MAT_LIB)
     172r2_lib:  $(R2_LIB)
     173img_lib: $(IMG_LIB)
     174tf_lib:  $(TF_LIB)
     175
     176$(MAT_LIB):
    172177        $(MAKE) -C $(MAT_DIR) all
    173178
    174 r2_lib:
     179$(R2_LIB):
    175180        $(MAKE) -C $(R2_DIR)/src all
    176181
    177 img_lib:
     182$(IMG_LIB):
    178183        $(MAKE) -C $(IMG_DIR) all
    179184
    180 tf_lib:
     185$(TF_LIB):
    181186        $(MAKE) -C $(TF_DIR) all
    182187
  • trunk/src/Makefile.in

    r1082 r1228  
    3636all:    core core2 objects
    3737
    38 core:
     38RAPPTURE_LIB = core/librappture.a
     39
     40core: $(RAPPTURE_LIB)
     41
     42$(RAPPTURE_LIB):
    3943        $(MAKE) -C core all
    40 core2:
     44
     45core2: $(RAPPTURE_LIB)
    4146        $(MAKE) -C core2 all
    42 objects:
     47
     48objects: $(RAPPTURE_LIB)
    4349        $(MAKE) -C objects all
    4450
    45 install:
     51install: $(RAPPTURE_LIB)
    4652        $(MAKE) -C core install
    4753        $(MAKE) -C core2 install
Note: See TracChangeset for help on using the changeset viewer.