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));
void gsd_zwritemask(unsigned long n)
Write out z-mask.
void gsd_do_scale(int doexag)
Set current scale.
void GS_done_draw(void)
Draw done, swap buffers.
void gsd_bgnpolygon(void)
Delimit the vertices of a primitive or a group of like primitives.
void gsd_colormode(int cm)
Set color mode.
void gsd_color_func(unsigned int col)
Set current color.
void gsd_translate(float dx, float dy, float dz)
Multiply the current matrix by a translation matrix.
void gsd_pushmatrix(void)
Push the current matrix stack.
void gsd_fringe_vert_poly(float bot, geosurf *surf, int col, int side)
ADD.
typbuff * gs_get_att_typbuff(geosurf *gs, int desc, int to_write)
Get attribute data buffer.
void gsd_endline(void)
End line.
void gsd_fringe_horiz_poly(float bot, geosurf *surf, int row, int side)
ADD.
void gsd_fringe_horiz_line(float bot, geosurf *surf, int row, int side)
ADD.
void gsd_vert_func(float *pt)
ADD.
void gsd_endpolygon(void)
Delimit the vertices of a primitive or a group of like primitives.
void gsd_linewidth(short n)
Set width of rasterized lines.
void gsd_flush(void)
Mostly for flushing drawing commands accross a network.
void gsd_popmatrix(void)
Pop the current matrix stack.
void gsd_display_fringe(geosurf *surf, unsigned long clr, float elev, int where[4])
Display fridge.
void gsd_fringe_vert_line(float bot, geosurf *surf, int col, int side)
ADD.
void gsd_bgnline(void)
Begin line.
void GS_set_draw(int where)
Sets which buffer to draw to.
void gsd_fringe_horiz_line2(float bot, geosurf *surf, int row, int side)
ADD.
#define GET_MAPATT(buff, offset, att)