version 1.17, 2006/03/03 10:36:18 |
version 1.20, 2008/08/07 06:00:34 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/lib/glib,v 1.16 2004/03/14 12:56:47 takayama Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/lib/glib,v 1.19 2006/03/08 07:59:15 takayama Exp $ */ |
|
|
/* BUG: this library has not yet been adapted to the new automatic launcher |
/* BUG: this library has not yet been adapted to the new automatic launcher |
of ox_plot. 2002, Aug, 4. Do not load glib more than twice. |
of ox_plot. 2002, Aug, 4. Do not load glib more than twice. |
Line 157 def glib_check_strict() { |
|
Line 157 def glib_check_strict() { |
|
} |
} |
} |
} |
|
|
|
/*&usage begin: glib_clear() |
|
Clear the screen. |
|
end: */ |
def glib_clear() { |
def glib_clear() { |
extern Glib_process, Glib_canvas; |
extern Glib_process, Glib_canvas; |
if (Glib_canvas < 0) glib_open(); |
if (Glib_canvas < 0) glib_open(); |
if (!Cfep_loaded) clear_canvas(Glib_process,Glib_canvas); |
if (!Cfep_loaded) clear_canvas(Glib_process,Glib_canvas); |
|
else cfep.glib_clear(); |
} |
} |
|
|
/*&usage begin: glib_window(Xmin,Ymin,Xmax,Ymax) |
/*&usage begin: glib_window(Xmin,Ymin,Xmax,Ymax) |
Line 231 def glib_putpixel(X,Y) { |
|
Line 235 def glib_putpixel(X,Y) { |
|
} |
} |
} |
} |
|
|
/*&usage begin: glib_line(X0,Y0,X1,Y1|color) |
/*&usage begin: glib_line(X0,Y0,X1,Y1|color,shape) |
It draws the line [{X0},{Y0}]-- [{X1},{Y1}] with {color} |
It draws the line [{X0},{Y0}]-- [{X1},{Y1}] with {color} and {shape} |
example: glib_line(0,0,5,3/2 | color=0xff00ff); |
example: glib_line(0,0,5,3/2 | color=0xff00ff); |
|
glib_line(0,0,10,0 | shape=arrow); |
end: */ |
end: */ |
def glib_line(X0,Y0,X1,Y1) { |
def glib_line(X0,Y0,X1,Y1) { |
extern Glib_xmag, Glib_ymag, Glib_xoffset, Glib_yoffset; |
extern Glib_xmag, Glib_ymag, Glib_xoffset, Glib_yoffset; |
Line 244 def glib_line(X0,Y0,X1,Y1) { |
|
Line 249 def glib_line(X0,Y0,X1,Y1) { |
|
glib_floor(Glib_ymag*(Y0+Glib_yoffset)), |
glib_floor(Glib_ymag*(Y0+Glib_yoffset)), |
glib_floor(Glib_xmag*(X1+Glib_xoffset)), |
glib_floor(Glib_xmag*(X1+Glib_xoffset)), |
glib_floor(Glib_ymag*(Y1+Glib_yoffset)),C); |
glib_floor(Glib_ymag*(Y1+Glib_yoffset)),C); |
|
Shape = getopt(shape); |
|
if (type(Shape) != 2) return; |
|
Px = X0+(7/8)*(X1-X0); |
|
Py = Y0+(7/8)*(Y1-Y0); |
|
Qx = (Y0-Y1)/8; |
|
Qy = (X1-X0)/8; |
|
if (type(C)>0) glib_line(X1,Y1,Px+Qx,Py+Qy | color=C); |
|
else glib_line(X1,Y1,Px+Qx,Py+Qy); |
|
if (type(C)>0) glib_line(X1,Y1,Px-Qx,Py-Qy | color=C); |
|
else glib_line(X1,Y1,Px-Qx,Py-Qy); |
} |
} |
|
|
def glib_clip_line(X0,Y0,X1,Y1,Color) { |
def glib_clip_line(X0,Y0,X1,Y1,Color) { |
Line 504 def glib_plot(F) { |
|
Line 519 def glib_plot(F) { |
|
taka_glib_plot(F,Opt); |
taka_glib_plot(F,Opt); |
} |
} |
|
|
|
/*&usage begin: glib_flush(); |
|
Flush the output. |
|
(Cfep only. It also set initGL to 1.). |
|
end: */ |
def glib_flush() { |
def glib_flush() { |
extern Glib_canvas; |
extern Glib_canvas; |
|
if (Glib_canvas < 0) glib_open(); |
if (Cfep_loaded) cfep.draw_flush(Glib_canvas); |
if (Cfep_loaded) cfep.draw_flush(Glib_canvas); |
} |
} |
|
/*&usage begin: glib_set_pixel_size(P) |
|
Set the size of putpixel to P. 1.0 is the default. |
|
(cfep only). |
|
end: */ |
|
def glib_set_pixel_size(X) { |
|
extern Glib_canvas; |
|
if (Glib_canvas < 0) glib_open(); |
|
if (!Cfep_loaded) /*Not implemented.*/ ; |
|
else cfep.glib_set_pixel_size(X); |
|
} |
|
|
|
/*&usage begin: glib_remove_last() |
|
Remove the last object. glib_flush() should also be called to remove |
|
the last object. |
|
(cfep only). |
|
end: */ |
|
def glib_remove_last() { |
|
extern Glib_canvas; |
|
if (Glib_canvas < 0) glib_open(); |
|
if (!Cfep_loaded) /*Not implemented.*/ ; |
|
else cfep.glib_remove_last(); |
|
} |
|
|
end$ |
end$ |
|
|