version 1.25, 2013/12/20 02:27:17 |
version 1.28, 2014/05/13 16:28:08 |
|
|
* 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/if.c,v 1.24 2013/12/19 05:48:24 saito Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/plot/if.c,v 1.27 2014/05/12 16:54:41 saito Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 102 int open_canvas(NODE arg){ |
|
Line 102 int open_canvas(NODE arg){ |
|
|
|
wsize=(LIST)ARG0(arg); |
wsize=(LIST)ARG0(arg); |
wname=(STRING)ARG1(arg); |
wname=(STRING)ARG1(arg); |
can=canvas[id=search_canvas()]; |
id=search_canvas(); |
can->mode=MODE_INTERACTIVE; |
can=canvas[id]; |
|
can->mode=modeNO(INTERACTIVE); |
if(!wsize){ |
if(!wsize){ |
can->width=DEFAULTWIDTH; |
can->width=DEFAULTWIDTH; |
can->height=DEFAULTHEIGHT; |
can->height=DEFAULTHEIGHT; |
Line 117 int open_canvas(NODE arg){ |
|
Line 118 int open_canvas(NODE arg){ |
|
return id; |
return id; |
} |
} |
|
|
|
int plot(NODE arg,char *fn){ |
int plot(NODE arg,int fn){ |
|
int id; |
int id; |
NODE n; |
NODE n; |
struct canvas *can; |
struct canvas *can; |
Line 144 int plot(NODE arg,int fn){ |
|
Line 144 int plot(NODE arg,int fn){ |
|
can->qymin=(Q)BDY(n);n=NEXT(n);can->qymax=(Q)BDY(n); |
can->qymin=(Q)BDY(n);n=NEXT(n);can->qymax=(Q)BDY(n); |
can->ymin=ToReal(can->qymin);can->ymax=ToReal(can->qymax); |
can->ymin=ToReal(can->qymin);can->ymax=ToReal(can->qymax); |
} |
} |
can->mode=fn; |
can->mode=modeNO(fn); |
if(zrange){ |
if(zrange){ |
n=BDY(zrange); can->zmin=ToReal(BDY(n)); |
n=BDY(zrange); can->zmin=ToReal(BDY(n)); |
n=NEXT(n);can->zmax=ToReal(BDY(n)); |
n=NEXT(n);can->zmax=ToReal(BDY(n)); |
n=NEXT(n); |
n=NEXT(n); |
if(can->mode==MODE_CONPLOT)can->nzstep=QTOS((Q)BDY(n)); |
if(can->mode==modeNO(CONPLOT))can->nzstep=QTOS((Q)BDY(n)); |
else { |
else { |
can->vx=VR((P)BDY(BDY(zrange))); |
can->vx=VR((P)BDY(BDY(zrange))); |
can->nzstep=QTOS((Q)BDY(n)); |
can->nzstep=QTOS((Q)BDY(n)); |
Line 165 int plot(NODE arg,int fn){ |
|
Line 165 int plot(NODE arg,int fn){ |
|
if(wname) can->wname = BDY(wname); |
if(wname) can->wname = BDY(wname); |
else can->wname=""; |
else can->wname=""; |
can->formula=formula; |
can->formula=formula; |
if(can->mode==MODE_PLOT){ |
if(can->mode==modeNO(PLOT)){ |
//plot |
//plot |
plotcalc(can); |
plotcalc(can); |
create_canvas(can); |
create_canvas(can); |
plot_print(display,can); |
plot_print(display,can); |
} else if(can->mode==MODE_POLARPLOT){ |
|
//polarplot |
|
polarplotcalc(can); |
|
create_canvas(can); |
|
plot_print(display,can); |
|
} else { |
} else { |
//ifplot,conplot |
//ifplot,conplot |
create_canvas(can); |
create_canvas(can); |
Line 229 int memory_plot(NODE arg,LIST *bytes){ |
|
Line 224 int memory_plot(NODE arg,LIST *bytes){ |
|
if( zrange ){ |
if( zrange ){ |
n=NEXT(BDY(zrange)); |
n=NEXT(BDY(zrange)); |
can->zmin=ToReal(BDY(n)); n=NEXT(n); can->zmax=ToReal(BDY(n)); |
can->zmin=ToReal(BDY(n)); n=NEXT(n); can->zmax=ToReal(BDY(n)); |
if(n=NEXT(n)) can->nzstep=QTOS((Q)BDY(n)); |
n=NEXT(n); |
|
if(n) can->nzstep=QTOS((Q)BDY(n)); |
else can->nzstep=MAXGC; |
else can->nzstep=MAXGC; |
can->mode=MODE_CONPLOT; |
can->mode=modeNO(CONPLOT); |
} else |
} else |
can->mode=MODE_IFPLOT; |
can->mode=modeNO(IFPLOT); |
} else |
} else |
can->mode=MODE_PLOT; |
can->mode=modeNO(PLOT); |
if( !wsize ){ |
if( !wsize ){ |
can->width=DEFAULTWIDTH; can->height=DEFAULTHEIGHT; |
can->width=DEFAULTWIDTH; can->height=DEFAULTHEIGHT; |
} else { |
} else { |
Line 244 int memory_plot(NODE arg,LIST *bytes){ |
|
Line 240 int memory_plot(NODE arg,LIST *bytes){ |
|
} |
} |
can->wname=""; |
can->wname=""; |
can->formula=formula; |
can->formula=formula; |
if( can->mode == MODE_PLOT ){ |
if( can->mode==modeNO(PLOT)){ |
plotcalc(can); |
plotcalc(can); |
memory_print(can,&barray); |
memory_print(can,&barray); |
STOQ(can->width,qw); STOQ(can->height,qh); |
STOQ(can->width,qw); STOQ(can->height,qh); |
Line 261 int memory_plot(NODE arg,LIST *bytes){ |
|
Line 257 int memory_plot(NODE arg,LIST *bytes){ |
|
n=mknode(3,qw,qh,barray); |
n=mknode(3,qw,qh,barray); |
MKLIST(*bytes,n); |
MKLIST(*bytes,n); |
} |
} |
|
return 0; |
} |
} |
|
|
int plotover(NODE arg){ |
int plotover(NODE arg){ |
Line 271 int plotover(NODE arg){ |
|
Line 268 int plotover(NODE arg){ |
|
|
|
id=QTOS((Q)ARG0(arg)); |
id=QTOS((Q)ARG0(arg)); |
formula=(P)ARG1(arg); |
formula=(P)ARG1(arg); |
color=QTOS((Q)ARG2(arg)); |
|
|
|
can=canvas[id]; |
can=canvas[id]; |
orgcolor=can->color; |
orgcolor=can->color; |
can->color=color; |
if(argc(arg)==3) can->color=QTOS((Q)ARG2(arg)); |
|
else can->color=0; |
get_vars_recursive((Obj)formula,&vl); |
get_vars_recursive((Obj)formula,&vl); |
for(vl0=vl;vl0;vl0=NEXT(vl0)) |
for(vl0=vl;vl0;vl0=NEXT(vl0)) |
if(vl0->v->attr==(pointer)V_IND) |
if(vl0->v->attr==(pointer)V_IND) |
Line 287 int plotover(NODE arg){ |
|
Line 283 int plotover(NODE arg){ |
|
#endif |
#endif |
current_can=can; |
current_can=can; |
can->formula=formula; |
can->formula=formula; |
if(can->mode==MODE_PLOT){ |
if(can->mode==modeNO(PLOT)){ |
plotcalc(can); |
plotcalc(can); |
plot_print(display,can); |
plot_print(display,can); |
} else ifplotmainOld(can); |
} else ifplotmainOld(can); |
Line 296 int plotover(NODE arg){ |
|
Line 292 int plotover(NODE arg){ |
|
#if !defined(VISUAL) |
#if !defined(VISUAL) |
set_drawcolor(can->color); |
set_drawcolor(can->color); |
#endif |
#endif |
return index; |
return id; |
} |
} |
|
|
int drawcircle(NODE arg){ |
int drawcircle(NODE arg){ |
Line 423 int clear_canvas(NODE arg){ |
|
Line 419 int clear_canvas(NODE arg){ |
|
copy_to_canvas(can); |
copy_to_canvas(can); |
// clear the history |
// clear the history |
can->history=0; |
can->history=0; |
|
return 0; |
} |
} |
|
|
#define RealtoDbl(r) ((r)?BDY(r):0.0) |
#define RealtoDbl(r) ((r)?BDY(r):0.0) |
Line 451 int arrayplot(NODE arg){ |
|
Line 448 int arrayplot(NODE arg){ |
|
can->width=QTOS((Q)BDY(BDY(wsize))); |
can->width=QTOS((Q)BDY(BDY(wsize))); |
can->height=QTOS((Q)BDY(NEXT(BDY(wsize)))); |
can->height=QTOS((Q)BDY(NEXT(BDY(wsize)))); |
} |
} |
can->wname=wname; can->formula=0; can->mode=MODE_PLOT; |
can->wname=wname; can->formula=0; can->mode=modeNO(PLOT); |
create_canvas(can); |
create_canvas(can); |
w=array->len; |
w=array->len; |
h=can->height; |
h=can->height; |
Line 651 void qifplotmain(struct canvas *can) |
|
Line 648 void qifplotmain(struct canvas *can) |
|
} |
} |
|
|
//*******************ifplotNG |
//*******************ifplotNG |
int ifplotNG(NODE arg,char *func){ |
int ifplotNG(NODE arg,int func){ |
int id,orgcolor,color,op_code; |
int id,orgcolor,color,op_code; |
NODE n; |
NODE n; |
struct canvas *can; |
struct canvas *can; |
Line 698 int ifplotNG(NODE arg,char *func){ |
|
Line 695 int ifplotNG(NODE arg,char *func){ |
|
else can->wname=""; |
else can->wname=""; |
can->formula=formula; |
can->formula=formula; |
set_drawcolor(color); |
set_drawcolor(color); |
if(!strcmp(func,"ifplot"))can->mode=MODE_IFPLOT; |
can->mode=func; |
else if(!strcmp(func,"ifplotD"))can->mode=MODE_IFPLOTD; |
|
else if(!strcmp(func,"ifplotQ"))can->mode=MODE_IFPLOTQ; |
|
else if(!strcmp(func,"ifplotB"))can->mode=MODE_IFPLOTB; |
|
else if(!strcmp(func,"ineqnD"))can->mode=MODE_INEQND; |
|
else if(!strcmp(func,"ineqnQ"))can->mode=MODE_INEQNQ; |
|
else if(!strcmp(func,"ineqnB"))can->mode=MODE_INEQNB; |
|
else if(!strcmp(func,"conplotD"))can->mode=MODE_CONPLOTD; |
|
else if(!strcmp(func,"conplotQ"))can->mode=MODE_CONPLOTQ; |
|
else if(!strcmp(func,"conplotB"))can->mode=MODE_CONPLOTB; |
|
else if(!strcmp(func,"itvifplot")){ |
|
can->mode=MODE_ITVIFPLOT; |
|
can->division=QTOS((Q)ARG7(arg)); |
|
} |
|
else can->mode=MODE_IFPLOTD; |
|
create_canvas(can); |
create_canvas(can); |
ifplotmain(can); |
ifplotmain(can); |
set_drawcolor(orgcolor); |
set_drawcolor(orgcolor); |
Line 721 int ifplotNG(NODE arg,char *func){ |
|
Line 704 int ifplotNG(NODE arg,char *func){ |
|
return id; |
return id; |
} |
} |
|
|
int ifplotOP(NODE arg,char *func){ |
int ifplotOP(NODE arg,int func){ |
//ineqnor[D,Q,B],ineqnand[D,Q,B],ineqnxor[D,Q,b] |
//ineqnor[D,Q,B],ineqnand[D,Q,B],ineqnxor[D,Q,b],plotover[D,Q,B] |
int index,orgcolor,color,op_code; |
int index,orgcolor,color,op_code; |
NODE n; |
|
struct canvas *can; |
|
P formula; |
P formula; |
//s_id,fname,w_id,poly,color |
struct canvas *can; |
|
VL vl,vl0; |
|
NODE n; |
|
|
index=QTOS((Q)ARG0(arg)); |
index=QTOS((Q)ARG0(arg)); |
formula=(P)ARG1(arg); |
formula=(P)ARG1(arg); |
color=QTOS((Q)ARG2(arg)); |
color=QTOS((Q)ARG2(arg)); |
|
// set canvas data |
can=canvas[index]; |
can=canvas[index]; |
orgcolor=can->color; |
orgcolor=can->color; |
can->color=color; |
can->color=color; |
// set canvas data |
|
can->formula=formula; |
can->formula=formula; |
if(!strcmp(func,"ineqnandD"))can->mode=MODE_INEQNANDD; |
current_can=can; |
else if(!strcmp(func,"ineqnandQ"))can->mode=MODE_INEQNANDQ; |
get_vars_recursive((Obj)formula,&vl); |
else if(!strcmp(func,"ineqnandB"))can->mode=MODE_INEQNANDB; |
for(vl0=vl;vl0;vl0=NEXT(vl0)) |
else if(!strcmp(func,"ineqnorD"))can->mode=MODE_INEQNORD; |
if(vl0->v->attr==(pointer)V_IND) |
else if(!strcmp(func,"ineqnorQ"))can->mode=MODE_INEQNORQ; |
if(vl->v!=can->vx && vl->v!=can->vy)return -1; |
else if(!strcmp(func,"ineqnorB"))can->mode=MODE_INEQNORB; |
#if !defined(VISUAL) |
else if(!strcmp(func,"ineqnxorD"))can->mode=MODE_INEQNXORD; |
set_drawcolor(can->color); |
else if(!strcmp(func,"ineqnxorQ"))can->mode=MODE_INEQNXORQ; |
#endif |
else if(!strcmp(func,"ineqnxorB"))can->mode=MODE_INEQNXORB; |
can->mode=func; |
else if(!strcmp(func,"plotoverD"))can->mode=MODE_PLOTOVERD; |
|
else if(!strcmp(func,"plotoverQ"))can->mode=MODE_PLOTOVERQ; |
|
else if(!strcmp(func,"plotoverB"))can->mode=MODE_PLOTOVERB; |
|
else can->mode=MODE_IFPLOTD; |
|
set_drawcolor(color); |
set_drawcolor(color); |
ifplotmain(can); |
ifplotmain(can); |
set_drawcolor(orgcolor); |
set_drawcolor(orgcolor); |
copy_to_canvas(can); |
copy_to_canvas(can); |
can->color=orgcolor; |
can->color=orgcolor; |
|
#if !defined(VISUAL) |
|
set_drawcolor(can->color); |
|
#endif |
return index; |
return index; |
} |
} |
|
|
Line 768 void ifplotmain(struct canvas *can){ |
|
Line 751 void ifplotmain(struct canvas *can){ |
|
set_busy(can); set_selection(); |
set_busy(can); set_selection(); |
set_drawcolor(can->color); |
set_drawcolor(can->color); |
switch(can->mode){ |
switch(can->mode){ |
case MODE_IFPLOTD: |
case 6://IFPLOTD |
calc(tabe,can,0); |
calc(tabe,can,0); |
if_print(display,tabe,can,1); |
if_print(display,tabe,can,1); |
break; |
break; |
case MODE_IFPLOTQ: |
case 7://IFPLOTQ |
calcq(tabe,can,0); |
calcq(tabe,can,0); |
if_print(display,tabe,can,1); |
if_print(display,tabe,can,1); |
break; |
break; |
case MODE_IFPLOTB: |
case 8://IFPLOTB |
calcb(tabe,can,0); |
calcb(tabe,can,0); |
if_print(display,tabe,can,0); |
if_print(display,tabe,can,0); |
break; |
break; |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
case MODE_INEQND: |
case 9://INEQND |
calc(tabe,can,0); |
calc(tabe,can,0); |
area_print(display,tabe,can,0); |
area_print(display,tabe,can,0); |
break; |
break; |
case MODE_INEQNQ: |
case 10://INEQNQ |
calcq(tabe,can,0); |
calcq(tabe,can,0); |
area_print(display,tabe,can,0); |
area_print(display,tabe,can,0); |
break; |
break; |
case MODE_INEQNB: |
case 11://INEQNB |
calcb(tabe,can,0); |
calcb(tabe,can,0); |
area_print(display,tabe,can,0); |
area_print(display,tabe,can,0); |
break; |
break; |
case MODE_INEQNANDD: |
case 12://INEQNFAND |
calc(tabe,can,0); |
calc(tabe,can,0); |
area_print(display,tabe,can,0); |
area_print(display,tabe,can,2); |
break; |
break; |
case MODE_INEQNANDQ: |
case 13://INEQNQAND |
calcq(tabe,can,0); |
calcq(tabe,can,0); |
area_print(display,tabe,can,2); |
area_print(display,tabe,can,2); |
break; |
break; |
case MODE_INEQNANDB: |
case 14://INEQNBAND |
calcb(tabe,can,0); |
calcb(tabe,can,0); |
area_print(display,tabe,can,2); |
area_print(display,tabe,can,2); |
break; |
break; |
case MODE_INEQNORD: |
case 15://INEQNDOR |
calc(tabe,can,0); |
calc(tabe,can,0); |
area_print(display,tabe,can,3); |
area_print(display,tabe,can,3); |
break; |
break; |
case MODE_INEQNORQ: |
case 16://INEQNQOR |
calcq(tabe,can,0); |
calcq(tabe,can,0); |
area_print(display,tabe,can,3); |
area_print(display,tabe,can,3); |
break; |
break; |
case MODE_INEQNORB: |
case 17://INEQNBOR |
calcb(tabe,can,0); |
calcb(tabe,can,0); |
area_print(display,tabe,can,3); |
area_print(display,tabe,can,3); |
break; |
break; |
case MODE_INEQNXORD: |
case 18://INEQNDXOR |
calc(tabe,can,0); |
calc(tabe,can,0); |
area_print(display,tabe,can,4); |
area_print(display,tabe,can,4); |
break; |
break; |
case MODE_INEQNXORQ: |
case 19://INEQNQXOR |
calcq(tabe,can,0); |
calcq(tabe,can,0); |
area_print(display,tabe,can,4); |
area_print(display,tabe,can,4); |
break; |
break; |
case MODE_INEQNXORB: |
case 20://INEQNBXOR |
calcb(tabe,can,0); |
calcb(tabe,can,0); |
area_print(display,tabe,can,4); |
area_print(display,tabe,can,4); |
break; |
break; |
case MODE_CONPLOTD: |
case 21://CONPLOTD |
calc(tabe,can,0); |
calc(tabe,can,0); |
con_print(display,tabe,can); |
con_print(display,tabe,can); |
break; |
break; |
case MODE_CONPLOTB: |
case 22://CONPLOTQ |
calcb(tabe,can,0); |
calcq(tabe,can,0); |
con_print(display,tabe,can); |
con_print(display,tabe,can); |
break; |
break; |
case MODE_CONPLOTQ: |
case 23://CONPLOTB |
calcq(tabe,can,0); |
calcb(tabe,can,0); |
con_print(display,tabe,can); |
con_print(display,tabe,can); |
break; |
break; |
case MODE_PLOTOVERD: |
case 24://ITVIFPLOT: |
|
itvcalc(tabe,can,1); |
|
if_print(display,tabe,can,1); |
|
break; |
|
case 25://PLOTOVERD |
calc(tabe,can,0); |
calc(tabe,can,0); |
over_print(display,tabe,can,0); |
over_print(display,tabe,can,0); |
break; |
break; |
case MODE_PLOTOVERQ: |
case 26://PLOTOVERQ: |
calcq(tabe,can,0); |
calcq(tabe,can,0); |
over_print(display,tabe,can,0); |
over_print(display,tabe,can,0); |
break; |
break; |
case MODE_PLOTOVERB: |
case 27://PLOTOVERB: |
calcb(tabe,can,0); |
calcb(tabe,can,0); |
over_print(display,tabe,can,0); |
over_print(display,tabe,can,0); |
break; |
break; |
case MODE_ITVIFPLOT: |
|
itvcalc(tabe,can,1); |
|
if_print(display,tabe,can,1); |
|
break; |
|
#endif |
#endif |
} |
} |
set_drawcolor(can->color); |
set_drawcolor(can->color); |
Line 962 void obj_op(struct canvas *cansrc, struct canvas *cant |
|
Line 945 void obj_op(struct canvas *cansrc, struct canvas *cant |
|
count_and_flush(); |
count_and_flush(); |
flush(); |
flush(); |
} |
} |
|
|
//ifplotNG |
|
/* |
|
int ineqnover(NODE arg) |
|
{ |
|
int id; |
|
struct canvas *can; |
|
int orgcolor, op_code; |
|
|
|
id = QTOS((Q)ARG0(arg)); |
|
can = canvas[id]; |
|
orgcolor = can->color; |
|
can->formula = (P)ARG1(arg); |
|
can->color = QTOS((Q)ARG2(arg)); |
|
op_code = QTOS((Q)ARG3(arg)); |
|
can->mode = MODE_INEQNP; |
|
ineqnmain(can, orgcolor, op_code); |
|
return id; |
|
} |
|
void ineqnmain(struct canvas *can, int orgcolor, int op_code) |
|
{ |
|
int **mask; |
|
double **tbl; |
|
int i,j; |
|
|
|
current_can = can; |
|
tbl = (double **)ALLOCA((can->height+1)*sizeof(double *)); |
|
for ( i = 0; i <= can->height; i++ ) |
|
tbl[i] = (double *)ALLOCA((can->width+1)*sizeof(double)); |
|
mask = (int **)ALLOCA(can->height*sizeof(int *)); |
|
for ( i = 0; i < can->height; i++) |
|
mask[i] = (int *)ALLOCA(can->width*sizeof(int)); |
|
|
|
define_cursor(can->window,runningcur); |
|
set_busy(can); set_selection(); |
|
// ineqncalc(tbl, can, 1); |
|
calc(tab,can,1); |
|
for (j = 0; j < can->height; j++){ |
|
for (i = 0; i < can->width; i++){ |
|
if ( tbl[j][i] >= 0 ){ |
|
if ( (tbl[j+1][i] <= 0 ) || |
|
(tbl[j][i+1] <= 0) || |
|
(tbl[j+1][i+1] <= 0) ) mask[j][i] = 0; |
|
else mask[j][i] = 1; |
|
} else { |
|
if( (tbl[j+1][i] >= 0) || |
|
(tbl[j][i+1] >= 0) || |
|
(tbl[j+1][i+1] >= 0) ) mask[j][i] = 0; |
|
else mask[j][i] = -1; |
|
} |
|
} |
|
} |
|
area_print(display, mask, can, op_code); |
|
reset_selection(); |
|
reset_busy(can); |
|
define_cursor(can->window,normalcur); |
|
#if !defined(VISUAL) |
|
set_drawcolor(orgcolor); |
|
can->color = orgcolor; |
|
#endif |
#endif |
copy_to_canvas(can); |
|
} |
|
*/ |
|
int polarplotNG(NODE arg){ |
int polarplotNG(NODE arg){ |
int id,color,orgcolor; |
int i,id,color,orgcolor,width,height; |
NODE n; |
NODE n; |
struct canvas *can; |
struct canvas *can; |
P formula; |
P formula; |
LIST xrange,wsize; |
LIST range,geom; |
STRING wname; |
STRING wname; |
V v; |
V v; |
|
|
formula=(P)ARG0(arg); |
formula=(P)ARG0(arg); |
xrange=(LIST)ARG1(arg); |
color=QTOS((Q)ARG1(arg)); |
color=QTOS((Q)ARG2(arg)); |
range=(LIST)ARG2(arg); |
wsize=(LIST)ARG3(arg); |
geom=(LIST)ARG3(arg); |
wname=(STRING)ARG4(arg); |
wname=(STRING)ARG4(arg); |
|
|
can=canvas[id=search_canvas()]; |
id=search_canvas(); |
if(xrange){ |
can=canvas[id]; |
n=BDY(xrange); can->vx=VR((P)BDY(n)); n=NEXT(n); |
can->mode=modeNO(POLARPLOT); |
can->qxmin=(Q)BDY(n); n=NEXT(n); can->qxmax=(Q)BDY(n); |
if(range){ |
can->xmin=ToReal(can->qxmin); can->xmax=ToReal(can->qxmax); |
n=NEXT(BDY(range)); |
|
can->zmin=ToReal(BDY(n)); |
|
n=NEXT(n);can->zmax=ToReal(BDY(n)); |
|
n=NEXT(n); |
|
can->vx=VR((P)BDY(BDY(range))); |
|
can->nzstep=n?QTOS((Q)BDY(n)):DEFAULTPOLARSTEP; |
} |
} |
can->mode=MODE_POLARPLOT; |
if(geom){ |
if(!wsize){ |
can->width=width=QTOS((Q)BDY(BDY(geom))); |
can->width=DEFAULTWIDTH; |
can->height=height=QTOS((Q)BDY(NEXT(BDY(geom)))); |
can->height=DEFAULTHEIGHT; |
|
} else { |
|
can->width=QTOS((Q)BDY(BDY(wsize))); |
|
can->height=QTOS((Q)BDY(NEXT(BDY(wsize)))); |
|
} |
} |
if(wname)can->wname=BDY(wname); |
if(wname)can->wname=BDY(wname); |
else can->wname=""; |
else can->wname=""; |
can->formula=formula; |
can->formula=formula; |
orgcolor=can->color; |
orgcolor=can->color; |
can->color=color; |
can->color=color; |
polarplotcalc(can); |
polarcalc(can); |
create_canvas(can); |
create_canvas(can); |
plot_print(display,can); |
set_drawcolor(color); |
|
polar_print(display,can); |
can->color=orgcolor; |
can->color=orgcolor; |
copy_to_canvas(can); |
set_drawcolor(orgcolor); |
|
reset_selection(); reset_busy(can); |
|
define_cursor(can->window,normalcur); |
return id; |
return id; |
} |
} |
|
|
int plotoverD(NODE arg){ |
|
int index, color; |
|
P formula; |
|
struct canvas *can; |
|
VL vl,vl0; |
|
|
|
index=QTOS((Q)ARG0(arg)); |
|
formula=(P)ARG1(arg); |
|
can=canvas[index]; |
|
color=can->color; |
|
if(!can->window)return -1; |
|
get_vars_recursive((Obj)formula,&vl); |
|
for(vl0=vl;vl0;vl0=NEXT(vl0)) |
|
if(vl0->v->attr==(pointer)V_IND) |
|
if(vl->v!=can->vx && vl->v!=can->vy) return -1; |
|
if(argc(arg)== 3)can->color=QTOS((Q)ARG2(arg)); |
|
else can->color=0; |
|
#if !defined(VISUAL) |
|
set_drawcolor(can->color); |
|
#endif |
|
current_can=can; |
|
can->formula=formula; |
|
if(can->mode==MODE_PLOT){ |
|
calcq(can); |
|
plot_print(display,can); |
|
} else ifplotmain(can); |
|
copy_to_canvas(can); |
|
can->color=color; |
|
#if !defined(VISUAL) |
|
set_drawcolor(can->color); |
|
#endif |
|
return index; |
|
} |
|
#endif |
|