File: graphk.i

package info (click to toggle)
yorick-yutils 1.3.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 604 kB
  • ctags: 17
  • sloc: makefile: 105; python: 12
file content (146 lines) | stat: -rw-r--r-- 5,412 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
 * graphk.i
 *
 * $Id: graphk.i,v 1.1 2008/01/04 13:47:48 frigaut Exp $
 * 
 * This file is part of Yutils
 * Copyright (C) 2007  Thibaut Paumard <paumard@users.sourceforge.net>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * $Log: graphk.i,v $
 * Revision 1.1  2008/01/04 13:47:48  frigaut
 * initial import of thibaut's functions
 *
 *
 */


extern graphk;
/* DOCUMENT graphk.i
    Alternate syntax for graphic routines:  every keywords are set through only
    one, of  type GraphK. Members of  GraphK are all pointer,  for some graphic
    keywords support several datatypes. This syntax is useful when one wants to
    carry  graphic keywords  trough programs  in a  handy way,  not  really for
    command line. Currently supported: plhk and plgk.
   SEE ALSO: GraphK, plhk, plgk, plmkk, drawmaskk in drawmask.i
*/

func plhk(y,x,keywords=) {
/* DOCUMENT plhk,y
         or plhk,y,x

    Wrapper to plh, which accepts a single keyword: KEYWORDS (of type GraphK).

    Example: plhk,y,x,keywords=GraphK(color=&string("white"));

    Sounds nuts, but it  can be quite useful to have all  graphic keywords in a
    single variable, that can be made external or belong to a sructure...

   SEE ALSO: plh, plgk, GraphK, graphk, pltk
*/
    if (is_void(keywords)) plh,y,x;
    else plh,y,x,just=*keywords.just,legend=*keywords.legend,
             hide=*keywords.hide, type=*keywords.type, width=*keywords.width,
             color=*keywords.color, marks=*keywords.marks,
             marker=*keywords.marker, mspace=*keywords.mspace,
             mphase=*keywords.mphase;
}

func plgk(y,x,keywords=) {
/* DOCUMENT plhk,y
         or plhk,y,x

    Wrapper to plg, which accepts a single keyword: KEYWORDS (of type GraphK).

    Example: plgk,y,x,keywords=GraphK(color=&string("white"));

    Sounds nuts, but it  can be quite useful to have all  graphic keywords in a
    single variable, that can be made external or belong to a sructure...

   SEE ALSO: plg, plhk, GraphK, graphk, pltk
*/
    if (is_void(keywords)) plg,y,x;
    else plg,y,x,legend=*keywords.legend, hide=*keywords.hide,
             type=*keywords.type, width=*keywords.width,
             color=*keywords.color, closed=*keywords.closed,
             smooth=*keywords.smooth, marks=*keywords.marks,
             marker=*keywords.marker, mspace=*keywords.mspace,
             mphase=*keywords.mphase, rays=*keywords.rays,
             arrowl=*keywords.arrowl, arroww=*keywords.arroww,
             rspace=*keywords.rspace, rphase=*keywords.rphase;
}

func plmkk(y,x,keywords=){
/* DOCUMENT plmkk,y
         or plmkk,y,x

    Wrapper to plmk, which accepts a single keyword: KEYWORDS (of type GraphK).

    Example: plmkk,y,x,keywords=GraphK(msize=&double(0.2));

    Sounds nuts, but it  can be quite useful to have all  graphic keywords in a
    single variable, that can be made external or belong to a sructure...

   SEE ALSO: plg, plhk, GraphK, graphk, plgk, pltk
*/
    if (is_void(keywords)) plmk,y,x;
    else plmk,y,x,width=*keywords.width,color=*keywords.color,
             marker=*keywords.marker,msize=*keywords.msize;
}
    

func pltk(t,x,y,keywords=){
/* DOCUMENT pltk,text,x,y

    Wrapper to plt, which accepts a single keyword: KEYWORDS (of type GraphK).

    Example: pltk,"text",x,y,keywords=GraphK(font=&string("helveticaB"));

    Sounds nuts, but it  can be quite useful to have all  graphic keywords in a
    single variable, that can be made external or belong to a sructure...

   SEE ALSO: plg, plhk, GraphK, graphk, plgk, plmkk
*/
    if (is_void(keywords)) plt,t,x,y;
    else plt,t,x,y,legend=*keywords.legend,hide=*keywords.hide,
             color=*keywords.color,font=*keywords.font,height=*keywords.height,
             opaque=*keywords.opaque,orient=*keywords.orient,
             justify=*keywords.justify,tosys=*keywords.tosys;
}
    

struct GraphK {
/* DOCUMENT GraphK
       A   structure   for   storing   all   possible   keywords   to   graphic
       routines.  Members are  _pointers_, as  a few  of these  keywords accept
       several data types.

       Example:
       mykeywords=GraphK(color=&string("white"),msize=&double(0.5)[...]);
       plgk,y,x,keywords=mykeywords;

       Note: You cannot make a reference to a known value directly like "&0.5",
       but  you can  always  do  "&double(0.5)".  Makes  the  syntax even  more
       awkward,   but  this   still  simplifies   somewhat   implementing  some
       programs...
       
   SEE ALSO: plgk, plhk, plg, plh, plmkk, graphk, pltk
*/ 
    pointer legend, hide,type, width, color, closed, smooth, marks, marker,
        mspace, mphase, rays, arrowl, arroww, rspace, rphase, just, msize,
        font, height, opaque, orient, justify, tosys;
}