21 #include <grass/gstypes.h>
26 #define FRINGE_FORE 0x000000
27 #define FRINGE_WIDTH 2
34 float Neast[] = { 0.8, 0.0, 0.6 };
35 float Nwest[] = { -0.8, 0.0, 0.6 };
36 float Ntop[] = { 0.0, 0.0, 1.0 };
54 float bot, xres, yres;
58 xres = surf->x_mod * surf->xres;
59 yres = surf->y_mod * surf->yres;
70 bot = elev - ((surf->zrange / 4.) * surf->z_exag);
77 if (where[0] || where[1]) {
91 if (where[2] || where[3]) {
105 if (where[0] || where[2]) {
118 if (where[1] || where[3]) {
162 pt[
X] = col * (surf->x_mod * surf->xres);
164 ((surf->rows - 1) * surf->yres) -
165 ((row + side) * (surf->y_mod * surf->yres));
169 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
171 pt[Z] = pt[Z] * surf->z_exag;
175 for (col = 0; col < xcnt - 1; col++) {
177 pt[
X] = col * (surf->x_mod * surf->xres);
179 ((surf->rows - 1) * surf->yres) -
180 ((row + side) * (surf->y_mod * surf->yres));
181 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
183 pt[Z] = pt[Z] * surf->z_exag;
189 pt[
X] = col * (surf->x_mod * surf->xres);
191 ((surf->rows - 1) * surf->yres) -
192 ((row + side) * (surf->y_mod * surf->yres));
235 pt[
X] = col * (surf->x_mod * surf->xres);
237 ((surf->rows - 1) * surf->yres) -
238 ((row + side) * (surf->y_mod * surf->yres));
242 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
244 pt[Z] = pt[Z] * surf->z_exag;
248 for (col = 0; col < xcnt - 1; col++) {
250 pt[
X] = col * (surf->x_mod * surf->xres);
252 ((surf->rows - 1) * surf->yres) -
253 ((row + side) * (surf->y_mod * surf->yres));
254 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
256 pt[Z] = pt[Z] * surf->z_exag;
262 pt[
X] = col * (surf->x_mod * surf->xres);
264 ((surf->rows - 1) * surf->yres) -
265 ((row + side) * (surf->y_mod * surf->yres));
270 pt[
X] = col * (surf->x_mod * surf->xres);
272 ((surf->rows - 1) * surf->yres) -
273 ((row + side) * (surf->y_mod * surf->yres));
316 pt[
X] = col * (surf->x_mod * surf->xres);
318 ((surf->rows - 1) * surf->yres) - (row * (surf->y_mod * surf->yres));
322 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
324 pt[Z] = pt[Z] * surf->z_exag;
328 for (row = 0; row < ycnt - 1; row++) {
330 pt[
X] = col * (surf->x_mod * surf->xres);
332 ((surf->rows - 1) * surf->yres) -
333 (row * (surf->y_mod * surf->yres));
334 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
336 pt[Z] = pt[Z] * surf->z_exag;
342 pt[
X] = col * (surf->x_mod * surf->xres);
344 ((surf->rows - 1) * surf->yres) - (row * (surf->y_mod * surf->yres));
386 pt[
X] = col * (surf->x_mod * surf->xres);
388 ((surf->rows - 1) * surf->yres) - (row * (surf->y_mod * surf->yres));
392 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
394 pt[Z] = pt[Z] * surf->z_exag;
398 for (row = 0; row < ycnt - 1; row++) {
400 pt[
X] = col * (surf->x_mod * surf->xres);
402 ((surf->rows - 1) * surf->yres) -
403 (row * (surf->y_mod * surf->yres));
404 offset = (row * surf->y_mod * surf->cols) + (col * surf->x_mod);
406 pt[Z] = pt[Z] * surf->z_exag;
412 pt[
X] = col * (surf->x_mod * surf->xres);
414 ((surf->rows - 1) * surf->yres) - (row * (surf->y_mod * surf->yres));
419 pt[
X] = col * (surf->x_mod * surf->xres);
421 ((surf->rows - 1) * surf->yres) - (row * (surf->y_mod * surf->yres));
462 pt[
X] = surf->xmin + (col * (surf->x_mod * surf->xres));
463 pt[
Y] = surf->ymax - ((row + side) * (surf->y_mod * surf->yres));
469 pt[Z] = pt[Z] * surf->z_exag;
473 for (col = 0; col < xcnt - 1; col++) {
475 pt[
X] = surf->xmin + (col * (surf->x_mod * surf->xres));
476 pt[
Y] = surf->ymax - ((row + side) * (surf->y_mod * surf->yres));
477 offset = col * surf->x_mod;
479 pt[Z] = pt[Z] * surf->z_exag;
485 pt[
X] = surf->xmin + (col * (surf->x_mod * surf->xres));
486 pt[
Y] = surf->ymax - ((row + side) * (surf->y_mod * surf->yres));