| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent abbb234 commit a18230d
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,11 @@ | |||
| 1 | + 2013-10-18 Christoph Bersch <usenet@bersch.net> | ||
| 2 | + | ||
| 3 | + * src/gadgets.h src/graphics.c src/graphics.h src/save.c src/set.c | ||
| 4 | + demo/all.dem demo/clipobject.dem docs/gnuplot.doc: | ||
| 5 | + New object attribute clip/noclip. "clip" retains the current default, | ||
| 6 | + clip to plot boundary unless one or more vertices are given in screen | ||
| 7 | + coordinates. "noclip" clips to the canvas. | ||
| 8 | + | ||
| 1 | 9 | 2013-10-18 Shigeharu Takeno <shige@iee.niit.ac.jp> | |
| 2 | 10 | ||
| 3 | 11 | * docs/gnuplot-ja.doc term-ja.diff: Sync translation to version 1.830 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | # | |
| 2 | - # $Id: all.dem,v 1.53 2012/11/24 21:54:29 sfeam Exp $ | ||
| 2 | + # $Id: all.dem,v 1.54 2013/05/24 23:02:15 sfeam Exp $ | ||
| 3 | 3 | # | |
| 4 | 4 | # Executes all demos (OK, MOST demos) in this directory. | |
| 5 | 5 | # This serves as a series of unit tests for non-interactive capabilities. | |
@@ -294,6 +294,10 @@ print "********************** file rectangle.dem *********************" | |||
| 294 | 294 | load "rectangle.dem" | |
| 295 | 295 | reset | |
| 296 | 296 | ||
| 297 | + print "********************** file clipobject.dem *********************" | ||
| 298 | + load "clipobject.dem" | ||
| 299 | + reset | ||
| 300 | + | ||
| 297 | 301 | print "********************** file approximate.dem *********************" | |
| 298 | 302 | load "approximate.dem" | |
| 299 | 303 | reset | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,78 @@ | |||
| 1 | + # | ||
| 2 | + # Demo and test for clipping applied to objects. | ||
| 3 | + # axis coordinates run from [-1:1] | ||
| 4 | + # graph coordinates from from [0:1] | ||
| 5 | + # screen coordinates from from [0.2:0.8] | ||
| 6 | + # | ||
| 7 | + reset | ||
| 8 | + | ||
| 9 | + set title "Default object clipping" | ||
| 10 | + set label 1 at graph 0.5, 0.9 center | ||
| 11 | + set label 1 "Outer = screen coords\nMiddle = graph coords\nInner = axis coords" | ||
| 12 | + | ||
| 13 | + set xrange[-1:1] | ||
| 14 | + set yrange[-1:1] | ||
| 15 | + set macros | ||
| 16 | + fs="fillstyle solid 1.0 border lc rgb 'black' lw 2" | ||
| 17 | + | ||
| 18 | + set lmargin at screen 0.2 | ||
| 19 | + set rmargin at screen 0.8 | ||
| 20 | + set tmargin at screen 0.8 | ||
| 21 | + set bmargin at screen 0.2 | ||
| 22 | + | ||
| 23 | + set object 1 rectangle from screen 0.1,screen 0.1 to screen 0.4, screen 0.4 | ||
| 24 | + set object 1 fc rgb '#880000' @fs | ||
| 25 | + | ||
| 26 | + set object 11 rectangle from first -1.1,first -1.1 to first -0.9, first -0.9 | ||
| 27 | + set object 11 fc rgb 'red' @fs | ||
| 28 | + set object 11 front | ||
| 29 | + | ||
| 30 | + set object 111 rectangle from graph -.1, -.1 to graph .1,.1 | ||
| 31 | + set object 111 fc rgb "#DDAA00' @fs | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + set object 2 circle at screen 0.2, screen 0.8 radius screen 0.1 | ||
| 35 | + set object 2 fc rgb '#008800' @fs | ||
| 36 | + | ||
| 37 | + set object 22 circle at first -1, 1 radius first .15 | ||
| 38 | + set object 22 fc rgb 'green' @fs | ||
| 39 | + set object 22 front | ||
| 40 | + | ||
| 41 | + set object 222 circle at graph 0, graph 1 radius graph 0.1 | ||
| 42 | + set object 222 fc rgb '#00DDAA' @fs | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + set object 3 polygon from screen 0.6,screen 0.6 rto 0.4,0 rto -0.2,0.4 | ||
| 46 | + set object 3 fc rgb '#BBBB00' @fs | ||
| 47 | + | ||
| 48 | + set object 33 polygon from first 0.8,first 0.8 rto first 0.4,0 rto first -0.2, 0.4 | ||
| 49 | + set object 33 fc rgb 'yellow' @fs | ||
| 50 | + set object 33 front | ||
| 51 | + | ||
| 52 | + set object 333 polygon from graph .8,graph .8 rto graph 0.4,0 rto graph -0.2, 0.4 | ||
| 53 | + set object 333 fc rgb '#AAAA88' @fs | ||
| 54 | + | ||
| 55 | + set object 4 ellipse at screen 0.8, screen 0.2 size screen 0.3, 0.25 | ||
| 56 | + set object 4 fc rgb '#4444bb' @fs | ||
| 57 | + | ||
| 58 | + set object 44 ellipse at first 1, -1 size first 0.4, first 0.25 | ||
| 59 | + set object 44 fc rgb "cyan" @fs | ||
| 60 | + set object 44 front | ||
| 61 | + | ||
| 62 | + set object 444 ellipse at graph 1,graph 0 size first 0.8, first 0.5 | ||
| 63 | + set object 444 fc rgb '#6666ff' @fs | ||
| 64 | + | ||
| 65 | + | ||
| 66 | + plot 0 | ||
| 67 | + | ||
| 68 | + pause -1 "Hit return to continue" | ||
| 69 | + | ||
| 70 | + set title "Object property 'noclip'" | ||
| 71 | + | ||
| 72 | + do for [i=1:4]{ set object i noclip; set object i*11 noclip; set object i*111 noclip; } | ||
| 73 | + | ||
| 74 | + plot 0 | ||
| 75 | + | ||
| 76 | + pause -1 "Hit return to continue" | ||
| 77 | + | ||
| 78 | + reset | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - C RCS $Id: gnuplot.doc,v 1.828 2013/10/07 21:03:48 sfeam Exp $ | ||
| 1 | + C RCS $Id: gnuplot.doc,v 1.830 2013/10/10 22:23:03 sfeam Exp $ | ||
| 2 | 2 | C | |
| 3 | 3 | C Copyright (C) 1986 - 1993, 1998, 1999, 2000, 2001, 2004 Thomas Williams, Colin Kelley et al. | |
| 4 | 4 | C | |
@@ -9799,7 +9799,8 @@ Ffigure_missing | |||
| 9799 | 9799 | Syntax: | |
| 9800 | 9800 | set object <index> | |
| 9801 | 9801 | <object-type> <object-properties> | |
| 9802 | - {front|back|behind} {fc|fillcolor <colorspec>} {fs <fillstyle>} | ||
| 9802 | + {front|back|behind} {clip|noclip} | ||
| 9803 | + {fc|fillcolor <colorspec>} {fs <fillstyle>} | ||
| 9803 | 9804 | {default} {lw|linewidth <width>} | |
| 9804 | 9805 | unset object <index> | |
| 9805 | 9806 | ||
@@ -9813,6 +9814,10 @@ Ffigure_missing | |||
| 9813 | 9814 | set object rectangle from screen 0,0 to screen 1,1 behind | |
| 9814 | 9815 | can be used to provide a colored background for the entire graph or page. | |
| 9815 | 9816 | ||
| 9817 | + By default, objects are clipped to the graph boundary unless one or more | ||
| 9818 | + vertices are given in screen coordinates. Setting `noclip` will disable | ||
| 9819 | + clipping to the graph boundary, but will still clip against the screen size. | ||
| 9820 | + | ||
| 9816 | 9821 | The fill color of the object is taken from the <colorspec>. `fillcolor` | |
| 9817 | 9822 | may be abbreviated `fc`. The fill style is taken from <fillstyle>. | |
| 9818 | 9823 | See `colorspec` and `fillstyle`. If the keyword `default` is given, | |
@@ -10986,8 +10991,8 @@ Ffigure_missing | |||
| 10986 | 10991 | Syntax: | |
| 10987 | 10992 | set style arrow <n> <arrowstyle> | |
| 10988 | 10993 | set style boxplot <boxplot style options> | |
| 10989 | - set style circle radius <size> | ||
| 10990 | - set style ellipse size <size> units {xy|xx|yy} | ||
| 10994 | + set style circle radius <size> {clip|noclip} | ||
| 10995 | + set style ellipse size <size> units {xy|xx|yy} {clip|noclip} | ||
| 10991 | 10996 | set style fill <fillstyle> | |
| 10992 | 10997 | set style histogram <histogram style options> | |
| 10993 | 10998 | set style line <n> <linestyle> | |
@@ -11435,13 +11440,17 @@ Ffigure_missing | |||
| 11435 | 11440 | ?show style circle | |
| 11436 | 11441 | ||
| 11437 | 11442 | Syntax: | |
| 11438 | - set style circle {radius {graph|screen} <R>} {{no}wedge} | ||
| 11443 | + set style circle {radius {graph|screen} <R>} | ||
| 11444 | + {{no}wedge} | ||
| 11445 | + {clip|noclip} | ||
| 11439 | 11446 | ||
| 11440 | 11447 | This command sets the default radius used in plot style "with circles". It | |
| 11441 | 11448 | applies to data plots with only 2 columns of data (x,y) and to function plots. | |
| 11442 | 11449 | The default is "set style circle radius graph 0.02". `Nowedge` disables | |
| 11443 | 11450 | drawing of the two radii that connect the ends of an arc to the center. | |
| 11444 | - The default is `wedge`. This parameter has no effect on full circles. | ||
| 11451 | + The default is `wedge`. This parameter has no effect on full circles. `Clip` | ||
| 11452 | + clips the circle at the plot boundaries, `noclip` disables this. Default is | ||
| 11453 | + `clip`. | ||
| 11445 | 11454 | ||
| 11446 | 11455 | 4 set style rectangle | |
| 11447 | 11456 | ?commands set style rectangle | |
@@ -11479,6 +11488,7 @@ Ffigure_missing | |||
| 11479 | 11488 | set style ellipse {units xx|xy|yy} | |
| 11480 | 11489 | {size {graph|screen} <a>, {{graph|screen} <b>}} | |
| 11481 | 11490 | {angle <angle>} | |
| 11491 | + {clip|noclip} | ||
| 11482 | 11492 | ||
| 11483 | 11493 | This command governs whether the diameters of ellipses are interpreted in | |
| 11484 | 11494 | the same units or not. | |
@@ -11508,6 +11518,9 @@ Ffigure_missing | |||
| 11508 | 11518 | `angle` keyword. The orientation, which is defined as the angle between the | |
| 11509 | 11519 | major axis of the ellipse and the plot's x axis, must be given in degrees. | |
| 11510 | 11520 | ||
| 11521 | + `Clip` clips the ellipse at the plot boundaries, `noclip` disables this. | ||
| 11522 | + Default is `clip`. | ||
| 11523 | + | ||
| 11511 | 11524 | For defining ellipse objects, see `set object ellipse`; | |
| 11512 | 11525 | for the 2D plot style, see `ellipses`. | |
| 11513 | 11526 | 4 set style textbox | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,12 +157,19 @@ typedef struct polygon { | |||
| 157 | 157 | t_position *vertex; /* Array of vertices */ | |
| 158 | 158 | } t_polygon; | |
| 159 | 159 | ||
| 160 | + typedef enum en_clip_object { | ||
| 161 | + OBJ_CLIP, /* Clip to graph unless coordinate type is screen */ | ||
| 162 | + OBJ_NOCLIP, /* Clip to canvas, never to graph */ | ||
| 163 | + OBJ_ALWAYS_CLIP /* Not yet implemented */ | ||
| 164 | + } t_clip_object; | ||
| 165 | + | ||
| 160 | 166 | /* Datastructure for 'set object' */ | |
| 161 | 167 | typedef struct object { | |
| 162 | 168 | struct object *next; | |
| 163 | 169 | int tag; | |
| 164 | 170 | int layer; /* behind or back or front */ | |
| 165 | 171 | int object_type; /* OBJ_RECTANGLE */ | |
| 172 | + t_clip_object clip; | ||
| 166 | 173 | fill_style_type fillstyle; | |
| 167 | 174 | lp_style_type lp_properties; | |
| 168 | 175 | union o {t_rectangle rectangle; t_circle circle; t_ellipse ellipse; t_polygon polygon;} o; | |
@@ -524,24 +531,24 @@ extern fill_style_type default_fillstyle; | |||
| 524 | 531 | #ifdef EAM_OBJECTS | |
| 525 | 532 | /* Warning: C89 does not like the union initializers */ | |
| 526 | 533 | extern struct object default_rectangle; | |
| 527 | - #define DEFAULT_RECTANGLE_STYLE { NULL, -1, 0, OBJ_RECTANGLE, \ | ||
| 534 | + #define DEFAULT_RECTANGLE_STYLE { NULL, -1, 0, OBJ_RECTANGLE, OBJ_CLIP, \ | ||
| 528 | 535 | {FS_SOLID, 100, 0, BLACK_COLORSPEC}, \ | |
| 529 | 536 | {0, LT_BACKGROUND, 0, 0, 1.0, 0.0, BACKGROUND_COLORSPEC}, \ | |
| 530 | 537 | {.rectangle = {0, {0,0,0,0.,0.,0.}, {0,0,0,0.,0.,0.}, {0,0,0,0.,0.,0.}, {0,0,0,0.,0.,0.}}} } | |
| 531 | 538 | ||
| 532 | 539 | extern struct object default_circle; | |
| 533 | - #define DEFAULT_CIRCLE_STYLE { NULL, -1, 0, OBJ_CIRCLE, \ | ||
| 540 | + #define DEFAULT_CIRCLE_STYLE { NULL, -1, 0, OBJ_CIRCLE, OBJ_CLIP, \ | ||
| 534 | 541 | {FS_SOLID, 100, 0, BLACK_COLORSPEC}, \ | |
| 535 | 542 | {0, LT_BACKGROUND, 0, 0, 1.0, 0.0, BACKGROUND_COLORSPEC}, \ | |
| 536 | 543 | {.circle = {1, {0,0,0,0.,0.,0.}, {graph,0,0,0.02,0.,0.}, 0., 360., TRUE }} } | |
| 537 | 544 | ||
| 538 | 545 | extern struct object default_ellipse; | |
| 539 | - #define DEFAULT_ELLIPSE_STYLE { NULL, -1, 0, OBJ_ELLIPSE, \ | ||
| 546 | + #define DEFAULT_ELLIPSE_STYLE { NULL, -1, 0, OBJ_ELLIPSE, OBJ_CLIP, \ | ||
| 540 | 547 | {FS_SOLID, 100, 0, BLACK_COLORSPEC}, \ | |
| 541 | 548 | {0, LT_BACKGROUND, 0, 0, 1.0, 0.0, BACKGROUND_COLORSPEC}, \ | |
| 542 | 549 | {.ellipse = {ELLIPSEAXES_XY, {0,0,0,0.,0.,0.}, {graph,graph,0,0.05,0.03,0.}, 0. }} } | |
| 543 | 550 | ||
| 544 | - #define DEFAULT_POLYGON_STYLE { NULL, -1, 0, OBJ_POLYGON, \ | ||
| 551 | + #define DEFAULT_POLYGON_STYLE { NULL, -1, 0, OBJ_POLYGON, OBJ_CLIP, \ | ||
| 545 | 552 | {FS_SOLID, 100, 0, BLACK_COLORSPEC}, \ | |
| 546 | 553 | {0, LT_BLACK, 0, 0, 1.0, 0.0, BLACK_COLORSPEC}, \ | |
| 547 | 554 | {.polygon = {0, NULL} } } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments