Commit 081b030e authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 7.0.0~beta1

parent 93aca188
.gitattributes export-ignore
.gitignore export-ignore
build
*.swp
nbproject
tags
tests/map.png
language: php
php:
- 5.5
- 5.6
env:
global:
......@@ -38,14 +39,24 @@ env:
compiler:
- gcc
- clang
before_install:
- mkdir tmp
- cd tmp
- wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.38.tar.bz2
- tar xjf harfbuzz-0.9.38.tar.bz2
- cd harfbuzz-0.9.38
- ./configure --without-cairo --without-glib --without-icu
- make -j3
- sudo make install && sudo ldconfig
- cd ../..
- git submodule update --init --recursive
- sudo mv /etc/apt/sources.list.d/pgdg-source.list* /tmp
- sudo apt-get -qq remove postgis
- sudo apt-get remove postgis libpq5 libpq-dev postgresql-9.1-postgis postgresql-9.2-postgis postgresql-9.3-postgis postgresql-9.1 postgresql-9.2 postgresql-9.3 libgdal1
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
- sudo apt-get update -qq
- sudo apt-get install -qq bison flex swig cmake librsvg2-dev colordiff postgis postgresql-9.1-postgis-2.0-scripts libpq-dev libpng12-dev libjpeg-dev libgif-dev libgeos-dev libgd2-xpm-dev libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libgdal1-dev libproj-dev libxml2-dev python-dev php5-dev libexempi-dev lcov lftp
- sudo apt-get update
- sudo apt-get install bison flex python-lxml libfribidi-dev swig cmake librsvg2-dev colordiff postgis postgresql-9.1 postgresql-9.1-postgis-2.1 postgresql-9.1-postgis-2.1-scripts libpq-dev libpng12-dev libjpeg-dev libgif-dev libgeos-dev libgd2-xpm-dev libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libgdal1-dev libproj-dev libxml2-dev python-dev php5-dev libexempi-dev lcov lftp
- sudo pip install git+git://github.com/tbonfort/cpp-coveralls.git@extensions
- cd msautotest
- ./create_postgis_test_data.sh
......@@ -58,7 +69,7 @@ before_install:
script:
- ./run-test-suite.sh
after_success:
after_success:
# Only run coverage when it is safe to do so (not on pull requests), and only on master branch
- echo "$TRAVIS_SECURE_ENV_VARS"
- echo "$TRAVIS_BRANCH"
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ sean Sean Gillies sgillies at frii.com SWIG Ma
assefa Assefa Yewondwossen assefay at gmail.com OGC Web Services, PHP MapScript
julien Julien-Samuel Lacroix jlacroix at dmsolutions.ca OGC Web Services
warmerdam Frank Warmerdam warmerdam at pobox.com Raster, outputFormatObj,
hobu Howard Butler hobu.inc at gmail.com mapsde.c
hobu Howard Butler howard at hobu.co docs
pramsey Paul Ramsey pramsey at cleverelephant.ca mappostgis.c, maptile.c
jerryp Jerry Pisk jerry.pisk at gmail.com
ned Ned Harding nharding at extendthereach.com
......@@ -17,8 +17,8 @@ novak John Novak hetzerrrat gmail.com mapgrat
jani Jani Averbach javerbach extendthereach com External Plugin Layers
tamas Tamas Szekeres szekerest at gmail.com MapScript C#
umberto Umberto Nicoletti umberto.nicoletti at gmail.com MapScript Java
tomkralidis Tom Kralidis tomkralidis at hotmail.com OGC, Perl Mapscript
tbonfort Thomas Bonfort thomas.bonfort at gmail.com AGG, Charting
tomkralidis Tom Kralidis tomkralidis at gmail.com OGC, Perl Mapscript
tbonfort Thomas Bonfort tbonfort at terriscope.fr AGG, Charting, Core Maintenance
jmckenna Jeff McKenna jmckenna at gatewaygeomatics.com Documentation
aboudreault Alan Boudreault aboudreault at mapgears.com OGR, general bug fixes
toby Toby Rahilly toby.rahilly at gmail.com OpenGL
......
......@@ -2,17 +2,50 @@
MapServer Revision History
==========================
$Id$
This is a human-readable revision history which will attempt to document
required changes for users to migrate from one version of MapServer to the
next. Developers are strongly encouraged to document their changes and
their impacts on the users here. (Please add the most recent changes to
their impacts on the users here. (Please add the most recent changes to
the top of the list.)
For a complete change history, please see the Git log comments.
6.4 release (2013/09/xx)
7.0.0-beta1 release (2014/02/12)
--------------------------------
- RFC91 Layer Filter Normalization
- Implement WCS20 Extensions (#4898)
- Require validation of ExternalGraphic OnlineResource (#4883)
- Require validation on the CGI queryfile parameter. (#4874)
- Apply RFC86 scaletoken substitutions to layer->PROCESSING entries
- RFC113 Layer Compositing Pipeline
- RFC109 Optimizing Runtime Substitutions
- RFC108 Heatmap / Kernel-Density Layers
- RFC106 Support of Geomtransform JavaScript Plugin
- RFC105 Support for WFS 2.0 (server side)
- RFC104 Bitmap Label removal, replaced with inlined truetype font
- RFC103 Layer Level Character Encoding
- RFC102 Support of Styleitem JavaScript Plugin
- RFC99 GD removal
- RFC98 Complex Text Rendering / Text Rendering Overhaul
- RFC93 UTF Grid Support
6.4 release (2013/09/17)
---------------------------
- RFC 101: Support for Content Dependant Legend Rendering
......
......@@ -119,12 +119,15 @@ default (in which case the cmake step will fail if the dependency cannot be foun
of these can be enabled or disabled by passing "-DWITH_XXX=0" or "-DWITH_XXX=1" to the
"cmake .." invocation in order to override a default selection.
This Readme file may be out of sync with the actual CMakeLists files shipped.
Refer to the CMakeLists.txt file for up-to-date options.
- option(WITH_PROJ "Choose if reprojection support should be built in" ON)
- option(WITH_KML "Enable native KML output support (requires libxml2 support)" OFF)
- option(WITH_SOS "Enable SOS Server support (requires PROJ and libxml2 support)" OFF)
- option(WITH_WMS "Enable WMS Server support (requires proj support)" ON)
- option(WITH_GD "Choose if (old) GD support should be built in" OFF)
- option(WITH_FRIBIDI "Choose if FriBidi glyph shaping support should be built in (usefull for left-to-right languages)" ON)
- option(WITH_FRIBIDI "Choose if FriBidi glyph reordering should be enabled (usefull for left-to-right languages)(requires harfbuzz)" ON)
- option(WITH_HARFBUZZ "Choose if Harfbuzz complex script glyph shaping support should be built in (requires fribidi)" ON)
- option(WITH_ICONV "Choose if Iconv Internationalization support should be built in" ON)
- option(WITH_CAIRO "Choose if CAIRO rendering support should be built in (required for SVG and PDF output)" ON)
- option(WITH_SVGCAIRO "Choose if SVG symbology support (via libsvgcairo) should be built in (requires cairo, libsvg, libsvg-cairo. Incompatible with librsvg)" OFF)
......@@ -156,6 +159,7 @@ of these can be enabled or disabled by passing "-DWITH_XXX=0" or "-DWITH_XXX=1"
- 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_V8 "include javacript v8 scripting" OFF)
The following options are for advanced users, i.e. you should not enable them unless
......
......@@ -6,10 +6,10 @@ BUILDPATH=../../build
FLEX=flex
YACC=yacc
CMAKEFLAGS=-DCMAKE_C_FLAGS="--coverage" -DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="-lgcov" -DWITH_GD=1 -DWITH_CLIENT_WMS=1 \
-DCMAKE_SHARED_LINKER_FLAGS="-lgcov" -DWITH_CLIENT_WMS=1 \
-DWITH_CLIENT_WFS=1 -DWITH_KML=1 -DWITH_SOS=1 -DWITH_PHP=1 \
-DWITH_PYTHON=1 -DWITH_JAVA=1 -DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=0 -DWITH_FCGI=0 -DWITH_EXEMPI=1 \
-DCMAKE_BUILD_TYPE=Release -DWITH_RSVG=1 -DWITH_CURL=1
-DWITH_PYTHON=1 -DWITH_JAVA=1 -DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=1 -DWITH_FCGI=0 -DWITH_EXEMPI=1 \
-DCMAKE_BUILD_TYPE=Release -DWITH_RSVG=1 -DWITH_CURL=1 -DWITH_HARFBUZZ=1 -DWITH_POINT_Z_M=1
all: cmakebuild
cmakebuild: lexer parser
......@@ -50,7 +50,6 @@ test: autotest-install cmakebuild
@$(MAKE) $(MFLAGS) wxs-testcase renderers-testcase misc-testcase gdal-testcase query-testcase mspython-testcase
@./print-test-results.sh
@$(MAKE) $(MFLAGS) php-testcase
@$(MAKE) $(MFLAGS) java-testcase
lexer: maplexer.c
......
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'socket'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = "mapserver-vagrant"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 1024, "--cpus", 2]
v.customize ["modifyvm", :id, "--ioapic", "on", "--largepages", "off", "--vtxvpid", "off"]
v.name = "mapserver-vagrant"
end
config.vm.provision "shell", path: "scripts/vagrant/virtualbox-fix.sh"
config.vm.provision "shell", path: "scripts/vagrant/packages.sh"
config.vm.provision "shell", path: "scripts/vagrant/postgis.sh"
config.vm.provision "shell", path: "scripts/vagrant/mapserver.sh"
end
......@@ -130,6 +130,7 @@ int loadParams(cgiRequestObj *request,
if(getenv2("REQUEST_METHOD", thread_context)==NULL) {
msIO_printf("This script can only be used to decode form results and \n");
msIO_printf("should be initiated as a CGI process via a httpd server.\n");
msIO_printf("For other options please try using the --help switch.\n");
return -1;
}
......@@ -386,33 +387,15 @@ int rind(char *s, char c)
return -1;
}
int _getline(char *s, int n, FILE *f)
{
register int i=0;
while(1) {
s[i] = (char)fgetc(f);
if(s[i] == CR)
s[i] = fgetc(f);
if((s[i] == 0x4) || (s[i] == LF) || (i == (n-1))) {
s[i] = '\0';
return (feof(f) ? 1 : 0);
}
++i;
}
}
void send_fd(FILE *f, FILE *fd)
{
char c;
int c;
while (1) {
c = fgetc(f);
if(feof(f))
if(c == EOF)
return;
fputc(c,fd);
fputc((char)c,fd);
}
}
......
......@@ -87,7 +87,6 @@ MS_DLL_EXPORT char x2c(char *);
MS_DLL_EXPORT void unescape_url(char *);
MS_DLL_EXPORT void plustospace(char *);
MS_DLL_EXPORT int rind(char *, char);
MS_DLL_EXPORT int _getline(char *, int, FILE *);
MS_DLL_EXPORT void send_fd(FILE *, FILE *);
MS_DLL_EXPORT int ind(char *, char);
MS_DLL_EXPORT void escape_shell_cmd(char *);
......
......@@ -24,9 +24,8 @@ find_program(HTTPD_EXECUTABLE NAMES httpd
)
if(APXS_BIN)
EXEC_PROGRAM(${APXS_BIN}
ARGS -q LIBEXECDIR
OUTPUT_VARIABLE APACHE_MODULE_DIR )
EXECUTE_PROCESS(COMMAND ${APXS_BIN} -q LIBEXECDIR
OUTPUT_VARIABLE APACHE_MODULE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
endif(APXS_BIN)
include(FindPackageHandleStandardArgs)
......
# Original Licence:
# Copyright (c) 2012, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Intel Corporation nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Try to find Harfbuzz include and library directories.
#
# After successful discovery, this will set for inclusion where needed:
# HARFBUZZ_INCLUDE_DIR - containg the HarfBuzz headers
# HARFBUZZ_LIBRARY - containg the HarfBuzz library
include(FindPkgConfig)
pkg_check_modules(PC_HARFBUZZ harfbuzz>=0.9.18)
find_path(HARFBUZZ_INCLUDE_DIR NAMES hb.h
HINTS ${PC_HARFBUZZ_INCLUDE_DIRS} ${PC_HARFBUZZ_INCLUDEDIR}
PATH_SUFFIXES harfbuzz
)
find_library(HARFBUZZ_LIBRARY NAMES harfbuzz
HINTS ${PC_HARFBUZZ_LIBRARY_DIRS} ${PC_HARFBUZZ_LIBDIR}
)
set(HARFBUZZ_INCLUDE_DIRS ${HARFBUZZ_INCLUDE_DIR})
set(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HarfBuzz DEFAULT_MSG HARFBUZZ_INCLUDE_DIR HARFBUZZ_LIBRARY)
mark_as_advanced(HARFBUZZ_LIBRARY HARFBUZZ_INCLUDE_DIR)
......@@ -37,8 +37,8 @@ if(DEFINED ENV{ORACLE_HOME})
${ORACLE_HOME}/OCI/include) # Oracle XE on Windows
set(ORACLE_OCI_NAMES clntsh libclntsh oci)
set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 ociw32)
set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11)
set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 nnz12 libnnz12 ociw32)
set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11 oraocci12)
set(ORACLE_LIB_DIR
${ORACLE_HOME}
......
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_PIXMAN pixman)
if(NOT PC_PIXMAN_FOUND)
PKG_CHECK_MODULES(PC_PIXMAN pixman-1)
endif(NOT PC_PIXMAN_FOUND)
FIND_PATH(PIXMAN_INCLUDE_DIR
NAMES pixman.h
HINTS ${PC_PIXMAN_INCLUDEDIR}
${PC_PIXMAN_INCLUDE_DIR}
PATH_SUFFIXES pixman pixman-1
)
FIND_LIBRARY(PIXMAN_LIBRARY
NAMES pixman pixman-1
HINTS ${PC_PIXMAN_LIBDIR}
${PC_PIXMAN_LIBRARY_DIRS}
)
set(PIXMAN_INCLUDE_DIRS ${PIXMAN_INCLUDE_DIR})
set(PIXMAN_LIBRARIES ${PIXMAN_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PIXMAN DEFAULT_MSG PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR)
mark_as_advanced(PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR)
# Find ESRI SDE
#
# If it's found it sets SDE_FOUND to TRUE
# and following variables are set:
# SDE_INCLUDE_DIRS
# SDE_LIBRARIES
FIND_PATH(SDE_INCLUDE_DIR sdetype.h
PATHS ${SDE_DIR}
PATH_SUFFIXES include arcsde/coverages/include
)
if(SDE_VERSION STREQUAL "91")
FIND_LIBRARY(SDE_LIBRARY NAMES sde91 PATHS ${SDE_DIR} PATH_SUFFIXES lib lib64)
FIND_LIBRARY(PE_LIBRARY NAMES pe91 PATHS ${SDE_DIR} PATH_SUFFIXES lib lib64)
FIND_LIBRARY(SG_LIBRARY NAMES sg91 PATHS ${SDE_DIR} PATH_SUFFIXES lib lib64)
else(SDE_VERSION STREQUAL "91")
FIND_LIBRARY(SDE_LIBRARY NAMES sde PATHS ${SDE_DIR} PATH_SUFFIXES lib lib64)
FIND_LIBRARY(PE_LIBRARY NAMES pe PATHS ${SDE_DIR} PATH_SUFFIXES lib lib64)
FIND_LIBRARY(SG_LIBRARY NAMES sg PATHS ${SDE_DIR} PATH_SUFFIXES lib lib64)
endif(SDE_VERSION STREQUAL "91")
FIND_LIBRARY(SDE_DL_LIBRARY NAMES dl)
FIND_LIBRARY(SDE_SOCKET_LIBRARY NAMES socket)
FIND_LIBRARY(SDE_PTHREAD_LIBRARY NAMES pthread)
set(SDE_LIBRARIES ${SDE_LIBRARY} ${PE_LIBRARY} ${SG_LIBRARY})
if(SDE_DL_LIBRARY)
set(SDE_LIBRARIES ${SDE_LIBRARIES} dl)
endif(SDE_DL_LIBRARY)
if(SDE_SOCKET_LIBRARY)
set(SDE_LIBRARIES ${SDE_LIBRARIES} socket)
endif(SDE_SOCKET_LIBRARY)
if(SDE_PTHREAD_LIBRARY)
set(SDE_LIBRARIES ${SDE_LIBRARIES} pthread)
endif(SDE_PTHREAD_LIBRARY)
set(SDE_INCLUDE_DIRS ${SDE_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDE DEFAULT_MSG SDE_LIBRARIES SDE_INCLUDE_DIRS)
mark_as_advanced(SDE_LIBRARIES SDE_INCLUDE_DIRS)
# - Find V8
#
# V8_INCLUDE - Where to find v8.h
# V8_LIBS - List of libraries when using V8.
# V8_FOUND - True if V8 found.
get_filename_component(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH)
# Look for the header file.
find_path(V8_INCLUDE NAMES v8.h PATHS $ENV{V8_ROOT}/include /opt/local/include /usr/local/include /usr/include DOC "Path in which the file v8.h is located." )
mark_as_advanced(V8_INCLUDE)
# Look for the library.
# Does this work on UNIX systems? (LINUX)
find_library(V8_LIBS NAMES v8 PATHS /usr/lib $ENV{V8_ROOT}/lib DOC "Path to v8 library." )
mark_as_advanced(V8_LIBS)
# Copy the results to the output variables.
if (V8_INCLUDE AND V8_LIBS)
message(STATUS "Found v8 in ${V8_INCLUDE} ${V8_LIBS}")
set(V8_FOUND 1)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_LIBRARIES ${V8_LIBS} pthread)
set(CMAKE_REQUIRED_INCLUDES ${V8_INCLUDE})
check_cxx_source_compiles("
#include <v8.h>
int main()
{
v8::Persistent<v8::Context> ctx;
ctx.Dispose(0);
return 0;
}"
V8_DISPOSE_HAS_ISOLATE)
else ()
set(V8_FOUND 0)
endif ()
# Report the results.
if (NOT V8_FOUND)
set(V8_DIR_MESSAGE "V8 was not found. Make sure V8_LIBS and V8_INCLUDE are set.")
if (V8_FIND_REQUIRED)
message(FATAL_ERROR "${V8_DIR_MESSAGE}")
elseif (NOT V8_FIND_QUIETLY)
message(STATUS "${V8_DIR_MESSAGE}")
endif ()
endif ()
This diff is collapsed.
This diff is collapsed.
#include "mapserver.h"
#include "uthash.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include FT_OUTLINE_H
#ifdef USE_FRIBIDI
#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(HAVE_FRIBIDI2)
#include "fribidi.h"
#else
#include <fribidi/fribidi.h>
#endif
#include <hb-ft.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { /* this one can remain private */
unsigned int unicode;
unsigned int codepoint;
UT_hash_handle hh;
} index_element;
typedef struct {
void *hbparentfont;
void *hbfont;
void *funcs;
int cursize;
} hb_font_element;
typedef struct {
unsigned int codepoint;
unsigned int size;
} glyph_element_key;
struct glyph_element{
glyph_element_key key;
glyph_metrics metrics;
UT_hash_handle hh;
};
typedef struct {
glyph_element *glyph;
} outline_element_key;
typedef struct {
outline_element_key key;
FT_Outline outline;
UT_hash_handle hh;
} outline_element;
typedef struct {
glyph_element *glyph;
} bitmap_element_key;
typedef struct {
bitmap_element_key key;
void *bitmap;
UT_hash_handle hh;
} bitmap_element;
struct face_element{
char *font;
FT_Face face;
index_element *index_cache;
glyph_element *glyph_cache;
outline_element *outline_cache;
hb_font_element *hbfont;
UT_hash_handle hh;
};
face_element* msGetFontFace(char *key, fontSetObj *fontset);
outline_element* msGetGlyphOutline(face_element *face, glyph_element *glyph);
glyph_element* msGetBitmapGlyph(rendererVTableObj *renderer, unsigned int size, unsigned int unicode);
unsigned int msGetGlyphIndex(face_element *face, unsigned int unicode);
glyph_element* msGetGlyphByIndex(face_element *face, unsigned int size, unsigned int codepoint);
#ifdef __cplusplus
}
#endif
......@@ -58,7 +58,6 @@ void initClassHitTests(classObj *c, class_hittest *ch, int default_status) {
void initLayerHitTests(layerObj *l, layer_hittest *lh) {
int i,default_status;
lh->classhits = msSmallCalloc(l->numclasses,sizeof(class_hittest));
lh->status = default_status;
switch(l->type) {
case MS_LAYER_POLYGON:
......@@ -71,6 +70,7 @@ void initLayerHitTests(layerObj *l, layer_hittest *lh) {
default_status = 1; /* no hittesting needed, use traditional mode */
break;
}
lh->status = default_status;
for(i=0; i<l->numclasses; i++) {
initClassHitTests(l->class[i],&lh->classhits[i], default_status);
}
......@@ -124,7 +124,7 @@ int msHitTestShape(mapObj *map, layerObj *layer, shapeObj *shape, int drawmode,
if(MS_DRAW_LABELS(drawmode)) {
for(i=0;i<cp->numlabels;i++) {
labelObj *l = cp->labels[i];
if(l->status == MS_ON) {
if(msGetLabelStatus(map,layer,shape,l) == MS_ON) {
int s;
hittest->labelhits[i].status = 1;
for(s=0; s<l->numstyles;s++) {
......@@ -251,7 +251,6 @@ int msHitTestLayer(mapObj *map, layerObj *layer, layer_hittest *hittest) {
featuresdrawn++;
if(annotate && layer->class[shape.classindex]->numlabels > 0) {
msShapeGetAnnotation(layer, &shape);
drawmode |= MS_DRAWMODE_LABELS;
}
......
This diff is collapsed.
......@@ -36,6 +36,7 @@ int main(int argc, char *argv[])
mapObj *map=NULL;
imageObj *img=NULL;
msSetup();
if(argc > 1 && strcmp(argv[1], "-v") == 0) {
printf("%s\n", msGetVersion());
exit(0);
......
This diff is collapsed.
/******************************************************************************
* $Id$
*
* 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.
*
* 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*/