GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gsd_wire.c
Go to the documentation of this file.
1 
19 #include <grass/gis.h>
20 #include <grass/gstypes.h>
21 
22 #include "gsget.h"
23 #include "rowcol.h"
24 
25 
26 #define DO_ARROWS
27 
28 /************************************************************************/
29 /* Notes on exageration:
30  vertical exageration is of two forms:
31  1) global exageration (from geoview struct)
32  2) vertical exageration for each surface - not implemented
33  */
34 
35 /************************************************************************/
36 /* may need to add more parameters to tell it which window or off_screen
37  * pixmap to draw into. nah - just have one current (OpenGL limitation)
38  */
39 
47 int gsd_wire_surf(geosurf * surf)
48 {
49  int desc, ret;
50 
51  G_debug(3, "gsd_wire_surf(): id=%d", surf->gsurf_id);
52 
53  desc = ATT_TOPO;
54 
55  switch (gs_get_att_src(surf, desc)) {
56  case NOTSET_ATT:
57  ret = (-1);
58 
59  break;
60 
61  case MAP_ATT:
62  if (surf->draw_mode & DM_GRID_WIRE)
63  ret = (gsd_wire_surf_map(surf)); /* draw mesh */
64  else
65  ret = (gsd_coarse_surf_map(surf)); /* draw coarse surf */
66 
67 #ifdef DO_ARROWS
68  /*
69  gsd_wire_arrows(surf);
70  */
71 #endif
72 
73  break;
74 
75  case CONST_ATT:
76  ret = (gsd_wire_surf_const(surf, surf->att[desc].constant));
77  break;
78 
79  case FUNC_ATT:
80  ret = (gsd_wire_surf_func(surf, surf->att[desc].user_func));
81 
82  break;
83 
84  default:
85  ret = (-1);
86 
87  break;
88  }
89 
90  return (ret);
91 }
92 
100 int gsd_wire_surf_map(geosurf * surf)
101 {
102  int check_mask, check_color;
103  typbuff *buff, *cobuff;
104  int xmod, ymod, row, col, cnt, xcnt, ycnt, x1off;
105  long offset, y1off;
106  float pt[4], xres, yres, ymax, zexag;
107  int col_src, curcolor;
108  gsurf_att *coloratt;
109 
110  G_debug(3, "gsd_wire_surf_map");
111 
112  buff = gs_get_att_typbuff(surf, ATT_TOPO, 0);
113  cobuff = gs_get_att_typbuff(surf, ATT_COLOR, 0);
114 
115  gs_update_curmask(surf);
116  check_mask = surf->curmask ? 1 : 0;
117 
118  /*
119  checks ATT_TOPO & ATT_COLOR no_zero flags, make a mask from each,
120  combine it/them with any current mask, put in typbuff:
121  if(surf->att[ATT_TOPO].constant)
122  */
123 
124  xmod = surf->x_modw;
125  ymod = surf->y_modw;
126  xres = xmod * surf->xres;
127  yres = ymod * surf->yres;
128  ymax = (surf->rows - 1) * surf->yres;
129  xcnt = 1 + (surf->cols - 1) / xmod;
130  ycnt = 1 + (surf->rows - 1) / ymod;
131 
132  gsd_pushmatrix();
133  gsd_do_scale(1);
134  gsd_translate(surf->x_trans, surf->y_trans, surf->z_trans);
135 
136  zexag = surf->z_exag;
137 
138  gsd_colormode(CM_COLOR);
139 
140  /* will need to check for color source of FUNC_ATT & NOTSET_ATT,
141  or else use more general and inefficient gets */
142 
143  check_color = (surf->wire_color == WC_COLOR_ATT);
144 
145  if (check_color) {
146  coloratt = &(surf->att[ATT_COLOR]);
147  col_src = surf->att[ATT_COLOR].att_src;
148 
149  if (col_src != MAP_ATT) {
150  if (col_src == CONST_ATT) {
151  gsd_color_func((int)surf->att[ATT_COLOR].constant);
152  }
153  else {
154  gsd_color_func(surf->wire_color);
155  }
156 
157  check_color = 0;
158  }
159  }
160  else {
161  gsd_color_func(surf->wire_color);
162  }
163 
164  /* would also be good to check if colormap == surfmap, to increase speed */
165  for (row = 0; row < ycnt; row++) {
166  pt[Y] = ymax - row * yres;
167  y1off = row * ymod * surf->cols;
168 
169  gsd_bgnline();
170  cnt = 0;
171 
172  for (col = 0; col < xcnt; col++) {
173  pt[X] = col * xres;
174  x1off = col * xmod;
175  offset = x1off + y1off;
176 
177  if (check_mask) {
178  if (BM_get(surf->curmask, col * xmod, row * ymod)) {
179  gsd_endline();
180  gsd_bgnline();
181  cnt = 0;
182  continue;
183  }
184  }
185 
186  GET_MAPATT(buff, offset, pt[Z]);
187 
188  if (check_color) {
189  curcolor = gs_mapcolor(cobuff, coloratt, offset);
190  gsd_color_func(curcolor);
191  /* could use this & skip the GET if colordata == elevdata
192  gsd_color_func(gs_fastmapcolor(cobuff, coloratt, offset,
193  (int)pt[Z]));
194  */
195  }
196 
197  pt[Z] = pt[Z] * zexag;
198 
199  gsd_vert_func(pt);
200 
201  if (cnt == 255) {
202  gsd_endline();
203  gsd_bgnline();
204  cnt = 0;
205  gsd_vert_func(pt);
206  }
207 
208  cnt++;
209  }
210 
211  gsd_endline();
212  }
213 
214  for (col = 0; col < xcnt; col++) {
215  pt[X] = col * xres;
216  x1off = col * xmod;
217 
218  gsd_bgnline();
219  cnt = 0;
220 
221  for (row = 0; row < ycnt; row++) {
222  pt[Y] = ymax - row * yres;
223  y1off = row * ymod * surf->cols;
224  offset = x1off + y1off;
225 
226  if (check_mask) {
227  if (BM_get(surf->curmask, col * xmod, row * ymod)) {
228  gsd_endline();
229  gsd_bgnline();
230  cnt = 0;
231  continue;
232  }
233  }
234 
235  GET_MAPATT(buff, offset, pt[Z]);
236 
237  if (check_color) {
238  curcolor = gs_mapcolor(cobuff, coloratt, offset);
239  gsd_color_func(curcolor);
240  /* could use this & skip the GET if colordata == elevdata
241  gsd_color_func(gs_fastmapcolor(coloratt, offset, (int)pt[Z]));
242  */
243  }
244 
245  pt[Z] = pt[Z] * zexag;
246 
247  gsd_vert_func(pt);
248 
249  if (cnt == 255) {
250  gsd_endline();
251  gsd_bgnline();
252  cnt = 0;
253  gsd_vert_func(pt);
254  }
255 
256  cnt++;
257  }
258 
259  gsd_endline();
260  }
261 
262  gsd_popmatrix();
263  gsd_colormode(CM_DIFFUSE);
264 
265  return (1);
266 }
267 
276 int gsd_wire_surf_const(geosurf * surf, float k)
277 {
278  int do_diff, check_mask, check_color;
279  int xmod, ymod, row, col, cnt, xcnt, ycnt, x1off;
280  long offset, y1off;
281  float pt[4], xres, yres, ymax, zexag;
282  int col_src;
283  gsurf_att *coloratt;
284  typbuff *cobuff;
285 
286  G_debug(3, "gsd_wire_surf_const");
287 
288  cobuff = gs_get_att_typbuff(surf, ATT_COLOR, 0);
289 
290  gs_update_curmask(surf);
291  check_mask = surf->curmask ? 1 : 0;
292 
293  do_diff = (NULL != gsdiff_get_SDref());
294 
295  xmod = surf->x_modw;
296  ymod = surf->y_modw;
297  xres = xmod * surf->xres;
298  yres = ymod * surf->yres;
299 
300  xcnt = 1 + (surf->cols - 1) / xmod;
301  ycnt = 1 + (surf->rows - 1) / ymod;
302  ymax = (surf->rows - 1) * surf->yres;
303 
304  gsd_pushmatrix();
305  gsd_do_scale(1);
306  gsd_translate(surf->x_trans, surf->y_trans, surf->z_trans);
307 
308  zexag = surf->z_exag;
309 
310  gsd_colormode(CM_COLOR);
311 
312  /* will need to check for color source of FUNC_ATT & NOTSET_ATT,
313  or else use more general and inefficient gets */
314 
315  check_color = (surf->wire_color == WC_COLOR_ATT);
316 
317  if (check_color) {
318  coloratt = &(surf->att[ATT_COLOR]);
319  col_src = surf->att[ATT_COLOR].att_src;
320 
321  if (col_src != MAP_ATT) {
322  if (col_src == CONST_ATT) {
323  gsd_color_func((int)surf->att[ATT_COLOR].constant);
324  }
325  else {
326  gsd_color_func(surf->wire_color);
327  }
328 
329  check_color = 0;
330  }
331  }
332  else {
333  gsd_color_func(surf->wire_color);
334  }
335 
336  pt[Z] = k * zexag;
337 
338  for (row = 0; row < ycnt; row++) {
339  pt[Y] = ymax - row * yres;
340  y1off = row * ymod * surf->cols;
341 
342  gsd_bgnline();
343  cnt = 0;
344 
345  for (col = 0; col < xcnt; col++) {
346  pt[X] = col * xres;
347  x1off = col * xmod;
348  offset = x1off + y1off;
349 
350  if (check_mask) {
351  if (BM_get(surf->curmask, col * xmod, row * ymod)) {
352  gsd_endline();
353  gsd_bgnline();
354  cnt = 0;
355  continue;
356  }
357  }
358 
359  if (check_color) {
360  gsd_color_func(gs_mapcolor(cobuff, coloratt, offset));
361  }
362 
363  if (do_diff) {
364  pt[Z] = gsdiff_do_SD(k * zexag, offset);
365  }
366 
367  gsd_vert_func(pt);
368 
369  if (cnt == 255) {
370  gsd_endline();
371  gsd_bgnline();
372  cnt = 0;
373  gsd_vert_func(pt);
374  }
375 
376  cnt++;
377  }
378 
379  gsd_endline();
380  }
381 
382  for (col = 0; col < xcnt; col++) {
383  pt[X] = col * xres;
384  x1off = col * xmod;
385 
386  gsd_bgnline();
387  cnt = 0;
388 
389  for (row = 0; row < ycnt; row++) {
390  pt[Y] = ymax - row * yres;
391  y1off = row * ymod * surf->cols;
392  offset = x1off + y1off;
393 
394  if (check_mask) {
395  if (BM_get(surf->curmask, col * xmod, row * ymod)) {
396  gsd_endline();
397  gsd_bgnline();
398  cnt = 0;
399  continue;
400  }
401  }
402 
403  if (check_color) {
404  gsd_color_func(gs_mapcolor(cobuff, coloratt, offset));
405  }
406 
407  if (do_diff) {
408  pt[Z] = gsdiff_do_SD(k * zexag, offset);
409  }
410 
411  gsd_vert_func(pt);
412 
413  if (cnt == 255) {
414  gsd_endline();
415  gsd_bgnline();
416  cnt = 0;
417  gsd_vert_func(pt);
418  }
419 
420  cnt++;
421  }
422 
423  gsd_endline();
424  }
425 
426  gsd_popmatrix();
427  gsd_colormode(CM_DIFFUSE);
428 
429  return (1);
430 }
431 
442 int gsd_wire_surf_func(geosurf * gs, int (*user_func) ())
443 {
444  return (1);
445 }
446 
457 int gsd_wire_arrows(geosurf * surf)
458 {
459  typbuff *buff, *cobuff;
460  int check_mask, check_color;
461  int xmod, ymod, row, col, xcnt, ycnt;
462  long offset, y1off;
463  float tx, ty, tz, sz;
464  float n[3], pt[4], xres, yres, ymax, zexag;
465  int col_src, curcolor;
466  gsurf_att *coloratt;
467 
468  G_debug(3, "gsd_norm_arrows");
469 
470  /* avoid scaling by zero */
471  GS_get_scale(&tx, &ty, &tz, 1);
472 
473  if (tz == 0.0) {
474  return (0);
475  }
476 
477  sz = GS_global_exag();
478 
479  gs_update_curmask(surf);
480  check_mask = surf->curmask ? 1 : 0;
481 
482  /*
483  checks ATT_TOPO & ATT_COLOR no_zero flags, make a mask from each,
484  combine it/them with any current mask, put in surf->curmask:
485  */
486 
487  check_color = 1;
488  coloratt = &(surf->att[ATT_COLOR]);
489  col_src = surf->att[ATT_COLOR].att_src;
490 
491  if (col_src != MAP_ATT) {
492  if (col_src == CONST_ATT) {
493  curcolor = (int)surf->att[ATT_COLOR].constant;
494  }
495  else {
496  curcolor = surf->wire_color;
497  }
498 
499  check_color = 0;
500  }
501 
502  buff = gs_get_att_typbuff(surf, ATT_TOPO, 0);
503  cobuff = gs_get_att_typbuff(surf, ATT_COLOR, 0);
504 
505  xmod = surf->x_modw;
506  ymod = surf->y_modw;
507  xres = xmod * surf->xres;
508  yres = ymod * surf->yres;
509  ymax = (surf->rows - 1) * surf->yres;
510  xcnt = 1 + (surf->cols - 1) / xmod;
511  ycnt = 1 + (surf->rows - 1) / ymod;
512 
513  gsd_pushmatrix();
514  gsd_do_scale(1);
515  gsd_translate(surf->x_trans, surf->y_trans, surf->z_trans);
516 
517  zexag = surf->z_exag;
518  /* CURRENTLY ALWAYS 1.0 */
519 
520  gsd_colormode(CM_COLOR);
521 
522  for (row = 0; row < ycnt; row++) {
523  pt[Y] = ymax - row * yres;
524  y1off = row * ymod * surf->cols;
525 
526  for (col = 0; col < xcnt; col++) {
527  pt[X] = col * xres;
528  offset = col * xmod + y1off;
529 
530  if (check_mask) {
531  if (BM_get(surf->curmask, col * xmod, row * ymod)) {
532  continue;
533  }
534  }
535 
536  FNORM(surf->norms[offset], n);
537  GET_MAPATT(buff, offset, pt[Z]);
538  pt[Z] *= zexag;
539 
540  if (check_color) {
541  curcolor = gs_mapcolor(cobuff, coloratt, offset);
542  }
543 
544  gsd_arrow(pt, curcolor, xres * 2, n, sz, surf);
545  } /* ea col */
546  } /* ea row */
547 
548  gsd_popmatrix();
549  gsd_colormode(CM_DIFFUSE);
550 
551  return (1);
552 }
553 
571 int gsd_coarse_surf_map(geosurf * surf)
572 {
573  int check_mask, check_color, check_transp;
574  int check_material, check_emis, check_shin;
575  typbuff *buff, *cobuff, *trbuff, *embuff, *shbuff;
576  int xmod, ymod;
577  int row, col, xcnt, ycnt;
578  long y1off, y2off, y3off;
579  long offset2[10];
580  float pt2[10][2];
581  int ii;
582  float x1, x2, x3, y1, y2, y3, tx, ty, tz, ttr;
583  float n[3], pt[4], xres, yres, ymax, zexag;
584  int em_src, sh_src, trans_src, col_src, curcolor;
585  gsurf_att *ematt, *shatt, *tratt, *coloratt;
586 
587 
588  int datarow1, datacol1, datarow2, datacol2, datarow3, datacol3;
589 
590  float kem, ksh, pkem, pksh;
591  unsigned int ktrans;
592 
593  int step_val = 2 * surf->x_modw; /* should always be factor of 2 for fan */
594  int start_val = surf->x_modw;
595 
596  /* ensure normals are correct */
597  gs_calc_normals(surf);
598 
599  /* avoid scaling by zero */
600  GS_get_scale(&tx, &ty, &tz, 1);
601 
602  if (tz == 0.0) {
603  return (gsd_surf_const(surf, 0.0));
604  }
605  /* else if (surf->z_exag == 0.0)
606  {
607  return(gsd_surf_const(surf, surf->z_min));
608  }
609  NOT YET IMPLEMENTED */
610 
611  buff = gs_get_att_typbuff(surf, ATT_TOPO, 0);
612  cobuff = gs_get_att_typbuff(surf, ATT_COLOR, 0);
613 
614  gs_update_curmask(surf);
615  check_mask = surf->curmask ? 1 : 0;
616 
617  /*
618  checks ATT_TOPO & ATT_COLOR no_zero flags, make a mask from each,
619  combine it/them with any current mask, put in surf->curmask:
620  */
621  xmod = surf->x_mod;
622  ymod = surf->y_mod;
623  xres = xmod * surf->xres;
624  yres = ymod * surf->yres;
625  ymax = (surf->rows - 1) * surf->yres;
626 
627  xcnt = VCOLS(surf);
628  ycnt = VROWS(surf);
629 
630  gsd_pushmatrix();
631  gsd_do_scale(1);
632  gsd_translate(surf->x_trans, surf->y_trans, surf->z_trans);
633  zexag = surf->z_exag;
634 
635  gsd_colormode(CM_DIFFUSE);
636 
637 
638  /* CURRENTLY ALWAYS 1.0 */
639 #ifdef CALC_AREA
640  sz = GS_global_exag();
641 #endif
642 
643  /* TODO: get rid of (define) these magic numbers scaling the attribute vals */
644  check_transp = 0;
645  tratt = &(surf->att[ATT_TRANSP]);
646  ktrans = (255 << 24);
647  trans_src = surf->att[ATT_TRANSP].att_src;
648 
649  if (CONST_ATT == trans_src && surf->att[ATT_TRANSP].constant != 0.0) {
650  ktrans = (255 - (int)surf->att[ATT_TRANSP].constant) << 24;
651  gsd_blend(1);
652  gsd_zwritemask(0x0);
653  }
654  else if (MAP_ATT == trans_src) {
655  trbuff = gs_get_att_typbuff(surf, ATT_TRANSP, 0);
656  check_transp = trbuff ? 1 : 0;
657  gsd_blend(1);
658  gsd_zwritemask(0x0);
659  }
660 
661  check_emis = 0;
662  ematt = &(surf->att[ATT_EMIT]);
663  kem = 0.0;
664  pkem = 1.0;
665  em_src = surf->att[ATT_EMIT].att_src;
666 
667  if (CONST_ATT == em_src) {
668  kem = surf->att[ATT_EMIT].constant / 255.;
669  }
670  else if (MAP_ATT == em_src) {
671  embuff = gs_get_att_typbuff(surf, ATT_EMIT, 0);
672  check_emis = embuff ? 1 : 0;
673  }
674 
675  check_shin = 0;
676  shatt = &(surf->att[ATT_SHINE]);
677  ksh = 0.0;
678  pksh = 1.0;
679  sh_src = surf->att[ATT_SHINE].att_src;
680 
681  if (CONST_ATT == sh_src) {
682  ksh = surf->att[ATT_SHINE].constant / 255.;
683  gsd_set_material(1, 0, ksh, kem, 0x0);
684  }
685  else if (MAP_ATT == sh_src) {
686  shbuff = gs_get_att_typbuff(surf, ATT_SHINE, 0);
687  check_shin = shbuff ? 1 : 0;
688  }
689 
690  /* will need to check for color source of FUNC_ATT & NOTSET_ATT,
691  or else use more general and inefficient gets */
692  check_color = 1;
693  coloratt = &(surf->att[ATT_COLOR]);
694  col_src = surf->att[ATT_COLOR].att_src;
695 
696  if (col_src != MAP_ATT) {
697  if (col_src == CONST_ATT) {
698  curcolor = (int)surf->att[ATT_COLOR].constant;
699  }
700  else {
701  curcolor = surf->wire_color;
702  }
703 
704  check_color = 0;
705  }
706 
707  check_material = (check_shin || check_emis || (kem && check_color));
708 
709  /* would also be good to check if colormap == surfmap, to increase speed */
710  /* will also need to set check_transp, check_shine, etc & fix material */
711  for (row = start_val; row <= ycnt - start_val; row += step_val) {
712 
713  datarow1 = row * ymod;
714  datarow2 = (row - (step_val / 2)) * ymod;
715  datarow3 = (row + (step_val / 2)) * ymod;
716 
717 
718  y1 = ymax - row * yres;
719  y2 = ymax - (row - (step_val / 2)) * yres;
720  y3 = ymax - (row + (step_val / 2)) * yres;
721 
722  y1off = row * ymod * surf->cols;
723  y2off = (row - (step_val / 2)) * ymod * surf->cols;
724  y3off = (row + (step_val / 2)) * ymod * surf->cols;
725 
726  for (col = start_val; col <= xcnt - start_val; col += step_val) {
727 
728  datacol1 = col * xmod;
729  datacol2 = (col - (step_val / 2)) * xmod;
730  datacol3 = (col + (step_val / 2)) * xmod;
731 
732  x1 = col * xres;
733  x2 = (col - (step_val / 2)) * xres;
734  x3 = (col + (step_val / 2)) * xres;
735 
736 
737  /* Do not need BM_get because GET_MAPATT calls
738  * same and returns zero if masked
739  */
740  offset2[0] = y1off + datacol1; /* fan center */
741  pt2[0][X] = x1;
742  pt2[0][Y] = y1; /* fan center */
743  pt[X] = pt2[0][X];
744  pt[Y] = pt2[0][Y];
745  if (!GET_MAPATT(buff, offset2[0], pt[Z]))
746  continue; /* masked */
747  pt[Z] *= zexag;
748 
749  offset2[1] = y2off + datacol2;
750  offset2[2] = y2off + datacol1;
751  offset2[3] = y2off + datacol3;
752  offset2[4] = y1off + datacol3;
753  offset2[5] = y3off + datacol3;
754  offset2[6] = y3off + datacol1;
755  offset2[7] = y3off + datacol2;
756  offset2[8] = y1off + datacol2;
757  offset2[9] = y2off + datacol2; /* repeat 1st corner to close */
758 
759  pt2[1][X] = x2;
760  pt2[1][Y] = y2;
761  pt2[2][X] = x1;
762  pt2[2][Y] = y2;
763  pt2[3][X] = x3;
764  pt2[3][Y] = y2;
765  pt2[4][X] = x3;
766  pt2[4][Y] = y1;
767  pt2[5][X] = x3;
768  pt2[5][Y] = y3;
769  pt2[6][X] = x1;
770  pt2[6][Y] = y3;
771  pt2[7][X] = x2;
772  pt2[7][Y] = y3;
773  pt2[8][X] = x2;
774  pt2[8][Y] = y1;
775  pt2[9][X] = x2;
776  pt2[9][Y] = y2; /* repeat 1st corner to close */
777 
778  /* Run through triangle fan */
779  gsd_bgntfan();
780  for (ii = 0; ii < 10; ii++) {
781 
782 
783  if (ii > 0) {
784  pt[X] = pt2[ii][X];
785  pt[Y] = pt2[ii][Y];
786  if (!GET_MAPATT(buff, offset2[ii], pt[Z]))
787  continue;
788  pt[Z] *= zexag;
789  }
790 
791  FNORM(surf->norms[offset2[ii]], n);
792 
793  if (check_color)
794  curcolor = gs_mapcolor(cobuff, coloratt, offset2[ii]);
795 
796  if (check_transp) {
797  GET_MAPATT(trbuff, offset2[ii], ttr);
798  ktrans = (char)SCALE_ATT(tratt, ttr, 0, 255);
799  ktrans = (char)(255 - ktrans) << 24;
800  }
801 
802 
803  if (check_material) {
804  if (check_emis) {
805  GET_MAPATT(embuff, offset2[ii], kem);
806  kem = SCALE_ATT(ematt, kem, 0., 1.);
807  }
808 
809  if (check_shin) {
810  GET_MAPATT(shbuff, offset2[ii], ksh);
811  ksh = SCALE_ATT(shatt, ksh, 0., 1.);
812  }
813 
814  if (pksh != ksh || pkem != kem || (kem && check_color)) {
815  pksh = ksh;
816  pkem = kem;
817  gsd_set_material(check_shin, check_emis,
818  ksh, kem, curcolor);
819  }
820  }
821 
822 
823  gsd_litvert_func(n, ktrans | curcolor, pt);
824 
825 
826  } /* close ii loop */
827  gsd_endtfan();
828 
829  } /* end col */
830 
831  } /* end row */
832 
833  gsd_popmatrix();
834  /*
835  gsd_colormode(CM_DIFFUSE);
836  */
837  gsd_blend(0);
838  gsd_zwritemask(0xffffffff);
839 
840  return (0);
841 }
void gsd_zwritemask(unsigned long n)
Write out z-mask.
Definition: gsd_prim.c:231
int BM_get(struct BM *map, int x, int y)
Gets &#39;val&#39; from the bitmap.
Definition: bitmap.c:220
int gsd_wire_surf(geosurf *surf)
Draw surface wire.
Definition: gsd_wire.c:47
void gsd_do_scale(int doexag)
Set current scale.
Definition: gsd_views.c:355
#define VROWS(gs)
Definition: rowcol.h:11
#define VCOLS(gs)
Definition: rowcol.h:12
void gsd_set_material(int set_shin, int set_emis, float sh, float em, int emcolor)
Set material.
Definition: gsd_prim.c:794
int gsd_surf_const(geosurf *surf, float k)
Using tmesh - not confident with qstrips portability.
Definition: gsd_surf.c:729
#define Y(x)
Definition: display/draw.c:246
int gs_calc_normals(geosurf *gs)
Calculate normals.
Definition: gs_norms.c:124
void gsd_colormode(int cm)
Set color mode.
Definition: gsd_prim.c:88
#define X(y)
Definition: display/draw.c:248
void gsd_color_func(unsigned int col)
Set current color.
Definition: gsd_prim.c:689
void gsd_translate(float dx, float dy, float dz)
Multiply the current matrix by a translation matrix.
Definition: gsd_prim.c:526
void gsd_litvert_func(float *norm, unsigned long col, float *pt)
Set the current normal vector &amp; specify vertex.
Definition: gsd_prim.c:648
geosurf * gsdiff_get_SDref(void)
ADD.
Definition: gsdiff.c:77
void gsd_bgntfan(void)
ADD.
Definition: gsd_prim.c:327
char buff[1024]
Definition: g3dcats.c:89
void gsd_pushmatrix(void)
Push the current matrix stack.
Definition: gsd_prim.c:498
int gsd_wire_surf_const(geosurf *surf, float k)
ADD.
Definition: gsd_wire.c:276
typbuff * gs_get_att_typbuff(geosurf *gs, int desc, int to_write)
Get attribute data buffer.
Definition: gs.c:681
void gsd_endline(void)
End line.
Definition: gsd_prim.c:397
int gsd_wire_arrows(geosurf *surf)
ADD.
Definition: gsd_wire.c:457
void gsd_endtfan(void)
ADD.
Definition: gsd_prim.c:337
int gsd_wire_surf_func(geosurf *gs, int(*user_func)())
ADD.
Definition: gsd_wire.c:442
int gsd_coarse_surf_map(geosurf *surf)
Draw coarse surface.
Definition: gsd_wire.c:571
int
Definition: g3dcolor.c:48
void gsd_blend(int yesno)
Specify pixel arithmetic.
Definition: gsd_prim.c:974
double ymax
Definition: dataquad.c:293
void gsd_vert_func(float *pt)
ADD.
Definition: gsd_prim.c:677
return NULL
Definition: dbfopen.c:1394
int G_debug(int level, const char *msg,...)
Print debugging message.
Definition: gis/debug.c:51
int gs_get_att_src(geosurf *gs, int desc)
Get attribute source.
Definition: gs.c:656
float gsdiff_do_SD(float val, int offset)
ADD.
Definition: gsdiff.c:94
void gsd_popmatrix(void)
Pop the current matrix stack.
Definition: gsd_prim.c:488
#define FNORM(i, nv)
Definition: gsget.h:50
#define SCALE_ATT(att, val, low, high)
Definition: gsget.h:22
int gs_mapcolor(typbuff *cobuff, gsurf_att *coloratt, int offset)
Call this one when you already know att_src is MAP_ATT.
Definition: gs.c:969
void gsd_bgnline(void)
Begin line.
Definition: gsd_prim.c:387
int n
Definition: dataquad.c:291
float GS_global_exag(void)
Get global z-exag value.
Definition: GS2.c:1996
int gs_update_curmask(geosurf *surf)
Update current maps.
Definition: gs_bm.c:232
int gsd_arrow(float *center, unsigned long colr, float siz, float *dir, float sz, geosurf *onsurf)
ADD.
Definition: gsd_objs.c:922
void GS_get_scale(float *sx, float *sy, float *sz, int doexag)
Get axis scale.
Definition: GS2.c:3238
int gsd_wire_surf_map(geosurf *surf)
ADD.
Definition: gsd_wire.c:100
#define GET_MAPATT(buff, offset, att)
Definition: gsget.h:27