Annotation of OpenXM_contrib2/asir2000/plot/plotf.c, Revision 1.13
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.13 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/plot/plotf.c,v 1.12 2002/07/10 05:29:36 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.10 noro 56: void Pmemory_ifplot();
1.12 noro 57: void Popen_canvas(), Pclear_canvas(), Pdraw_obj(), Pdraw_string();
1.11 noro 58: void Pox_rpc();
59: void Pox_cmo_rpc();
1.1 noro 60:
61: struct ftab plot_tab[] = {
62: {"ifplot",Pifplot,-7},
1.10 noro 63: {"memory_ifplot",Pmemory_ifplot,-7},
1.1 noro 64: {"conplot",Pconplot,-8},
65: {"plot",Pplot,-6},
66: {"plotover",Pplotover,3},
67: {"drawcircle",Pdrawcircle,5},
1.6 noro 68: {"open_canvas",Popen_canvas,-3},
69: {"clear_canvas",Pclear_canvas,2},
1.7 noro 70: {"draw_obj",Pdraw_obj,-4},
1.12 noro 71: {"draw_string",Pdraw_string,-5},
1.1 noro 72: /*
73: {"arrayplot",Parrayplot,2},
74: */
75: {0,0,0},
76: };
77:
1.11 noro 78: void Popen_canvas(NODE arg,Obj *rp)
1.6 noro 79: {
1.9 noro 80: Q w300,s_id;
1.6 noro 81: LIST geom;
1.11 noro 82: int stream;
1.6 noro 83: NODE n,n0;
84: STRING fname,wname;
85:
86: geom = 0; wname = 0; stream = -1;
87: for ( ; arg; arg = NEXT(arg) )
88: if ( !BDY(arg) )
89: stream = 0;
90: else
91: switch ( OID(BDY(arg)) ) {
92: case O_LIST:
93: geom = (LIST)BDY(arg);
94: break;
95: case O_N:
96: stream = QTOS((Q)BDY(arg)); break;
97: case O_STR:
98: wname = (STRING)BDY(arg); break;
99: default:
100: error("open_canvas : invalid argument"); break;
101: }
102: /* open_canvas in ox_plot requires
1.9 noro 103: [s_id (Q),
1.6 noro 104: geom=[xsize,ysize] (LIST),
105: wname=name (STRING)]
106: */
107:
1.13 ! noro 108: stream = validate_ox_plot_stream(stream);
1.9 noro 109: STOQ(stream,s_id);
1.6 noro 110: if ( !geom ) {
111: STOQ(300,w300);
112: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
113: }
114: MKSTR(fname,"open_canvas");
1.9 noro 115: arg = mknode(4,s_id,fname,geom,wname);
1.6 noro 116: Pox_cmo_rpc(arg,rp);
117: }
118:
1.13 ! noro 119: void Pifplot(NODE arg,Q *rp)
1.1 noro 120: {
1.9 noro 121: Q m2,p2,w300,s_id;
1.1 noro 122: NODE defrange;
123: LIST xrange,yrange,range[2],list,geom;
124: VL vl,vl0;
125: V v[2],av[2];
1.11 noro 126: int stream,ri,i;
1.1 noro 127: P poly;
128: P var;
129: NODE n,n0;
130: STRING fname,wname;
1.13 ! noro 131: Obj t;
1.1 noro 132:
133: STOQ(-2,m2); STOQ(2,p2);
134: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
135: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
136: for ( ; arg; arg = NEXT(arg) )
137: if ( !BDY(arg) )
138: stream = 0;
139: else
140: switch ( OID(BDY(arg)) ) {
141: case O_P:
142: poly = (P)BDY(arg);
1.11 noro 143: get_vars_recursive((Obj)poly,&vl);
1.1 noro 144: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 145: if ( vl0->v->attr == (pointer)V_IND )
1.1 noro 146: if ( i >= 2 )
147: error("ifplot : invalid argument");
148: else
149: v[i++] = vl0->v;
150: break;
151: case O_LIST:
152: list = (LIST)BDY(arg);
153: if ( OID(BDY(BDY(list))) == O_P )
154: if ( ri > 1 )
155: error("ifplot : invalid argument");
156: else
157: range[ri++] = list;
158: else
159: geom = list;
160: break;
161: case O_N:
162: stream = QTOS((Q)BDY(arg)); break;
163: case O_STR:
164: wname = (STRING)BDY(arg); break;
165: default:
166: error("ifplot : invalid argument"); break;
167: }
168: if ( !poly )
169: error("ifplot : invalid argument");
170: switch ( ri ) {
171: case 0:
172: if ( !v[1] )
173: error("ifplot : please specify all variables");
174: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
175: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
176: break;
177: case 1:
178: if ( !v[1] )
179: error("ifplot : please specify all variables");
180: av[0] = VR((P)BDY(BDY(range[0])));
181: if ( v[0] == av[0] ) {
182: xrange = range[0];
183: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
184: } else if ( v[1] == av[0] ) {
185: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
186: yrange = range[0];
187: } else
188: error("ifplot : invalid argument");
189: break;
190: case 2:
191: av[0] = VR((P)BDY(BDY(range[0])));
192: av[1] = VR((P)BDY(BDY(range[1])));
193: if ( ((v[0] == av[0]) && (!v[1] || v[1] == av[1])) ||
194: ((v[0] == av[1]) && (!v[1] || v[1] == av[0])) ) {
195: xrange = range[0]; yrange = range[1];
196: } else
197: error("ifplot : invalid argument");
198: break;
199: default:
200: error("ifplot : cannot happen"); break;
201: }
202: /* ifplot in ox_plot requires
1.9 noro 203: [s_id (Q),
1.1 noro 204: formula (Obj),
205: xrange=[x,xmin,xmax] (LIST),
206: yrange=[y,ymin,ymax] (LIST),
207: zrange=0,
208: geom=[xsize,ysize] (LIST),
209: wname=name (STRING)]
210: */
211:
1.13 ! noro 212: stream = validate_ox_plot_stream(stream);
1.9 noro 213: STOQ(stream,s_id);
1.1 noro 214: if ( !geom ) {
215: STOQ(300,w300);
216: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
217: }
218: MKSTR(fname,"plot");
1.9 noro 219: arg = mknode(8,s_id,fname,poly,xrange,yrange,0,geom,wname);
1.13 ! noro 220: Pox_rpc(arg,&t);
! 221: *rp = s_id;
1.10 noro 222: }
223:
1.13 ! noro 224: void Pmemory_ifplot(NODE arg,Q *rp)
1.10 noro 225: {
226: Q m2,p2,w300,s_id;
227: NODE defrange;
228: LIST xrange,yrange,range[2],list,geom;
229: VL vl,vl0;
230: V v[2],av[2];
1.11 noro 231: int stream,ri,i;
1.10 noro 232: P poly;
233: P var;
234: NODE n,n0;
1.11 noro 235: STRING fname;
1.13 ! noro 236: Obj t;
1.10 noro 237:
238: STOQ(-2,m2); STOQ(2,p2);
239: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
240: poly = 0; vl = 0; geom = 0; stream = -1; ri = 0;
241: for ( ; arg; arg = NEXT(arg) )
242: if ( !BDY(arg) )
243: stream = 0;
244: else
245: switch ( OID(BDY(arg)) ) {
246: case O_P:
247: poly = (P)BDY(arg);
1.11 noro 248: get_vars_recursive((Obj)poly,&vl);
1.10 noro 249: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 250: if ( vl0->v->attr == (pointer)V_IND )
1.10 noro 251: if ( i >= 2 )
252: error("ifplot : invalid argument");
253: else
254: v[i++] = vl0->v;
255: break;
256: case O_LIST:
257: list = (LIST)BDY(arg);
258: if ( OID(BDY(BDY(list))) == O_P )
259: if ( ri > 1 )
260: error("ifplot : invalid argument");
261: else
262: range[ri++] = list;
263: else
264: geom = list;
265: break;
266: case O_N:
267: stream = QTOS((Q)BDY(arg)); break;
268: default:
269: error("memory_ifplot : invalid argument"); break;
270: }
271: if ( !poly )
272: error("memory_ifplot : invalid argument");
273: switch ( ri ) {
274: case 0:
275: if ( !v[1] )
276: error("memory_ifplot : please specify all variables");
277: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
278: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
279: break;
280: case 1:
281: if ( !v[1] )
282: error("memory_ifplot : please specify all variables");
283: av[0] = VR((P)BDY(BDY(range[0])));
284: if ( v[0] == av[0] ) {
285: xrange = range[0];
286: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
287: } else if ( v[1] == av[0] ) {
288: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
289: yrange = range[0];
290: } else
291: error("memory_ifplot : invalid argument");
292: break;
293: case 2:
294: av[0] = VR((P)BDY(BDY(range[0])));
295: av[1] = VR((P)BDY(BDY(range[1])));
296: if ( ((v[0] == av[0]) && (!v[1] || v[1] == av[1])) ||
297: ((v[0] == av[1]) && (!v[1] || v[1] == av[0])) ) {
298: xrange = range[0]; yrange = range[1];
299: } else
300: error("memory_ifplot : invalid argument");
301: break;
302: default:
303: error("memory_ifplot : cannot happen"); break;
304: }
305: /* memory_ifplot in ox_plot requires
306: [s_id (Q),
307: formula (Obj),
308: xrange=[x,xmin,xmax] (LIST),
309: yrange=[y,ymin,ymax] (LIST),
310: zrange=0,
311: geom=[xsize,ysize] (LIST)]
312: */
313:
1.13 ! noro 314: stream = validate_ox_plot_stream(stream);
1.10 noro 315: STOQ(stream,s_id);
316: if ( !geom ) {
317: STOQ(300,w300);
318: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
319: }
320: MKSTR(fname,"memory_plot");
321: arg = mknode(7,s_id,fname,poly,xrange,yrange,0,geom);
1.13 ! noro 322: Pox_rpc(arg,&t);
! 323: *rp = s_id;
1.1 noro 324: }
325:
1.13 ! noro 326: void Pconplot(NODE arg,Q *rp)
1.1 noro 327: {
1.9 noro 328: Q m2,p2,w300,s_id;
1.1 noro 329: NODE defrange;
330: LIST xrange,yrange,zrange,range[3],list,geom;
331: VL vl,vl0;
332: V v[2],av[2];
1.11 noro 333: int stream,ri,i;
1.1 noro 334: P poly;
335: P var;
336: NODE n,n0;
337: STRING fname,wname;
1.13 ! noro 338: Obj t;
1.1 noro 339:
340: STOQ(-2,m2); STOQ(2,p2);
341: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
342: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
343: for ( ; arg; arg = NEXT(arg) )
344: if ( !BDY(arg) )
345: stream = 0;
346: else
347: switch ( OID(BDY(arg)) ) {
348: case O_P:
349: poly = (P)BDY(arg);
1.11 noro 350: get_vars_recursive((Obj)poly,&vl);
1.1 noro 351: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 352: if ( vl0->v->attr == (pointer)V_IND )
1.1 noro 353: if ( i >= 2 )
354: error("ifplot : invalid argument");
355: else
356: v[i++] = vl0->v;
357: break;
358: case O_LIST:
359: list = (LIST)BDY(arg);
360: if ( OID(BDY(BDY(list))) == O_P )
361: if ( ri > 2 )
362: error("ifplot : invalid argument");
363: else
364: range[ri++] = list;
365: else
366: geom = list;
367: break;
368: case O_N:
369: stream = QTOS((Q)BDY(arg)); break;
370: case O_STR:
371: wname = (STRING)BDY(arg); break;
372: default:
373: error("ifplot : invalid argument"); break;
374: }
375: if ( !poly )
376: error("ifplot : invalid argument");
377: switch ( ri ) {
378: case 0:
379: if ( !v[1] )
380: error("ifplot : please specify all variables");
381: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
382: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
383: MKNODE(n,0,defrange); MKLIST(zrange,n);
384: break;
385: case 1:
386: if ( !v[1] )
387: error("ifplot : please specify all variables");
388: av[0] = VR((P)BDY(BDY(range[0])));
389: if ( v[0] == av[0] ) {
390: xrange = range[0];
391: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
392: MKNODE(n,0,defrange); MKLIST(zrange,n);
393: } else if ( v[1] == av[0] ) {
394: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
395: yrange = range[0];
396: MKNODE(n,0,defrange); MKLIST(zrange,n);
397: } else {
398: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
399: MKV(v[1],var); MKNODE(n,var,defrange); MKLIST(yrange,n);
400: zrange = range[0];
401: }
402: break;
403: case 2: case 3:
404: av[0] = VR((P)BDY(BDY(range[0])));
405: av[1] = VR((P)BDY(BDY(range[1])));
406: if ( ((v[0] == av[0]) && (!v[1] || v[1] == av[1])) ||
407: ((v[0] == av[1]) && (!v[1] || v[1] == av[0])) ) {
408: xrange = range[0]; yrange = range[1];
409: if ( ri == 3 )
410: zrange = range[2];
411: else {
412: MKNODE(n,0,defrange); MKLIST(zrange,n);
413: }
414: } else
415: error("ifplot : invalid argument");
416: break;
417: default:
418: error("ifplot : cannot happen"); break;
419: }
420: /* conplot in ox_plot requires
1.9 noro 421: [s_id (Q),
1.1 noro 422: formula (Obj),
423: xrange=[x,xmin,xmax] (LIST),
424: yrange=[y,ymin,ymax] (LIST),
425: zrange=[z,zmin,zmax] (LIST),
426: geom=[xsize,ysize] (LIST),
427: wname=name (STRING)]
428: */
429:
1.13 ! noro 430: stream = validate_ox_plot_stream(stream);
1.9 noro 431: STOQ(stream,s_id);
1.1 noro 432: if ( !geom ) {
433: STOQ(300,w300);
434: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
435: }
436: MKSTR(fname,"plot");
1.9 noro 437: arg = mknode(8,s_id,fname,poly,xrange,yrange,zrange,geom,wname);
1.13 ! noro 438: Pox_rpc(arg,&t);
! 439: *rp = s_id;
1.1 noro 440: }
441:
1.13 ! noro 442: void Pplot(NODE arg,Q *rp)
1.1 noro 443: {
1.9 noro 444: Q m2,p2,w300,s_id;
1.1 noro 445: NODE defrange;
446: LIST xrange,range[1],list,geom;
447: VL vl,vl0;
448: V v[1],av[1];
1.11 noro 449: int stream,ri,i;
1.1 noro 450: P poly;
451: P var;
452: NODE n,n0;
453: STRING fname,wname;
1.13 ! noro 454: Obj t;
1.1 noro 455:
456: STOQ(-2,m2); STOQ(2,p2);
457: MKNODE(n,p2,0); MKNODE(defrange,m2,n);
458: poly = 0; vl = 0; geom = 0; wname = 0; stream = -1; ri = 0;
459: for ( ; arg; arg = NEXT(arg) )
460: if ( !BDY(arg) )
461: stream = 0;
462: else
463: switch ( OID(BDY(arg)) ) {
464: case O_P: case O_R:
465: poly = (P)BDY(arg);
1.11 noro 466: get_vars_recursive((Obj)poly,&vl);
1.1 noro 467: for ( vl0 = vl, i = 0; vl0; vl0 = NEXT(vl0) )
1.11 noro 468: if ( vl0->v->attr == (pointer)V_IND )
1.1 noro 469: if ( i >= 1 )
470: error("ifplot : invalid argument");
471: else
472: v[i++] = vl0->v;
1.8 noro 473: if ( i != 1 )
474: error("ifplot : invalid argument");
1.1 noro 475: break;
476: case O_LIST:
477: list = (LIST)BDY(arg);
478: if ( OID(BDY(BDY(list))) == O_P )
479: if ( ri > 0 )
480: error("plot : invalid argument");
481: else
482: range[ri++] = list;
483: else
484: geom = list;
485: break;
486: case O_N:
487: stream = QTOS((Q)BDY(arg)); break;
488: case O_STR:
489: wname = (STRING)BDY(arg); break;
490: default:
491: error("plot : invalid argument"); break;
492: }
493: if ( !poly )
494: error("plot : invalid argument");
495: switch ( ri ) {
496: case 0:
497: MKV(v[0],var); MKNODE(n,var,defrange); MKLIST(xrange,n);
498: break;
499: case 1:
500: av[0] = VR((P)BDY(BDY(range[0])));
501: if ( v[0] == av[0] )
502: xrange = range[0];
503: else
504: error("plot : invalid argument");
505: break;
506: default:
507: error("plot : cannot happen"); break;
508: }
509: /* conplot in ox_plot requires
1.9 noro 510: [s_id (Q),
1.1 noro 511: formula (Obj),
512: xrange=[x,xmin,xmax] (LIST),
513: yrange=0,
514: zrange=0,
515: geom=[xsize,ysize] (LIST),
516: wname=name (STRING)]
517: */
1.13 ! noro 518: stream = validate_ox_plot_stream(stream);
1.9 noro 519: STOQ(stream,s_id);
1.1 noro 520: if ( !geom ) {
521: STOQ(300,w300);
522: MKNODE(n0,w300,0); MKNODE(n,w300,n0); MKLIST(geom,n);
523: }
524: MKSTR(fname,"plot");
1.9 noro 525: arg = mknode(8,s_id,fname,poly,xrange,0,0,geom,wname);
1.13 ! noro 526: Pox_rpc(arg,&t);
! 527: *rp = s_id;
1.1 noro 528: }
529:
1.13 ! noro 530: void Pplotover(NODE arg,Q *rp)
1.1 noro 531: {
1.9 noro 532: Q s_id,index;
1.1 noro 533: P poly;
534: STRING fname;
1.13 ! noro 535: Obj t;
1.1 noro 536:
537: poly = (P)ARG0(arg);
1.9 noro 538: s_id = (Q)ARG1(arg);
1.1 noro 539: index = (Q)ARG2(arg);
540: MKSTR(fname,"plotover");
1.9 noro 541: arg = mknode(4,s_id,fname,index,poly);
1.13 ! noro 542: Pox_rpc(arg,&t);
! 543: *rp = s_id;
1.1 noro 544: }
545:
1.9 noro 546: /* arg = [x,y,r,s_id,index] */
1.1 noro 547:
1.13 ! noro 548: void Pdrawcircle(NODE arg,Q *rp)
1.1 noro 549: {
1.9 noro 550: Q s_id,index;
1.1 noro 551: Obj x,y,r;
552: STRING fname;
553: NODE n;
554: LIST pos;
1.13 ! noro 555: Obj t;
1.1 noro 556:
557: x = (Obj)ARG0(arg);
558: y = (Obj)ARG1(arg);
559: r = (Obj)ARG2(arg);
1.9 noro 560: s_id = (Q)ARG3(arg);
1.1 noro 561: index = (Q)ARG4(arg);
562: MKSTR(fname,"drawcircle");
563: n = mknode(3,x,y,r); MKLIST(pos,n);
1.9 noro 564: arg = mknode(4,s_id,fname,index,pos);
1.13 ! noro 565: Pox_rpc(arg,&t);
! 566: *rp = s_id;
1.6 noro 567: }
568:
1.9 noro 569: /* draw_obj(s_id,cindex,point|line); point = [x,y], line = [xa,ya,xb,yb] */
1.13 ! noro 570: void Pdraw_obj(NODE arg,Q *rp)
1.6 noro 571: {
572: static STRING fname;
1.9 noro 573: Q s_id,index;
1.6 noro 574: LIST obj;
1.13 ! noro 575: Obj t;
1.6 noro 576:
577: if ( !fname ) {
578: MKSTR(fname,"draw_obj");
579: }
1.9 noro 580: s_id = (Q)ARG0(arg);
1.6 noro 581: index = (Q)ARG1(arg);
582: obj = (LIST)ARG2(arg);
1.7 noro 583: /* ARG3(arg) = color */
584: if ( argc(arg) == 4 )
1.9 noro 585: arg = mknode(5,s_id,fname,index,obj,ARG3(arg));
1.7 noro 586: else
1.9 noro 587: arg = mknode(4,s_id,fname,index,obj);
1.13 ! noro 588: Pox_cmo_rpc(arg,&t);
! 589: *rp = s_id;
1.12 noro 590: }
591:
592: /* draw_string(s_id,cindex,pos,string,[,color]); pos=[x,y] */
1.13 ! noro 593: void Pdraw_string(NODE arg,Q *rp)
1.12 noro 594: {
595: static STRING fname;
596: STRING str;
597: Q s_id,index;
598: LIST pos;
1.13 ! noro 599: Obj t;
1.12 noro 600:
601: if ( !fname ) {
602: MKSTR(fname,"draw_string");
603: }
604: s_id = (Q)ARG0(arg);
605: index = (Q)ARG1(arg);
606: pos = (LIST)ARG2(arg);
607: str = (STRING)ARG3(arg);
608: /* ARG4(arg) = color */
609: if ( argc(arg) == 5 )
610: arg = mknode(6,s_id,fname,index,pos,str,ARG4(arg));
611: else
612: arg = mknode(5,s_id,fname,index,pos,str);
1.13 ! noro 613: Pox_cmo_rpc(arg,&t);
! 614: *rp = s_id;
1.6 noro 615: }
616:
1.13 ! noro 617: void Pclear_canvas(NODE arg,Q *rp)
1.6 noro 618: {
619: static STRING fname;
1.9 noro 620: Q s_id,index;
1.13 ! noro 621: Obj t;
1.6 noro 622:
623: if ( !fname ) {
624: MKSTR(fname,"clear_canvas");
625: }
1.9 noro 626: s_id = (Q)ARG0(arg);
1.6 noro 627: index = (Q)ARG1(arg);
1.9 noro 628: arg = mknode(3,s_id,fname,index);
1.13 ! noro 629: Pox_cmo_rpc(arg,&t);
! 630: *rp = s_id;
1.1 noro 631: }
632:
633: #if 0
1.11 noro 634: void Parrayplot(NODE arg,Obj *rp)
1.1 noro 635: {
636: int s;
637: int id;
638:
639: if ( ID((Obj)ARG0(arg)) == O_VECT && ID((Obj)ARG1(arg)) == O_LIST ) {
640: s = current_s;
641: gensend(s,C_APLOT,0);
642: gensend(s,C_OBJ,ARG0(arg)); gensend(s,C_OBJ,ARG1(arg)); genflush(s);
643: }
644: genrecv(s,&id,rp);
645: }
646: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>