version 1.25, 2014/01/07 06:22:08 |
version 1.26, 2014/05/12 16:54:41 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/plot/plotf.c,v 1.24 2013/12/19 05:48:25 saito Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/plot/plotf.c,v 1.25 2014/01/07 06:22:08 saito Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#include "ox.h" |
#include "ox.h" |
#include "ifplot.h" |
#include "ifplot.h" |
|
|
|
int validate_ox_plot_stream(int); |
void ListCheck(char *,LIST); |
void ListCheck(char *,LIST); |
void Pplot(NODE, Obj *); |
void Pplot(NODE,Obj *); |
void Ppolarplot(NODE, Obj *); |
void Ppolarplot(NODE,Obj *); |
void Pobj_cp(NODE, Obj *),Parrayplot(NODE,Obj*),Pdrawcircle(NODE,Obj*); |
void Pobj_cp(NODE,Obj *),Parrayplot(NODE,Obj*),Pdrawcircle(NODE,Obj*); |
void Pifplot(NODE,Obj *),Pconplot(NODE,Obj *),Pplotover(NODE,Obj *); |
void Pifplot(NODE,Obj *),Pconplot(NODE,Obj *),Pplotover(NODE,Obj *); |
void Pmemory_ifplot(NODE, Obj *),Pmemory_conplot(NODE, Obj *); |
void Pmemory_ifplot(NODE,Obj *),Pmemory_conplot(NODE,Obj *); |
void Pmemory_plot(NODE, Obj *); |
void Pmemory_plot(NODE,Obj *); |
void ifplot_main(NODE, int, int, Obj *); |
void ifplot_main(NODE,int,char *,Obj *); |
void plot_main(NODE, int, int, Obj *); |
void plot_main(NODE,int,char *,Obj *); |
void conplot_main(NODE, int, Obj *); |
void conplot_main(NODE,int,Obj *); |
|
|
void Popen_canvas(NODE,Obj *),Pclear_canvas(NODE,Obj *),Pdraw_obj(NODE,Obj *); |
void Popen_canvas(NODE,Obj *),Pclear_canvas(NODE,Obj *),Pdraw_obj(NODE,Obj *); |
void Pdraw_string(NODE,Obj *); |
void Pdraw_string(NODE,Obj *); |
void Pox_rpc(), Pox_cmo_rpc(); |
void Pox_rpc(NODE,Obj *), Pox_cmo_rpc(NODE,Obj *); |
|
|
//NG |
//NG |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
Line 78 void PineqnorD(NODE,Obj *), PineqnorQ(NODE,Obj *), Pin |
|
Line 79 void PineqnorD(NODE,Obj *), PineqnorQ(NODE,Obj *), Pin |
|
void PineqnxorD(NODE,Obj *), PineqnxorQ(NODE,Obj *), PineqnxorB(NODE,Obj *); |
void PineqnxorD(NODE,Obj *), PineqnxorQ(NODE,Obj *), PineqnxorB(NODE,Obj *); |
void PconplotD(NODE,Obj *),PconplotQ(NODE,Obj *),PconplotB(NODE,Obj *); |
void PconplotD(NODE,Obj *),PconplotQ(NODE,Obj *),PconplotB(NODE,Obj *); |
void PplotoverD(NODE,Obj *),PplotoverQ(NODE,Obj *),PplotoverB(NODE,Obj *); |
void PplotoverD(NODE,Obj *),PplotoverQ(NODE,Obj *),PplotoverB(NODE,Obj *); |
void ifplot_mainNG(NODE,int,Obj *); |
void ifplot_mainNG(NODE,char *,Obj *); |
void ifplot_mainOP(NODE,int,Obj *); |
void conplot_mainNG(NODE,char *,Obj *); |
void conplot_mainNG(NODE,int,Obj *); |
void plotover_mainNG(NODE,char *,Obj *); |
void plotover_mainNG(NODE,int,Obj *); |
|
//void PplotD(NODE, Obj *); |
|
|
|
char *pfunc[]={ |
|
"ifplot","conplot","plot","interactive","polarplot","plotover", |
|
"ifplotD","ifplotQ","ifplotB","ineqnD","ineqnQ","ineqnB", |
|
"ineqnandD","ineqnandQ","ineqnandB","ineqnorD","ineqnorQ","ineqnorB", |
|
"ineqnxorD","ineqnxorQ","ineqnxorB", |
|
"conplotD","conplotQ","conplotB","itvifplot", |
|
"plotoverD","plotoverQ","plotoverB"}; |
|
// end NG |
|
|
|
struct ftab plot_tab[]={ |
struct ftab plot_tab[]={ |
{"plot",Pplot,-6}, |
{PLOT,Pplot,-7}, |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
{"itvifplot",Pitvifplot,-8}, |
{ITVIFPLOT,Pitvifplot,-8}, |
#endif |
#endif |
{"polarplot",Ppolarplot,-7}, |
{POLARPLOT,Ppolarplot,-6}, |
{"obj_cp",Pobj_cp,4}, |
{OBJ_CP,Pobj_cp,4}, |
{"ifplot",Pifplot,-7}, |
{IFPLOT,Pifplot,-7}, |
{"ifplotD",PifplotD,-8}, |
{IFPLOTD,PifplotD,-8}, |
{"ifplotQ",PifplotQ,-8}, |
{IFPLOTQ,PifplotQ,-8}, |
{"ifplotB",PifplotB,-8}, |
{IFPLOTB,PifplotB,-8}, |
{"ineqn",PineqnD,-8}, |
{INEQN,PineqnD,-8}, |
{"ineqnD",PineqnD,-8}, |
{INEQND,PineqnD,-8}, |
{"ineqnQ",PineqnQ,-8}, |
{INEQNQ,PineqnQ,-8}, |
{"ineqnB",PineqnB,-8}, |
{INEQNB,PineqnB,-8}, |
{"ineqnand",PineqnandD,4},//ifplot_mainOP :argc is const |
{INEQNAND,PineqnandD,-4}, |
{"ineqnandD",PineqnandD,4}, |
{INEQNDAND,PineqnandD,-4}, |
{"ineqnandQ",PineqnandQ,4}, |
{INEQNQAND,PineqnandQ,-4}, |
{"ineqnandB",PineqnandB,4}, |
{INEQNBAND,PineqnandB,-4}, |
{"ineqnor",PineqnorD,4}, |
{INEQNOR,PineqnorD,-4}, |
{"ineqnorD",PineqnorD,4}, |
{INEQNDOR,PineqnorD,-4}, |
{"ineqnorQ",PineqnorQ,4}, |
{INEQNQOR,PineqnorQ,-4}, |
{"ineqnorB",PineqnorB,4}, |
{INEQNBOR,PineqnorB,-4}, |
{"ineqnxor",PineqnxorD,4}, |
{INEQNXOR,PineqnxorD,-4}, |
{"ineqnxorD",PineqnxorD,4}, |
{INEQNDXOR,PineqnxorD,-4}, |
{"ineqnxorQ",PineqnxorQ,4}, |
{INEQNQXOR,PineqnxorQ,-4}, |
{"ineqnxorB",PineqnxorB,4}, |
{INEQNBXOR,PineqnxorB,-4}, |
{"conplot",Pconplot,-8}, |
{CONPLOT,Pconplot,-7}, |
{"conplotD",PconplotD,-9}, |
{CONPLOTD,PconplotD,-8}, |
{"conplotB",PconplotB,-9}, |
{CONPLOTB,PconplotB,-8}, |
{"conplotQ",PconplotQ,-9}, |
{CONPLOTQ,PconplotQ,-8}, |
{"plotover",Pplotover,-5}, |
{PLOTOVER,Pplotover,-4}, |
{"plotoverD",PplotoverD,-5}, |
{PLOTOVERD,PplotoverD,-4}, |
{"plotoverQ",PplotoverQ,-5}, |
{PLOTOVERQ,PplotoverQ,-4}, |
{"plotoverB",PplotoverB,-5}, |
{PLOTOVERB,PplotoverB,-4}, |
{"memory_ifplot",Pmemory_ifplot,-6}, |
{MEMORY_IFPLOT,Pmemory_ifplot,-7}, |
{"memory_conplot",Pmemory_conplot,-7}, |
{MEMORY_CONPLOT,Pmemory_conplot,-7}, |
{"memory_plot",Pmemory_plot,-5}, |
{MEMORY_PLOT,Pmemory_plot,-7}, |
{"drawcircle",Pdrawcircle,6}, |
{DRAWCIRCLE,Pdrawcircle,4}, |
{"open_canvas",Popen_canvas,-3}, |
{OPEN_CANVAS,Popen_canvas,-3}, |
{"clear_canvas",Pclear_canvas,2}, |
{CLEAR_CANVAS,Pclear_canvas,2}, |
{"draw_obj",Pdraw_obj,-4}, |
{DRAW_OBJ,Pdraw_obj,-3}, |
{"draw_string",Pdraw_string,-5}, |
{DRAW_STRING,Pdraw_string,-4}, |
{0,0,0}, |
{0,0,0}, |
}; |
}; |
|
char *pfn[]={ |
|
IFPLOT,CONPLOT,PLOT,INTERACTIVE,POLARPLOT,PLOTOVER, |
|
IFPLOTD,IFPLOTQ,IFPLOTB,INEQND,INEQNQ,INEQNB, |
|
INEQNDAND,INEQNQAND,INEQNBAND, |
|
INEQNDOR,INEQNQOR,INEQNBOR, |
|
INEQNDXOR,INEQNQXOR,INEQNBXOR, |
|
CONPLOTD,CONPLOTQ,CONPLOTB,ITVIFPLOT, |
|
PLOTOVERD,PLOTOVERQ,PLOTOVERB, |
|
MEMORY_IFPLOT,MEMORY_CONPLOT,MEMORY_PLOT,ARRAYPLOT,OPEN_CANVAS, |
|
DRAWCIRCLE,DRAW_OBJ,DRAW_STRING,OBJ_CP,CLEAR_CANVAS}; |
|
/* |
|
IFPLOT:0,CONPLOT:1,PLOT:2,INTERACTIVE:3,POLARPLOT:4,PLOTOVER:5, |
|
IFPLOTD:6,IFPLOTQ:7,IFPLOTB:8,INEQND:9,INEQNQ:10,INEQNB:11, |
|
INEQNDAND:12,INEQNQAND:13,INEQNBAND:14, |
|
INEQNDOR:15,INEQNQOR:16,INEQNBOR:17, |
|
INEQNDXOR:18,INEQNQXOR:19,INEQNBXOR:20, |
|
CONPLOTD:21,CONPLOTQ:22,CONPLOTB:23,ITVIFPLOT:24, |
|
PLOTOVERD:25,PLOTOVERQ:26,PLOTOVERB:27, |
|
MEMORY_IFPLOT:28,MEMORY_CONPLOT:29,MEMORY_PLOT:30,ARRAYPLOT:31, |
|
OPEN_CANVAS:32,DRAWCIRCLE:33,DRAW_OBJ:34,DRAW_STRING:35,OBJ_CP:36, |
|
CLEAR_CANVAS:37 |
|
*/ |
|
int modeNO(char *fn){ |
|
int i; |
|
char **z; |
|
for(i=0,z=pfn;*z!=NULL;z++,i++)if(!strcmp(fn,*z))return i; |
|
return -1; |
|
} |
|
|
void Popen_canvas(NODE arg,Obj *rp){ |
void Popen_canvas(NODE arg,Obj *rp){ |
Q w300,s_id; |
Q w300,s_id; |
Line 171 void Popen_canvas(NODE arg,Obj *rp){ |
|
Line 189 void Popen_canvas(NODE arg,Obj *rp){ |
|
MKNODE(n,w300,n0); |
MKNODE(n,w300,n0); |
MKLIST(geom,n); |
MKLIST(geom,n); |
} |
} |
MKSTR(fname,"open_canvas"); |
MKSTR(fname,OPEN_CANVAS); |
arg=mknode(4,s_id,fname,geom,wname); |
arg=mknode(4,s_id,fname,geom,wname); |
Pox_cmo_rpc(arg,rp); |
Pox_cmo_rpc(arg,rp); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
} |
} |
|
|
void Pifplot(NODE arg,Obj *rp){ifplot_main(arg,0,MODE_IFPLOT,rp);} |
void Pifplot(NODE arg,Obj *rp){ifplot_main(arg,0,IFPLOT,rp);} |
void Pmemory_ifplot(NODE arg,Obj *rp){ifplot_main(arg,1,MODE_IFPLOT,rp);} |
void Pmemory_ifplot(NODE arg,Obj *rp){ifplot_main(arg,1,IFPLOT,rp);} |
|
|
void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
void ifplot_main(NODE arg,int is_memory,char *fn,Obj *rp){ |
Q m2,p2,w300,s_id; |
Q m2,p2,w300,s_id; |
NODE defrange; |
NODE defrange; |
LIST xrange,yrange,range[2],list,geom; |
LIST xrange,yrange,zrange,range[2],list,geom; |
VL vl,vl0; |
VL vl,vl0; |
V v[2],av[2]; |
V v[2],av[2]; |
int stream,ri,i,sign; |
int stream,ri,i,sign; |
Line 193 void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp |
|
Line 211 void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp |
|
Obj t; |
Obj t; |
|
|
STOQ(-2,m2);STOQ(2,p2);MKNODE(n,p2,0);MKNODE(defrange,m2,n); |
STOQ(-2,m2);STOQ(2,p2);MKNODE(n,p2,0);MKNODE(defrange,m2,n); |
poly=0;vl=0;geom=0;wname=0;stream=-1;ri=0; |
poly=0;vl=0;geom=0;wname=0;stream=-1;ri=0;xrange=0;yrange=0;zrange=0; |
v[0]=v[1]=0; |
v[0]=v[1]=0; |
for(;arg;arg=NEXT(arg)) |
for(;arg;arg=NEXT(arg)) |
if(!BDY(arg))stream=0; |
if(!BDY(arg))stream=0; |
Line 202 void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp |
|
Line 220 void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp |
|
case O_P: |
case O_P: |
poly=(P)BDY(arg); |
poly=(P)BDY(arg); |
get_vars_recursive((Obj)poly,&vl); |
get_vars_recursive((Obj)poly,&vl); |
for(vl0=vl,i=0;vl0;vl0=NEXT(vl0)) |
for(vl0=vl,i=0;vl0;vl0=NEXT(vl0)){ |
if(vl0->v->attr==(pointer)V_IND) |
if(vl0->v->attr==(pointer)V_IND){ |
if(i>=2)error("ifplot : invalid argument"); |
if(i>=2)error("ifplot : invalid argument"); |
else v[i++]=vl0->v; |
else v[i++]=vl0->v; |
|
} |
|
} |
break; |
break; |
case O_LIST: |
case O_LIST: |
list=(LIST)BDY(arg); |
list=(LIST)BDY(arg); |
Line 265 void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp |
|
Line 285 void ifplot_main(NODE arg,int is_memory,int fn,Obj *rp |
|
STOQ(300,w300);MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
STOQ(300,w300);MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
} |
} |
if(is_memory){ |
if(is_memory){ |
MKSTR(fname,"memory_plot"); |
MKSTR(fname,MEMORY_PLOT); |
arg=mknode(8,s_id,fname,poly,xrange,yrange,0,geom); |
arg=mknode(8,s_id,fname,poly,xrange,yrange,zrange,geom); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
arg=mknode(1,s_id); |
arg=mknode(1,s_id); |
Pox_pop_cmo(arg,rp); |
Pox_pop_cmo(arg,rp); |
} else { |
} else { |
MKSTR(fname,pfunc[fn]); |
MKSTR(fname,fn); |
arg=mknode(8,s_id,fname,poly,xrange,yrange,0,geom,wname); |
/* |
|
printf("%s\n",fn); |
|
ListCheck("xrange",xrange); |
|
ListCheck("yrange",yrange); |
|
ListCheck("geom",geom); |
|
*/ |
|
arg=mknode(8,s_id,fname,poly,xrange,yrange,zrange,geom,wname); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
} |
} |
Line 288 void Pobj_cp(NODE arg,Obj *rp){ |
|
Line 314 void Pobj_cp(NODE arg,Obj *rp){ |
|
index_A=(Q)ARG1(arg); |
index_A=(Q)ARG1(arg); |
index_B=(Q)ARG2(arg); |
index_B=(Q)ARG2(arg); |
op_code=(Q)ARG3(arg); |
op_code=(Q)ARG3(arg); |
MKSTR(fname,"objcp"); |
MKSTR(fname,OBJ_CP); |
arg=mknode(5,sysid,fname,index_A,index_B,op_code); |
arg=mknode(5,sysid,fname,index_A,index_B,op_code); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)sysid; |
*rp=(Obj)sysid; |
Line 316 void conplot_main(NODE arg,int is_memory,Obj *rp){ |
|
Line 342 void conplot_main(NODE arg,int is_memory,Obj *rp){ |
|
case O_P: |
case O_P: |
poly=(P)BDY(arg); |
poly=(P)BDY(arg); |
get_vars_recursive((Obj)poly,&vl); |
get_vars_recursive((Obj)poly,&vl); |
for(vl0=vl,i=0;vl0;vl0=NEXT(vl0)) |
for(vl0=vl,i=0;vl0;vl0=NEXT(vl0)){ |
if(vl0->v->attr==(pointer)V_IND) |
if(vl0->v->attr==(pointer)V_IND){ |
if(i>=2) error("conplot : invalid argument"); |
if(i>=2){ |
else v[i++]=vl0->v; |
error("conplot : invalid argument"); |
|
} else v[i++]=vl0->v; |
|
} |
|
} |
break; |
break; |
case O_LIST: |
case O_LIST: |
list=(LIST)BDY(arg); |
list=(LIST)BDY(arg); |
Line 415 void conplot_main(NODE arg,int is_memory,Obj *rp){ |
|
Line 444 void conplot_main(NODE arg,int is_memory,Obj *rp){ |
|
MKLIST(geom,n); |
MKLIST(geom,n); |
} |
} |
if(is_memory){ |
if(is_memory){ |
MKSTR(fname,"memory_plot"); |
MKSTR(fname,MEMORY_PLOT); |
arg=mknode(7,s_id,fname,poly,xrange,yrange,zrange,geom); |
arg=mknode(7,s_id,fname,poly,xrange,yrange,zrange,geom); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
arg=mknode(1,s_id); |
arg=mknode(1,s_id); |
Line 428 void conplot_main(NODE arg,int is_memory,Obj *rp){ |
|
Line 457 void conplot_main(NODE arg,int is_memory,Obj *rp){ |
|
if(i!=3)error("conplot : yrange error"); |
if(i!=3)error("conplot : yrange error"); |
for(i=0,n=(NODE)BDY(zrange);n;i++,n=NEXT(n)); |
for(i=0,n=(NODE)BDY(zrange);n;i++,n=NEXT(n)); |
if(i!=3)error("conplot : xrange error"); |
if(i!=3)error("conplot : xrange error"); |
MKSTR(fname,pfunc[MODE_CONPLOT]); |
MKSTR(fname,CONPLOT); |
arg=mknode(8,s_id,fname,poly,xrange,yrange,zrange,geom,wname); |
arg=mknode(8,s_id,fname,poly,xrange,yrange,zrange,geom,wname); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
} |
} |
} |
} |
|
|
void Pplot(NODE arg,Obj *rp){plot_main(arg,0,MODE_PLOT,rp);} |
void Pplot(NODE arg,Obj *rp){plot_main(arg,0,PLOT,rp);} |
void Pmemory_plot(NODE arg,Obj *rp){plot_main(arg,1,MODE_PLOT,rp);} |
void Pmemory_plot(NODE arg,Obj *rp){plot_main(arg,1,PLOT,rp);} |
|
|
void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
void plot_main(NODE arg,int is_memory,char *fn,Obj *rp){ |
Q m2,p2,w300,s_id; |
Q m2,p2,w300,s_id; |
NODE defrange; |
NODE defrange; |
LIST xrange,range[1],list,geom; |
LIST xrange,range[1],list,geom; |
Line 463 void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
|
Line 492 void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
|
case O_P: case O_R: |
case O_P: case O_R: |
poly=(P)BDY(arg); |
poly=(P)BDY(arg); |
get_vars_recursive((Obj)poly,&vl); |
get_vars_recursive((Obj)poly,&vl); |
for(vl0=vl, i=0;vl0;vl0=NEXT(vl0) ) |
for(vl0=vl, i=0;vl0;vl0=NEXT(vl0) ){ |
if(vl0->v->attr==(pointer)V_IND ) |
if(vl0->v->attr==(pointer)V_IND ){ |
if(i >= 1 ) |
if(i >= 1 ) error("ifplot : invalid argument"); |
error("ifplot : invalid argument"); |
else v[i++]=vl0->v; |
else |
} |
v[i++]=vl0->v; |
} |
if(i != 1 ) |
if(i != 1 ) error("ifplot : invalid argument"); |
error("ifplot : invalid argument"); |
|
break; |
break; |
case O_LIST: |
case O_LIST: |
list=(LIST)BDY(arg); |
list=(LIST)BDY(arg); |
if(OID(BDY(BDY(list)))==O_P ) |
if(OID(BDY(BDY(list)))==O_P ){ |
if(ri > 0 ) |
if(ri > 0 ) error("plot : invalid argument"); |
error("plot : invalid argument"); |
else range[ri++]=list; |
else |
} else geom=list; |
range[ri++]=list; |
|
else |
|
geom=list; |
|
break; |
break; |
case O_N: |
case O_N: |
stream=QTOS((Q)BDY(arg));break; |
stream=QTOS((Q)BDY(arg));break; |
Line 521 void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
|
Line 546 void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
|
MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
} |
} |
if(is_memory ){ |
if(is_memory ){ |
MKSTR(fname,"memory_plot"); |
MKSTR(fname,MEMORY_PLOT); |
arg=mknode(7,s_id,fname,poly,xrange,NULLP,NULLP,geom); |
arg=mknode(7,s_id,fname,poly,xrange,NULLP,NULLP,geom); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
arg=mknode(1,s_id); |
arg=mknode(1,s_id); |
Pox_pop_cmo(arg,rp); |
Pox_pop_cmo(arg,rp); |
} else { |
} else { |
MKSTR(fname,pfunc[fn]); |
MKSTR(fname,fn); |
arg=mknode(8,s_id,fname,poly,xrange,NULLP,NULLP,geom,wname); |
arg=mknode(8,s_id,fname,poly,xrange,NULLP,NULLP,geom,wname); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
Line 537 void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
|
Line 562 void plot_main(NODE arg,int is_memory,int fn,Obj *rp){ |
|
#define Pi 3.14159265358979323846264 |
#define Pi 3.14159265358979323846264 |
|
|
void Ppolarplot(NODE arg,Obj *rp){ |
void Ppolarplot(NODE arg,Obj *rp){ |
Q m2,p2,w300,s_id; |
Q m2,p2,w300,defstep,s_id,color; |
NODE defrange; |
NODE defrange,n,n0,n1,n2; |
LIST zrange,range[1],list,geom; |
LIST range,geom,list[2]; |
VL vl,vl0; |
VL vl,vl0; |
V v[1],av[1]; |
V v[1],av; |
int stream,ri,i; |
int stream,ri,i,len,iNo,lNo,vNo,sNo,pfine,findG; |
P poly; |
P poly,var; |
P var; |
|
NODE n,n0; |
|
STRING fname,wname; |
STRING fname,wname; |
Real pi2; |
Real pi2; |
Obj t; |
Obj t,frst,sec,thr;; |
|
char ebuf[BUFSIZ]; |
|
|
MKReal(2*Pi,pi2); |
iNo=lNo=sNo=findG=0;pfine=TRUE; |
MKNODE(n,pi2,0);MKNODE(defrange,0,n); |
poly=0;vl=0;geom=0;wname=0;color=0;stream=-1;ri=0;v[0]=0; |
poly=0;vl=0;geom=0;wname=0;stream=-1;ri=0; |
for(;arg;arg=NEXT(arg)){ |
v[0]=0; |
if(!BDY(arg)) iNo++; |
for(;arg;arg=NEXT(arg) ) |
else switch(OID(BDY(arg))){ |
if(!BDY(arg) ) |
case O_P: case O_R://formular |
stream=0; |
poly=(P)BDY(arg); |
else |
get_vars_recursive((Obj)poly,&vl); |
switch ( OID(BDY(arg)) ){ |
for(vl0=vl,vNo=0;vl0;vl0=NEXT(vl0)){ |
case O_P: case O_R: |
if(vl0->v->attr==(pointer)V_IND){ |
poly=(P)BDY(arg); |
if(vNo>=1){ |
get_vars_recursive((Obj)poly,&vl); |
sprintf(ebuf,"%s : invalaid argument",POLARPLOT); |
for(vl0=vl, i=0;vl0;vl0=NEXT(vl0) ) |
error(ebuf); |
if(vl0->v->attr==(pointer)V_IND ) |
} else v[vNo++]=vl0->v; |
if(i >= 1 ) |
} |
error("polarplot : invalid argument"); |
} |
else |
if(vNo!=1){ |
v[i++]=vl0->v; |
sprintf(ebuf,"%s : only uni-variate formular",POLARPLOT); |
if(i != 1 ) |
error(ebuf); |
error("polarplot : invalid argument"); |
} |
|
break; |
|
case O_N://color,id,idx,division |
|
switch (iNo){ |
|
case 0://color arg |
|
color=(Q)BDY(arg); |
|
iNo++; |
break; |
break; |
case O_LIST: |
case 1://stream arg |
list=(LIST)BDY(arg); |
stream=QTOS((Q)BDY(arg)); |
if(OID(BDY(BDY(list)))==O_P ) |
iNo++; |
if(ri > 0 ) |
|
error("polarplot : invalid argument"); |
|
else |
|
range[ri++]=list; |
|
else |
|
geom=list; |
|
break; |
break; |
case O_N: |
default://error |
stream=QTOS((Q)BDY(arg));break; |
sprintf(ebuf,"%s : invalid number arguments",POLARPLOT); |
case O_STR: |
error(ebuf); |
wname=(STRING)BDY(arg);break; |
break; |
default: |
} |
error("polarplot : invalid argument");break; |
|
} |
|
if(!poly ) |
|
error("polarplot : invalid argument"); |
|
switch ( ri ){ |
|
case 0: |
|
MKV(v[0],var);MKNODE(n,var,defrange);MKLIST(zrange,n); |
|
break; |
break; |
case 1: |
case O_LIST://range,geomerty |
av[0]=VR((P)BDY(BDY(range[0]))); |
if(lNo<2)list[lNo++]=(LIST)BDY(arg); |
if(v[0]==av[0] ) |
else { |
zrange=range[0]; |
sprintf(ebuf,"%s : invalid list argument",POLARPLOT); |
else |
error(ebuf); |
error("polarplot : invalid argument"); |
} |
break; |
break; |
|
case O_STR://wname |
|
wname=(STRING)BDY(arg); |
|
sNo++; |
|
break; |
default: |
default: |
error("polarplot : cannot happen");break; |
break; |
|
} |
} |
} |
stream=validate_ox_plot_stream(stream); |
//formular check |
STOQ(stream,s_id); |
if(!poly){ |
|
sprintf(ebuf,"%s : invalid ploy argument",POLARPLOT); |
|
error(ebuf); |
|
} |
|
//vars check |
|
get_vars_recursive((Obj)poly,&vl); |
|
for(vl0=vl,vNo=0;vl0;vNo++,vl0=NEXT(vl0)){ |
|
if(vl0->v->attr==(pointer)V_IND){ |
|
if(vNo>=2){ |
|
sprintf(ebuf,"%s : invalid ploy argument",POLARPLOT); |
|
error(ebuf); |
|
} else v[vNo]=vl0->v; |
|
} |
|
} |
|
//list check |
|
for(i=0;i<lNo;i++){ |
|
if(OID(BDY(BDY(list[i])))!=O_P){ |
|
// list first value is number (geometry) |
|
for(len=0,n=(NODE)BDY(list[i]);n;len++,n=NEXT(n)){ |
|
if(len==0) frst=BDY(n); |
|
else if(len==1) sec=BDY(n); |
|
else { |
|
sprintf(ebuf,"%s : geometry list too long",POLARPLOT); |
|
error(ebuf); |
|
} |
|
} |
|
if(len!=2){ |
|
sprintf(ebuf,"%s : geometry requierd 2 numbers", POLARPLOT); |
|
error(ebuf); |
|
} else geom=list[i]; |
|
} else { |
|
//list first value is var (range) |
|
av=VR((P)BDY(BDY(list[i]))); |
|
if(v[0]==av)range=list[i]; |
|
else { |
|
sprintf(ebuf,"%s : invalid list length",POLARPLOT); |
|
error(ebuf); |
|
} |
|
} |
|
} |
|
// set default |
|
if(!range){ |
|
STOQ(DEFAULTPOLARSTEP,defstep);MKReal(2*Pi,pi2);MKV(v[0],var); |
|
MKNODE(n,defstep,0);MKNODE(n1,pi2,n);MKNODE(n2,0,n1); |
|
MKNODE(defrange,var,n2);MKLIST(range,defrange); |
|
} |
if(!geom){ |
if(!geom){ |
STOQ(300,w300); |
STOQ(300,w300);MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
|
} |
} |
MKSTR(fname,pfunc[MODE_POLARPLOT]); |
stream=validate_ox_plot_stream(stream); |
arg=mknode(8,s_id,fname,poly,NULLP,NULLP,zrange,geom,wname); |
STOQ(stream,s_id); |
|
MKSTR(fname,POLARPLOT); |
|
arg=mknode(7,s_id,fname,poly,color,range,geom,wname); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
} |
} |
Line 626 void Pplotover(NODE arg,Obj *rp){ |
|
Line 694 void Pplotover(NODE arg,Obj *rp){ |
|
w_id=(Q)ARG2(arg); |
w_id=(Q)ARG2(arg); |
if(argc(arg)==4)color=(Q)ARG3(arg); |
if(argc(arg)==4)color=(Q)ARG3(arg); |
else color=0; |
else color=0; |
MKSTR(fname,"plotover"); |
MKSTR(fname,PLOTOVER); |
arg=mknode(5,s_id,fname,w_id,poly,color); |
arg=mknode(5,s_id,fname,w_id,poly,color); |
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
Line 645 void Pdrawcircle(NODE arg,Obj *rp){ |
|
Line 713 void Pdrawcircle(NODE arg,Obj *rp){ |
|
c=(Obj)ARG3(arg); |
c=(Obj)ARG3(arg); |
s_id=(Q)ARG4(arg); |
s_id=(Q)ARG4(arg); |
index=(Q)ARG5(arg); |
index=(Q)ARG5(arg); |
MKSTR(fname,"drawcircle"); |
MKSTR(fname,DRAWCIRCLE); |
n=mknode(3,x,y,r,c); |
n=mknode(3,x,y,r,c); |
MKLIST(pos,n); |
MKLIST(pos,n); |
arg=mknode(5,s_id,fname,index,pos,c); |
arg=mknode(5,s_id,fname,index,pos,c); |
Line 659 void Pdraw_obj(NODE arg,Obj *rp){ |
|
Line 727 void Pdraw_obj(NODE arg,Obj *rp){ |
|
LIST obj; |
LIST obj; |
Obj t; |
Obj t; |
|
|
if(!fname)MKSTR(fname,"draw_obj"); |
if(!fname)MKSTR(fname,DRAW_OBJ); |
s_id=(Q)ARG0(arg); |
s_id=(Q)ARG0(arg); |
index=(Q)ARG1(arg); |
index=(Q)ARG1(arg); |
obj=(LIST)ARG2(arg); |
obj=(LIST)ARG2(arg); |
Line 677 void Pdraw_string(NODE arg,Obj *rp){ |
|
Line 745 void Pdraw_string(NODE arg,Obj *rp){ |
|
LIST pos; |
LIST pos; |
Obj t; |
Obj t; |
|
|
if(!fname)MKSTR(fname,"draw_string"); |
if(!fname)MKSTR(fname,DRAW_STRING); |
s_id=(Q)ARG0(arg); |
s_id=(Q)ARG0(arg); |
index=(Q)ARG1(arg); |
index=(Q)ARG1(arg); |
pos=(LIST)ARG2(arg); |
pos=(LIST)ARG2(arg); |
Line 694 void Pclear_canvas(NODE arg,Obj *rp){ |
|
Line 762 void Pclear_canvas(NODE arg,Obj *rp){ |
|
Q s_id,index; |
Q s_id,index; |
Obj t; |
Obj t; |
|
|
if(!fname) MKSTR(fname,"clear_canvas"); |
if(!fname) MKSTR(fname,CLEAR_CANVAS); |
s_id=(Q)ARG0(arg); |
s_id=(Q)ARG0(arg); |
index=(Q)ARG1(arg); |
index=(Q)ARG1(arg); |
arg=mknode(3,s_id,fname,index); |
arg=mknode(3,s_id,fname,index); |
Line 712 void Pclear_canvas(NODE arg,Obj *rp){ |
|
Line 780 void Pclear_canvas(NODE arg,Obj *rp){ |
|
void ListCheck(char * head,LIST list){ |
void ListCheck(char * head,LIST list){ |
int i; |
int i; |
NODE n; |
NODE n; |
printf("%s\n",head); |
|
if(!list){ |
if(!list){ |
printf("zero list\n"); |
printf("%s zero \n",head); |
return; |
return; |
} |
} |
|
for(i=0,n=(NODE)BDY(list);n;i++,n=NEXT(n)); |
|
printf("%s length %d\n",head,i); |
for(i=0,n=(NODE)BDY(list);n;i++,n=NEXT(n)){ |
for(i=0,n=(NODE)BDY(list);n;i++,n=NEXT(n)){ |
if(!BDY(n))printf("%d 0\n",i); |
if(!BDY(n))printf("%d 0\n",i); |
else if(OID(BDY(n))==O_P) printf("%d poly\n",i); |
else if(OID(BDY(n))==O_P) printf("%d poly\n",i); |
else printf("%d %d\n",i,QTOS((Q)BDY(n))); |
else if(OID(BDY(n))==O_R) printf("%d real\n",i); |
|
else if(OID(BDY(n))==O_N) printf("%d %d\n",i,QTOS((Q)BDY(n))); |
} |
} |
} |
} |
|
|
void PifplotD(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_IFPLOTD,rp);} |
void PifplotD(NODE arg,Obj *rp){ifplot_mainNG(arg,IFPLOTD,rp);} |
void PifplotQ(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_IFPLOTQ,rp);} |
void PifplotQ(NODE arg,Obj *rp){ifplot_mainNG(arg,IFPLOTQ,rp);} |
void PifplotB(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_IFPLOTB,rp);} |
void PifplotB(NODE arg,Obj *rp){ifplot_mainNG(arg,IFPLOTB,rp);} |
|
|
void PconplotD(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_CONPLOTD,rp);} |
void PconplotD(NODE arg,Obj *rp){ifplot_mainNG(arg,CONPLOTD,rp);} |
void PconplotQ(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_CONPLOTQ,rp);} |
void PconplotQ(NODE arg,Obj *rp){ifplot_mainNG(arg,CONPLOTQ,rp);} |
void PconplotB(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_CONPLOTB,rp);} |
void PconplotB(NODE arg,Obj *rp){ifplot_mainNG(arg,CONPLOTB,rp);} |
|
|
void PineqnD(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_INEQND,rp);} |
void PineqnD(NODE arg,Obj *rp){ifplot_mainNG(arg,INEQND,rp);} |
void PineqnQ(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_INEQNQ,rp);} |
void PineqnQ(NODE arg,Obj *rp){ifplot_mainNG(arg,INEQNQ,rp);} |
void PineqnB(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_INEQNB,rp);} |
void PineqnB(NODE arg,Obj *rp){ifplot_mainNG(arg,INEQNB,rp);} |
|
|
#if defined(INTERVAL) |
#if defined(INTERVAL) |
void Pitvifplot(NODE arg,Obj *rp){ifplot_mainNG(arg,MODE_ITVIFPLOT,rp);} |
void Pitvifplot(NODE arg,Obj *rp){ifplot_mainNG(arg,ITVIFPLOT,rp);} |
#endif |
#endif |
|
|
void PineqnorD(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNORD,rp);} |
void PineqnorD(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNDOR,rp);} |
void PineqnorQ(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNORQ,rp);} |
void PineqnorQ(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNQOR,rp);} |
void PineqnorB(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNORB,rp);} |
void PineqnorB(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNBOR,rp);} |
|
|
void PineqnandD(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNANDD,rp);} |
void PineqnandD(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNDAND,rp);} |
void PineqnandQ(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNANDQ,rp);} |
void PineqnandQ(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNQAND,rp);} |
void PineqnandB(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNANDB,rp);} |
void PineqnandB(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNBAND,rp);} |
|
|
void PineqnxorD(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNXORD,rp);} |
void PineqnxorD(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNDXOR,rp);} |
void PineqnxorQ(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNXORQ,rp);} |
void PineqnxorQ(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNQXOR,rp);} |
void PineqnxorB(NODE arg,Obj *rp){ifplot_mainOP(arg,MODE_INEQNXORB,rp);} |
void PineqnxorB(NODE arg,Obj *rp){plotover_mainNG(arg,INEQNBXOR,rp);} |
|
|
void PplotoverD(NODE arg,Obj *rp){plotover_mainNG(arg,MODE_PLOTOVERD,rp);} |
void PplotoverD(NODE arg,Obj *rp){plotover_mainNG(arg,PLOTOVERD,rp);} |
void PplotoverQ(NODE arg,Obj *rp){plotover_mainNG(arg,MODE_PLOTOVERQ,rp);} |
void PplotoverQ(NODE arg,Obj *rp){plotover_mainNG(arg,PLOTOVERQ,rp);} |
void PplotoverB(NODE arg,Obj *rp){plotover_mainNG(arg,MODE_PLOTOVERB,rp);} |
void PplotoverB(NODE arg,Obj *rp){plotover_mainNG(arg,PLOTOVERB,rp);} |
|
|
void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
void ifplot_mainNG(NODE arg,char *fn,Obj *rp){ |
Q m2,p2,w300,mxgc,s_id,color,idv; |
Q m2,p2,w300,mxgc,s_id,color; |
NODE defrange,n,n0,n1,n2; |
NODE defrange,n,n0,n1,n2; |
P poly,var; |
P poly,var; |
VL vl,vl0; |
VL vl,vl0; |
Line 769 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 839 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
char ebuf[BUFSIZ]; |
char ebuf[BUFSIZ]; |
|
|
iNo=lNo=sNo=findG=0;pfine=TRUE; |
iNo=lNo=sNo=findG=0;pfine=TRUE; |
poly=0;stream=-1;wname=0;color=0;idv=0;stream=0; |
poly=0;stream=-1;wname=0;color=0;stream=0; |
STOQ(-2,m2);STOQ(2,p2);MKNODE(n,p2,0);MKNODE(defrange,m2,n); |
STOQ(-2,m2);STOQ(2,p2);MKNODE(n,p2,0);MKNODE(defrange,m2,n); |
STOQ(MAXGC,mxgc); |
STOQ(MAXGC,mxgc); |
for(;arg;arg=NEXT(arg)){ |
for(;arg;arg=NEXT(arg)){ |
Line 780 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 850 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
poly=(P)BDY(arg); |
poly=(P)BDY(arg); |
pfine=FALSE; |
pfine=FALSE; |
} else { |
} else { |
sprintf(ebuf,"%s : to many ploy arguments",pfunc[fn]); |
sprintf(ebuf,"%s : to many ploy arguments",fn); |
error(ebuf); |
error(ebuf); |
} |
} |
break; |
break; |
Line 794 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 864 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
stream=QTOS((Q)BDY(arg)); |
stream=QTOS((Q)BDY(arg)); |
iNo++; |
iNo++; |
break; |
break; |
case 2: //division arg |
default: |
if(fn==MODE_ITVIFPLOT){//itvifplot |
sprintf(ebuf,"%s : invalid number arguments",fn); |
idv=(Q)BDY(arg); |
|
iNo++; |
|
} else {//others |
|
sprintf(ebuf,"%s : invalid number arguments",pfunc[fn]); |
|
error(ebuf); |
|
} |
|
break; |
|
case 3:// error |
|
sprintf(ebuf,"%s : invalid number arguments",pfunc[fn]); |
|
error(ebuf); |
error(ebuf); |
break; |
break; |
} |
} |
Line 812 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 873 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
case O_LIST://xrange,yrange,zrange,geometry |
case O_LIST://xrange,yrange,zrange,geometry |
if(lNo<4) list[lNo++]=(LIST)BDY(arg); |
if(lNo<4) list[lNo++]=(LIST)BDY(arg); |
else { |
else { |
sprintf(ebuf,"%s : invalid list argument",pfunc[fn]); |
sprintf(ebuf,"%s : invalid list argument",fn); |
error(ebuf); |
error(ebuf); |
} |
} |
break; |
break; |
Line 826 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 887 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
} |
} |
// formular check |
// formular check |
if(!poly){ |
if(!poly){ |
sprintf(ebuf,"%s : invalid ploy argument",pfunc[fn]); |
sprintf(ebuf,"%s : invalid ploy argument",fn); |
error(ebuf); |
error(ebuf); |
} |
} |
// vars check |
// vars check |
get_vars_recursive((Obj)poly,&vl); |
get_vars_recursive((Obj)poly,&vl); |
for(vl0=vl,vNo=0;vl0;vl0=NEXT(vl0)) |
for(vl0=vl,vNo=0;vl0;vl0=NEXT(vl0)){ |
if(vl0->v->attr==(pointer)V_IND) |
if(vl0->v->attr==(pointer)V_IND){ |
if(vNo>=2){ |
if(vNo>=2){ |
sprintf(ebuf,"%s : invalid ploy argument",pfunc[fn]); |
sprintf(ebuf,"%s : invalid ploy argument",fn); |
error(ebuf); |
error(ebuf); |
} else v[vNo++]=vl0->v; |
} else v[vNo++]=vl0->v; |
|
} |
|
} |
//list check |
//list check |
xrange=yrange=zrange=geom=0;frst=sec=thr=0; |
xrange=yrange=zrange=geom=0;frst=sec=thr=0; |
for(i=0;i<lNo;i++){ |
for(i=0;i<lNo;i++){ |
for(llen=0,n=(NODE)BDY(list[i]);n;llen++,n=NEXT(n)); |
for(llen=0,n=(NODE)BDY(list[i]);n;llen++,n=NEXT(n)); |
if(llen>4){ |
if(llen>4){ |
sprintf(ebuf,"%s : invalid list length",pfunc[fn]); |
sprintf(ebuf,"%s : invalid list length",fn); |
error(ebuf); |
error(ebuf); |
} |
} |
if(OID(BDY(BDY(list[i])))!=O_P){ |
if(OID(BDY(BDY(list[i])))!=O_P){ |
Line 854 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 917 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
} |
} |
switch(len){ |
switch(len){ |
case 2: |
case 2: |
if(fn==MODE_CONPLOT){ |
if(!strcmp(fn,CONPLOT)){ |
if(thr==0)thr=(Obj)mxgc; |
if(thr==0)thr=(Obj)mxgc; |
MKNODE(n,thr,0);MKNODE(n1,sec,n);MKNODE(n2,frst,n1);MKLIST(zrange,n2); |
MKNODE(n,thr,0);MKNODE(n1,sec,n);MKNODE(n2,frst,n1);MKLIST(zrange,n2); |
} else geom=list[i]; |
} else geom=list[i]; |
Line 865 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 928 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
case 0: |
case 0: |
case 1: |
case 1: |
default: |
default: |
sprintf(ebuf,"%s : invalid list length",pfunc[fn]); |
sprintf(ebuf,"%s : invalid list length",fn); |
error(ebuf); |
error(ebuf); |
break; |
break; |
} |
} |
Line 889 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 952 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
if(!geom){ |
if(!geom){ |
STOQ(300,w300);MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
STOQ(300,w300);MKNODE(n0,w300,0);MKNODE(n,w300,n0);MKLIST(geom,n); |
} |
} |
if(fn==MODE_CONPLOTD||fn==MODE_CONPLOTQ||fn==MODE_CONPLOTB) if(!zrange){ |
if(!(strcmp(fn,CONPLOTD)&strcmp(fn,CONPLOTQ)&strcmp(fn,CONPLOTB))&!zrange){ |
MKNODE(n,mxgc,0);MKNODE(n1,m2,n);MKNODE(n2,m2,n1);MKLIST(zrange,n2); |
MKNODE(n,mxgc,0);MKNODE(n1,m2,n);MKNODE(n2,m2,n1);MKLIST(zrange,n2); |
} |
} |
/*new ifplot in ox_plot requires |
/*new ifplot in ox_plot requires |
Line 901 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
Line 964 void ifplot_mainNG(NODE arg,int fn,Obj *rp){ |
|
yrange=[y,ymin,ymax] (LIST optional), |
yrange=[y,ymin,ymax] (LIST optional), |
zrange=[zmin,zmax,zstep] (LIST optional), |
zrange=[zmin,zmax,zstep] (LIST optional), |
wname=name (STRING optional)], |
wname=name (STRING optional)], |
itvstep (Q) if MODE_ITVIFPLOT */ |
itvstep (Q) if ITVIFPLOT */ |
stream=validate_ox_plot_stream(stream); |
stream=validate_ox_plot_stream(stream); |
STOQ(stream,s_id); |
STOQ(stream,s_id); |
MKSTR(fname,pfunc[fn]); |
MKSTR(fname,fn); |
/* |
/* |
printf("%s\n",pfunc[fn]); |
printf("%s\n",fn); |
ListCheck("xrange",xrange); |
ListCheck("xrange",xrange); |
ListCheck("yrange",yrange); |
ListCheck("yrange",yrange); |
ListCheck("zrange",zrange); |
ListCheck("zrange",zrange); |
ListCheck("geom",geom); |
ListCheck("geom",geom); |
|
printf("idv %d\n",idv); |
*/ |
*/ |
if(fn==MODE_ITVIFPLOT) |
arg=mknode(9,s_id,fname,poly,color,xrange,yrange,zrange,geom,wname); |
arg=mknode(10,s_id,fname,poly,color,xrange,yrange,zrange,geom,wname,idv); |
|
else arg=mknode(9,s_id,fname,poly,color,xrange,yrange,zrange,geom,wname); |
|
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
} |
} |
|
|
void ifplot_mainOP(NODE arg,int fn,Obj *rp){ |
void plotover_mainNG(NODE arg,char *fn,Obj *rp){ |
/* |
//[s_id (Q), w_id (Q), formula (Obj), color (Q)] |
new ineqnXX in ox_plot requires |
|
[s_id (Q), |
|
w_id (Q), |
|
formula (Obj), |
|
color (Q)] |
|
*/ |
|
Q s_id,w_id,color; |
Q s_id,w_id,color; |
P poly; |
P poly; |
STRING fname; |
STRING fname; |
Line 944 void ifplot_mainOP(NODE arg,int fn,Obj *rp){ |
|
Line 1000 void ifplot_mainOP(NODE arg,int fn,Obj *rp){ |
|
poly=(P)BDY(arg); |
poly=(P)BDY(arg); |
pfine=FALSE; |
pfine=FALSE; |
} else { |
} else { |
sprintf(ebuf,"%s : to many ploy arguments",pfunc[fn]); |
sprintf(ebuf,"%s : to many ploy arguments",fn); |
error(ebuf); |
error(ebuf); |
} |
} |
break; |
break; |
Line 963 void ifplot_mainOP(NODE arg,int fn,Obj *rp){ |
|
Line 1019 void ifplot_mainOP(NODE arg,int fn,Obj *rp){ |
|
iNo++; |
iNo++; |
break; |
break; |
default://error |
default://error |
sprintf(ebuf,"%s : to many numbers",pfunc[fn]); |
sprintf(ebuf,"%s : to many numbers",fn); |
error(ebuf); |
error(ebuf); |
break; |
break; |
} |
} |
break; |
break; |
default: |
default: |
sprintf(ebuf,"%s : arguments type miss match",pfunc[fn]); |
sprintf(ebuf,"%s : arguments type miss match",fn); |
error(ebuf); |
error(ebuf); |
} |
} |
} |
} |
MKSTR(fname,pfunc[fn]); |
MKSTR(fname,fn); |
/* |
|
printf("fname %s\n",BDY(fname)); |
|
printf("s_id %d\n",QTOS((Q)s_id)); |
|
printf("w_id %d\n",QTOS((Q)w_id)); |
|
printf("color %d\n",QTOS((Q)color)); |
|
*/ |
|
arg=mknode(5,s_id,fname,w_id,poly,color); |
arg=mknode(5,s_id,fname,w_id,poly,color); |
Pox_rpc(arg,&t); |
//printf("fn:%s s_id:%d w_id:%d color:%d\n",BDY(fname),QTOS(s_id),QTOS(w_id),QTOS(color)); |
*rp=(Obj)s_id; |
|
} |
|
|
|
void plotover_mainNG(NODE arg,int fn,Obj *rp){ |
|
/* |
|
[s_id (Q), |
|
w_id (Q), |
|
formula (Obj), |
|
color (Q)] |
|
*/ |
|
Q s_id,w_id,color; |
|
P poly; |
|
STRING fname; |
|
Obj t; |
|
int iNo,pfine,sfine; |
|
char ebuf[BUFSIZ]; |
|
|
|
pfine=sfine=TRUE; |
|
iNo=0;poly=0;color=s_id=w_id=0; |
|
for(;arg;arg=NEXT(arg)){ |
|
if(!BDY(arg)) iNo++; |
|
else switch(OID(BDY(arg))){ |
|
case O_P://formular |
|
if(pfine){ |
|
poly=(P)BDY(arg); |
|
pfine=FALSE; |
|
} else { |
|
sprintf(ebuf,"%s : to many ploy arguments",pfunc[fn]); |
|
error(ebuf); |
|
} |
|
break; |
|
case O_N://color,s_id,w_id |
|
switch(iNo){ |
|
case 0://color arg |
|
color=(Q)BDY(arg); |
|
iNo++; |
|
break; |
|
case 1://stream arg |
|
s_id=(Q)BDY(arg); |
|
iNo++; |
|
break; |
|
case 2://window arg |
|
w_id=(Q)BDY(arg); |
|
iNo++; |
|
break; |
|
default://error |
|
sprintf(ebuf,"%s : to many numbers",pfunc[fn]); |
|
error(ebuf); |
|
break; |
|
} |
|
break; |
|
default: |
|
sprintf(ebuf,"%s : arguments type miss match",pfunc[fn]); |
|
error(ebuf); |
|
} |
|
} |
|
MKSTR(fname,pfunc[fn]); |
|
/* |
|
printf("fname %s\n",BDY(fname)); |
|
printf("s_id %d\n",QTOS((Q)s_id)); |
|
printf("w_id %d\n",QTOS((Q)w_id)); |
|
printf("color %d\n",QTOS((Q)color)); |
|
*/ |
|
arg=mknode(5,s_id,fname,w_id,poly,color); |
|
Pox_rpc(arg,&t); |
Pox_rpc(arg,&t); |
*rp=(Obj)s_id; |
*rp=(Obj)s_id; |
} |
} |