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