PostGIS  2.4.9dev-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 646 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().

647 {
648  char *ptr;
649  int i;
650  int k;
651  /* int dimension=2; */
652 
653  ptr = output;
654 
655  ptr += sprintf(ptr, "<IndexedTriangleSet %s index='",defid);
656  k = 0;
658  for (i=0; i<tin->ngeoms; i++)
659  {
660  ptr += sprintf(ptr, "%d %d %d", k, (k+1), (k+2));
661  if (i < (tin->ngeoms - 1) )
662  {
663  ptr += sprintf(ptr, " ");
664  }
665  k += 3;
666  }
667 
668  if ( X3D_USE_GEOCOORDS(opts) ) ptr += sprintf(ptr, "'><GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
669  else ptr += sprintf(ptr, "'><Coordinate point='");
670 
671  for (i=0; i<tin->ngeoms; i++)
672  {
673  ptr += asx3d3_triangle_buf(tin->geoms[i], 0, ptr, precision,
674  opts, defid);
675  if (i < (tin->ngeoms - 1) )
676  {
677  ptr += sprintf(ptr, " ");
678  }
679  }
680 
681  /* Close outmost tag */
682 
683  ptr += sprintf(ptr, "'/></IndexedTriangleSet>");
684 
685  return (ptr-output);
686 }
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1555
int ngeoms
Definition: liblwgeom.h:585
LWTRIANGLE ** geoms
Definition: liblwgeom.h:587
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1553
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:367
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: