PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asx3d3_tin_sb()

static int asx3d3_tin_sb ( const LWTIN tin,
__attribute__((__unused__)) char *  srs,
int  precision,
int  opts,
const char *  defid,
stringbuffer_t sb 
)
static

Fill in triangle index

Definition at line 402 of file lwout_x3d.c.

403 {
404  uint32_t i;
405  uint32_t k;
406  /* int dimension=2; */
407 
408  stringbuffer_aprintf(sb,"<IndexedTriangleSet %s index='",defid);
409  k = 0;
411  for (i=0; i<tin->ngeoms; i++)
412  {
413  stringbuffer_aprintf(sb, "%d %d %d", k, (k+1), (k+2));
414  if (i < (tin->ngeoms - 1) )
415  {
416  stringbuffer_aprintf(sb, " ");
417  }
418  k += 3;
419  }
420 
421  if ( X3D_USE_GEOCOORDS(opts) ) stringbuffer_aprintf(sb, "'><GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
422  else stringbuffer_aprintf(sb, "'><Coordinate point='");
423 
424  for (i=0; i<tin->ngeoms; i++)
425  {
426  asx3d3_triangle_sb(tin->geoms[i], 0, precision,
427  opts, defid, sb);
428  if (i < (tin->ngeoms - 1) )
429  {
430  stringbuffer_aprintf(sb, " ");
431  }
432  }
433 
434  /* Close outmost tag */
435 
436  return stringbuffer_aprintf(sb, "'/></IndexedTriangleSet>");
437 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1560
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1562
static int asx3d3_triangle_sb(const LWTRIANGLE *triangle, __attribute__((__unused__)) char *srs, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:259
opts
Definition: ovdump.py:44
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
Definition: stringbuffer.c:253
uint32_t ngeoms
Definition: liblwgeom.h:588
LWTRIANGLE ** geoms
Definition: liblwgeom.h:590
unsigned int uint32_t
Definition: uthash.h:78

References asx3d3_triangle_sb(), LWTIN::geoms, LW_X3D_FLIP_XY, LWTIN::ngeoms, ovdump::opts, precision, stringbuffer_aprintf(), and X3D_USE_GEOCOORDS.

Referenced by asx3d3_collection_sb(), and lwgeom_to_x3d3_sb().

Here is the call graph for this function:
Here is the caller graph for this function: