summaryrefslogtreecommitdiffstats
path: root/tksao
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-09-05 17:41:43 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-09-05 17:41:43 (GMT)
commitce22e6a1f37e5db1dd6cfc4fefdf4d9ab2cab036 (patch)
treeda00199d50fbceef3c121bf4252d9123a8f94869 /tksao
parent0cf0d3665b5ea001db3ad489b70344f688bc21ff (diff)
downloadblt-ce22e6a1f37e5db1dd6cfc4fefdf4d9ab2cab036.zip
blt-ce22e6a1f37e5db1dd6cfc4fefdf4d9ab2cab036.tar.gz
blt-ce22e6a1f37e5db1dd6cfc4fefdf4d9ab2cab036.tar.bz2
new AST support
Diffstat (limited to 'tksao')
-rw-r--r--tksao/frame/frame3dbase.C72
1 files changed, 72 insertions, 0 deletions
diff --git a/tksao/frame/frame3dbase.C b/tksao/frame/frame3dbase.C
index 9069b03..8956684 100644
--- a/tksao/frame/frame3dbase.C
+++ b/tksao/frame/frame3dbase.C
@@ -785,6 +785,7 @@ void Frame3dBase::updatePannerMatrices()
Base::updatePannerMatrices();
}
+#ifndef NEWWCS
void Frame3dBase::updatePanner()
{
// do this first
@@ -849,6 +850,76 @@ void Frame3dBase::updatePanner()
east = (Vector3d(-1,0)*mm).normalize();
}
+ cerr << endl;
+ cerr << north << ' ' << east << endl;
+ {
+ }
+
+ // and update the panner
+ str << pannerName << " update wcs compass "
+ << north << ' ' << east << ends;
+ }
+ else
+ str << pannerName << " update wcs compass invalid" << ends;
+
+ Tcl_Eval(interp, str.str().c_str());
+ }
+}
+#else
+void Frame3dBase::updatePanner()
+{
+ // do this first
+ Base::updatePanner();
+
+ // always render (to update panner background color)
+ if (usePanner) {
+ if (keyContext->fits) {
+ XSetForeground(display, pannerGC, getColor("black"));
+ x11Border(Coord::PANNER,FrScale::IMGSEC,pannerGC,pannerPixmap);
+ }
+
+ ostringstream str;
+ str << pannerName << " update " << (void*)pannerPixmap << ';';
+
+ // calculate bbox
+ Vector ll = Vector(0,0) * widgetToPanner3d;
+ Vector lr = Vector(options->width,0) * widgetToPanner3d;
+ Vector ur = Vector(options->width,options->height) * widgetToPanner3d;
+ Vector ul = Vector(0,options->height) * widgetToPanner3d;
+
+ str << pannerName << " update bbox "
+ << ll << ' ' << lr << ' ' << ur << ' ' << ul << ';';
+
+ // calculate image compass vectors
+ Matrix3d mm =
+ Matrix3d(wcsOrientationMatrix) *
+ Matrix3d(orientationMatrix) *
+ RotateZ3d(wcsRotation) *
+ RotateZ3d(rotation) *
+ RotateY3d(az_) *
+ RotateX3d(-el_) *
+ FlipY3d();
+
+ Vector xx = (Vector3d(1,0,0)*mm).normalize();
+ Vector yy = (Vector3d(0,1,0)*mm).normalize();
+ Vector zz = (Vector3d(0,0,1)*mm).normalize();
+
+ str << pannerName << " update image compass "
+ << xx << ' ' << yy << ' ' << zz << ';';
+
+ if (keyContext->fits && keyContext->fits->hasWCS(wcsSystem_)) {
+ Matrix3d mx;
+ switch (keyContext->fits->getWCSOrientation(wcsSystem_, wcsSky_)) {
+ case Coord::XX:
+ mx *= FlipX3d();
+ break;
+ default:
+ break;
+ }
+ mx *= mm;
+ Vector north = (Vector3d(0,1)*mx).normalize();
+ Vector east = (Vector3d(-1,0)*mx).normalize();
+
// and update the panner
str << pannerName << " update wcs compass "
<< north << ' ' << east << ends;
@@ -859,6 +930,7 @@ void Frame3dBase::updatePanner()
Tcl_Eval(interp, str.str().c_str());
}
}
+#endif
void Frame3dBase::x11Graphics()
{