diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-09-01 21:19:35 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-09-01 21:19:35 (GMT) |
commit | 0cf0d3665b5ea001db3ad489b70344f688bc21ff (patch) | |
tree | eb99bf86a93b4f1b26d0f30bc94453f261137d40 | |
parent | dd509055091e6dbb4cec991b5179aa979c699ad5 (diff) | |
download | blt-0cf0d3665b5ea001db3ad489b70344f688bc21ff.zip blt-0cf0d3665b5ea001db3ad489b70344f688bc21ff.tar.gz blt-0cf0d3665b5ea001db3ad489b70344f688bc21ff.tar.bz2 |
new AST support
-rw-r--r-- | tksao/frame/framebase.C | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/tksao/frame/framebase.C b/tksao/frame/framebase.C index fcb043a..50e4077 100644 --- a/tksao/frame/framebase.C +++ b/tksao/frame/framebase.C @@ -131,6 +131,7 @@ void FrameBase::updateBin(const Matrix& mx) Base::updateBin(mx); } +#ifndef NEWWCS void FrameBase::updatePanner() { Base::updatePanner(); @@ -174,7 +175,7 @@ void FrameBase::updatePanner() Vector north = ((npix-orpix2)*mm).normalize(); Vector epix = keyContext->fits->wcs2pix(Vector(orval[0]+delta[0],orval[1]), wcsSystem_,wcsSky_); Vector east = ((epix-orpix2)*mm).normalize(); - + // sanity check Vector diff = (north-east).abs(); if ((north[0]==0 && north[1]==0) || @@ -193,6 +194,64 @@ void FrameBase::updatePanner() Tcl_Eval(interp, str.str().c_str()); } } +#else +void FrameBase::updatePanner() +{ + Base::updatePanner(); + + if (usePanner) { + ostringstream str; + + str << pannerName << " update " << (void*)pannerPixmap << ';'; + + // calculate bbox + Vector ll = Vector(0,0) * widgetToPanner; + Vector lr = Vector(options->width,0) * widgetToPanner; + Vector ur = Vector(options->width,options->height) * widgetToPanner; + Vector ul = Vector(0,options->height) * widgetToPanner; + + str << pannerName << " update bbox " + << ll << ' ' << lr << ' ' << ur << ' ' << ul << ';'; + + // calculate image compass vectors + Matrix mm = + FlipY() * + irafMatrix_ * + wcsOrientationMatrix * + Rotate(wcsRotation) * + orientationMatrix * + Rotate(rotation); + + Vector xx = (Vector(1,0)*mm).normalize(); + Vector yy = (Vector(0,1)*mm).normalize(); + + str << pannerName << " update image compass " + << xx << ' ' << yy << ';'; + + if (keyContext->fits && keyContext->fits->hasWCS(wcsSystem_)) { + double rr = keyContext->fits->getWCSRotation(wcsSystem_, wcsSky_); + Matrix mx; + switch (keyContext->fits->getWCSOrientation(wcsSystem_, wcsSky_)) { + case Coord::XX: + mx *= FlipX(); + break; + default: + break; + } + mx *= Rotate(rr)*mm; + Vector north = (Vector(0,1)*mx).normalize(); + Vector east = (Vector(-1,0)*mx).normalize(); + + str << pannerName << " update wcs compass " + << north << ' ' << east << ends; + } + else + str << pannerName << " update wcs compass invalid" << ends; + + Tcl_Eval(interp, str.str().c_str()); + } +} +#endif void FrameBase::x11MagnifierCursor(const Vector& vv) { |