summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-08-24 21:33:54 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-08-24 21:33:54 (GMT)
commit395cc8ac191b8820f4b1fb066d5cc82ccf4ab56c (patch)
tree7cbef75ea979728de0b0940c32698460d5d2596a /ds9/library
parentb3818336d6da51ef552922675b1d41a2517efd09 (diff)
downloadblt-395cc8ac191b8820f4b1fb066d5cc82ccf4ab56c.zip
blt-395cc8ac191b8820f4b1fb066d5cc82ccf4ab56c.tar.gz
blt-395cc8ac191b8820f4b1fb066d5cc82ccf4ab56c.tar.bz2
add 3d match/lock support
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/3d.tcl67
-rw-r--r--ds9/library/frame.tcl14
-rw-r--r--ds9/library/mframe.tcl4
3 files changed, 82 insertions, 3 deletions
diff --git a/ds9/library/3d.tcl b/ds9/library/3d.tcl
index ca5c83b..2c17889 100644
--- a/ds9/library/3d.tcl
+++ b/ds9/library/3d.tcl
@@ -16,6 +16,7 @@ proc 3DDef {} {
set threed(az) 0
set threed(el) 0
set threed(scale) 1
+ set threed(lock) 0
set threed(method) mip
set threed(background) none
@@ -166,6 +167,7 @@ proc 3DApplyDialog {} {
if {$grid(view)} {
GridUpdateCurrent
}
+ Lock3DCurrent
}
}
@@ -177,6 +179,7 @@ proc 3DResetDialog {} {
3DViewPoint
set threed(scale) 1
3DScale
+ Lock3DCurrent
}
proc Update3DDialog {} {
@@ -229,6 +232,7 @@ proc 3DViewPoint {} {
if {$grid(view)} {
GridUpdateCurrent
}
+ Lock3DCurrent
}
}
@@ -237,7 +241,8 @@ proc 3DViewButton {} {
global current
if {$current(frame) != {}} {
- $current(frame) 3d view begin $threed(az) $threed(el)
+ $current(frame) 3d view $threed(az) $threed(el)
+ Lock3DCurrent
}
}
@@ -246,7 +251,8 @@ proc 3DViewMotion {} {
global current
if {$current(frame) != {}} {
- $current(frame) 3d view motion $threed(az) $threed(el)
+ $current(frame) 3d view $threed(az) $threed(el)
+ Lock3DCurrent
}
}
@@ -255,7 +261,8 @@ proc 3DViewRelease {} {
global current
if {$current(frame) != {}} {
- $current(frame) 3d view end $threed(az) $threed(el)
+ $current(frame) 3d view $threed(az) $threed(el)
+ Lock3DCurrent
}
}
@@ -269,6 +276,7 @@ proc 3DScale {} {
if {$grid(view)} {
GridUpdateCurrent
}
+ Lock3DCurrent
}
}
@@ -344,6 +352,47 @@ proc 3DBackground {} {
}
}
+proc Match3DCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ Match3DView $current(frame)
+ }
+}
+
+proc Match3DView {which} {
+ global ds9
+ global threed
+
+ set rr [$which get 3d view]
+ set az [lindex $rr 0]
+ set el [lindex $rr 1]
+ set scale [$which get 3d scale]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ $ff 3d view $az $el
+ $ff 3d scale $scale
+ }
+ }
+}
+
+proc Lock3DCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ Lock3DView $current(frame)
+ }
+}
+
+proc Lock3DView {which} {
+ global threed
+
+ if {$threed(lock)} {
+ Match3DView $which
+ }
+}
+
# Prefs
proc PrefsDialog3d {} {
@@ -497,6 +546,17 @@ proc Process3DCmd {varname iname} {
}
}
}
+ match {Match3DCurrent}
+ lock {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set threed(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set threed(lock) 1
+ incr i -1
+ }
+ Lock3DCurrent
+ }
default {Create3DFrame; incr i -1}
}
}
@@ -512,6 +572,7 @@ proc ProcessSend3DCmd {proc id param} {
scale {$proc $id "$threed(scale)\n"}
method {$proc $id "$threed(method)\n"}
background {$proc $id "$threed(background)\n"}
+ lock {$proc $id [ToYesNo $threed(lock)]}
highlite {
switch [string tolower [lindex $param 1]] {
color {$proc $id "$threed(highlite,color)\n"}
diff --git a/ds9/library/frame.tcl b/ds9/library/frame.tcl
index ca4ca62..521e8d5 100644
--- a/ds9/library/frame.tcl
+++ b/ds9/library/frame.tcl
@@ -2456,6 +2456,7 @@ proc ProcessLockCmd {varname iname} {
global colorbar
global block
global smooth
+ global threed
# we need to be realized
ProcessRealizeDS9
@@ -2573,6 +2574,16 @@ proc ProcessLockCmd {varname iname} {
}
LockSmoothCurrent
}
+ 3d {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set threed(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set threed(lock) 1
+ incr i -1
+ }
+ Lock3DCurrent
+ }
}
}
@@ -2587,6 +2598,7 @@ proc ProcessSendLockCmd {proc id param} {
global colorbar
global block
global smooth
+ global threed
switch -- [lindex $param 0] {
frame -
@@ -2611,6 +2623,7 @@ proc ProcessSendLockCmd {proc id param} {
colorbars {$proc $id [ToYesNo $colorbar(lock)]}
block {$proc $id [ToYesNo $block(lock)]}
smooth {$proc $id [ToYesNo $smooth(lock)]}
+ 3d {$proc $id [ToYesNo $threed(lock)]}
}
}
@@ -2664,6 +2677,7 @@ proc ProcessMatchCmd {varname iname} {
colorbars {MatchColorCurrent}
block {MatchBlockCurrent}
smooth {MatchSmoothCurrent}
+ 3d {Match3DCurrent}
}
}
diff --git a/ds9/library/mframe.tcl b/ds9/library/mframe.tcl
index 241149f..276d1eb 100644
--- a/ds9/library/mframe.tcl
+++ b/ds9/library/mframe.tcl
@@ -92,6 +92,8 @@ proc FrameMainMenu {} {
-command MatchBlockCurrent
$ds9(mb).frame.match add command -label [msgcat::mc {Smooth}] \
-command MatchSmoothCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {3D View}] \
+ -command Match3DCurrent
menu $ds9(mb).frame.match.frame
$ds9(mb).frame.match.frame add command -label [msgcat::mc {WCS}] \
@@ -163,6 +165,8 @@ proc FrameMainMenu {} {
-variable block(lock) -command {LockBlockCurrent}
$ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Smooth}] \
-variable smooth(lock) -command {LockSmoothCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {3D View}] \
+ -variable threed(lock) -command {Lock3DCurrent}
menu $ds9(mb).frame.lock.frame
$ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {None}] \