PostGIS  2.5.7dev-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.

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 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define LW_FAILURE
Definition: liblwgeom.h:79
#define MULTILINETYPE
Definition: liblwgeom.h:89
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
Definition: lwgeom.c:371
#define LINETYPE
Definition: liblwgeom.h:86
#define LW_SUCCESS
Definition: liblwgeom.h:80
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:356
#define TRIANGLETYPE
Definition: liblwgeom.h:98
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
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
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
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
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
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_multi_sb(const LWCOLLECTION *col, __attribute__((__unused__)) char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:270
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
opts
Definition: ovdump.py:44
type
Definition: ovdump.py:41
uint8_t type
Definition: liblwgeom.h:399

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, ovdump::opts, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, precision, TINTYPE, TRIANGLETYPE, LWGEOM::type, and ovdump::type.

Referenced by lwgeom_to_x3d3().

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