* PostGIS - Spatial Types for PostgreSQL\r
* http://www.postgis.org\r
* adapted from lwout_asgml.c\r
- * Copyright 2011 Arrival 3D \r
+ * Copyright 2011 Arrival 3D\r
* Regina Obe with input from Dave Arendash\r
*\r
* This is free software; you can redistribute and/or modify it under\r
\r
/* takes a GEOMETRY and returns an X3D representation */\r
extern char *\r
- lwgeom_to_x3d3(const LWGEOM *geom, char *srs, int precision, int opts, const char *defid)\r
+lwgeom_to_x3d3(const LWGEOM *geom, char *srs, int precision, int opts, const char *defid)\r
{\r
int type = geom->type;\r
\r
\r
case POLYGONTYPE:\r
/** We might change this later, but putting a polygon in an indexed face set\r
- * seems like the simplest way to go so treat just like a mulitpolygon \r
+ * seems like the simplest way to go so treat just like a mulitpolygon\r
*/\r
return asx3d3_multi((LWCOLLECTION*)lwgeom_as_multi(geom), srs, precision, opts, defid);\r
\r
size = pointArray_X3Dsize(line->points, precision)*2;\r
\r
size += (\r
- sizeof("<LineSet vertexCount=''><Coordinate point='' /></LineSet>") + defidlen\r
- ) * 2;\r
+ sizeof("<LineSet vertexCount=''><Coordinate point='' /></LineSet>") + defidlen\r
+ ) * 2;\r
\r
//if (srs) size += strlen(srs) + sizeof(" srsName=..");\r
return size;\r
pa = geom->points;\r
np = pa->npoints;\r
si = j; //start index of first point of linestring\r
- for(k=0; k < np ; k++)\r
+ for (k=0; k < np ; k++)\r
{\r
if (k)\r
{\r
}\r
\r
/* Calculate the coordIndex property of the IndexedLineSet for a multipolygon\r
- This is not ideal -- would be really nice to just share this function with psurf, \r
+ This is not ideal -- would be really nice to just share this function with psurf,\r
but I'm not smart enough to do that yet*/\r
static size_t\r
asx3d3_mpoly_coordindex(const LWMPOLY *psur, char *output)\r
for (i=0; i<psur->ngeoms; i++)\r
{\r
patch = (LWPOLY *) psur->geoms[i];\r
- for (l=0; l < patch->nrings; l++){\r
+ for (l=0; l < patch->nrings; l++)\r
+ {\r
np = patch->rings[l]->npoints - 1;\r
- for(k=0; k < np ; k++)\r
+ for (k=0; k < np ; k++)\r
{\r
if (k)\r
{\r
j += k;\r
if (l < (patch->nrings - 1) )\r
{\r
- /** @todo TODO: Decide the best way to render holes\r
- * Evidentally according to my X3D expert the X3D consortium doesn't really \r
- * support holes and it's an issue of argument among many that feel it should. He thinks CAD x3d extensions to spec might.\r
- * What he has done and others developing X3D exports to simulate a hole is to cut around it.\r
- * So if you have a donut, you would cut it into half and have 2 solid polygons. Not really sure the best way to handle this.\r
- * For now will leave it as polygons stacked on top of each other -- which is what we are doing here and perhaps an option\r
- * to color differently. It's not ideal but the alternative sounds complicated.\r
- **/\r
- ptr += sprintf(ptr, " -1 "); //separator for each inner ring. Ideally we should probably triangulate and cut around as others do \r
+ /** @todo TODO: Decide the best way to render holes\r
+ * Evidentally according to my X3D expert the X3D consortium doesn't really\r
+ * support holes and it's an issue of argument among many that feel it should. He thinks CAD x3d extensions to spec might.\r
+ * What he has done and others developing X3D exports to simulate a hole is to cut around it.\r
+ * So if you have a donut, you would cut it into half and have 2 solid polygons. Not really sure the best way to handle this.\r
+ * For now will leave it as polygons stacked on top of each other -- which is what we are doing here and perhaps an option\r
+ * to color differently. It's not ideal but the alternative sounds complicated.\r
+ **/\r
+ ptr += sprintf(ptr, " -1 "); //separator for each inner ring. Ideally we should probably triangulate and cut around as others do\r
}\r
}\r
if (i < (psur->ngeoms - 1) )\r
{\r
patch = (LWPOLY *) psur->geoms[i];\r
np = patch->rings[0]->npoints - 1;\r
- for(k=0; k < np ; k++)\r
+ for (k=0; k < np ; k++)\r
{\r
if (k)\r
{\r
for (i=0; i<tin->ngeoms; i++)\r
{\r
ptr += asx3d3_triangle_buf(tin->geoms[i], 0, ptr, precision,\r
- opts, defid);\r
+ opts, defid);\r
if (i < (tin->ngeoms - 1) )\r
{\r
ptr += sprintf(ptr, " ");\r
{\r
if (FLAGS_NDIMS(pa->flags) == 2)\r
return (OUT_MAX_DIGS_DOUBLE + precision + sizeof(" "))\r
- * 2 * pa->npoints;\r
+ * 2 * pa->npoints;\r
\r
return (OUT_MAX_DIGS_DOUBLE + precision + sizeof(" ")) * 3 * pa->npoints;\r
}
\ No newline at end of file