PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asx3d3_tin_buf()

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 625 of file lwout_x3d.c.

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

Referenced by asx3d3_collection_buf(), and asx3d3_tin().

626 {
627  char *ptr;
628  int i;
629  int k;
630  /* int dimension=2; */
631 
632  ptr = output;
633 
634  ptr += sprintf(ptr, "<IndexedTriangleSet %s index='",defid);
635  k = 0;
637  for (i=0; i<tin->ngeoms; i++)
638  {
639  ptr += sprintf(ptr, "%d %d %d", k, (k+1), (k+2));
640  if (i < (tin->ngeoms - 1) )
641  {
642  ptr += sprintf(ptr, " ");
643  }
644  k += 3;
645  }
646 
647  if ( X3D_USE_GEOCOORDS(opts) ) ptr += sprintf(ptr, "'><GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
648  else ptr += sprintf(ptr, "'><Coordinate point='");
649 
650  for (i=0; i<tin->ngeoms; i++)
651  {
652  ptr += asx3d3_triangle_buf(tin->geoms[i], 0, ptr, precision,
653  opts, defid);
654  if (i < (tin->ngeoms - 1) )
655  {
656  ptr += sprintf(ptr, " ");
657  }
658  }
659 
660  /* Close outmost tag */
661 
662  ptr += sprintf(ptr, "'/></IndexedTriangleSet>");
663 
664  return (ptr-output);
665 }
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1489
int ngeoms
Definition: liblwgeom.h:569
LWTRIANGLE ** geoms
Definition: liblwgeom.h:571
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1487
uint8_t precision
Definition: cu_in_twkb.c:25
static size_t asx3d3_triangle_buf(const LWTRIANGLE *triangle, char *srs, char *output, int precision, int opts, const char *defid)
Definition: lwout_x3d.c:346
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: