PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ lwgeom_to_x3d3_sb()

static int lwgeom_to_x3d3_sb ( const LWGEOM geom,
char *  srs,
int  precision,
int  opts,
const char *  defid,
stringbuffer_t sb 
)
static

We might change this later, but putting a polygon in an indexed face set seems like the simplest way to go so treat just like a mulitpolygon

Definition at line 67 of file lwout_x3d.c.

References asx3d3_collection_sb(), asx3d3_line_sb(), asx3d3_multi_sb(), asx3d3_point_sb(), asx3d3_psurface_sb(), asx3d3_tin_sb(), asx3d3_triangle_sb(), COLLECTIONTYPE, LINETYPE, LW_FAILURE, LW_SUCCESS, lwcollection_free(), lwerror(), lwgeom_as_multi(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, ovdump::type, and LWGEOM::type.

Referenced by lwgeom_to_x3d3().

68 {
69  int type = geom->type;
70 
71  switch (type)
72  {
73  case POINTTYPE:
74  return asx3d3_point_sb((LWPOINT*)geom, srs, precision, opts, defid, sb);
75 
76  case LINETYPE:
77  return asx3d3_line_sb((LWLINE*)geom, srs, precision, opts, defid, sb);
78 
79  case POLYGONTYPE:
80  {
85  asx3d3_multi_sb(tmp, srs, precision, opts, defid, sb);
86  lwcollection_free(tmp);
87  return LW_SUCCESS;
88  }
89 
90  case TRIANGLETYPE:
91  return asx3d3_triangle_sb((LWTRIANGLE*)geom, srs, precision, opts, defid, sb);
92 
93  case MULTIPOINTTYPE:
94  case MULTILINETYPE:
95  case MULTIPOLYGONTYPE:
96  return asx3d3_multi_sb((LWCOLLECTION*)geom, srs, precision, opts, defid, sb);
97 
99  return asx3d3_psurface_sb((LWPSURFACE*)geom, srs, precision, opts, defid, sb);
100 
101  case TINTYPE:
102  return asx3d3_tin_sb((LWTIN*)geom, srs, precision, opts, defid, sb);
103 
104  case COLLECTIONTYPE:
105  return asx3d3_collection_sb((LWCOLLECTION*)geom, srs, precision, opts, defid, sb);
106 
107  default:
108  lwerror("lwgeom_to_x3d3: '%s' geometry type not supported", lwtype_name(type));
109  return LW_FAILURE;
110  }
111 }
#define LINETYPE
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define LW_SUCCESS
Definition: liblwgeom.h:79
static int asx3d3_psurface_sb(const LWPSURFACE *psur, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:349
#define TRIANGLETYPE
Definition: liblwgeom.h:97
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
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
Definition: lwgeom.c:371
#define LW_FAILURE
Definition: liblwgeom.h:78
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
static int asx3d3_multi_sb(const LWCOLLECTION *col, __attribute__((__unused__)) char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:270
#define TINTYPE
Definition: liblwgeom.h:98
uint8_t precision
Definition: cu_in_twkb.c:25
static int asx3d3_point_sb(const LWPOINT *point, __attribute__((__unused__)) char *srs, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:114
static int asx3d3_line_sb(const LWLINE *line, __attribute__((__unused__)) char *srs, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Return the linestring as an X3D LineSet.
Definition: lwout_x3d.c:219
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
type
Definition: ovdump.py:41
static int asx3d3_collection_sb(const LWCOLLECTION *col, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:440
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:356
#define MULTILINETYPE
Definition: liblwgeom.h:88
opts
Definition: ovdump.py:44
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
static int asx3d3_tin_sb(const LWTIN *tin, __attribute__((__unused__)) char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:402
Here is the call graph for this function:
Here is the caller graph for this function: