From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/xtools/gtools/gtswind.x | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 pkg/xtools/gtools/gtswind.x (limited to 'pkg/xtools/gtools/gtswind.x') 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 +include +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 -- cgit