1 /********************************************************************** 2 * 3 * PostGIS - Spatial Types for PostgreSQL 4 * http://postgis.net 5 * 6 * PostGIS is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * PostGIS is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with PostGIS. If not, see <http://www.gnu.org/licenses/>. 18 * 19 ********************************************************************** 20 * 21 * Copyright 2011-2017 Arrival 3D, Regina Obe 22 * 23 **********************************************************************/ 24 25 /** 26 * @file X3D output routines. 27 * 28 **********************************************************************/ 29 #include <string.h> 30 #include "liblwgeom_internal.h" 31 #include "stringbuffer.h" 32 33 /** defid is the id of the coordinate can be used to hold other elements DEF='abc' transform='' etc. **/ 34 static int lwgeom_to_x3d3_sb(const LWGEOM *geom, int precision, int opts, const char *defid, stringbuffer_t *sb); 35 36 static int asx3d3_point_sb(const LWPOINT *point, int precision, int opts, const char *defid, stringbuffer_t *sb); 37 static int asx3d3_line_sb(const LWLINE *line, int precision, int opts, const char *defid, stringbuffer_t *sb); 38 39 static int 40 asx3d3_triangle_sb(const LWTRIANGLE *triangle, int precision, int opts, const char *defid, stringbuffer_t *sb); 41 42 static int asx3d3_multi_sb(const LWCOLLECTION *col, int precision, int opts, const char *defid, stringbuffer_t *sb); 43 static int asx3d3_psurface_sb(const LWPSURFACE *psur, int precision, int opts, const char *defid, stringbuffer_t *sb); 44 static int asx3d3_tin_sb(const LWTIN *tin, int precision, int opts, const char *defid, stringbuffer_t *sb); 45 46 static int 47 asx3d3_collection_sb(const LWCOLLECTION *col, int precision, int opts, const char *defid, stringbuffer_t *sb); 48 static int ptarray_to_x3d3_sb(POINTARRAY *pa, int precision, int opts, int is_closed, stringbuffer_t *sb ); 49