[mapserver-commits] r9859 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Feb 22 10:06:08 EST 2010


Author: sdlime
Date: 2010-02-22 10:06:08 -0500 (Mon, 22 Feb 2010)
New Revision: 9859

Modified:
   trunk/mapserver/mapcopy.c
   trunk/mapserver/mapdraw.c
   trunk/mapserver/mapfile.c
   trunk/mapserver/mapgeomtransform.c
   trunk/mapserver/maplabel.c
   trunk/mapserver/mapserver.h
Log:
Initial implmentation of adding styleObj's into labelObj's (#3335)

Modified: trunk/mapserver/mapcopy.c
===================================================================
--- trunk/mapserver/mapcopy.c	2010-02-22 15:05:01 UTC (rev 9858)
+++ trunk/mapserver/mapcopy.c	2010-02-22 15:06:08 UTC (rev 9859)
@@ -247,7 +247,7 @@
 /***********************************************************************
  * msCopyLabel()                                                       *
  *                                                                     *
- * Copy a labelObj, using msCopyColor()                                *
+ * Copy a labelObj, using msCopyColor() and msCopyStyle()              *
  **********************************************************************/
 
 int msCopyLabel(labelObj *dst, labelObj *src) 
@@ -260,52 +260,80 @@
   }
   MS_COPYSTELEM(numbindings);
 
-    MS_COPYSTRING(dst->font, src->font);
-    MS_COPYSTELEM(type);
+  MS_COPYSTRING(dst->font, src->font);
+  MS_COPYSTELEM(type);
 
-    MS_COPYCOLOR(&(dst->color), &(src->color));
-    MS_COPYCOLOR(&(dst->outlinecolor), &(src->outlinecolor));
-    MS_COPYCOLOR(&(dst->shadowcolor), &(src->shadowcolor));
+  MS_COPYCOLOR(&(dst->color), &(src->color));
+  MS_COPYCOLOR(&(dst->outlinecolor), &(src->outlinecolor));
+  MS_COPYCOLOR(&(dst->shadowcolor), &(src->shadowcolor));
 
-    MS_COPYSTELEM(shadowsizex);
-    MS_COPYSTELEM(shadowsizey);
+  MS_COPYSTELEM(shadowsizex);
+  MS_COPYSTELEM(shadowsizey);
 
-    MS_COPYCOLOR(&(dst->backgroundcolor), &(src->backgroundcolor));
-    MS_COPYCOLOR(&(dst->backgroundshadowcolor), &(src->backgroundshadowcolor));
+  MS_COPYCOLOR(&(dst->backgroundcolor), &(src->backgroundcolor));
+  MS_COPYCOLOR(&(dst->backgroundshadowcolor), &(src->backgroundshadowcolor));
 
-    MS_COPYSTELEM(backgroundshadowsizex);
-    MS_COPYSTELEM(backgroundshadowsizey);
-    MS_COPYSTELEM(size);
-    MS_COPYSTELEM(minsize);
-    MS_COPYSTELEM(maxsize);
-    MS_COPYSTELEM(position);
-    MS_COPYSTELEM(offsetx);
-    MS_COPYSTELEM(offsety);
-    MS_COPYSTELEM(angle);
-    MS_COPYSTELEM(autoangle);    
-    MS_COPYSTELEM(autofollow);
-    MS_COPYSTELEM(buffer);
-    MS_COPYSTELEM(antialias);
-    MS_COPYSTELEM(wrap);
-    MS_COPYSTELEM(align);
-    MS_COPYSTELEM(maxlength);
-    MS_COPYSTELEM(minfeaturesize);
+  MS_COPYSTELEM(backgroundshadowsizex);
+  MS_COPYSTELEM(backgroundshadowsizey);
+  MS_COPYSTELEM(size);
+  MS_COPYSTELEM(minsize);
+  MS_COPYSTELEM(maxsize);
+  MS_COPYSTELEM(position);
+  MS_COPYSTELEM(offsetx);
+  MS_COPYSTELEM(offsety);
+  MS_COPYSTELEM(angle);
+  MS_COPYSTELEM(autoangle);    
+  MS_COPYSTELEM(autofollow);
+  MS_COPYSTELEM(buffer);
+  MS_COPYSTELEM(antialias);
+  MS_COPYSTELEM(wrap);
+  MS_COPYSTELEM(align);
+  MS_COPYSTELEM(maxlength);
+  MS_COPYSTELEM(minfeaturesize);
     
