diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/xtools/gtools/gtswind.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/xtools/gtools/gtswind.x')
-rw-r--r-- | pkg/xtools/gtools/gtswind.x | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/pkg/xtools/gtools/gtswind.x b/pkg/xtools/gtools/gtswind.x new file mode 100644 index 00000000..02766326 --- /dev/null +++ b/pkg/xtools/gtools/gtswind.x @@ -0,0 +1,65 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <gset.h> +include <mach.h> +include "gtools.h" + +# GT_SWIND -- Set graphics window. + +procedure gt_swind (gp, gt) + +pointer gp # GIO pointer +pointer gt # GTOOLS pointer + +real xmin, xmax, dx, ymin, ymax, dy + +begin + if (gt != NULL) { + if (GT_TRANSPOSE(gt) == NO) { + call gseti (gp, G_XTRAN, GT_XTRAN(gt)) + call gseti (gp, G_YTRAN, GT_YTRAN(gt)) + } else { + call gseti (gp, G_YTRAN, GT_XTRAN(gt)) + call gseti (gp, G_XTRAN, GT_YTRAN(gt)) + } + call ggwind (gp, xmin, xmax, ymin, ymax) + dx = xmax - xmin + dy = ymax - ymin + + if (IS_INDEF (GT_XMIN(gt))) + xmin = xmin - GT_XBUF(gt) * dx + else + xmin = GT_XMIN(gt) + + if (IS_INDEF (GT_XMAX(gt))) + xmax = xmax + GT_XBUF(gt) * dx + else + xmax = GT_XMAX(gt) + + if (IS_INDEF (GT_YMIN(gt))) + ymin = ymin - GT_YBUF(gt) * dy + else + ymin = GT_YMIN(gt) + + if (IS_INDEF (GT_YMAX(gt))) + ymax = ymax + GT_YBUF(gt) * dy + else + ymax = GT_YMAX(gt) + + if (GT_XFLIP(gt) == YES) { + dx = xmin + xmin = xmax + xmax = dx + } + if (GT_YFLIP(gt) == YES) { + dy = ymin + ymin = ymax + ymax = dy + } + + if (GT_TRANSPOSE(gt) == NO) + call gswind (gp, xmin, xmax, ymin, ymax) + else + call gswind (gp, ymin, ymax, xmin, xmax) + } +end |