tioga 1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Tioga_README +372 -0
- data/lgpl.txt +504 -0
- data/split/Dtable/defs.h +33 -0
- data/split/Dtable/dtable.c +1928 -0
- data/split/Dtable/dtable_intern.h +144 -0
- data/split/Dtable/dvector.h +61 -0
- data/split/Dtable/extconf.rb +4 -0
- data/split/Dtable/include/dtable.h +35 -0
- data/split/Dtable/lib/Dtable_extras.rb +90 -0
- data/split/Dtable/namespace.h +47 -0
- data/split/Dtable/safe_double.h +104 -0
- data/split/Dtable/symbols.c +92 -0
- data/split/Dtable/symbols.h +52 -0
- data/split/Dvector/defs.h +33 -0
- data/split/Dvector/dvector.c +5486 -0
- data/split/Dvector/dvector_intern.h +142 -0
- data/split/Dvector/extconf.rb +4 -0
- data/split/Dvector/include/dvector.h +61 -0
- data/split/Dvector/lib/Dvector_extras.rb +328 -0
- data/split/Dvector/lib/Numeric_extras.rb +134 -0
- data/split/Dvector/namespace.h +47 -0
- data/split/Dvector/safe_double.h +104 -0
- data/split/Dvector/symbols.c +92 -0
- data/split/Dvector/symbols.h +52 -0
- data/split/Flate/defs.h +33 -0
- data/split/Flate/extconf.rb +19 -0
- data/split/Flate/flate.c +156 -0
- data/split/Flate/flate_intern.h +97 -0
- data/split/Flate/include/flate.h +98 -0
- data/split/Flate/namespace.h +47 -0
- data/split/Flate/safe_double.h +104 -0
- data/split/Flate/symbols.c +92 -0
- data/split/Flate/symbols.h +52 -0
- data/split/Function/defs.h +33 -0
- data/split/Function/dvector.h +61 -0
- data/split/Function/extconf.rb +4 -0
- data/split/Function/function.c +988 -0
- data/split/Function/joint_qsort.c +258 -0
- data/split/Function/lib/Function_extras.rb +44 -0
- data/split/Function/namespace.h +47 -0
- data/split/Function/safe_double.h +104 -0
- data/split/Function/symbols.c +92 -0
- data/split/Function/symbols.h +52 -0
- data/split/Tioga/axes.c +774 -0
- data/split/Tioga/defs.h +33 -0
- data/split/Tioga/dtable.h +35 -0
- data/split/Tioga/dvector.h +61 -0
- data/split/Tioga/extconf.rb +4 -0
- data/split/Tioga/figures.c +672 -0
- data/split/Tioga/figures.h +855 -0
- data/split/Tioga/flate.h +98 -0
- data/split/Tioga/init.c +524 -0
- data/split/Tioga/lib/Arcs_and_Circles.rb +64 -0
- data/split/Tioga/lib/ColorConstants.rb +274 -0
- data/split/Tioga/lib/Colorbars.rb +10 -0
- data/split/Tioga/lib/Colormaps.rb +105 -0
- data/split/Tioga/lib/Coordinate_Conversions.rb +194 -0
- data/split/Tioga/lib/Creating_Paths.rb +94 -0
- data/split/Tioga/lib/Doc.rb +91 -0
- data/split/Tioga/lib/Executive.rb +515 -0
- data/split/Tioga/lib/FigMkr.rb +2224 -0
- data/split/Tioga/lib/FigureConstants.rb +125 -0
- data/split/Tioga/lib/Figures_and_Plots.rb +268 -0
- data/split/Tioga/lib/Images.rb +278 -0
- data/split/Tioga/lib/Legends.rb +190 -0
- data/split/Tioga/lib/MarkerConstants.rb +122 -0
- data/split/Tioga/lib/Markers.rb +129 -0
- data/split/Tioga/lib/Page_Frame_Bounds.rb +567 -0
- data/split/Tioga/lib/Rectangles.rb +94 -0
- data/split/Tioga/lib/Shading.rb +100 -0
- data/split/Tioga/lib/Special_Paths.rb +307 -0
- data/split/Tioga/lib/Strokes.rb +129 -0
- data/split/Tioga/lib/TeX_Text.rb +454 -0
- data/split/Tioga/lib/TexPreamble.rb +358 -0
- data/split/Tioga/lib/Titles_and_Labels.rb +306 -0
- data/split/Tioga/lib/Transparency.rb +89 -0
- data/split/Tioga/lib/Using_Paths.rb +164 -0
- data/split/Tioga/lib/Utils.rb +74 -0
- data/split/Tioga/lib/X_and_Y_Axes.rb +749 -0
- data/split/Tioga/lib/irb_tioga.rb +122 -0
- data/split/Tioga/lib/tioga.rb +1 -0
- data/split/Tioga/lib/tioga_ui.rb +5 -0
- data/split/Tioga/lib/tioga_ui_cmds.rb +793 -0
- data/split/Tioga/makers.c +989 -0
- data/split/Tioga/mk_tioga_sty.rb +53 -0
- data/split/Tioga/namespace.h +47 -0
- data/split/Tioga/pdf_font_dicts.c +18253 -0
- data/split/Tioga/pdfcolor.c +486 -0
- data/split/Tioga/pdfcoords.c +505 -0
- data/split/Tioga/pdffile.c +342 -0
- data/split/Tioga/pdfimage.c +536 -0
- data/split/Tioga/pdfpath.c +914 -0
- data/split/Tioga/pdfs.h +229 -0
- data/split/Tioga/pdftext.c +443 -0
- data/split/Tioga/safe_double.h +104 -0
- data/split/Tioga/symbols.c +92 -0
- data/split/Tioga/symbols.h +52 -0
- data/split/Tioga/texout.c +380 -0
- data/split/defs.h +33 -0
- data/split/extconf.rb +107 -0
- data/split/mkmf2.rb +1612 -0
- data/split/namespace.h +47 -0
- data/split/safe_double.h +104 -0
- data/split/scripts/tioga +4 -0
- data/split/symbols.c +92 -0
- data/split/symbols.h +52 -0
- data/tests/dtable_test.data +6 -0
- data/tests/dvector_read_test.data +1 -0
- data/tests/dvector_test.data +101 -0
- data/tests/tc_Dtable.rb +221 -0
- data/tests/tc_Dvector.rb +791 -0
- data/tests/tc_FMkr.rb +162 -0
- data/tests/tc_Flate.rb +45 -0
- data/tests/tc_Function.rb +111 -0
- data/tests/ts_Tioga.rb +38 -0
- metadata +163 -0
@@ -0,0 +1,505 @@
|
|
1
|
+
/* pdfcoords.c */
|
2
|
+
/*
|
3
|
+
Copyright (C) 2005 Bill Paxton
|
4
|
+
|
5
|
+
This file is part of Tioga.
|
6
|
+
|
7
|
+
Tioga is free software; you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Library Public License as published
|
9
|
+
by the Free Software Foundation; either version 2 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
Tioga is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Library General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Library General Public License
|
18
|
+
along with Tioga; if not, write to the Free Software
|
19
|
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "figures.h"
|
23
|
+
#include "pdfs.h"
|
24
|
+
|
25
|
+
/* Frame and Bounds */
|
26
|
+
void Recalc_Font_Hts(FM *p)
|
27
|
+
{
|
28
|
+
double dx, dy;
|
29
|
+
dx = dy = ENLARGE * p->default_font_size * p->default_text_scale; // font height in output coords
|
30
|
+
dx = convert_output_to_page_dx(p,dx);
|
31
|
+
dx = convert_page_to_frame_dx(p,dx);
|
32
|
+
p->default_text_height_dx = convert_frame_to_figure_dx(p,dx);
|
33
|
+
dy = convert_output_to_page_dy(p,dy);
|
34
|
+
dy = convert_page_to_frame_dy(p,dy);
|
35
|
+
p->default_text_height_dy = convert_frame_to_figure_dy(p,dy);
|
36
|
+
}
|
37
|
+
|
38
|
+
void c_set_subframe(FM *p, double left_margin, double right_margin, double top_margin, double bottom_margin)
|
39
|
+
{
|
40
|
+
double x, y, w, h;
|
41
|
+
if (left_margin < 0 || right_margin < 0 || top_margin < 0 || bottom_margin < 0)
|
42
|
+
rb_raise(rb_eArgError, "Sorry: margins for set_subframe must be non-negative");
|
43
|
+
if (left_margin + right_margin >= 1.0)
|
44
|
+
rb_raise(rb_eArgError, "Sorry: margins too large: left_margin (%g) right_margin (%g)", left_margin, right_margin);
|
45
|
+
if (top_margin + bottom_margin >= 1.0)
|
46
|
+
rb_raise(rb_eArgError, "Sorry: margins too large: top_margin (%g) bottom_margin (%g)", top_margin, bottom_margin);
|
47
|
+
x = p->frame_left += left_margin * p->frame_width;
|
48
|
+
p->frame_right -= right_margin * p->frame_width;
|
49
|
+
p->frame_top -= top_margin * p->frame_height;
|
50
|
+
y = p->frame_bottom += bottom_margin * p->frame_height;
|
51
|
+
w = p->frame_width = p->frame_right - p->frame_left;
|
52
|
+
h = p->frame_height = p->frame_top - p->frame_bottom;
|
53
|
+
Recalc_Font_Hts(p);
|
54
|
+
}
|
55
|
+
|
56
|
+
VALUE FM_private_set_subframe(VALUE fmkr, VALUE left_margin, VALUE right_margin, VALUE top_margin, VALUE bottom_margin)
|
57
|
+
{
|
58
|
+
FM *p = Get_FM(fmkr);
|
59
|
+
left_margin = rb_Float(left_margin);
|
60
|
+
right_margin = rb_Float(right_margin);
|
61
|
+
top_margin = rb_Float(top_margin);
|
62
|
+
bottom_margin = rb_Float(bottom_margin);
|
63
|
+
c_set_subframe(p, NUM2DBL(left_margin), NUM2DBL(right_margin), NUM2DBL(top_margin), NUM2DBL(bottom_margin));
|
64
|
+
return fmkr;
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
void c_private_set_default_font_size(FM *p, double size) {
|
69
|
+
p->default_font_size = size;
|
70
|
+
Recalc_Font_Hts(p);
|
71
|
+
}
|
72
|
+
|
73
|
+
VALUE FM_private_set_default_font_size(VALUE fmkr, VALUE size) {
|
74
|
+
FM *p = Get_FM(fmkr);
|
75
|
+
size = rb_Float(size);
|
76
|
+
c_private_set_default_font_size(p, NUM2DBL(size));
|
77
|
+
return fmkr;
|
78
|
+
}
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
// We need to do some extra work to use 'ensure' around 'context'
|
83
|
+
// which is necessary in case code does 'return' from the block being executed in the context
|
84
|
+
// otherwise we won't get a chance to restore the state
|
85
|
+
typedef struct {
|
86
|
+
VALUE fmkr;
|
87
|
+
FM *p;
|
88
|
+
FM saved;
|
89
|
+
VALUE cmd;
|
90
|
+
} Context_Info;
|
91
|
+
|
92
|
+
static VALUE do_context_body(VALUE args)
|
93
|
+
{
|
94
|
+
Context_Info *cp = (Context_Info *)args; // nasty but it works
|
95
|
+
fprintf(TF, "q\n");
|
96
|
+
return do_cmd(cp->fmkr, cp->cmd);
|
97
|
+
}
|
98
|
+
|
99
|
+
static VALUE do_context_ensure(VALUE args)
|
100
|
+
{
|
101
|
+
Context_Info *cp = (Context_Info *)args;
|
102
|
+
fprintf(TF, "Q\n");
|
103
|
+
*cp->p = cp->saved;
|
104
|
+
return Qnil; // what should we be returning here?
|
105
|
+
}
|
106
|
+
|
107
|
+
VALUE FM_private_context(VALUE fmkr, VALUE cmd)
|
108
|
+
{
|
109
|
+
Context_Info c;
|
110
|
+
c.fmkr = fmkr;
|
111
|
+
c.cmd = cmd;
|
112
|
+
c.p = Get_FM(fmkr);
|
113
|
+
c.saved = *c.p;
|
114
|
+
return rb_ensure(do_context_body, (VALUE)&c, do_context_ensure, (VALUE)&c);
|
115
|
+
}
|
116
|
+
|
117
|
+
VALUE FM_doing_subplot(VALUE fmkr)
|
118
|
+
{
|
119
|
+
FM *p = Get_FM(fmkr);
|
120
|
+
p->in_subplot = true;
|
121
|
+
return fmkr;
|
122
|
+
}
|
123
|
+
|
124
|
+
VALUE FM_doing_subfigure(VALUE fmkr)
|
125
|
+
{
|
126
|
+
FM *p = Get_FM(fmkr);
|
127
|
+
p->root_figure = false;
|
128
|
+
return fmkr;
|
129
|
+
}
|
130
|
+
|
131
|
+
void c_set_bounds(FM *p, double left, double right, double top, double bottom)
|
132
|
+
{
|
133
|
+
if (constructing_path) rb_raise(rb_eArgError, "Sorry: must finish with current path before calling set_bounds");
|
134
|
+
p->bounds_left = left; p->bounds_right = right;
|
135
|
+
p->bounds_bottom = bottom; p->bounds_top = top;
|
136
|
+
if (left < right) {
|
137
|
+
p->xaxis_reversed = false;
|
138
|
+
p->bounds_xmin = left; p->bounds_xmax = right;
|
139
|
+
} else if (right < left) {
|
140
|
+
p->xaxis_reversed = true;
|
141
|
+
p->bounds_xmin = right; p->bounds_xmax = left;
|
142
|
+
} else rb_raise(rb_eArgError, "Sorry: left and right bounds cannot be the same (%g)", left);
|
143
|
+
if (bottom < top) {
|
144
|
+
p->yaxis_reversed = false;
|
145
|
+
p->bounds_ymin = bottom; p->bounds_ymax = top;
|
146
|
+
} else if (top < bottom) {
|
147
|
+
p->yaxis_reversed = true;
|
148
|
+
p->bounds_ymin = top; p->bounds_ymax = bottom;
|
149
|
+
} else rb_raise(rb_eArgError, "Sorry: top and bottom bounds cannot be the same (%g)", top);
|
150
|
+
p->bounds_width = p->bounds_xmax - p->bounds_xmin;
|
151
|
+
p->bounds_height = p->bounds_ymax - p->bounds_ymin;
|
152
|
+
Recalc_Font_Hts(p);
|
153
|
+
}
|
154
|
+
|
155
|
+
VALUE FM_private_set_bounds(VALUE fmkr, VALUE left, VALUE right, VALUE top, VALUE bottom)
|
156
|
+
{
|
157
|
+
FM *p = Get_FM(fmkr);
|
158
|
+
double left_boundary, right_boundary, top_boundary, bottom_boundary;
|
159
|
+
left = rb_Float(left);
|
160
|
+
left_boundary = NUM2DBL(left);
|
161
|
+
right = rb_Float(right);
|
162
|
+
right_boundary = NUM2DBL(right);
|
163
|
+
top = rb_Float(top);
|
164
|
+
top_boundary = NUM2DBL(top);
|
165
|
+
bottom = rb_Float(bottom);
|
166
|
+
bottom_boundary = NUM2DBL(bottom);
|
167
|
+
c_set_bounds(p, left_boundary, right_boundary, top_boundary, bottom_boundary);
|
168
|
+
return fmkr;
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
// Conversions
|
173
|
+
|
174
|
+
double c_convert_to_degrees(FM *p, double dx, double dy) // dx and dy in figure coords
|
175
|
+
{
|
176
|
+
double angle;
|
177
|
+
if (dx == 0.0 && dy == 0.0) angle = 0.0;
|
178
|
+
else if (dx > 0.0 && dy == 0.0) angle = (p->bounds_left > p->bounds_right)? 180.0 : 0.0;
|
179
|
+
else if (dx < 0.0 && dy == 0.0) angle = (p->bounds_left > p->bounds_right)? 0.0 : 180.0;
|
180
|
+
else if (dx == 0.0 && dy > 0.0) angle = (p->bounds_bottom > p->bounds_top)? -90.0 : 90.0;
|
181
|
+
else if (dx == 0.0 && dy < 0.0) angle = (p->bounds_bottom > p->bounds_top)? 90.0 : -90.0;
|
182
|
+
else angle = atan2(convert_figure_to_output_dy(p,dy),convert_figure_to_output_dx(p,dx))*RADIANS_TO_DEGREES;
|
183
|
+
return angle;
|
184
|
+
}
|
185
|
+
|
186
|
+
VALUE FM_convert_to_degrees(VALUE fmkr, VALUE dx, VALUE dy) // dx and dy in figure coords
|
187
|
+
{
|
188
|
+
FM *p = Get_FM(fmkr);
|
189
|
+
dx = rb_Float(dx);
|
190
|
+
dy = rb_Float(dy);
|
191
|
+
return rb_float_new(c_convert_to_degrees(p, NUM2DBL(dx), NUM2DBL(dy)));
|
192
|
+
}
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
VALUE FM_convert_inches_to_output(VALUE fmkr, VALUE v)
|
197
|
+
{
|
198
|
+
v = rb_Float(v); double val = NUM2DBL(v);
|
199
|
+
val = convert_inches_to_output(val);
|
200
|
+
return rb_float_new(val);
|
201
|
+
}
|
202
|
+
|
203
|
+
VALUE FM_convert_output_to_inches(VALUE fmkr, VALUE v)
|
204
|
+
{
|
205
|
+
v = rb_Float(v); double val = NUM2DBL(v);
|
206
|
+
val = convert_output_to_inches(val);
|
207
|
+
return rb_float_new(val);
|
208
|
+
}
|
209
|
+
|
210
|
+
|
211
|
+
VALUE FM_convert_mm_to_output(VALUE fmkr, VALUE v)
|
212
|
+
{
|
213
|
+
v = rb_Float(v); double val = NUM2DBL(v);
|
214
|
+
val = convert_mm_to_output(val);
|
215
|
+
return rb_float_new(val);
|
216
|
+
}
|
217
|
+
|
218
|
+
VALUE FM_convert_output_to_mm(VALUE fmkr, VALUE v)
|
219
|
+
{
|
220
|
+
v = rb_Float(v); double val = NUM2DBL(v);
|
221
|
+
val = convert_output_to_mm(val);
|
222
|
+
return rb_float_new(val);
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
VALUE FM_convert_page_to_output_x(VALUE fmkr, VALUE v)
|
227
|
+
{
|
228
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
229
|
+
val = convert_page_to_output_x(p,val);
|
230
|
+
return rb_float_new(val);
|
231
|
+
}
|
232
|
+
|
233
|
+
VALUE FM_convert_page_to_output_y(VALUE fmkr, VALUE v)
|
234
|
+
{
|
235
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
236
|
+
val = convert_page_to_output_y(p,val);
|
237
|
+
return rb_float_new(val);
|
238
|
+
}
|
239
|
+
|
240
|
+
VALUE FM_convert_page_to_output_dx(VALUE fmkr, VALUE v)
|
241
|
+
{
|
242
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
243
|
+
val = convert_page_to_output_dx(p,val);
|
244
|
+
return rb_float_new(val);
|
245
|
+
}
|
246
|
+
|
247
|
+
VALUE FM_convert_page_to_output_dy(VALUE fmkr, VALUE v)
|
248
|
+
{
|
249
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
250
|
+
val = convert_page_to_output_dy(p,val);
|
251
|
+
return rb_float_new(val);
|
252
|
+
}
|
253
|
+
|
254
|
+
VALUE FM_convert_output_to_page_x(VALUE fmkr, VALUE v)
|
255
|
+
{
|
256
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
257
|
+
val = convert_output_to_page_x(p,val);
|
258
|
+
return rb_float_new(val);
|
259
|
+
}
|
260
|
+
|
261
|
+
VALUE FM_convert_output_to_page_y(VALUE fmkr, VALUE v)
|
262
|
+
{
|
263
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
264
|
+
val = convert_output_to_page_y(p,val);
|
265
|
+
return rb_float_new(val);
|
266
|
+
}
|
267
|
+
|
268
|
+
VALUE FM_convert_output_to_page_dx(VALUE fmkr, VALUE v)
|
269
|
+
{
|
270
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
271
|
+
return convert_output_to_page_dx(p,val);
|
272
|
+
return rb_float_new(val);
|
273
|
+
}
|
274
|
+
|
275
|
+
VALUE FM_convert_output_to_page_dy(VALUE fmkr, VALUE v)
|
276
|
+
{
|
277
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
278
|
+
val = convert_output_to_page_dy(p,val);
|
279
|
+
return rb_float_new(val);
|
280
|
+
}
|
281
|
+
|
282
|
+
VALUE FM_convert_frame_to_page_x(VALUE fmkr, VALUE v)
|
283
|
+
{
|
284
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
285
|
+
val = convert_frame_to_page_x(p,val);
|
286
|
+
return rb_float_new(val);
|
287
|
+
}
|
288
|
+
|
289
|
+
VALUE FM_convert_frame_to_page_y(VALUE fmkr, VALUE v)
|
290
|
+
{
|
291
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
292
|
+
val = convert_frame_to_page_y(p,val);
|
293
|
+
return rb_float_new(val);
|
294
|
+
}
|
295
|
+
|
296
|
+
VALUE FM_convert_frame_to_page_dx(VALUE fmkr, VALUE v)
|
297
|
+
{
|
298
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
299
|
+
val = convert_frame_to_page_dx(p,val);
|
300
|
+
return rb_float_new(val);
|
301
|
+
}
|
302
|
+
|
303
|
+
VALUE FM_convert_frame_to_page_dy(VALUE fmkr, VALUE v)
|
304
|
+
{
|
305
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
306
|
+
val = convert_frame_to_page_dy(p,val);
|
307
|
+
return rb_float_new(val);
|
308
|
+
}
|
309
|
+
|
310
|
+
VALUE FM_convert_page_to_frame_x(VALUE fmkr, VALUE v)
|
311
|
+
{
|
312
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
313
|
+
val = convert_page_to_frame_x(p,val);
|
314
|
+
return rb_float_new(val);
|
315
|
+
}
|
316
|
+
|
317
|
+
VALUE FM_convert_page_to_frame_y(VALUE fmkr, VALUE v)
|
318
|
+
{
|
319
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
320
|
+
val = convert_page_to_frame_y(p,val);
|
321
|
+
return rb_float_new(val);
|
322
|
+
}
|
323
|
+
|
324
|
+
VALUE FM_convert_page_to_frame_dx(VALUE fmkr, VALUE v)
|
325
|
+
{
|
326
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
327
|
+
val = convert_page_to_frame_dx(p,val);
|
328
|
+
return rb_float_new(val);
|
329
|
+
}
|
330
|
+
|
331
|
+
VALUE FM_convert_page_to_frame_dy(VALUE fmkr, VALUE v)
|
332
|
+
{
|
333
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
334
|
+
val = convert_page_to_frame_dy(p,val);
|
335
|
+
return rb_float_new(val);
|
336
|
+
}
|
337
|
+
|
338
|
+
VALUE FM_convert_figure_to_frame_x(VALUE fmkr, VALUE v)
|
339
|
+
{
|
340
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
341
|
+
val = convert_figure_to_frame_x(p,val);
|
342
|
+
return rb_float_new(val);
|
343
|
+
}
|
344
|
+
|
345
|
+
VALUE FM_convert_figure_to_frame_y(VALUE fmkr, VALUE v)
|
346
|
+
{
|
347
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
348
|
+
val = convert_figure_to_frame_y(p,val);
|
349
|
+
return rb_float_new(val);
|
350
|
+
}
|
351
|
+
|
352
|
+
VALUE FM_convert_figure_to_frame_dx(VALUE fmkr, VALUE v)
|
353
|
+
{
|
354
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
355
|
+
val = convert_figure_to_frame_dx(p,val);
|
356
|
+
return rb_float_new(val);
|
357
|
+
}
|
358
|
+
|
359
|
+
VALUE FM_convert_figure_to_frame_dy(VALUE fmkr, VALUE v)
|
360
|
+
{
|
361
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
362
|
+
val = convert_figure_to_frame_dy(p,val);
|
363
|
+
return rb_float_new(val);
|
364
|
+
}
|
365
|
+
|
366
|
+
VALUE FM_convert_frame_to_figure_x(VALUE fmkr, VALUE v)
|
367
|
+
{
|
368
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
369
|
+
val = convert_frame_to_figure_x(p,val);
|
370
|
+
return rb_float_new(val);
|
371
|
+
}
|
372
|
+
|
373
|
+
VALUE FM_convert_frame_to_figure_y(VALUE fmkr, VALUE v)
|
374
|
+
{
|
375
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
376
|
+
val = convert_frame_to_figure_y(p,val);
|
377
|
+
return rb_float_new(val);
|
378
|
+
}
|
379
|
+
|
380
|
+
VALUE FM_convert_frame_to_figure_dx(VALUE fmkr, VALUE v)
|
381
|
+
{
|
382
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
383
|
+
val = convert_frame_to_figure_dx(p,val);
|
384
|
+
return rb_float_new(val);
|
385
|
+
}
|
386
|
+
|
387
|
+
VALUE FM_convert_frame_to_figure_dy(VALUE fmkr, VALUE v)
|
388
|
+
{
|
389
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
390
|
+
val = convert_frame_to_figure_dy(p,val);
|
391
|
+
return rb_float_new(val);
|
392
|
+
}
|
393
|
+
|
394
|
+
double convert_figure_to_output_x(FM *p, double x)
|
395
|
+
{
|
396
|
+
x = convert_figure_to_frame_x(p,x);
|
397
|
+
x = convert_frame_to_page_x(p,x);
|
398
|
+
x = convert_page_to_output_x(p,x);
|
399
|
+
return x;
|
400
|
+
}
|
401
|
+
|
402
|
+
double convert_figure_to_output_dy(FM *p, double dy)
|
403
|
+
{
|
404
|
+
dy = convert_figure_to_frame_dy(p,dy);
|
405
|
+
dy = convert_frame_to_page_dy(p,dy);
|
406
|
+
dy = convert_page_to_output_dy(p,dy);
|
407
|
+
return dy;
|
408
|
+
}
|
409
|
+
|
410
|
+
double convert_figure_to_output_dx(FM *p, double dx)
|
411
|
+
{
|
412
|
+
dx = convert_figure_to_frame_dx(p,dx);
|
413
|
+
dx = convert_frame_to_page_dx(p,dx);
|
414
|
+
dx = convert_page_to_output_dx(p,dx);
|
415
|
+
return dx;
|
416
|
+
}
|
417
|
+
|
418
|
+
double convert_figure_to_output_y(FM *p, double y)
|
419
|
+
{
|
420
|
+
y = convert_figure_to_frame_y(p,y);
|
421
|
+
y = convert_frame_to_page_y(p,y);
|
422
|
+
y = convert_page_to_output_y(p,y);
|
423
|
+
return y;
|
424
|
+
}
|
425
|
+
|
426
|
+
VALUE FM_convert_figure_to_output_x(VALUE fmkr, VALUE v)
|
427
|
+
{
|
428
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
429
|
+
return rb_float_new(convert_figure_to_output_x(p,val));
|
430
|
+
}
|
431
|
+
|
432
|
+
VALUE FM_convert_figure_to_output_y(VALUE fmkr, VALUE v)
|
433
|
+
{
|
434
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
435
|
+
return rb_float_new(convert_figure_to_output_y(p,val));
|
436
|
+
}
|
437
|
+
|
438
|
+
VALUE FM_convert_figure_to_output_dx(VALUE fmkr, VALUE v)
|
439
|
+
{
|
440
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
441
|
+
return rb_float_new(convert_figure_to_output_dx(p,val));
|
442
|
+
}
|
443
|
+
|
444
|
+
VALUE FM_convert_figure_to_output_dy(VALUE fmkr, VALUE v)
|
445
|
+
{
|
446
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
447
|
+
return rb_float_new(convert_figure_to_output_dy(p,val));
|
448
|
+
}
|
449
|
+
|
450
|
+
double convert_output_to_figure_x(FM *p, double x)
|
451
|
+
{
|
452
|
+
x = convert_output_to_page_x(p,x);
|
453
|
+
x = convert_page_to_frame_x(p,x);
|
454
|
+
x = convert_frame_to_figure_x(p,x);
|
455
|
+
return x;
|
456
|
+
}
|
457
|
+
|
458
|
+
double convert_output_to_figure_dy(FM *p, double dy)
|
459
|
+
{
|
460
|
+
dy = convert_output_to_page_dy(p,dy);
|
461
|
+
dy = convert_page_to_frame_dy(p,dy);
|
462
|
+
dy = convert_frame_to_figure_dy(p,dy);
|
463
|
+
return dy;
|
464
|
+
}
|
465
|
+
|
466
|
+
double convert_output_to_figure_dx(FM *p, double dx)
|
467
|
+
{
|
468
|
+
dx = convert_output_to_page_dx(p,dx);
|
469
|
+
dx = convert_page_to_frame_dx(p,dx);
|
470
|
+
dx = convert_frame_to_figure_dx(p,dx);
|
471
|
+
return dx;
|
472
|
+
}
|
473
|
+
|
474
|
+
double convert_output_to_figure_y(FM *p, double y)
|
475
|
+
{
|
476
|
+
y = convert_output_to_page_y(p,y);
|
477
|
+
y = convert_page_to_frame_y(p,y);
|
478
|
+
y = convert_frame_to_figure_y(p,y);
|
479
|
+
return y;
|
480
|
+
}
|
481
|
+
|
482
|
+
VALUE FM_convert_output_to_figure_x(VALUE fmkr, VALUE v)
|
483
|
+
{
|
484
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
485
|
+
return rb_float_new(convert_output_to_figure_x(p,val));
|
486
|
+
}
|
487
|
+
|
488
|
+
VALUE FM_convert_output_to_figure_y(VALUE fmkr, VALUE v)
|
489
|
+
{
|
490
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
491
|
+
return rb_float_new(convert_output_to_figure_y(p,val));
|
492
|
+
}
|
493
|
+
|
494
|
+
VALUE FM_convert_output_to_figure_dx(VALUE fmkr, VALUE v)
|
495
|
+
{
|
496
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
497
|
+
return rb_float_new(convert_output_to_figure_dx(p,val));
|
498
|
+
}
|
499
|
+
|
500
|
+
VALUE FM_convert_output_to_figure_dy(VALUE fmkr, VALUE v)
|
501
|
+
{
|
502
|
+
FM *p = Get_FM(fmkr); v = rb_Float(v); double val = NUM2DBL(v);
|
503
|
+
return rb_float_new(convert_output_to_figure_dy(p,val));
|
504
|
+
}
|
505
|
+
|