00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #define NEED_PLDEBUG
00029 #include "plplotP.h"
00030
00031
00032
00033
00034 int
00035 plParseOpts(int *p_argc, const char **argv, PLINT mode)
00036 {
00037 plwarn("plParseOpts: function deprecated. Use plparseopts instead");
00038 return c_plparseopts(p_argc, argv, mode);
00039 }
00040
00041
00042
00043
00044
00045 void
00046 plHLS_RGB(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b)
00047 {
00048 plwarn("plHLS_RGB: function deprecated. Use plhlsrgb instead");
00049 c_plhlsrgb(h, l, s, p_r, p_g, p_b);
00050 }
00051
00052
00053
00054
00055 void
00056 plRGB_HLS(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s)
00057 {
00058 plwarn("plRGB_HLS: function deprecated. Use plrgbhls instead");
00059 c_plrgbhls(r, g, b, p_h, p_l, p_s);
00060 }
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 #define SCALE0 2.0
00085
00086
00087
00088 static PLFLT arrow_x[4] = {0.5, -0.5, -0.27, -0.5};
00089 static PLFLT arrow_y[4] = {0.0, 0.0, 0.0, 0.20};
00090
00091 void
00092 plarrows(PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n,
00093 PLFLT scale, PLFLT dx, PLFLT dy)
00094 {
00095 PLFLT uu, vv;
00096 PLINT i, j, npts = 4;
00097 PLINT px0, py0, dpx, dpy;
00098 PLINT a_x[4], a_y[4];
00099 PLFLT max_u, max_v;
00100 double t;
00101
00102 plwarn("plarrows: function deprecated. Use plvect instead");
00103
00104 if (n <= 0) return;
00105
00106 if (scale <= 0.0) {
00107
00108
00109
00110
00111 max_u = u[0];
00112 max_v = v[0];
00113 for (i = 1; i < n; i++) {
00114 t = fabs((double) u[i]);
00115 max_u = t > max_u ? t : max_u;
00116 t = fabs((double) v[i]);
00117 max_v = t > max_v ? t : max_v;
00118 }
00119
00120
00121
00122 max_u = max_u / fabs( (double) dx);
00123 max_v = max_v / fabs( (double) dy);
00124
00125 t = (max_u > max_v ? max_u : max_v);
00126 t = SCALE0 / t;
00127 if (scale < 0) {
00128 scale = -scale * t;
00129 }
00130 else {
00131 scale = t;
00132 }
00133 }
00134 pldebug("plarrows", "scale factor=%lf n=%d\n", scale,n);
00135
00136 for (i = 0; i < n; i++) {
00137 uu = scale * u[i];
00138 vv = scale * v[i];
00139 if (uu == 0.0 && uu == 0.0) continue;
00140
00141
00142
00143 px0 = plP_wcpcx(x[i]);
00144 py0 = plP_wcpcy(y[i]);
00145
00146 pldebug("plarrows", "%f %f %d %d\n",x[i],y[i],px0,py0);
00147
00148 dpx = plP_wcpcx(x[i] + 0.5*uu) - px0;
00149 dpy = plP_wcpcy(y[i] + 0.5*vv) - py0;
00150
00151
00152
00153 for (j = 0; j < npts; j++) {
00154 a_x[j] = (PLINT)(arrow_x[j] * dpx -
00155 arrow_y[j] * dpy + px0);
00156 a_y[j] = (PLINT)(arrow_x[j] * dpy +
00157 arrow_y[j] * dpx + py0);
00158 }
00159
00160
00161 plP_movphy(a_x[0], a_y[0]);
00162 plP_draphy(a_x[1], a_y[1]);
00163 plP_movphy(a_x[2], a_y[2]);
00164 plP_draphy(a_x[3], a_y[3]);
00165 }
00166
00167 }
00168