From 617eb28f415b4ba0df09acd61e4c32c48ef02445 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 3 May 2019 13:50:57 -0400 Subject: display 3d coordinates in infobox --- ds9/library/colorbar.tcl | 4 +- ds9/library/info.tcl | 127 +++++++++++++++++++++++++++++++---------------- ds9/library/wcs.tcl | 6 +++ 3 files changed, 93 insertions(+), 44 deletions(-) diff --git a/ds9/library/colorbar.tcl b/ds9/library/colorbar.tcl index ed9ec83..f774e63 100644 --- a/ds9/library/colorbar.tcl +++ b/ds9/library/colorbar.tcl @@ -218,8 +218,8 @@ proc ColorbarEnter {x y} { $ds9(canvas) focus $current(colorbar) switch -- $current(colorbar) { - colorbar {LayoutFrameInfoBox base} - colorbarrgb {LayoutFrameInfoBox rgb} + colorbar {LayoutFrameInfoBox $current(frame) base} + colorbarrgb {LayoutFrameInfoBox $current(frame) rgb} } } diff --git a/ds9/library/info.tcl b/ds9/library/info.tcl index c5785ea..931d8d3 100644 --- a/ds9/library/info.tcl +++ b/ds9/library/info.tcl @@ -115,9 +115,6 @@ proc CreateInfoPanel {} { ttk::label $ds9(info).physicalYLabel -text {y} ttk::label $ds9(info).physicalYValue -relief groove \ -textvariable infobox(physical,y) -anchor center - ttk::label $ds9(info).physicalZLabel -text {z} - ttk::label $ds9(info).physicalZValue -relief groove \ - -textvariable infobox(physical,z) -anchor center ttk::label $ds9(info).imageTitle -text [msgcat::mc {Image}] ttk::label $ds9(info).imageXLabel -text {x} @@ -142,16 +139,16 @@ proc CreateInfoPanel {} { -textvariable infobox(angle) -anchor center } -proc LayoutFrameInfoBox {which} { +proc LayoutFrameInfoBox {which type} { global ds9 global view global debug if {$debug(tcl,events)} { - puts stderr "LayoutFrameInfoBox" + puts stderr "LayoutFrameInfoBox $which $type" } - switch -- $which { + switch -- $type { base { grid forget $ds9(info).valueRTitle $ds9(info).valueR \ $ds9(info).valueGTitle $ds9(info).valueG \ @@ -162,20 +159,87 @@ proc LayoutFrameInfoBox {which} { grid $ds9(info).value \ -row $ds9(info,row,value) \ -column 1 -padx 2 -sticky w + + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$which != {} && $view(info,wcs$ll)} { + if {[$which has wcs 3d wcs$ll]} { + grid $ds9(info).wcsZLabel$ll \ + -row $ds9(info,row,wcs$ll) \ + -column 0 -sticky w + grid $ds9(info).wcsZValue$ll \ + -row $ds9(info,row,wcs$ll) \ + -column 1 -padx 2 + incr row + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + } + + if {$which != {} && $view(info,image)} { + if {[$which has fits cube]} { + grid $ds9(info).imageZLabel \ + -row $ds9(info,row,image) \ + -column 0 -sticky w + grid $ds9(info).imageZValue \ + -row $ds9(info,row,image) \ + -column 1 -padx 2 + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue + } + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue + } } horizontal { grid $ds9(info).value \ -row $ds9(info,row,value) \ -column 2 -padx 2 -sticky w - } - } - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$which != {} && $view(info,wcs$ll)} { + if {[$which has wcs 3d wcs$ll]} { + grid $ds9(info).wcsZLabel$ll \ + -row $ds9(info,row,wcs$ll) \ + -column 5 -sticky w + grid $ds9(info).wcsZValue$ll \ + -row $ds9(info,row,wcs$ll) \ + -column 6 -padx 2 + incr row + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + } + + if {$which != {} && $view(info,image)} { + if {[$which has fits cube]} { + grid $ds9(info).imageZLabel \ + -row $ds9(info,row,image) \ + -column 5 -sticky w + grid $ds9(info).imageZValue \ + -row $ds9(info,row,image) \ + -column 6 -padx 2 + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue + } + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue + } + } } - grid forget $ds9(info).physicalZLabel $ds9(info).physicalZValue - grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } rgb { grid forget $ds9(info).value @@ -224,7 +288,6 @@ proc LayoutFrameInfoBox {which} { grid forget $ds9(info).wcsZLabel$ll grid forget $ds9(info).wcsZValue$ll } - grid forget $ds9(info).physicalZLabel $ds9(info).physicalZValue grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } 3d { @@ -253,17 +316,6 @@ proc LayoutFrameInfoBox {which} { } } - if {$view(info,physical)} { - grid $ds9(info).physicalZLabel \ - -row $ds9(info,row,physical) \ - -column 0 -sticky w - grid $ds9(info).physicalZValue \ - -row $ds9(info,row,physical) \ - -column 1 -padx 2 - } else { - grid forget $ds9(info).physicalZLabel \ - $ds9(info).physicalZValue - } if {$view(info,image)} { grid $ds9(info).imageZLabel \ -row $ds9(info,row,image) \ @@ -296,17 +348,6 @@ proc LayoutFrameInfoBox {which} { } } - if {$view(info,physical)} { - grid $ds9(info).physicalZLabel \ - -row $ds9(info,row,physical) \ - -column 5 -sticky w - grid $ds9(info).physicalZValue \ - -row $ds9(info,row,physical) \ - -column 6 -padx 2 - } else { - grid forget $ds9(info).physicalZLabel \ - $ds9(info).physicalZValue - } if {$view(info,image)} { grid $ds9(info).imageZLabel \ -row $ds9(info,row,image) \ @@ -332,7 +373,7 @@ proc EnterInfoBox {which} { puts stderr "EnterInfoBox $which" } - LayoutFrameInfoBox [$which get type] + LayoutFrameInfoBox $which [$which get type] LayoutWCSInfoBox $which set infobox(frame) "[msgcat::mc {Frame}] [string range $which 5 end]" @@ -565,6 +606,7 @@ proc LayoutInfoPanel {} { proc LayoutInfoPanelHorz {} { global ds9 global view + global current set ww 12 set row 0 @@ -685,7 +727,6 @@ proc LayoutInfoPanelHorz {} { set ds9(info,row,value,green) $row set ds9(info,row,value,blue) $row incr row - LayoutFrameInfoBox base # unit if {$view(info,bunit)} { @@ -767,7 +808,6 @@ proc LayoutInfoPanelHorz {} { if {$view(info,physical)} { $ds9(info).physicalXValue configure -width $ww $ds9(info).physicalYValue configure -width $ww - $ds9(info).physicalZValue configure -width $ww grid $ds9(info).physicalTitle -row $row -column 0 -sticky w grid $ds9(info).physicalXLabel -row $row -column 1 -sticky w @@ -805,6 +845,8 @@ proc LayoutInfoPanelHorz {} { grid forget $ds9(info).imageYValue } + LayoutFrameInfoBox $current(frame) base + # frame, zoom, angle if {$view(info,frame)} { $ds9(info).zoomValue configure -width $ww @@ -831,6 +873,7 @@ proc LayoutInfoPanelHorz {} { proc LayoutInfoPanelVert {} { global ds9 global view + global current set ww 13 set row 0 @@ -950,8 +993,7 @@ proc LayoutInfoPanelVert {} { incr row set ds9(info,row,value,blue) $row incr row - LayoutFrameInfoBox base - + # units if {$view(info,bunit)} { $ds9(info).bunitValue configure -width $ww @@ -1042,7 +1084,6 @@ proc LayoutInfoPanelVert {} { if {$view(info,physical)} { $ds9(info).physicalXValue configure -width $ww $ds9(info).physicalYValue configure -width $ww - $ds9(info).physicalZValue configure -width $ww grid $ds9(info).physicalTitle -row $row -column 1 -sticky ew incr row @@ -1086,6 +1127,8 @@ proc LayoutInfoPanelVert {} { grid forget $ds9(info).imageYValue } + LayoutFrameInfoBox $current(frame) base + # frame, zoom, angle if {$view(info,frame)} { $ds9(info).zoomValue configure -width $ww diff --git a/ds9/library/wcs.tcl b/ds9/library/wcs.tcl index b7ed3d5..2f29154 100644 --- a/ds9/library/wcs.tcl +++ b/ds9/library/wcs.tcl @@ -96,6 +96,11 @@ proc LayoutWCSInfoBox {which} { global wcs global view + global debug + if {$debug(tcl,events)} { + puts stderr "LayoutWCSInfoBox $which" + } + # if one wcs coord system is visible, change it set cnt 0 set vv {} @@ -105,6 +110,7 @@ proc LayoutWCSInfoBox {which} { set vv wcs$ll } } + if {$cnt == 1} { set ww [lindex [$which get wcs] 0] if {$view(info,$vv) != $view(info,$ww)} { -- cgit v0.12 From 36c318d244dad7c153a87025405d8aeacbb62dc1 Mon Sep 17 00:00:00 2001 From: William Joye Date: Mon, 6 May 2019 12:50:32 -0400 Subject: display 3d coordinates in infobox --- tksao/frame/framebase.C | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/tksao/frame/framebase.C b/tksao/frame/framebase.C index 6f240bf..dafaa60 100644 --- a/tksao/frame/framebase.C +++ b/tksao/frame/framebase.C @@ -84,7 +84,13 @@ void FrameBase::getInfoCmd(const Vector& vv, Coord::InternalSystem ref, Tcl_SetVar2(interp,var,"value",(char*)sptr->getValue(img),0); CLEARSIGBUS - coordToTclArray(sptr,rr,Coord::IMAGE,var,"image"); + if (isCube()) { + int ss = currentContext->slice(2); + coordToTclArray(sptr,Vector3d(rr,ss-.5),Coord::IMAGE,var,"image"); + } + else + coordToTclArray(sptr,rr,Coord::IMAGE,var,"image"); + coordToTclArray(sptr,rr,Coord::PHYSICAL,var,"physical"); if (hasATMV()) coordToTclArray(sptr,rr,Coord::AMPLIFIER,var,"amplifier"); @@ -127,12 +133,27 @@ void FrameBase::getInfoWCS(char* var, Vector& rr, FitsImage* sptr) Coord::CoordSystem www = (Coord::CoordSystem)(Coord::WCS+ii); if (hasWCS(www)) { - VectorStr out = sptr->mapFromRef(rr, www, wcsSkyFrame_, wcsSkyFormat_); - - Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",x"),out[0],0); - Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",y"),out[1],0); - Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",z"),"",0); + if (hasWCS3D(www)) { + int ss = currentContext->slice(2); + VectorStr3d out = sptr->mapFromRef(Vector3d(rr, ss-.5), + www, wcsSkyFrame_,wcsSkyFormat_); + Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",x"), + out[0],0); + Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",y"), + out[1],0); + Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",z"), + out[2],0); + } + else { + VectorStr out = sptr->mapFromRef(rr, www, wcsSkyFrame_, wcsSkyFormat_); + Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",x"), + out[0],0); + Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",y"), + out[1],0); + Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",z"),"",0); + } + char* xsym = (char*)sptr->getWCSAxisSymbol(www,0); if (xsym) Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",x,sys"),xsym,0); @@ -179,6 +200,16 @@ void FrameBase::coordToTclArray(FitsImage* ptr, const Vector& vv, doubleToTclArray(rr[1], var, base, "y"); } +void FrameBase::coordToTclArray(FitsImage* ptr, const Vector3d& vv, + Coord::CoordSystem out, + const char* var, const char* base) +{ + Vector3d rr = ptr->mapFromRef(vv, out); + doubleToTclArray(rr[0], var, base, "x"); + doubleToTclArray(rr[1], var, base, "y"); + doubleToTclArray(rr[2], var, base, "z"); +} + double FrameBase::calcZoomPanner() { if (!(keyContext->fits && pannerPixmap)) -- cgit v0.12 From 8822e419e6d558c187cf08ea4850ed3a6aed95f1 Mon Sep 17 00:00:00 2001 From: William Joye Date: Mon, 6 May 2019 12:50:47 -0400 Subject: display 3d coordinates in infobox --- tksao/frame/framebase.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tksao/frame/framebase.h b/tksao/frame/framebase.h index b379d14..9aa10a5 100644 --- a/tksao/frame/framebase.h +++ b/tksao/frame/framebase.h @@ -22,6 +22,8 @@ protected: private: void coordToTclArray(FitsImage*, const Vector&, Coord::CoordSystem, const char*, const char*); + void coordToTclArray(FitsImage*, const Vector3d&, Coord::CoordSystem, + const char*, const char*); void getInfoWCS(char*, Vector&, FitsImage*); -- cgit v0.12 From 1b31a85d1fd954211fef55a2619dbbaeb38cf45c Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 8 May 2019 13:03:00 -0400 Subject: display 3d coordinates in infobox --- ds9/library/info.tcl | 351 +++++++++++++++++++++++++-------------------------- 1 file changed, 174 insertions(+), 177 deletions(-) diff --git a/ds9/library/info.tcl b/ds9/library/info.tcl index 931d8d3..2ab718e 100644 --- a/ds9/library/info.tcl +++ b/ds9/library/info.tcl @@ -148,142 +148,76 @@ proc LayoutFrameInfoBox {which type} { puts stderr "LayoutFrameInfoBox $which $type" } + switch -- $view(layout) { + horizontal {LayoutFrameInfoBoxHorz $which $type} + vertical {LayoutFrameInfoBoxVert $which $type} + } +} + +proc LayoutFrameInfoBoxHorz {which type} { + global ds9 + global view + + global debug + if {$debug(tcl,events)} { + puts stderr "LayoutFrameInfoBoxHorz $which $type" + } + switch -- $type { base { grid forget $ds9(info).valueRTitle $ds9(info).valueR \ $ds9(info).valueGTitle $ds9(info).valueG \ $ds9(info).valueBTitle $ds9(info).valueB - switch -- $view(layout) { - vertical { - grid $ds9(info).value \ - -row $ds9(info,row,value) \ - -column 1 -padx 2 -sticky w - - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {$which != {} && $view(info,wcs$ll)} { - if {[$which has wcs 3d wcs$ll]} { - grid $ds9(info).wcsZLabel$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 0 -sticky w - grid $ds9(info).wcsZValue$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 1 -padx 2 - incr row - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } + grid $ds9(info).value -row $ds9(info,row,value) \ + -column 2 -padx 2 -sticky w - if {$which != {} && $view(info,image)} { - if {[$which has fits cube]} { - grid $ds9(info).imageZLabel \ - -row $ds9(info,row,image) \ - -column 0 -sticky w - grid $ds9(info).imageZValue \ - -row $ds9(info,row,image) \ - -column 1 -padx 2 - } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue - } + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$which != {} && $view(info,wcs$ll)} { + if {[$which has wcs 3d wcs$ll]} { + grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll)\ + -column 5 -sticky w + grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll)\ + -column 6 -padx 2 + incr row } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll } + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll } - horizontal { - grid $ds9(info).value \ - -row $ds9(info,row,value) \ - -column 2 -padx 2 -sticky w - - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {$which != {} && $view(info,wcs$ll)} { - if {[$which has wcs 3d wcs$ll]} { - grid $ds9(info).wcsZLabel$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 5 -sticky w - grid $ds9(info).wcsZValue$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 6 -padx 2 - incr row - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } + } - if {$which != {} && $view(info,image)} { - if {[$which has fits cube]} { - grid $ds9(info).imageZLabel \ - -row $ds9(info,row,image) \ - -column 5 -sticky w - grid $ds9(info).imageZValue \ - -row $ds9(info,row,image) \ - -column 6 -padx 2 - } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue - } - } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue - } + if {$which != {} && $view(info,image)} { + if {[$which has fits cube]} { + grid $ds9(info).imageZLabel \ + -row $ds9(info,row,image) -column 5 -sticky w + grid $ds9(info).imageZValue \ + -row $ds9(info,row,image) -column 6 -padx 2 + } else { + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } + } else { + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } } rgb { grid forget $ds9(info).value - switch $view(layout) { - vertical { - grid $ds9(info).valueRTitle \ - -row $ds9(info,row,value,red) \ - -column 0 -sticky w - grid $ds9(info).valueR -row $ds9(info,row,value,red) \ - -column 1 -padx 2 -sticky w - grid $ds9(info).valueGTitle \ - -row $ds9(info,row,value,green) \ - -column 0 -sticky w - grid $ds9(info).valueG \ - -row $ds9(info,row,value,green) \ - -column 1 -padx 2 -sticky w - grid $ds9(info).valueBTitle \ - -row $ds9(info,row,value,blue) \ - -column 0 -sticky w - grid $ds9(info).valueB \ - -row $ds9(info,row,value,blue) \ - -column 1 -padx 2 -sticky w - } - horizontal { - grid $ds9(info).valueRTitle \ - -row $ds9(info,row,value,red) \ - -column 1 -sticky w - grid $ds9(info).valueR \ - -row $ds9(info,row,value,red) \ - -column 2 -padx 2 -sticky w - grid $ds9(info).valueGTitle \ - -row $ds9(info,row,value,green) \ - -column 3 -sticky w - grid $ds9(info).valueG \ - -row $ds9(info,row,value,green) \ - -column 4 -padx 2 -sticky w - grid $ds9(info).valueBTitle \ - -row $ds9(info,row,value,blue) \ - -column 5 -sticky w - grid $ds9(info).valueB \ - -row $ds9(info,row,value,blue) \ - -column 6 -padx 2 -sticky w - } - } + grid $ds9(info).valueRTitle -row $ds9(info,row,value,red) \ + -column 1 -sticky w + grid $ds9(info).valueR -row $ds9(info,row,value,red) \ + -column 2 -padx 2 -sticky w + grid $ds9(info).valueGTitle -row $ds9(info,row,value,green) \ + -column 3 -sticky w + grid $ds9(info).valueG -row $ds9(info,row,value,green) \ + -column 4 -padx 2 -sticky w + grid $ds9(info).valueBTitle -row $ds9(info,row,value,blue) \ + -column 5 -sticky w + grid $ds9(info).valueB -row $ds9(info,row,value,blue) \ + -column 6 -padx 2 -sticky w + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { grid forget $ds9(info).wcsZLabel$ll grid forget $ds9(info).wcsZValue$ll @@ -295,71 +229,134 @@ proc LayoutFrameInfoBox {which type} { $ds9(info).valueGTitle $ds9(info).valueG \ $ds9(info).valueBTitle $ds9(info).valueB - switch -- $view(layout) { - vertical { - grid $ds9(info).value -row $ds9(info,row,value) \ - -column 1 -padx 2 -sticky w - - foreach ll {{} a b c d e f g h i j - k l m n o p q r s t u v w x y z} { - if {$view(info,wcs$ll)} { - grid $ds9(info).wcsZLabel$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 0 -sticky w - grid $ds9(info).wcsZValue$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 1 -padx 2 - incr row - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } + grid $ds9(info).value -row $ds9(info,row,value) \ + -column 2 -padx 2 -sticky w + + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$view(info,wcs$ll)} { + grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll) \ + -column 5 -sticky w + grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll) \ + -column 6 -padx 2 + incr row + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + } + + if {$view(info,image)} { + grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ + -column 5 -sticky w + grid $ds9(info).imageZValue -row $ds9(info,row,image) \ + -column 6 -padx 2 + } else { + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue + } + } + } +} + +proc LayoutFrameInfoBoxVert {which type} { + global ds9 + global view + + global debug + if {$debug(tcl,events)} { + puts stderr "LayoutFrameInfoBoxVert $which $type" + } + + switch -- $type { + base { + grid forget $ds9(info).valueRTitle $ds9(info).valueR \ + $ds9(info).valueGTitle $ds9(info).valueG \ + $ds9(info).valueBTitle $ds9(info).valueB - if {$view(info,image)} { - grid $ds9(info).imageZLabel \ - -row $ds9(info,row,image) \ + grid $ds9(info).value -row $ds9(info,row,value) \ + -column 1 -padx 2 -sticky w + + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$which != {} && $view(info,wcs$ll)} { + if {[$which has wcs 3d wcs$ll]} { + grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll)\ -column 0 -sticky w - grid $ds9(info).imageZValue \ - -row $ds9(info,row,image) \ + grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll)\ -column 1 -padx 2 + incr row } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll } + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll } - horizontal { - grid $ds9(info).value -row $ds9(info,row,value) \ - -column 2 -padx 2 -sticky w - - foreach ll {{} a b c d e f g h i j - k l m n o p q r s t u v w x y z} { - if {$view(info,wcs$ll)} { - grid $ds9(info).wcsZLabel$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 5 -sticky w - grid $ds9(info).wcsZValue$ll \ - -row $ds9(info,row,wcs$ll) \ - -column 6 -padx 2 - incr row - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } + } - if {$view(info,image)} { - grid $ds9(info).imageZLabel \ - -row $ds9(info,row,image) \ - -column 5 -sticky w - grid $ds9(info).imageZValue \ - -row $ds9(info,row,image) \ - -column 6 -padx 2 - } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue - } + if {$which != {} && $view(info,image)} { + if {[$which has fits cube]} { + grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ + -column 0 -sticky w + grid $ds9(info).imageZValue -row $ds9(info,row,image) \ + -column 1 -padx 2 + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue } + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue + } + } + rgb { + grid forget $ds9(info).value + grid $ds9(info).valueRTitle -row $ds9(info,row,value,red) \ + -column 0 -sticky w + grid $ds9(info).valueR -row $ds9(info,row,value,red) \ + -column 1 -padx 2 -sticky w + grid $ds9(info).valueGTitle -row $ds9(info,row,value,green) \ + -column 0 -sticky w + grid $ds9(info).valueG -row $ds9(info,row,value,green) \ + -column 1 -padx 2 -sticky w + grid $ds9(info).valueBTitle -row $ds9(info,row,value,blue) \ + -column 0 -sticky w + grid $ds9(info).valueB -row $ds9(info,row,value,blue) \ + -column 1 -padx 2 -sticky w + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue + } + 3d { + grid forget $ds9(info).valueRTitle $ds9(info).valueR \ + $ds9(info).valueGTitle $ds9(info).valueG \ + $ds9(info).valueBTitle $ds9(info).valueB + + grid $ds9(info).value -row $ds9(info,row,value) \ + -column 1 -padx 2 -sticky w + + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$view(info,wcs$ll)} { + grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll) \ + -column 0 -sticky w + grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll) \ + -column 1 -padx 2 + incr row + } else { + grid forget $ds9(info).wcsZLabel$ll + grid forget $ds9(info).wcsZValue$ll + } + } + + if {$view(info,image)} { + grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ + -column 0 -sticky w + grid $ds9(info).imageZValue -row $ds9(info,row,image) \ + -column 1 -padx 2 + } else { + grid forget $ds9(info).imageZLabel \ + $ds9(info).imageZValue } } } -- cgit v0.12 From 45159fc43e20ea078fef413f3cab48f933bfbae1 Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 8 May 2019 14:09:39 -0400 Subject: display 3d coordinates in infobox --- ds9/library/info.tcl | 226 ++++++++++++++++++++++----------------------------- 1 file changed, 99 insertions(+), 127 deletions(-) diff --git a/ds9/library/info.tcl b/ds9/library/info.tcl index 2ab718e..cc0bc01 100644 --- a/ds9/library/info.tcl +++ b/ds9/library/info.tcl @@ -140,7 +140,6 @@ proc CreateInfoPanel {} { } proc LayoutFrameInfoBox {which type} { - global ds9 global view global debug @@ -149,62 +148,35 @@ proc LayoutFrameInfoBox {which type} { } switch -- $view(layout) { - horizontal {LayoutFrameInfoBoxHorz $which $type} - vertical {LayoutFrameInfoBoxVert $which $type} + horizontal { + LayoutFrameInfoBoxHorzValue $which $type + LayoutFrameInfoBoxHorzWCS $which $type + LayoutFrameInfoBoxHorzImage $which $type + } + vertical { + LayoutFrameInfoBoxVertValue $which $type + LayoutFrameInfoBoxVertWCS $which $type + LayoutFrameInfoBoxVertImage $which $type + } } } -proc LayoutFrameInfoBoxHorz {which type} { +proc LayoutFrameInfoBoxHorzValue {which type} { global ds9 - global view - - global debug - if {$debug(tcl,events)} { - puts stderr "LayoutFrameInfoBoxHorz $which $type" - } switch -- $type { - base { + base - + 3d { grid forget $ds9(info).valueRTitle $ds9(info).valueR \ $ds9(info).valueGTitle $ds9(info).valueG \ $ds9(info).valueBTitle $ds9(info).valueB grid $ds9(info).value -row $ds9(info,row,value) \ -column 2 -padx 2 -sticky w - - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {$which != {} && $view(info,wcs$ll)} { - if {[$which has wcs 3d wcs$ll]} { - grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll)\ - -column 5 -sticky w - grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll)\ - -column 6 -padx 2 - incr row - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } - - if {$which != {} && $view(info,image)} { - if {[$which has fits cube]} { - grid $ds9(info).imageZLabel \ - -row $ds9(info,row,image) -column 5 -sticky w - grid $ds9(info).imageZValue \ - -row $ds9(info,row,image) -column 6 -padx 2 - } else { - grid forget $ds9(info).imageZLabel $ds9(info).imageZValue - } - } else { - grid forget $ds9(info).imageZLabel $ds9(info).imageZValue - } } rgb { grid forget $ds9(info).value + grid $ds9(info).valueRTitle -row $ds9(info,row,value,red) \ -column 1 -sticky w grid $ds9(info).valueR -row $ds9(info,row,value,red) \ @@ -217,39 +189,58 @@ proc LayoutFrameInfoBoxHorz {which type} { -column 5 -sticky w grid $ds9(info).valueB -row $ds9(info,row,value,blue) \ -column 6 -padx 2 -sticky w + } + } +} - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll +proc LayoutFrameInfoBoxHorzWCS {which type} { + global ds9 + global view + + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$which != {} && $view(info,wcs$ll)} { + if {[$which has wcs 3d wcs$ll]} { + grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll)\ + -column 5 -sticky w + grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll)\ + -column 6 -padx 2 + incr row + } else { + grid forget $ds9(info).wcsZLabel$ll \ + $ds9(info).wcsZValue$ll } - grid forget $ds9(info).imageZLabel $ds9(info).imageZValue + } else { + grid forget $ds9(info).wcsZLabel$ll $ds9(info).wcsZValue$ll } - 3d { - grid forget $ds9(info).valueRTitle $ds9(info).valueR \ - $ds9(info).valueGTitle $ds9(info).valueG \ - $ds9(info).valueBTitle $ds9(info).valueB + } +} - grid $ds9(info).value -row $ds9(info,row,value) \ - -column 2 -padx 2 -sticky w +proc LayoutFrameInfoBoxHorzImage {which type} { + global ds9 + global view - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {$view(info,wcs$ll)} { - grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll) \ - -column 5 -sticky w - grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll) \ - -column 6 -padx 2 - incr row + switch $type { + base - + rgb { + if {$which != {} && $view(info,image)} { + if {[$which has fits cube]} { + grid $ds9(info).imageZLabel \ + -row $ds9(info,row,image) -column 5 -sticky w + grid $ds9(info).imageZValue \ + -row $ds9(info,row,image) -column 6 -padx 2 } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } + } else { + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } - + } + 3d { if {$view(info,image)} { - grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ - -column 5 -sticky w - grid $ds9(info).imageZValue -row $ds9(info,row,image) \ - -column 6 -padx 2 + grid $ds9(info).imageZLabel \ + -row $ds9(info,row,image) -column 5 -sticky w + grid $ds9(info).imageZValue \ + -row $ds9(info,row,image) -column 6 -padx 2 } else { grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } @@ -257,59 +248,22 @@ proc LayoutFrameInfoBoxHorz {which type} { } } -proc LayoutFrameInfoBoxVert {which type} { +proc LayoutFrameInfoBoxVertValue {which type} { global ds9 - global view - - global debug - if {$debug(tcl,events)} { - puts stderr "LayoutFrameInfoBoxVert $which $type" - } switch -- $type { - base { + base - + 3d { grid forget $ds9(info).valueRTitle $ds9(info).valueR \ $ds9(info).valueGTitle $ds9(info).valueG \ $ds9(info).valueBTitle $ds9(info).valueB grid $ds9(info).value -row $ds9(info,row,value) \ -column 1 -padx 2 -sticky w - - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {$which != {} && $view(info,wcs$ll)} { - if {[$which has wcs 3d wcs$ll]} { - grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll)\ - -column 0 -sticky w - grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll)\ - -column 1 -padx 2 - incr row - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll - } - } - - if {$which != {} && $view(info,image)} { - if {[$which has fits cube]} { - grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ - -column 0 -sticky w - grid $ds9(info).imageZValue -row $ds9(info,row,image) \ - -column 1 -padx 2 - } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue - } - } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue - } } rgb { grid forget $ds9(info).value + grid $ds9(info).valueRTitle -row $ds9(info,row,value,red) \ -column 0 -sticky w grid $ds9(info).valueR -row $ds9(info,row,value,red) \ @@ -322,41 +276,59 @@ proc LayoutFrameInfoBoxVert {which type} { -column 0 -sticky w grid $ds9(info).valueB -row $ds9(info,row,value,blue) \ -column 1 -padx 2 -sticky w - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll + } + } +} + +proc LayoutFrameInfoBoxVertWCS {which type} { + global ds9 + global view + + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {$which != {} && $view(info,wcs$ll)} { + if {[$which has wcs 3d wcs$ll]} { + grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll)\ + -column 0 -sticky w + grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll)\ + -column 1 -padx 2 + incr row + } else { + grid forget $ds9(info).wcsZLabel$ll $ds9(info).wcsZValue$ll } - grid forget $ds9(info).imageZLabel $ds9(info).imageZValue + } else { + grid forget $ds9(info).wcsZLabel$ll $ds9(info).wcsZValue$ll } - 3d { - grid forget $ds9(info).valueRTitle $ds9(info).valueR \ - $ds9(info).valueGTitle $ds9(info).valueG \ - $ds9(info).valueBTitle $ds9(info).valueB + } +} - grid $ds9(info).value -row $ds9(info,row,value) \ - -column 1 -padx 2 -sticky w +proc LayoutFrameInfoBoxVertImage {which type} { + global ds9 + global view - foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {$view(info,wcs$ll)} { - grid $ds9(info).wcsZLabel$ll -row $ds9(info,row,wcs$ll) \ + switch $type { + base - + rgb { + if {$which != {} && $view(info,image)} { + if {[$which has fits cube]} { + grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ -column 0 -sticky w - grid $ds9(info).wcsZValue$ll -row $ds9(info,row,wcs$ll) \ + grid $ds9(info).imageZValue -row $ds9(info,row,image) \ -column 1 -padx 2 - incr row } else { - grid forget $ds9(info).wcsZLabel$ll - grid forget $ds9(info).wcsZValue$ll + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } + } else { + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } - + } + 3d { if {$view(info,image)} { grid $ds9(info).imageZLabel -row $ds9(info,row,image) \ -column 0 -sticky w grid $ds9(info).imageZValue -row $ds9(info,row,image) \ -column 1 -padx 2 } else { - grid forget $ds9(info).imageZLabel \ - $ds9(info).imageZValue + grid forget $ds9(info).imageZLabel $ds9(info).imageZValue } } } -- cgit v0.12 From 4003cb0f684a8f901093a6ca85ac9d862c553369 Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 8 May 2019 14:11:09 -0400 Subject: display 3d coordinates in infobox --- ds9/doc/release/r8.1.html | 1 + 1 file changed, 1 insertion(+) diff --git a/ds9/doc/release/r8.1.html b/ds9/doc/release/r8.1.html index b853eb0..75aed02 100644 --- a/ds9/doc/release/r8.1.html +++ b/ds9/doc/release/r8.1.html @@ -79,6 +79,7 @@
  • 05.02.2019 REGION: fixed histogram analysis plot if region off image.
  • 05.03.2019 REGION: fixed statistics dialog if region off image.
  • 05.07.2019 SAMP: removed previous added -keepalive to http::geturl calls except for URL cda.harvard.edu.
  • +
  • 05.08.2019 GUI: display 3d coordinates in infobox if available for all types of frames.
  • xx.xx.2019 RELEASE version 8.1b1
  • -- cgit v0.12