-    MS_COPYSTELEM(minscaledenom);
-    MS_COPYSTELEM(maxscaledenom);
+  MS_COPYSTELEM(minscaledenom);
+  MS_COPYSTELEM(maxscaledenom);
 
-    MS_COPYSTELEM(autominfeaturesize);
+  MS_COPYSTELEM(autominfeaturesize);
 
-    MS_COPYSTELEM(mindistance);
-    MS_COPYSTELEM(partials);
-    MS_COPYSTELEM(force);
-    MS_COPYSTELEM(priority);
+  MS_COPYSTELEM(mindistance);
+  MS_COPYSTELEM(partials);
+  MS_COPYSTELEM(force);
+  MS_COPYSTELEM(priority);
 
-    MS_COPYSTRING(dst->encoding, src->encoding);
+  MS_COPYSTRING(dst->encoding, src->encoding);
 
-    MS_COPYSTELEM(outlinewidth);
+  MS_COPYSTELEM(outlinewidth);
 
-    return MS_SUCCESS;
+  /* 
+  ** now the styles 
+  */
+
+  /* free any previous styles on the dst label */
+  for(i=0;i<dst->numstyles;i++) { /* each style */
+    if (dst->styles[i]!=NULL) {
+      if( freeStyle(dst->styles[i]) == MS_SUCCESS ) msFree(dst->styles[i]);
+    }
+  }
+  msFree(dst->styles);
+  dst->numstyles = 0;
+
+  for (i = 0; i < src->numstyles; i++) {
+    if (msGrowLabelStyles(dst) == NULL)
+      return MS_FAILURE;
+    if (initStyle(dst->styles[i]) != MS_SUCCESS) {
+      msSetError(MS_MEMERR, "Failed to init style.", "msCopyLabel()");
+      return MS_FAILURE;
+    }
+    if (msCopyStyle(dst->styles[i], src->styles[i]) != MS_SUCCESS) {
+      msSetError(MS_MEMERR, "Failed to copy style.", "msCopyLabel()");
+      return MS_FAILURE;
+    }
+    dst->numstyles++;
+  }
+
+
+  return MS_SUCCESS;
 }
 
 /***********************************************************************
@@ -428,8 +456,8 @@
 
     MS_COPYSTELEM(status);
 
-    /* free any previous styles on the dst layer*/
-    for(i=0;i<dst->numstyles;i++) { /* each style     */
+    /* free any previous styles on the dst layer */
+    for(i=0;i<dst->numstyles;i++) { /* each style */
       if (dst->styles[i]!=NULL) {
     	if( freeStyle(dst->styles[i]) == MS_SUCCESS ) {
           msFree(dst->styles[i]);

Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2010-02-22 15:05:01 UTC (rev 9858)
+++ trunk/mapserver/mapdraw.c	2010-02-22 15:06:08 UTC (rev 9859)
@@ -2164,7 +2164,7 @@
       else
     	msDrawTransformedShape(map, &map->symbolset, image, &nonClippedShape, curStyle, layer->scalefactor);
     }
-	if(hasGeomTransform)
+    if(hasGeomTransform)
       msFreeShape(&nonClippedShape);
 
     if(shape->text) {
@@ -2391,7 +2391,8 @@
       lineObj billboard_line;
       pointObj billboard_points[5];
 
-      labelCacheMemberObj *cachePtr=NULL;
+      markerCacheMemberObj *markerPtr=NULL; /* for santity */
+      labelCacheMemberObj *cachePtr=NULL;      
       layerObj *layerPtr=NULL;
       labelObj *labelPtr=NULL;
 
@@ -2399,8 +2400,10 @@
       int marker_offset_x, marker_offset_y, label_offset_x, label_offset_y;
       rectObj marker_rect;
       int label_mindistance=-1,
-          label_buffer=0, map_edge_buffer=0;
+      label_buffer=0, map_edge_buffer=0;
 
+      int needBillboard = MS_FALSE;
+
       const char *value;
 
 #ifdef USE_AGG
@@ -2425,8 +2428,7 @@
        */
       if((value = msLookupHashTable(&(map->web.metadata), "labelcache_map_edge_buffer")) != NULL) {
         map_edge_buffer = atoi(value);
-        if(map->debug)
-        msDebug("msDrawLabelCache(): labelcache_map_edge_buffer = %d\n", map_edge_buffer);
+        if(map->debug) msDebug("msDrawLabelCache(): labelcache_map_edge_buffer = %d\n", map_edge_buffer);
       }
 
       for(priority=MS_MAX_LABEL_PRIORITY-1; priority>=0; priority--) {
@@ -2437,6 +2439,9 @@
           double scalefactor,size;
           cachePtr = &(cacheslot->labels[l]); /* point to right spot in the label cache */
 
+          markerPtr = NULL;
+          if(cachePtr->markerid != -1) markerPtr = &(cacheslot->markers[cachePtr->markerid]); /* point to the right sport in the marker cache (if available) */
+
           layerPtr = (GET_LAYER(map, cachePtr->layerindex)); /* set a couple of other pointers, avoids nasty references */
           labelPtr = &(cachePtr->label);
 
@@ -2445,6 +2450,15 @@
 
           if(msGetLabelSize(image,cachePtr->text, labelPtr, &r, &(map->fontset), layerPtr->scalefactor, MS_TRUE,NULL) == -1)
             return(-1);
+
+          needBillboard = MS_FALSE;
+          if(MS_VALID_COLOR(labelPtr->backgroundcolor)) needBillboard = MS_TRUE;
+          for(i=0; i<labelPtr->numstyles; i++) {
+            if(labelPtr->styles[i]->_geomtransform == MS_GEOMTRANSFORM_LABELPOLY) {
+              needBillboard = MS_TRUE;
+              break;
+            }
+          }
           
           size = labelPtr->size * layerPtr->scalefactor;
           size = MS_MAX(size, labelPtr->minsize*image->resolutionfactor);
@@ -2461,7 +2475,7 @@
             continue; /* label too large relative to the feature */
 
           marker_offset_x = marker_offset_y = 0; /* assume no marker */
-          if((layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles > 0) || layerPtr->type == MS_LAYER_POINT) { /* there *is* a marker */
+          if(layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles > 0) { /* there might be a marker added to the image */
 
             /* TODO: at the moment only checks the bottom style, perhaps should check all of them */
             if(msGetMarkerSize(&map->symbolset, &(cachePtr->styles[0]), &marker_width, &marker_height, layerPtr->scalefactor) != MS_SUCCESS)
@@ -2474,6 +2488,12 @@
             marker_rect.miny = MS_NINT(cachePtr->point.y - .5 * marker_height);
             marker_rect.maxx = marker_rect.minx + (marker_width-1);
             marker_rect.maxy = marker_rect.miny + (marker_height-1); 
+          } else if (layerPtr->type == MS_LAYER_POINT) { /* there is a marker already in the image */
+            marker_rect = markerPtr->poly->bounds;
+            marker_width = marker_rect.maxx - marker_rect.minx;
+            marker_height = marker_rect.maxy - marker_rect.miny;
+            marker_offset_x = MS_NINT(marker_width/2.0);
+            marker_offset_y = MS_NINT(marker_height/2.0);
           }
 
           /* handle path following labels first (position does not matter) */
@@ -2519,7 +2539,7 @@
                 msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, label_buffer + map_edge_buffer, cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));
 
                 if(cachePtr->status) /* found a suitable place for this label */ {
-                  if(MS_VALID_COLOR(labelPtr->backgroundcolor))
+                  if(needBillboard)
                     get_metrics_line(&(cachePtr->point), positions[i], r, (marker_offset_x + label_offset_x), (marker_offset_y + label_offset_y), labelPtr->angle, 1, billboard.line);
                   break; /* ...out of position loop */
                 }
@@ -2529,7 +2549,7 @@
               if(labelPtr->force) {
 
                   /*billboard wasn't initialized if no non-coliding position was found*/
-                  if(!cachePtr->status && MS_VALID_COLOR(labelPtr->backgroundcolor))
+                  if(!cachePtr->status && needBillboard)
                       get_metrics_line(&(cachePtr->point), positions[npositions-1], r,
                               (marker_offset_x + label_offset_x),
                               (marker_offset_y + label_offset_y),
@@ -2544,11 +2564,11 @@
 
               if(labelPtr->position == MS_CC) { /* don't need the marker_offset */
                 p = get_metrics(&(cachePtr->point), labelPtr->position, r, label_offset_x, label_offset_y, labelPtr->angle, label_buffer, cachePtr->poly);
-                if(MS_VALID_COLOR(labelPtr->backgroundcolor))
+                if(needBillboard)
                   get_metrics_line(&(cachePtr->point), labelPtr->position, r, label_offset_x, label_offset_y, labelPtr->angle, 1, billboard.line);
               } else {
                 p = get_metrics(&(cachePtr->point), labelPtr->position, r, (marker_offset_x + label_offset_x), (marker_offset_y + label_offset_y), labelPtr->angle, label_buffer, cachePtr->poly);
-                if(MS_VALID_COLOR(labelPtr->backgroundcolor))
+                if(needBillboard)
                   get_metrics_line(&(cachePtr->point), labelPtr->position, r, (marker_offset_x + label_offset_x), (marker_offset_y + label_offset_y), labelPtr->angle, 1, billboard.line);
               }
   
@@ -2567,12 +2587,29 @@
           if(!cachePtr->status)
             continue; /* next label */
 
+          /* here's where we draw the label styles */
+          fprintf(stderr, "%d\n", cachePtr->label.numstyles);
+          if(cachePtr->label.numstyles > 0) {
+            for(i=0; i<cachePtr->label.numstyles; i++) {
+              fprintf(stderr, "gt=%d\n", cachePtr->label.styles[i]->_geomtransform);
+              if(cachePtr->label.styles[i]->_geomtransform == MS_GEOMTRANSFORM_LABELPOINT)
+                msDrawMarkerSymbol(&map->symbolset, image, &(cachePtr->point), cachePtr->label.styles[i], layerPtr->scalefactor);
+              else if(cachePtr->label.styles[i]->_geomtransform == MS_GEOMTRANSFORM_LABELPOLY) {
+                fprintf(stderr, "HERE!\n");
+                msDrawShadeSymbol(&map->symbolset, image, &billboard, cachePtr->label.styles[i], layerPtr->scalefactor);
+              } else {
+                /* need error msg about unsupported geomtransform */
+                return -1;
+              }
+            }
+          }
+
           if(layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles > 0) { /* need to draw a marker */
             for(i=0; i<cachePtr->numstyles; i++)
               msDrawMarkerSymbol(&map->symbolset, image, &(cachePtr->point), &(cachePtr->styles[i]), layerPtr->scalefactor);
           }
 
-          /*draw the background, only if we're not using FOLLOW labels*/
+          /*draw the background, only if we're not using FOLLOW labels -- THIS GOES AWAY*/
           if(!cachePtr->labelpath && MS_VALID_COLOR(labelPtr->backgroundcolor)) {
             styleObj style;
 
@@ -2595,6 +2632,7 @@
             msDrawText(image, p, cachePtr->text, labelPtr, &(map->fontset), layerPtr->scalefactor); /* actually draw the label */
           }
 
+          fprintf(stderr, "Finished %s, next label...\n", cachePtr->text);
 	} /* next label */
       } /* next priority */
 

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2010-02-22 15:05:01 UTC (rev 9858)
+++ trunk/mapserver/mapfile.c	2010-02-22 15:06:08 UTC (rev 9859)
@@ -63,6 +63,7 @@
 extern int loadSymbol(symbolObj *s, char *symbolpath); /* in mapsymbol.c */
 extern void writeSymbol(symbolObj *s, FILE *stream); /* in mapsymbol.c */
 static int loadGrid( layerObj *pLayer );
+static int loadStyle(styleObj *style);
 
 /*
 ** Symbol to string static arrays needed for writing map files.
@@ -1366,6 +1367,7 @@
   msFree(label->font);
   msFree(label->encoding);
 
+  fprintf(stderr, "in freeLabel %d\n", label->numstyles);
   for(i=0;i<label->numstyles;i++) { /* each style */
     if(label->styles[i]!=NULL) {
       if(freeStyle(label->styles[i]) == MS_SUCCESS) {
@@ -1489,9 +1491,7 @@
       if(getInteger(&(label->repeatdistance)) == -1) return(-1);
       break;
     case(MINFEATURESIZE):
-      if((symbol = getSymbol(2, MS_NUMBER,MS_AUTO)) == -1) 
-	return(-1);
-
+      if((symbol = getSymbol(2, MS_NUMBER,MS_AUTO)) == -1)  return(-1);
       if(symbol == MS_NUMBER)
 	label->minfeaturesize = (int)msyynumber;
       else
@@ -1568,6 +1568,15 @@
         return(-1);
 #endif
       break; 
+    case(STYLE):
+      if(msGrowLabelStyles(label) == NULL)
+        return(-1);
+      initStyle(label->styles[label->numstyles]);
+      if(loadStyle(label->styles[label->numstyles]) != MS_SUCCESS) return(-1);
+      if(label->styles[label->numstyles]->_geomtransform == MS_GEOMTRANSFORM_NONE) 
+        label->styles[label->numstyles]->_geomtransform = MS_GEOMTRANSFORM_LABELPOINT; /* set a default, a marker? */
+      label->numstyles++;
+      break;
     case(TYPE):
       if((label->type = getSymbol(2, MS_TRUETYPE,MS_BITMAP)) == -1) return(-1);
       break;    
@@ -2215,6 +2224,8 @@
 int freeStyle(styleObj *style) {
   int i;
 
+  fprintf(stderr, "%g\n", style->size);
+
   if( MS_REFCNT_DECR_IS_NOT_ZERO(style) ) { return MS_FAILURE; }
 
   msFree(style->symbolname);
@@ -2356,6 +2367,7 @@
   if (&(class->metadata)) msFreeHashItems(&(class->metadata));
   if (&(class->validation)) msFreeHashItems(&(class->validation));
   
+  fprintf(stderr, "in freeClass %d\n", class->numstyles);
   for(i=0;i<class->numstyles;i++) { /* each style */
     if(class->styles[i]!=NULL) {
       if(freeStyle(class->styles[i]) == MS_SUCCESS) {
@@ -4943,6 +4955,8 @@
       /* step through layers and classes to resolve symbol names */
       for(i=0; i<map->numlayers; i++) {
         for(j=0; j<GET_LAYER(map, i)->numclasses; j++) {
+
+          /* class styles */
 	  for(k=0; k<GET_LAYER(map, i)->class[j]->numstyles; k++) {
             if(GET_LAYER(map, i)->class[j]->styles[k]->symbolname) {
               if((GET_LAYER(map, i)->class[j]->styles[k]->symbol =  msGetSymbolIndex(&(map->symbolset), GET_LAYER(map, i)->class[j]->styles[k]->symbolname, MS_TRUE)) == -1) {
@@ -4951,6 +4965,17 @@
               }
             }
           }
+
+          /* label styles */
+          for(k=0; k<GET_LAYER(map, i)->class[j]->label.numstyles; k++) {
+            if(GET_LAYER(map, i)->class[j]->label.styles[k]->symbolname) {
+              if((GET_LAYER(map, i)->class[j]->label.styles[k]->symbol =  msGetSymbolIndex(&(map->symbolset), GET_LAYER(map, i)->class[j]->label.styles[k]->symbolname, MS_TRUE)) == -1) {
+                msSetError(MS_MISCERR, "Undefined symbol \"%s\" in class %d, label style %d of layer %s.", 
+                                       "msLoadMap()", GET_LAYER(map, i)->class[j]->label.styles[k]->symbolname, j, k, GET_LAYER(map, i)->name);
+                return MS_FAILURE;
+              }
+            }
+          }          
         }
       }
       

Modified: trunk/mapserver/mapgeomtransform.c
===================================================================
--- trunk/mapserver/mapgeomtransform.c	2010-02-22 15:05:01 UTC (rev 9858)
+++ trunk/mapserver/mapgeomtransform.c	2010-02-22 15:06:08 UTC (rev 9859)
@@ -44,9 +44,12 @@
   else if(!strncasecmp("bbox",transform,4)) {
     s->_geomtransform = MS_GEOMTRANSFORM_BBOX;
   }
-  else if(!strncasecmp("centroid",transform,8)) {
-    s->_geomtransform = MS_GEOMTRANSFORM_CENTROID;
+  else if(!strncasecmp("labelpnt",transform,8)) {
+    s->_geomtransform = MS_GEOMTRANSFORM_LABELPOINT;
   }
+  else if(!strncasecmp("labelpoly",transform,9)) {
+    s->_geomtransform = MS_GEOMTRANSFORM_LABELPOLY;
+  }
   else {
     s->_geomtransform = MS_GEOMTRANSFORM_NONE;
     msSetError(MS_MISCERR,"unknown transform expression","msStyleSetGeomTransform()");
@@ -170,9 +173,13 @@
           msDrawMarkerSymbol(symbolset,image,&centroid,style,scalefactor);
         }
       }
+      break;
+    case MS_GEOMTRANSFORM_LABELPOINT:
+    case MS_GEOMTRANSFORM_LABELPOLY:
+      break;
     default:
-     msSetError(MS_MISCERR, "unknown geomtransform", "msDrawTransformedShape()");
-     return MS_FAILURE;
+      msSetError(MS_MISCERR, "unknown geomtransform", "msDrawTransformedShape()");
+      return MS_FAILURE;
   }
   return MS_SUCCESS;
 }

Modified: trunk/mapserver/maplabel.c
===================================================================
--- trunk/mapserver/maplabel.c	2010-02-22 15:05:01 UTC (rev 9858)
+++ trunk/mapserver/maplabel.c	2010-02-22 15:06:08 UTC (rev 9859)
@@ -387,12 +387,14 @@
 
   cachePtr->text = strdup(string); /* the actual text */
 
+  /* TODO: perhaps we can get rid of this next section and just store a marker size? Why do we cache the styles for a point layer? */
+
   /* copy the styles (only if there is an accompanying marker)
    * We cannot simply keeep refs because the rendering code alters some members of the style objects
    */
   cachePtr->styles = NULL;
   cachePtr->numstyles = 0;
-  if((layerPtr->type == MS_LAYER_ANNOTATION && classPtr->numstyles > 0) || layerPtr->type == MS_LAYER_POINT) {
+  if(layerPtr->type == MS_LAYER_ANNOTATION && classPtr->numstyles > 0) {
     cachePtr->numstyles = classPtr->numstyles;
     cachePtr->styles = (styleObj *) malloc(sizeof(styleObj)*classPtr->numstyles);
     if (classPtr->numstyles > 0) {
@@ -404,9 +406,11 @@
   }
 
   /* copy the label */
-  cachePtr->label = *label; /* this copies all non-pointers */
-  if(label->font) cachePtr->label.font = strdup(label->font);
+  initLabel(&(cachePtr->label));
+  msCopyLabel(&(cachePtr->label), label);
 
+  cachePtr->markerid = -1;
+
   cachePtr->featuresize = featuresize;
 
   cachePtr->poly = (shapeObj *) malloc(sizeof(shapeObj));
@@ -447,6 +451,8 @@
     rect.maxy = rect.miny + (h-1);
     msRectToPolygon(rect, cacheslot->markers[i].poly);    
     cacheslot->markers[i].id = cacheslot->numlabels;
+ 
+    cachePtr->markerid = i;
 
     cacheslot->nummarkers++;
   }

Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h	2010-02-22 15:05:01 UTC (rev 9858)
+++ trunk/mapserver/mapserver.h	2010-02-22 15:06:08 UTC (rev 9859)
@@ -947,6 +947,8 @@
 #ifndef SWIG
   labelPathObj *labelpath;  /* Path & bounds of curved labels.  Bug #1620 implementation */
 #endif /* SWIG */
+
+  int markerid; /* corresponding marker (POINT layers only) */
   
 } labelCacheMemberObj;
 
@@ -2475,16 +2477,20 @@
 /* ==================================================================== */
 
 /* ==================================================================== */
-/*      prototypes for functions in mapgeomtransform.c                        */
+/*      prototypes for functions in mapgeomtransform.c                  */
 /* ==================================================================== */
-#define MS_GEOMTRANSFORM_NONE 0
-#define MS_GEOMTRANSFORM_START 1
-#define MS_GEOMTRANSFORM_END 2
-#define MS_GEOMTRANSFORM_VERTICES 3
-#define MS_GEOMTRANSFORM_BBOX 4
-#define MS_GEOMTRANSFORM_CENTROID 5
-#define MS_GEOMTRANSFORM_BUFFER 6
-#define MS_GEOMTRANSFORM_CONVEXHULL 7
+enum MS_GEOMTRANSFORM_TYPE {
+  MS_GEOMTRANSFORM_NONE,
+  MS_GEOMTRANSFORM_START,
+  MS_GEOMTRANSFORM_END,
+  MS_GEOMTRANSFORM_VERTICES,
+  MS_GEOMTRANSFORM_BBOX,
+  MS_GEOMTRANSFORM_CENTROID,
+  MS_GEOMTRANSFORM_BUFFER,
+  MS_GEOMTRANSFORM_CONVEXHULL,
+  MS_GEOMTRANSFORM_LABELPOINT,
+  MS_GEOMTRANSFORM_LABELPOLY
+};
 
 MS_DLL_EXPORT int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image, shapeObj *shape, styleObj *style, double scalefactor);
 MS_DLL_EXPORT void msStyleSetGeomTransform(styleObj *style, char *transform);



More information about the mapserver-commits mailing list