Annotation of OpenXM_contrib2/asir2000/plot/plotf.c, Revision 1.21
1.4 noro 1: /*
2: * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
3: * All rights reserved.
4: *
5: * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
6: * non-exclusive and royalty-free license to use, copy, modify and
7: * redistribute, solely for non-commercial and non-profit purposes, the
8: * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
9: * conditions of this Agreement. For the avoidance of doubt, you acquire
10: * only a limited right to use the SOFTWARE hereunder, and FLL or any
11: * third party developer retains all rights, including but not limited to
12: * copyrights, in and to the SOFTWARE.
13: *
14: * (1) FLL does not grant you a license in any way for commercial
15: * purposes. You may use the SOFTWARE only for non-commercial and
16: * non-profit purposes only, such as academic, research and internal
17: * business use.
18: * (2) The SOFTWARE is protected by the Copyright Law of Japan and
19: * international copyright treaties. If you make copies of the SOFTWARE,
20: * with or without modification, as permitted hereunder, you shall affix
21: * to all such copies of the SOFTWARE the above copyright notice.
22: * (3) An explicit reference to this SOFTWARE and its copyright owner
23: * shall be made on your publication or presentation in any form of the
24: * results obtained by use of the SOFTWARE.
25: * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
1.5 noro 26: * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
1.4 noro 27: * for such modification or the source code of the modified part of the
28: * SOFTWARE.
29: *
30: * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
31: * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
32: * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
33: * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
34: * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
35: * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
36: * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
37: * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
38: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
39: * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
40: * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
41: * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
42: * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
43: * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
44: * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
45: * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
46: * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
47: *
1.21 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/plot/plotf.c,v 1.20 2006/11/15 01:28:44 noro Exp $
1.4 noro 49: */
1.1 noro 50: #include "ca.h"
51: #include "parse.h"
52: #include "ox.h"
53: #include "ifplot.h"
54:
55: void Pifplot(), Pconplot(), Pplotover(), Pplot(), Parrayplot(), Pdrawcircle();
1.15 noro 56: void Ppolarplot();
1.18 noro 57: void Pmemory_ifplot(),Pmemory_conplot(),Pmemory_plot();
1.12 noro 58: void Popen_canvas(), Pclear_canvas(), Pdraw_obj(), Pdraw_string();
1.11 noro 59: void Pox_rpc();
60: void Pox_cmo_rpc();
1.1 noro 61:
62: struct ftab plot_tab[] = {
63: {"ifplot",Pifplot,-7},
1.18 noro 64: {"memory_ifplot",Pmemory_ifplot,-6},
1.1 noro 65: {"conplot",Pconplot,-8},
1.18 noro 66: {"memory_conplot",Pmemory_conplot,-7},
1.1 noro 67: {"plot",Pplot,-6},
1.18 noro 68: {"memory_plot",Pmemory_plot,-5},
1.15 noro 69: {"polarplot",Ppolarplot,-6},
1.17 noro 70: {"plotover",Pplotover,-4},
1.19 saito 71: {"drawcircle",Pdrawcircle,6},
1.6 noro 72: {"open_canvas",Popen_canvas,-3},
73: {"clear_canvas",Pclear_canvas,2},
1.7 noro 74: {"draw_obj",Pdraw_obj,-4},
1.12 noro 75: {"draw_string",Pdraw_string,-5},
1.1 noro 76: /*
77: {"arrayplot",Parrayplot,2},
78: */
79: {0,0,0},
80: };
81:
1.16 noro 82: void Popen_canvas(NODE arg,Q *rp)
1.6 noro 83: {
1.9 noro 84: Q w300,s_id;
1.6 noro 85: LIST geom;
1.11 noro 86: int stream;
1.6 noro 87: NODE n,n0;
88: STRING fname,wname;
89:
90: geom = 0; wname = 0; stream = -1;
91: for ( ; arg; arg = NEXT(arg) )
92: if ( !BDY(arg) )
93: stream = 0;
94: else
95: switch ( OID(BDY(arg)) ) {
96: case O_LIST:
97: geom = (LIST)BDY(arg);
98: break;
99: case O_N:
100: stream = QTOS((Q)BDY(arg)); break;
101: case O_STR:
102: wname = (STRING)BDY(arg); break;
103: default:
104: error("open_canvas : invalid argument"); break;
105: }
106: /* open_canvas in ox_plot requires
1.9 noro 107: [s_id (Q),
1.6 noro 108: geom=[xsize,ysize] (LIST),
109: wname=name (STRING)]
110: */
111:
1.13 noro 112: stream = validate_ox_plot_stream(stream);
1.9 noro 113: STOQ(stream,s_id);
1.6 noro 114: if ( !geom ) {
115: STOQ(300,w300);
116: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
117: }
118: MKSTR(fname,"open_canvas");
1.9 noro 119: arg = mknode(4,s_id,fname,geom,wname);
1.6 noro 120: Pox_cmo_rpc(arg,rp);
1.16 noro 121: *rp = s_id;
1.6 noro 122: }
123:
1.18 noro 124: void ifplot_main(NODE arg,int is_memory, Obj *rp);
125:
126: void Pifplot(NODE arg,Obj *rp)
127: {
128: ifplot_main(arg,0,rp);
129: }
130:
131: void Pmemory_ifplot(NODE arg,Obj *rp)
132: {
133: ifplot_main(arg,1,rp);
134: }
135:
136: void ifplot_main(NODE arg,int is_memory, Obj *rp)
1.1 noro 137: {
1.9 noro 138: Q m2,p2,w300,s_id;
1.1 noro 139: NODE defrange;
140: LIST xrange,yrange,range[2],list,geom;
141: VL vl,vl0;
142: V v[2],av[2];
1.11 noro 143: int stream,ri,i;
1.1 noro 144: P poly;
145: P var;
146: NODE n,n0;
147: STRING fname,wname;
1.13 noro 148: Obj t;
1.1 noro 149:
150: STOQ(-2,m2); STOQ(2,p2);
151: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
152: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
1.14 noro 153: v[0] = v[1] = 0;
1.1 noro 154: for ( ; arg; arg = NEXT(arg) )
155: if ( !BDY(arg) )
156: stream = 0;
157: else
158: switch ( OID(BDY(arg)) ) {
159: case O_P:
160: poly = (P)BDY(arg);
1.11 noro 161: get_vars_recursive((Obj)poly,&vl);
1.1 noro 162: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 163: if ( vl0->v->attr == (pointer)V_IND )
1.1 noro 164: if ( i >= 2 )
165: error("ifplot : invalid argument");
166: else
167: v[i++] = vl0->v;
168: break;
169: case O_LIST:
170: list = (LIST)BDY(arg);
171: if ( OID(BDY(BDY(list))) == O_P )
172: if ( ri > 1 )
173: error("ifplot : invalid argument");
174: else
175: range[ri++] = list;
176: else
177: geom = list;
178: break;
179: case O_N:
180: stream = QTOS((Q)BDY(arg)); break;
181: case O_STR:
182: wname = (STRING)BDY(arg); break;
183: default:
184: error("ifplot : invalid argument"); break;
185: }
186: if ( !poly )
187: error("ifplot : invalid argument");
188: switch ( ri ) {
189: case 0:
190: if ( !v[1] )
191: error("ifplot : please specify all variables");
192: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
193: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
194: break;
195: case 1:
196: if ( !v[1] )
197: error("ifplot : please specify all variables");
198: av[0] = VR((P)BDY(BDY(range[0])));
199: if ( v[0] == av[0] ) {
200: xrange = range[0];
201: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
202: } else if ( v[1] == av[0] ) {
203: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
204: yrange = range[0];
205: } else
206: error("ifplot : invalid argument");
207: break;
208: case 2:
209: av[0] = VR((P)BDY(BDY(range[0])));
210: av[1] = VR((P)BDY(BDY(range[1])));
211: if ( ((v[0] == av[0]) && (!v[1] || v[1] == av[1])) ||
212: ((v[0] == av[1]) && (!v[1] || v[1] == av[0])) ) {
213: xrange = range[0]; yrange = range[1];
214: } else
215: error("ifplot : invalid argument");
216: break;
217: default:
218: error("ifplot : cannot happen"); break;
219: }
220: /* ifplot in ox_plot requires
1.9 noro 221: [s_id (Q),
1.1 noro 222: formula (Obj),
223: xrange=[x,xmin,xmax] (LIST),
224: yrange=[y,ymin,ymax] (LIST),
225: zrange=0,
226: geom=[xsize,ysize] (LIST),
227: wname=name (STRING)]
228: */
229:
1.13 noro 230: stream = validate_ox_plot_stream(stream);
1.9 noro 231: STOQ(stream,s_id);
1.1 noro 232: if ( !geom ) {
233: STOQ(300,w300);
234: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
235: }
1.18 noro 236: if ( is_memory ) {
237: MKSTR(fname,"memory_plot");
1.21 ! noro 238: arg = mknode(7,s_id,fname,poly,xrange,yrange,NULLP,geom);
1.18 noro 239: Pox_rpc(arg,&t);
240: arg = mknode(1,s_id);
241: Pox_pop_cmo(arg,rp);
242: } else {
243: MKSTR(fname,"plot");
1.21 ! noro 244: arg = mknode(8,s_id,fname,poly,xrange,yrange,NULLP,geom,wname);
1.18 noro 245: Pox_rpc(arg,&t);
246: *rp = (Obj)s_id;
247: }
1.10 noro 248: }
249:
1.18 noro 250: void conplot_main(NODE arg,int is_memory, Obj *rp);
251:
252: void Pconplot(NODE arg,Obj *rp)
1.10 noro 253: {
1.18 noro 254: conplot_main(arg,0,rp);
255: }
1.10 noro 256:
1.18 noro 257: void Pmemory_conplot(NODE arg,Obj *rp)
258: {
259: conplot_main(arg,1,rp);
1.1 noro 260: }
261:
1.18 noro 262: void conplot_main(NODE arg,int is_memory,Obj *rp)
1.1 noro 263: {
1.9 noro 264: Q m2,p2,w300,s_id;
1.1 noro 265: NODE defrange;
266: LIST xrange,yrange,zrange,range[3],list,geom;
267: VL vl,vl0;
268: V v[2],av[2];
1.11 noro 269: int stream,ri,i;
1.1 noro 270: P poly;
271: P var;
272: NODE n,n0;
273: STRING fname,wname;
1.13 noro 274: Obj t;
1.1 noro 275:
276: STOQ(-2,m2); STOQ(2,p2);
277: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
278: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
1.14 noro 279: v[0] = v[1] = 0;
1.1 noro 280: for ( ; arg; arg = NEXT(arg) )
281: if ( !BDY(arg) )
282: stream = 0;
283: else
284: switch ( OID(BDY(arg)) ) {
285: case O_P:
286: poly = (P)BDY(arg);
1.11 noro 287: get_vars_recursive((Obj)poly,&vl);
1.1 noro 288: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 289: if ( vl0->v->attr == (pointer)V_IND )
1.1 noro 290: if ( i >= 2 )
291: error("ifplot : invalid argument");
292: else
293: v[i++] = vl0->v;
294: break;
295: case O_LIST:
296: list = (LIST)BDY(arg);
297: if ( OID(BDY(BDY(list))) == O_P )
298: if ( ri > 2 )
299: error("ifplot : invalid argument");
300: else
301: range[ri++] = list;
302: else
303: geom = list;
304: break;
305: case O_N:
306: stream = QTOS((Q)BDY(arg)); break;
307: case O_STR:
308: wname = (STRING)BDY(arg); break;
309: default:
310: error("ifplot : invalid argument"); break;
311: }
312: if ( !poly )
313: error("ifplot : invalid argument");
314: switch ( ri ) {
315: case 0:
316: if ( !v[1] )
317: error("ifplot : please specify all variables");
318: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
319: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
320: MKNODE(n,0,defrange); MKLIST(zrange,n);
321: break;
322: case 1:
323: if ( !v[1] )
324: error("ifplot : please specify all variables");
325: av[0] = VR((P)BDY(BDY(range[0])));
326: if ( v[0] == av[0] ) {
327: xrange = range[0];
328: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
329: MKNODE(n,0,defrange); MKLIST(zrange,n);
330: } else if ( v[1] == av[0] ) {
331: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
332: yrange = range[0];
333: MKNODE(n,0,defrange); MKLIST(zrange,n);
334: } else {
335: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
336: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
337: zrange = range[0];
338: }
339: break;
340: case 2: case 3:
341: av[0] = VR((P)BDY(BDY(range[0])));
342: av[1] = VR((P)BDY(BDY(range[1])));
343: if ( ((v[0] == av[0]) && (!v[1] || v[1] == av[1])) ||
344: ((v[0] == av[1]) && (!v[1] || v[1] == av[0])) ) {
345: xrange = range[0]; yrange = range[1];
346: if ( ri == 3 )
347: zrange = range[2];
348: else {
349: MKNODE(n,0,defrange); MKLIST(zrange,n);
350: }
351: } else
352: error("ifplot : invalid argument");
353: break;
354: default:
355: error("ifplot : cannot happen"); break;
356: }
357: /* conplot in ox_plot requires
1.9 noro 358: [s_id (Q),
1.1 noro 359: formula (Obj),
360: xrange=[x,xmin,xmax] (LIST),
361: yrange=[y,ymin,ymax] (LIST),
362: zrange=[z,zmin,zmax] (LIST),
363: geom=[xsize,ysize] (LIST),
364: wname=name (STRING)]
365: */
366:
1.13 noro 367: stream = validate_ox_plot_stream(stream);
1.9 noro 368: STOQ(stream,s_id);
1.1 noro 369: if ( !geom ) {
370: STOQ(300,w300);
371: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
372: }
1.18 noro 373: if ( is_memory ) {
374: MKSTR(fname,"memory_plot");
375: arg = mknode(7,s_id,fname,poly,xrange,yrange,zrange,geom);
376: Pox_rpc(arg,&t);
377: arg = mknode(1,s_id);
378: Pox_pop_cmo(arg,rp);
379: } else {
380: MKSTR(fname,"plot");
381: arg = mknode(8,s_id,fname,poly,xrange,yrange,zrange,geom,wname);
382: Pox_rpc(arg,&t);
383: *rp = (Obj)s_id;
384: }
385: }
386:
387: void plot_main(NODE arg,int is_memory,Obj *rp);
388:
389: void Pplot(NODE arg,Obj *rp)
390: {
391: plot_main(arg,0,rp);
392: }
393:
394: void Pmemory_plot(NODE arg,Obj *rp)
395: {
396: plot_main(arg,1,rp);
1.1 noro 397: }
398:
1.18 noro 399: void plot_main(NODE arg,int is_memory,Obj *rp)
1.1 noro 400: {
1.9 noro 401: Q m2,p2,w300,s_id;
1.1 noro 402: NODE defrange;
403: LIST xrange,range[1],list,geom;
404: VL vl,vl0;
405: V v[1],av[1];
1.11 noro 406: int stream,ri,i;
1.1 noro 407: P poly;
408: P var;
409: NODE n,n0;
410: STRING fname,wname;
1.13 noro 411: Obj t;
1.1 noro 412:
413: STOQ(-2,m2); STOQ(2,p2);
414: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
415: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
1.14 noro 416: v[0] = 0;
1.1 noro 417: for ( ; arg; arg = NEXT(arg) )
418: if ( !BDY(arg) )
419: stream = 0;
420: else
421: switch ( OID(BDY(arg)) ) {
422: case O_P: case O_R:
423: poly = (P)BDY(arg);
1.11 noro 424: get_vars_recursive((Obj)poly,&vl);
1.1 noro 425: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 426: if ( vl0->v->attr == (pointer)V_IND )
1.1 noro 427: if ( i >= 1 )
428: error("ifplot : invalid argument");
429: else
430: v[i++] = vl0->v;
1.8 noro 431: if ( i != 1 )
432: error("ifplot : invalid argument");
1.1 noro 433: break;
434: case O_LIST:
435: list = (LIST)BDY(arg);
436: if ( OID(BDY(BDY(list))) == O_P )
437: if ( ri > 0 )
438: error("plot : invalid argument");
439: else
440: range[ri++] = list;
441: else
442: geom = list;
443: break;
444: case O_N:
445: stream = QTOS((Q)BDY(arg)); break;
446: case O_STR:
447: wname = (STRING)BDY(arg); break;
448: default:
449: error("plot : invalid argument"); break;
450: }
451: if ( !poly )
452: error("plot : invalid argument");
453: switch ( ri ) {
454: case 0:
455: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
456: break;
457: case 1:
458: av[0] = VR((P)BDY(BDY(range[0])));
459: if ( v[0] == av[0] )
460: xrange = range[0];
461: else
462: error("plot : invalid argument");
463: break;
464: default:
465: error("plot : cannot happen"); break;
466: }
467: /* conplot in ox_plot requires
1.9 noro 468: [s_id (Q),
1.1 noro 469: formula (Obj),
470: xrange=[x,xmin,xmax] (LIST),
471: yrange=0,
472: zrange=0,
473: geom=[xsize,ysize] (LIST),
474: wname=name (STRING)]
475: */
1.13 noro 476: stream = validate_ox_plot_stream(stream);
1.9 noro 477: STOQ(stream,s_id);
1.1 noro 478: if ( !geom ) {
479: STOQ(300,w300);
480: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
481: }
1.18 noro 482: if ( is_memory ) {
483: MKSTR(fname,"memory_plot");
1.21 ! noro 484: arg = mknode(7,s_id,fname,poly,xrange,NULLP,NULLP,geom);
1.18 noro 485: Pox_rpc(arg,&t);
486: arg = mknode(1,s_id);
487: Pox_pop_cmo(arg,rp);
488: } else {
489: MKSTR(fname,"plot");
1.21 ! noro 490: arg = mknode(8,s_id,fname,poly,xrange,NULLP,NULLP,geom,wname);
1.18 noro 491: Pox_rpc(arg,&t);
492: *rp = (Obj)s_id;
493: }
1.15 noro 494: }
495:
496: #define Pi 3.14159265358979323846264
497:
498: void Ppolarplot(NODE arg,Q *rp)
499: {
500: Q m2,p2,w300,s_id;
501: NODE defrange;
502: LIST zrange,range[1],list,geom;
503: VL vl,vl0;
504: V v[1],av[1];
505: int stream,ri,i;
506: P poly;
507: P var;
508: NODE n,n0;
509: STRING fname,wname;
510: Real pi2;
511: Obj t;
512:
513: MKReal(2*Pi,pi2);
514: MKNODE(n,pi2,0); MKNODE(defrange,0,n);
515: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
516: v[0] = 0;
517: for ( ; arg; arg = NEXT(arg) )
518: if ( !BDY(arg) )
519: stream = 0;
520: else
521: switch ( OID(BDY(arg)) ) {
522: case O_P: case O_R:
523: poly = (P)BDY(arg);
524: get_vars_recursive((Obj)poly,&vl);
525: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
526: if ( vl0->v->attr == (pointer)V_IND )
527: if ( i >= 1 )
528: error("polarplot : invalid argument");
529: else
530: v[i++] = vl0->v;
531: if ( i != 1 )
532: error("polarplot : invalid argument");
533: break;
534: case O_LIST:
535: list = (LIST)BDY(arg);
536: if ( OID(BDY(BDY(list))) == O_P )
537: if ( ri > 0 )
538: error("polarplot : invalid argument");
539: else
540: range[ri++] = list;
541: else
542: geom = list;
543: break;
544: case O_N:
545: stream = QTOS((Q)BDY(arg)); break;
546: case O_STR:
547: wname = (STRING)BDY(arg); break;
548: default:
549: error("polarplot : invalid argument"); break;
550: }
551: if ( !poly )
552: error("polarplot : invalid argument");
553: switch ( ri ) {
554: case 0:
555: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(zrange,n);
556: break;
557: case 1:
558: av[0] = VR((P)BDY(BDY(range[0])));
559: if ( v[0] == av[0] )
560: zrange = range[0];
561: else
562: error("polarplot : invalid argument");
563: break;
564: default:
565: error("polarplot : cannot happen"); break;
566: }
567: stream = validate_ox_plot_stream(stream);
568: STOQ(stream,s_id);
569: if ( !geom ) {
570: STOQ(300,w300);
571: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
572: }
573: MKSTR(fname,"plot");
1.21 ! noro 574: arg = mknode(8,s_id,fname,poly,NULLP,NULLP,zrange,geom,wname);
1.13 noro 575: Pox_rpc(arg,&t);
576: *rp = s_id;
1.1 noro 577: }
578:
1.13 noro 579: void Pplotover(NODE arg,Q *rp)
1.1 noro 580: {
1.9 noro 581: Q s_id,index;
1.1 noro 582: P poly;
583: STRING fname;
1.13 noro 584: Obj t;
1.1 noro 585:
586: poly = (P)ARG0(arg);
1.9 noro 587: s_id = (Q)ARG1(arg);
1.1 noro 588: index = (Q)ARG2(arg);
589: MKSTR(fname,"plotover");
1.17 noro 590: if ( argc(arg) == 4 )
591: arg = mknode(5,s_id,fname,index,poly,(Q)ARG3(arg));
592: else
593: arg = mknode(4,s_id,fname,index,poly);
1.13 noro 594: Pox_rpc(arg,&t);
595: *rp = s_id;
1.1 noro 596: }
597:
1.19 saito 598: /* arg = [x,y,r,c,s_id,index] */
1.1 noro 599:
1.13 noro 600: void Pdrawcircle(NODE arg,Q *rp)
1.1 noro 601: {
1.9 noro 602: Q s_id,index;
1.20 noro 603: Obj x,y,r,c;
1.1 noro 604: STRING fname;
605: NODE n;
606: LIST pos;
1.13 noro 607: Obj t;
1.1 noro 608:
609: x = (Obj)ARG0(arg);
610: y = (Obj)ARG1(arg);
611: r = (Obj)ARG2(arg);
1.19 saito 612: c = (Obj)ARG3(arg);
613: s_id = (Q)ARG4(arg);
614: index = (Q)ARG5(arg);
1.1 noro 615: MKSTR(fname,"drawcircle");
616: n = mknode(3,x,y,r); MKLIST(pos,n);
1.19 saito 617: arg = mknode(5,s_id,fname,index,pos,c);
1.13 noro 618: Pox_rpc(arg,&t);
619: *rp = s_id;
1.6 noro 620: }
621:
1.9 noro 622: /* draw_obj(s_id,cindex,point|line); point = [x,y], line = [xa,ya,xb,yb] */
1.13 noro 623: void Pdraw_obj(NODE arg,Q *rp)
1.6 noro 624: {
625: static STRING fname;
1.9 noro 626: Q s_id,index;
1.6 noro 627: LIST obj;
1.13 noro 628: Obj t;
1.6 noro 629:
630: if ( !fname ) {
631: MKSTR(fname,"draw_obj");
632: }
1.9 noro 633: s_id = (Q)ARG0(arg);
1.6 noro 634: index = (Q)ARG1(arg);
635: obj = (LIST)ARG2(arg);
1.7 noro 636: /* ARG3(arg) = color */
637: if ( argc(arg) == 4 )
1.9 noro 638: arg = mknode(5,s_id,fname,index,obj,ARG3(arg));
1.7 noro 639: else
1.9 noro 640: arg = mknode(4,s_id,fname,index,obj);
1.13 noro 641: Pox_cmo_rpc(arg,&t);
642: *rp = s_id;
1.12 noro 643: }
644:
645: /* draw_string(s_id,cindex,pos,string,[,color]); pos=[x,y] */
1.13 noro 646: void Pdraw_string(NODE arg,Q *rp)
1.12 noro 647: {
648: static STRING fname;
649: STRING str;
650: Q s_id,index;
651: LIST pos;
1.13 noro 652: Obj t;
1.12 noro 653:
654: if ( !fname ) {
655: MKSTR(fname,"draw_string");
656: }
657: s_id = (Q)ARG0(arg);
658: index = (Q)ARG1(arg);
659: pos = (LIST)ARG2(arg);
660: str = (STRING)ARG3(arg);
661: /* ARG4(arg) = color */
662: if ( argc(arg) == 5 )
663: arg = mknode(6,s_id,fname,index,pos,str,ARG4(arg));
664: else
665: arg = mknode(5,s_id,fname,index,pos,str);
1.13 noro 666: Pox_cmo_rpc(arg,&t);
667: *rp = s_id;
1.6 noro 668: }
669:
1.13 noro 670: void Pclear_canvas(NODE arg,Q *rp)
1.6 noro 671: {
672: static STRING fname;
1.9 noro 673: Q s_id,index;
1.13 noro 674: Obj t;
1.6 noro 675:
676: if ( !fname ) {
677: MKSTR(fname,"clear_canvas");
678: }
1.9 noro 679: s_id = (Q)ARG0(arg);
1.6 noro 680: index = (Q)ARG1(arg);
1.9 noro 681: arg = mknode(3,s_id,fname,index);
1.13 noro 682: Pox_cmo_rpc(arg,&t);
683: *rp = s_id;
1.1 noro 684: }
685:
686: #if 0
1.11 noro 687: void Parrayplot(NODE arg,Obj *rp)
1.1 noro 688: {
689: int s;
690: int id;
691:
692: if ( ID((Obj)ARG0(arg)) == O_VECT && ID((Obj)ARG1(arg)) == O_LIST ) {
693: s = current_s;
694: gensend(s,C_APLOT,0);
695: gensend(s,C_OBJ,ARG0(arg)); gensend(s,C_OBJ,ARG1(arg)); genflush(s);
696: }
697: genrecv(s,&id,rp);
698: }
699: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>