aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/apphot/polyphot/apycoords.x
diff options
context:
space:
mode:
Diffstat (limited to 'noao/digiphot/apphot/polyphot/apycoords.x')
-rw-r--r--noao/digiphot/apphot/polyphot/apycoords.x43
1 files changed, 43 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/polyphot/apycoords.x b/noao/digiphot/apphot/polyphot/apycoords.x
new file mode 100644
index 00000000..0298b0f8
--- /dev/null
+++ b/noao/digiphot/apphot/polyphot/apycoords.x
@@ -0,0 +1,43 @@
+include "../lib/polyphot.h"
+
+# AP_YCOORDS -- Procedure to fetch the next center coordinates for the polygon.
+
+int procedure ap_ycoords (cl, delim, xshift, yshift, stdin)
+
+int cl # coordinates file descriptor
+int delim # delimiter character
+real xshift # new x coordinate
+real yshift # new y coordinate
+int stdin # is cl STDIN?
+
+char marker
+int stat
+int fscan(), nscan()
+
+begin
+ if (stdin == YES) {
+ call printf ("Type object x and y coordinates (^D or^Z to end): ")
+ call flush (STDOUT)
+ }
+
+ stat = fscan (cl)
+ while (stat != EOF) {
+
+ call gargr (xshift)
+ call gargr (yshift)
+
+ if (nscan() != 2) {
+ call reset_scan()
+ call gargc (marker)
+ if (int (marker) == delim)
+ return (NEXT_POLYGON)
+ #else
+ #return (NEXT_OBJECT)
+ } else
+ return (THIS_OBJECT)
+
+ stat = fscan (cl)
+ }
+
+ return (stat)
+end