PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 {
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:1666
#define X3D_USE_GEOCOORDS(x)
Definition liblwgeom.h:1668
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
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.
uint32_t ngeoms
Definition liblwgeom.h:650
LWTRIANGLE ** geoms
Definition liblwgeom.h:645

References asx3d3_triangle_sb(), LWTIN::geoms, LW_X3D_FLIP_XY, LWTIN::ngeoms, 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: