[mapserver-commits] r9168 - sandbox/davidK

svn at osgeo.org svn at osgeo.org
Sat Jul 11 16:52:27 EDT 2009


Author: davidK
Date: 2009-07-11 16:52:26 -0400 (Sat, 11 Jul 2009)
New Revision: 9168

Modified:
   sandbox/davidK/mapcairo.c
   sandbox/davidK/mapdraw.c
   sandbox/davidK/mapio.c
   sandbox/davidK/mapio.h
   sandbox/davidK/mapogl.cpp
   sandbox/davidK/mapoutput.c
   sandbox/davidK/mapserver.h
Log:
Added KML output format

Modified: sandbox/davidK/mapcairo.c
===================================================================
--- sandbox/davidK/mapcairo.c	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapcairo.c	2009-07-11 20:52:26 UTC (rev 9168)
@@ -691,12 +691,13 @@
 
 
 
-void startNewLayerCairo(imageObj *img, double opacity) {
+void startNewLayerCairo(imageObj *img, layerObj *layer) {
 	cairo_renderer *r = getCairoRenderer(img);
 	cairo_push_group (r->cr);
 }
 
-void closeNewLayerCairo(imageObj *img, double opacity) {
+void closeNewLayerCairo(imageObj *img, layerObj *layer) {
+	double opacity = layer->opacity * 0.01;
 	cairo_renderer *r = getCairoRenderer(img);
 	cairo_pop_group_to_source (r->cr);
 	cairo_paint_with_alpha (r->cr, opacity);

Modified: sandbox/davidK/mapdraw.c
===================================================================
--- sandbox/davidK/mapdraw.c	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapdraw.c	2009-07-11 20:52:26 UTC (rev 9168)
@@ -836,7 +836,7 @@
 		  /* deref and possibly free temporary transparent output format.  */
 		  msApplyOutputFormat( &transFormat, NULL, MS_NOOVERRIDE, MS_NOOVERRIDE, MS_NOOVERRIDE );
 	  } else {
-		  renderer->closeNewLayer(image_draw,layer->opacity*0.01);
+		  renderer->closeNewLayer(image_draw,layer);
 	  }
   }
 #ifdef USE_AGG

Modified: sandbox/davidK/mapio.c
===================================================================
--- sandbox/davidK/mapio.c	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapio.c	2009-07-11 20:52:26 UTC (rev 9168)
@@ -37,6 +37,10 @@
 #include <io.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 MS_CVSID("$Id$")
 
 static int is_msIO_initialized = MS_FALSE;
@@ -986,3 +990,8 @@
 
     return 0;
 }
+
+#ifdef __cplusplus
+}
+#endif
+

Modified: sandbox/davidK/mapio.h
===================================================================
--- sandbox/davidK/mapio.h	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapio.h	2009-07-11 20:52:26 UTC (rev 9168)
@@ -32,6 +32,10 @@
 
 #define USE_MAPIO
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if defined(USE_FASTCGI) && !defined(USE_MAPIO)
 #define USE_MAPIO
 #endif
@@ -117,4 +121,8 @@
 int msIO_needBinaryStdout( void );
 int msIO_needBinaryStdin( void );
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* nef MAPIO_H */

Modified: sandbox/davidK/mapogl.cpp
===================================================================
--- sandbox/davidK/mapogl.cpp	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapogl.cpp	2009-07-11 20:52:26 UTC (rev 9168)
@@ -201,12 +201,13 @@
 	img->img.plugin=NULL;
 }
 
-void msStartNewLayerOgl(imageObj *img, double opacity)
+void msStartNewLayerOgl(imageObj *img, layerObj *layer)
 {
-	getOglRenderer(img)->setTransparency(opacity/100);
+	double opacity = layer->opacity/100;
+	getOglRenderer(img)->setTransparency(opacity);
 }
 
-void msCloseNewLayerOgl(imageObj *img, double opacity)
+void msCloseNewLayerOgl(imageObj *img, layerObj *layer)
 {
 	getOglRenderer(img)->setTransparency(1.0);
 }

Modified: sandbox/davidK/mapoutput.c
===================================================================
--- sandbox/davidK/mapoutput.c	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapoutput.c	2009-07-11 20:52:26 UTC (rev 9168)
@@ -268,7 +268,16 @@
     } 
 #endif 
  
-    
+#if defined(USE_KML) 
+    if( strcasecmp(driver,"KML") == 0 ) 
+    { 
+        format = msAllocOutputFormat( map, "kml", driver ); 
+        format->mimetype = strdup("application/vnd.google-earth.kml+xml"); 
+        format->imagemode = MS_IMAGEMODE_RGB; 
+        format->extension = strdup("kml"); 
+        format->renderer = MS_RENDER_WITH_KML; 
+    } 
+#endif     
 
 #ifdef USE_MING_FLASH
     if( strcasecmp(driver,"swf") == 0 )
@@ -1023,6 +1032,8 @@
             return msPopulateRendererVTableCairoSVG(format->vtable);
         case MS_RENDER_WITH_OGL:
             return msPopulateRendererVTableOGL(format->vtable);
+        case MS_RENDER_WITH_KML:
+            return msPopulateRendererVTableKML(format->vtable);
         default:
             msSetError(MS_MISCERR, "unsupported RendererVtable renderer %d",
                     "msInitializeRendererVTable()",format->renderer);

Modified: sandbox/davidK/mapserver.h
===================================================================
--- sandbox/davidK/mapserver.h	2009-07-11 20:51:02 UTC (rev 9167)
+++ sandbox/davidK/mapserver.h	2009-07-11 20:52:26 UTC (rev 9168)
@@ -70,10 +70,14 @@
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #  define MS_DLL_EXPORT     __declspec(dllexport)
+#if (_MSC_VER == 1500)
+#define inline __inline
+#endif
 #else
 #define  MS_DLL_EXPORT
 #endif
 
+
 /* definition of  ms_int32/ms_uint32 */
 #include <limits.h>
 #if ULONG_MAX == 0xffffffff
@@ -321,6 +325,7 @@
 #define MS_RENDER_WITH_CAIRO_PDF 10
 #define MS_RENDER_WITH_CAIRO_SVG 11
 #define MS_RENDER_WITH_OGL      12
+#define MS_RENDER_WITH_KML      13
 
 #define MS_RENDERER_GD(format)  ((format)->renderer == MS_RENDER_WITH_GD)
 #define MS_RENDERER_SWF(format) ((format)->renderer == MS_RENDER_WITH_SWF)
@@ -2498,6 +2503,7 @@
 MS_DLL_EXPORT int msPopulateRendererVTableCairoSVG( rendererVTableObj *renderer );
 MS_DLL_EXPORT int msPopulateRendererVTableCairoPDF( rendererVTableObj *renderer );
 MS_DLL_EXPORT int msPopulateRendererVTableOGL( rendererVTableObj *renderer );
+MS_DLL_EXPORT int msPopulateRendererVTableKML( rendererVTableObj *renderer );
 
 //allocate 50k for starters
 #define MS_DEFAULT_BUFFER_ALLOC 50000
@@ -2575,8 +2581,8 @@
     int (*getTruetypeTextBBox)(imageObj *img,char *font, double size, char *string,
     		rectObj *rect, double **advances);
     
-	void (*startNewLayer)(imageObj *img, double opacity);
-	void (*closeNewLayer)(imageObj *img, double opacity);
+	void (*startNewLayer)(imageObj *img, layerObj *layer);
+	void (*closeNewLayer)(imageObj *img, layerObj *layer);
 	
     void (*transformShape)(shapeObj *shape, rectObj extend, double cellsize);
     void (*freeImage)(imageObj *image);



More information about the mapserver-commits mailing list