Permalink
Browse files

Fixes for UTFGrid merge into master, tests added (#4765)

  • Loading branch information...
tbonfort committed Sep 25, 2013
1 parent f0a45de commit e208e844e828e6a89195ba93c23b0390cc3b331a
Showing with 1,904 additions and 2,116 deletions.
  1. +0 −6 CMakeLists.txt
  2. +0 −1 mapagg.cpp
  3. +5 −38 mapagg.h
  4. +0 −153 mapaggcommon.h
  5. +1,892 −1,897 maplexer.c
  6. +1 −1 mapoutput.c
  7. +5 −19 maputfgrid.cpp
  8. +1 −1 msautotest
View
@@ -130,7 +130,6 @@ option(WITH_SDE_PLUGIN "include ArcSDE support as a plugin (must specify SDE_INC
option(WITH_SDE "include ArcSDE support. Add -DSDE_VERSION=91 to use 9.1 arcSDE version" OFF)
option(WITH_EXEMPI "include xmp output metadata support" OFF)
option(WITH_XMLMAPFILE "include native xml mapfile support (requires libxslt/libexslt)" OFF)
-option(WITH_AGG_ALIASED "turn off antialising on AGG" OFF)
option(BUILD_STATIC "Also build a static version of mapserver" OFF)
option(LINK_STATIC_LIBMAPSERVER "Link to static version of libmapserver (also for mapscripts)" OFF)
@@ -342,10 +341,6 @@ if(WITH_ICONV)
endif(ICONV_FOUND)
endif (WITH_ICONV)
-if(WITH_AGG_ALIASED)
- set (AGG_ALIASED_ENABLED 1)
-endif(WITH_AGG_ALIASED)
-
if(WITH_GENERIC_NINT)
set(USE_GENERIC_MS_NINT 1)
endif(WITH_GENERIC_NINT)
@@ -867,7 +862,6 @@ status_optional_feature("WCS SERVER" "${USE_WCS_SVR}")
status_optional_feature("SOS SERVER" "${USE_SOS_SVR}")
status_optional_feature("WMS CLIENT" "${USE_WMS_LYR}")
status_optional_feature("WFS CLIENT" "${USE_WFS_LYR}")
-status_optional_feature("AGG ALISING" "${AGG_ALIASED_ENABLED}")
status_optional_feature("ICONV" "${USE_ICONV}")
status_optional_feature("Thread-safety support" "${USE_THREAD}")
status_optional_feature("KML output" "${USE_KML}")
View
@@ -30,7 +30,6 @@
#include "mapserver.h"
#include "fontcache.h"
#include "mapagg.h"
-#include "mapaggcommon.h"
#include <assert.h>
#include "renderers/agg/include/agg_color_rgba.h"
#include "renderers/agg/include/agg_pixfmt_rgba.h"
View
@@ -4,6 +4,7 @@
* Project: MapServer
* Purpose: AGG template library types.
* Author: John Novak (jnovak@novacell.com)
+ * Author: Thomas Bonfort (tbonfort@terriscope.fr)
*
******************************************************************************
* Copyright (c) 1996-2007 Regents of the University of Minnesota.
@@ -27,7 +28,7 @@
* DEALINGS IN THE SOFTWARE.
******************************************************************************/
-#include "renderers/agg/include/agg_rendering_buffer.h"
+#include "renderers/agg/include/agg_path_storage.h"
/*
* interface to a shapeObj representing lines, providing the functions
@@ -75,31 +76,14 @@ class line_adaptor
return vertex(x,y); /*this will return the first point of the next line*/
}
-private:
+protected:
shapeObj *s;
lineObj *m_line, /*current line pointer*/
*m_lend; /*points to after the last line*/
pointObj *m_point, /*current point*/
*m_pend; /*points to after last point of current line*/
};
-class offset_line_adaptor: public line_adaptor
-{
-public:
- offset_line_adaptor(shapeObj *shape, double ox, double oy):line_adaptor(shape),ox(ox),oy(oy) {
- }
-
- unsigned vertex(double* x, double* y) {
- unsigned ret = line_adaptor::vertex(x,y);
- *x+=ox;
- *y+=oy;
- return ret;
- }
-private:
- double ox,oy;
-};
-
-
class polygon_adaptor
{
@@ -154,7 +138,7 @@ class polygon_adaptor
* of the shape. return the command to stop processing this shape*/
return mapserver::path_cmd_stop;
}
-private:
+protected:
shapeObj *s;
double ox,oy;
lineObj *m_line, /*pointer to current line*/
@@ -164,21 +148,4 @@ class polygon_adaptor
bool m_stop; /*should next call return stop command*/
};
-class offset_polygon_adaptor: public polygon_adaptor
-{
-public:
- offset_polygon_adaptor(shapeObj *shape, double ox, double oy):polygon_adaptor(shape),ox(ox),oy(oy) {
- }
-
- unsigned vertex(double* x, double* y) {
- unsigned ret = polygon_adaptor::vertex(x,y);
- *x+=ox;
- *y+=oy;
- return ret;
- }
-private:
- double ox,oy;
-};
-
-
-
+mapserver::path_storage imageVectorSymbol(symbolObj *);
View
@@ -1,153 +0,0 @@
-/******************************************************************************
- * $Id$
- *
- * Project: MapServer
- * Purpose: UTFGrid and AGG common ressources
- * Author: Francois Desjarlais
- *
- ******************************************************************************
- * Copyright (c) 1996-2007 Regents of the University of Minnesota.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies of this Software or works derived from this Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include "renderers/agg/include/agg_path_storage.h"
-
-/*
- * interface to a shapeObj representing lines, providing the functions
- * needed by the agg rasterizer. treats shapeObjs with multiple linestrings.
- */
-class line_adaptor
-{
-public:
- line_adaptor(shapeObj *shape):s(shape) {
- m_line=s->line; /*first line*/
- m_point=m_line->point; /*current vertex is first vertex of first line*/
- m_lend=&(s->line[s->numlines]); /*pointer to after last line*/
- m_pend=&(m_line->point[m_line->numpoints]); /*pointer to after last vertex of first line*/
- }
-
- /* a class with virtual functions should also provide a virtual destructor */
- virtual ~line_adaptor() {}
-
- void rewind(unsigned) {
- m_line=s->line; /*first line*/
- m_point=m_line->point; /*current vertex is first vertex of first line*/
- m_pend=&(m_line->point[m_line->numpoints]); /*pointer to after last vertex of first line*/
- }
-
- virtual unsigned vertex(double* x, double* y) {
- if(m_point < m_pend) {
- /*here we treat the case where a real vertex is returned*/
- bool first = m_point == m_line->point; /*is this the first vertex of a line*/
- *x = m_point->x;
- *y = m_point->y;
- m_point++;
- return first ? mapserver::path_cmd_move_to : mapserver::path_cmd_line_to;
- }
- /*if here, we're at the end of a line*/
- m_line++;
- *x = *y = 0.0;
- if(m_line>=m_lend) /*is this the last line of the shapObj. normally,
- (m_line==m_lend) should be a sufficient test, as the caller should not call
- this function if a previous call returned path_cmd_stop.*/
- return mapserver::path_cmd_stop; /*no more points to process*/
-
- /*if here, there are more lines in the shapeObj, continue with next one*/
- m_point=m_line->point; /*pointer to first point of next line*/
- m_pend=&(m_line->point[m_line->numpoints]); /*pointer to after last point of next line*/
-
- return vertex(x,y); /*this will return the first point of the next line*/
- }
-protected:
- shapeObj *s;
- lineObj *m_line, /*current line pointer*/
- *m_lend; /*points to after the last line*/
- pointObj *m_point, /*current point*/
- *m_pend; /*points to after last point of current line*/
-};
-
-class polygon_adaptor
-{
-public:
- polygon_adaptor(shapeObj *shape):s(shape),m_stop(false) {
- m_line=s->line; /*first lines*/
- m_point=m_line->point; /*first vertex of first line*/
- m_lend=&(s->line[s->numlines]); /*pointer to after last line*/
- m_pend=&(m_line->point[m_line->numpoints]); /*pointer to after last vertex of first line*/
- }
-
- /* a class with virtual functions should also provide a virtual destructor */
- virtual ~polygon_adaptor() {}
-
- void rewind(unsigned) {
- /*reset pointers*/
- m_stop=false;
- m_line=s->line;
- m_point=m_line->point;
- m_pend=&(m_line->point[m_line->numpoints]);
- }
-
- virtual unsigned vertex(double* x, double* y) {
- if(m_point < m_pend) {
- /*if here, we have a real vertex*/
- bool first = m_point == m_line->point;
- *x = m_point->x;
- *y = m_point->y;
- m_point++;
- return first ? mapserver::path_cmd_move_to : mapserver::path_cmd_line_to;
- }
- *x = *y = 0.0;
- if(!m_stop) {
- /*if here, we're after the last vertex of the current line
- * we return the command to close the current polygon*/
- m_line++;
- if(m_line>=m_lend) {
- /*if here, we've finished all the vertexes of the shape.
- * we still return the command to close the current polygon,
- * but set m_stop so the subsequent call to vertex() will return
- * the stop command*/
- m_stop=true;
- return mapserver::path_cmd_end_poly;
- }
- /*if here, there's another line in the shape, so we set the pointers accordingly
- * and return the command to close the current polygon*/
- m_point=m_line->point; /*first vertex of next line*/
- m_pend=&(m_line->point[m_line->numpoints]); /*pointer to after last vertex of next line*/
- return mapserver::path_cmd_end_poly;
- }
- /*if here, a previous call to vertex informed us that we'd consumed all the vertexes
- * of the shape. return the command to stop processing this shape*/
- return mapserver::path_cmd_stop;
- }
-protected:
- shapeObj *s;
- double ox,oy;
- lineObj *m_line, /*pointer to current line*/
- *m_lend; /*pointer to after last line of the shape*/
- pointObj *m_point, /*pointer to current vertex*/
- *m_pend; /*pointer to after last vertex of current line*/
- bool m_stop; /*should next call return stop command*/
-};
-
-/*
- * Function that allow vector symbol to be stored in a AGG path storage.
- */
-mapserver::path_storage imageVectorSymbol(symbolObj *);
-
Oops, something went wrong.

0 comments on commit e208e84

Please sign in to comment.