PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asx3d3_tin_buf ( const LWTIN tin,
char *  srs,
char *  output,
int  precision,
int  opts,
const char *  defid 
)
static

Fill in triangle index

Definition at line 607 of file lwout_x3d.c.

References asx3d3_triangle_buf(), LWTIN::geoms, and LWTIN::ngeoms.

Referenced by asx3d3_tin().

608 {
609  char *ptr;
610  int i;
611  int k;
612  /* int dimension=2; */
613 
614  ptr = output;
615 
616  ptr += sprintf(ptr, "<IndexedTriangleSet %s index='",defid);
617  k = 0;
619  for (i=0; i<tin->ngeoms; i++)
620  {
621  ptr += sprintf(ptr, "%d %d %d", k, (k+1), (k+2));
622  if (i < (tin->ngeoms - 1) )
623  {
624  ptr += sprintf(ptr, " ");
625  }
626  k += 3;
627  }
628 
629  ptr += sprintf(ptr, "'><Coordinate point='");
630  for (i=0; i<tin->ngeoms; i++)
631  {
632  ptr += asx3d3_triangle_buf(tin->geoms[i], 0, ptr, precision,
633  opts, defid);
634  if (i < (tin->ngeoms - 1) )
635  {
636  ptr += sprintf(ptr, " ");
637  }
638  }
639 
640  /* Close outmost tag */
641 
642  ptr += sprintf(ptr, "'/></IndexedTriangleSet>");
643 
644  return (ptr-output);
645 }
int ngeoms
Definition: liblwgeom.h:541
LWTRIANGLE ** geoms
Definition: liblwgeom.h:543
static size_t asx3d3_triangle_buf(const LWTRIANGLE *triangle, char *srs, char *output, int precision, int opts, const char *defid)
Definition: lwout_x3d.c:339

Here is the call graph for this function:

Here is the caller graph for this function: