Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68227 - in trunk/libs/geometry/test/extensions/algorithms: . buffer
From: barend.gehrels_at_[hidden]
Date: 2011-01-18 08:05:29


Author: barendgehrels
Date: 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
New Revision: 68227
URL: http://svn.boost.org/trac/boost/changeset/68227

Log:
Updated testcases for reimplemented remove_spikes by first marking and after that removing
Added:
   trunk/libs/geometry/test/extensions/algorithms/mark_spikes.cpp (contents, props changed)
   trunk/libs/geometry/test/extensions/algorithms/mark_spikes.vcproj (contents, props changed)
Removed:
   trunk/libs/geometry/test/extensions/algorithms/remove_spikes.cpp
   trunk/libs/geometry/test/extensions/algorithms/remove_spikes.vcproj
Text files modified:
   trunk/libs/geometry/test/extensions/algorithms/buffer/test_buffer.hpp | 102 ++++++++++++++++++++++-----------------
   trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln | 13 ++--
   2 files changed, 64 insertions(+), 51 deletions(-)

Modified: trunk/libs/geometry/test/extensions/algorithms/buffer/test_buffer.hpp
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/buffer/test_buffer.hpp (original)
+++ trunk/libs/geometry/test/extensions/algorithms/buffer/test_buffer.hpp 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
@@ -86,6 +86,7 @@
             double expected_area,
             double distance_left, double distance_right)
 {
+ namespace bg = boost::geometry;
 
     typedef typename bg::coordinate_type<Geometry>::type coordinate_type;
     typedef typename bg::point_type<Geometry>::type point_type;
@@ -109,64 +110,76 @@
> inserter_type;
 
 
- /***
- typedef bg::model::box<point_type> box_type;
+ /***/
+ typedef bg::box<point_type> box_type;
     typedef bg::sections<box_type, 1> sections_type;
 
     sections_type sections;
     bg::sectionalize(geometry, sections);
 
- std::vector<GeometryOut> sections_buffered;
+ std::vector<GeometryOut> sections_buffered;
 
 
- // Buffer all sections separately
+ // Buffer all sections separately
     BOOST_FOREACH(typename sections_type::value_type const& section, sections)
     {
         if (! section.duplicate)
         {
- typedef typename boost::range_iterator
- <
- typename bg::range_type<Geometry>::type const
- >::type iterator_type;
+ typedef typename boost::range_iterator
+ <
+ typename bg::range_type<Geometry>::type const
+ >::type iterator_type;
+
 
+ inserter_type inserter(sections_buffered);
 
- inserter_type inserter(sections_buffered);
+ iterator_type begin, end;
+ typedef std::pair<iterator_type, iterator_type> section_range;
+ //bg::get_section(geometry, section, begin, end);
 
- iterator_type begin, end;
- typedef std::pair<iterator_type, iterator_type> section_range;
- bg::get_section(geometry, section, begin, end);
- bg::detail::buffer::linestring_buffer
+ typedef bg::closeable_view
                 <
- section_range, ring_type, distance, join_strategy
- >::apply(std::make_pair(begin, end), inserter,
- distance(distance_left, distance_left / 2.0), // two times left
- join_strategy());
+ typename bg::range_type<Geometry>::type const,
+ bg::closure<Geometry>::value == bg::open
+ > view_type;
+
+ view_type view = bg::get_full_section<view_type>(geometry, section);
+
+ bg::detail::buffer::linestring_buffer
+ <
+ section_range, ring_type, distance, join_strategy
+ >::apply(std::make_pair(
+ boost::begin(view) + section.begin_index,
+ boost::begin(view) + section.end_index),
+ inserter,
+ distance(distance_left, distance_left / 2.0), // two times left
+ join_strategy());
         }
     }
 
     std::vector<GeometryOut> sections_buffered_unioned;
     BOOST_FOREACH(GeometryOut const& p, sections_buffered)
     {
- if (sections_buffered_unioned.empty())
- {
- bg::union_inserter<GeometryOut>(geometry, p, std::back_inserter(sections_buffered_unioned));
- }
- else if (boost::size(sections_buffered_unioned) == 1)
- {
- std::vector<GeometryOut> step;
- bg::union_inserter<GeometryOut>(sections_buffered_unioned.front(), p, std::back_inserter(step));
- step.swap(sections_buffered_unioned);
- }
- else
- {
- std::cout << "nyi" << std::endl;
- BOOST_FOREACH(GeometryOut const& sbu, sections_buffered_unioned)
- {
- bg::union_inserter<GeometryOut>(p, sbu, sections_buffered_unioned);
- }
- }
+ if (sections_buffered_unioned.empty())
+ {
+ bg::union_inserter<GeometryOut>(geometry, p, std::back_inserter(sections_buffered_unioned));
+ }
+ else if (boost::size(sections_buffered_unioned) == 1)
+ {
+ std::vector<GeometryOut> step;
+ bg::union_inserter<GeometryOut>(sections_buffered_unioned.front(), p, std::back_inserter(step));
+ step.swap(sections_buffered_unioned);
+ }
+ else
+ {
+ std::cout << "nyi" << std::endl;
+ BOOST_FOREACH(GeometryOut const& sbu, sections_buffered_unioned)
+ {
+ bg::union_inserter<GeometryOut>(p, sbu, sections_buffered_unioned);
+ }
+ }
     }
- ***/
+ /***/
 
 
     std::vector<GeometryOut> buffered;
@@ -212,7 +225,7 @@
         //inserter_type inserter(buffered);
 
         // Display including a margin
- bg::model::box<point_type> extent;
+ bg::box<point_type> extent;
         bg::envelope(geometry, extent);
         bg::buffer(extent, extent, distance_left * 1.01);
         mapper.add(extent);
@@ -223,8 +236,8 @@
 
 #if defined(BOOST_GEOMETRY_TEST_BUFFER_POLYGON)
 /*
- bg::detail::buffer::unioning_buffer(geometry, sections_buffered_unioned,
- distance(distance_left, distance_left / 2.0)
+ bg::detail::buffer::unioning_buffer(geometry, sections_buffered_unioned,
+ distance(distance_left, distance_left / 2.0)
 #ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER
                             , join_strategy(mapper), mapper
 #else
@@ -251,8 +264,8 @@
         #else
 
 
- bg::detail::buffer::segmenting_buffer(geometry, sections_buffered_unioned,
- distance(distance_left, distance_right)
+ bg::detail::buffer::segmenting_buffer(geometry, sections_buffered_unioned,
+ distance(distance_left, distance_right)
 #ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER
                             , join_strategy(mapper), mapper
 #else
@@ -329,16 +342,16 @@
 }
 #endif
 
- /***
+ /***
     coordinate_type a = coordinate_type();
     BOOST_FOREACH(GeometryOut const& polygon, buffered)
     {
         a += bg::area(polygon);
     }
- BOOST_CHECK_CLOSE(a, expected_area, join == 'r'
+ BOOST_CHECK_CLOSE(a, expected_area, join == 'r'
         ? coordinate_type(0.1)
         : coordinate_type(0.001));
- ***/
+ ***/
 }
 
 #ifdef BOOST_GEOMETRY_CHECK_WITH_POSTGIS
@@ -362,6 +375,7 @@
         char join, double expected_area,
         double distance_left, double distance_right = -999)
 {
+ namespace bg = boost::geometry;
     Geometry g;
     bg::read_wkt(wkt, g);
 

Modified: trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln (original)
+++ trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
@@ -1,4 +1,3 @@
-
 Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual C++ Express 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remove_holes_if", "remove_holes_if.vcproj", "{A7E79D37-594F-4337-B748-DB40FAEF7505}"
@@ -7,12 +6,12 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "selected", "selected.vcproj", "{22DD12E5-4AAD-4066-9C4F-4C360F7759AA}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remove_spikes", "remove_spikes.vcproj", "{3EA21C81-DE4A-410D-AABE-CDC5091DAB6E}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connect", "connect.vcproj", "{D502500F-AF66-4F24-8735-09DF8A7DF6AA}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "offset", "offset.vcproj", "{E9260F9F-41D3-4FD0-8DE6-95EE372F5391}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mark_spikes", "mark_spikes.vcproj", "{0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -31,10 +30,6 @@
                 {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Debug|Win32.Build.0 = Debug|Win32
                 {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Release|Win32.ActiveCfg = Release|Win32
                 {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Release|Win32.Build.0 = Release|Win32
- {3EA21C81-DE4A-410D-AABE-CDC5091DAB6E}.Debug|Win32.ActiveCfg = Debug|Win32
- {3EA21C81-DE4A-410D-AABE-CDC5091DAB6E}.Debug|Win32.Build.0 = Debug|Win32
- {3EA21C81-DE4A-410D-AABE-CDC5091DAB6E}.Release|Win32.ActiveCfg = Release|Win32
- {3EA21C81-DE4A-410D-AABE-CDC5091DAB6E}.Release|Win32.Build.0 = Release|Win32
                 {D502500F-AF66-4F24-8735-09DF8A7DF6AA}.Debug|Win32.ActiveCfg = Debug|Win32
                 {D502500F-AF66-4F24-8735-09DF8A7DF6AA}.Debug|Win32.Build.0 = Debug|Win32
                 {D502500F-AF66-4F24-8735-09DF8A7DF6AA}.Release|Win32.ActiveCfg = Release|Win32
@@ -43,6 +38,10 @@
                 {E9260F9F-41D3-4FD0-8DE6-95EE372F5391}.Debug|Win32.Build.0 = Debug|Win32
                 {E9260F9F-41D3-4FD0-8DE6-95EE372F5391}.Release|Win32.ActiveCfg = Release|Win32
                 {E9260F9F-41D3-4FD0-8DE6-95EE372F5391}.Release|Win32.Build.0 = Release|Win32
+ {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Debug|Win32.Build.0 = Debug|Win32
+ {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Release|Win32.ActiveCfg = Release|Win32
+ {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Added: trunk/libs/geometry/test/extensions/algorithms/mark_spikes.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/test/extensions/algorithms/mark_spikes.cpp 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
@@ -0,0 +1,160 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <iostream>
+#include <iomanip>
+#include <string>
+
+//#define BOOST_GEOMETRY_DEBUG_MARK_SPIKES
+
+#include <geometry_test_common.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/multi/multi.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/algorithms/mark_spikes.hpp>
+#include <boost/geometry/extensions/algorithms/remove_marked.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+template <typename Geometry, typename Policy>
+inline void test_remove_indentations(std::string const& id,
+ Geometry const& geometry,
+ Policy const& policy,
+ double expected_area, double expected_perimeter)
+{
+ typedef typename bg::point_type<Geometry>::type point_type;
+
+
+ std::map<bg::ring_identifier, std::vector<bool> > mark_map;
+
+ double a = bg::area(geometry);
+ double p = bg::perimeter(geometry);
+
+ bool marked = bg::mark_spikes(geometry, mark_map, policy);
+
+ Geometry processed;
+ bg::remove_marked(geometry, processed, mark_map);
+ bg::correct(processed);
+
+
+ double detected_area = bg::area(processed);
+ double detected_perimeter = bg::perimeter(processed);
+
+ BOOST_CHECK_CLOSE(detected_area, expected_area, 0.01);
+ BOOST_CHECK_CLOSE(detected_perimeter, expected_perimeter, 0.01);
+
+ /***/
+#if defined(BOOST_GEOMETRY_DEBUG_MARK_SPIKES)
+
+ std::cout << id << " area=" << a << " perimeter=" << p;
+ if (marked)
+ {
+ std::cout << " MARKED"
+ << ", new area=" << detected_area
+ << " new perimeter=" << detected_perimeter;
+
+ //std::cout << std::endl << std::setprecision(16) << " new WKT:" << bg::wkt(processed);
+ }
+ std::cout << std::endl;
+#endif
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "remove_indentations_" << id << ".svg";
+ std::ofstream svg(filename.str().c_str());
+
+ bg::svg_mapper<typename bg::point_type<Geometry>::type> mapper(svg, 500, 500);
+ mapper.add(geometry);
+ mapper.map(geometry, "fill-opacity:0.3;opacity:0.6;fill:rgb(51,51,153);stroke:rgb(0,0,255);stroke-width:2");
+ mapper.map(processed, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:3");
+ }
+#endif
+}
+
+template <typename Geometry, typename Policy>
+void test_geometry(std::string const& id, std::string const& wkt, Policy const& policy,
+ double expected_area, double expected_perimeter)
+{
+ Geometry geometry;
+ bg::read_wkt(wkt, geometry);
+ bg::correct(geometry);
+ test_remove_indentations(id, geometry, policy, expected_area, expected_perimeter);
+}
+
+
+#if ! defined(GGL_TEST_MULTI)
+
+template <typename P>
+void test_all()
+{
+ typedef bg::model::linear_ring<P> ring;
+ typedef bg::model::polygon<P> polygon;
+ typedef bg::model::multi_polygon<polygon> mp;
+
+ test_geometry<polygon>("case1",
+ "POLYGON((0 0,0 100,100 100,100 51,150 51,150 90,151 90,151 50,100 50,100 0,0 0))",
+ bg::select_gapped_spike<>(2.0, 0.5), 10000.0, 400.0);
+
+ test_geometry<mp>("texel_183836",
+ "MULTIPOLYGON( ((114766.45300292969 560935.37800598145, 114839.08099365234 560958.13200378418, 114919.38200378418 560983.13500976562, 114945.70799255371 560990.80799865723, 114946.2380065918 560992.39601135254, 114930.75900268555 561046.63500976562, 114923.41007995606 561073.32402038574, 114924.41039576962 561073.6148228565, 114903.32929992676 561145.36410522461, 114895.68840026856 561171.36880493164, 114894.6575012207 561174.46450805664, 114894.59449768066 561174.43589782715, 114894.31700134277 561175.496307373, 114894.01480102539 561178.669998169, 114894.57029724121 561179.59580993652, 114969.90060575516 561202.33975150948, 114969.85419015621 561202.51050945686, 114942.83399963379 561194.24600219727, 114895.87001037598 561180.091003418, 114893.3570098877 561179.16500854492, 114872.97556998512 561162.44151731138, 114893.35699462891 561179.16400146484, 114894.90800476074 561173.2380065918, 114892.52699279785 561174.03199768066, 114889.74899291992 561171.51899719238, 114879.56199645996 561162.788
00964355, 114844.50500488281 561131.30200195312, 114809.71200561523 561099.1549987793, 114787.22300720215 561079.17900085449, 114771.87699890137 561065.68499755859, 114753.62100219727 561048.4880065918, 114727.0299987793 561029.17300415039, 114717.10800170898 561021.5, 114701.89500427246 561011.04901123047, 114700.83599853516 561009.59400939941, 114701.89500427246 561006.94799804688, 114715.38800048828 560981.28300476074, 114729.9409942627 560953.370010376, 114738.27499389648 560937.62699890137, 114739.46600341797 560937.75900268555, 114766.45300292969 560935.37800598145), (114825.04400634766 560971.37200927734, 114823.72099304199 560971.76800537109, 114822.66299438477 560971.90100097656, 114821.07600402832 560973.22399902344, 114821.07600402832 560975.33999633789, 114821.47200012207 560976.26600646973, 114823.19200134277 560978.11799621582, 114825.04400634766 560978.51499938965, 114827.42599487305 560978.25100708008, 114828.48399353027 560976.796005249, 114828.61599731445 560974.15000915527, 114827.82200622
559 560972.8270111084, 114825.04400634766 560971.37200927734), (114893.16600036621 561141.21200561523, 114891.51400756836 561142.51000976562, 114890.68800354004 561144.2799987793, 114890.92399597168 561146.9940032959, 114893.04200744629 561149.43600463867, 114897.01100158691 561148.77500915527, 114898.59399414063 561145.10600280762, 114898.00399780273 561142.9820098877, 114895.64399719238 561141.56600952148, 114893.16600036621 561141.21200561523)))",
+ bg::select_gapped_spike<>(2.0, 0.1), 31052.272, 794.761);
+
+ // Found some PostGIS stored procedure as well.
+ // http://trac.osgeo.org/postgis/wiki/UsersWikiExamplesSpikeRemover
+ // (note that that algorithm is completely different from this one)
+ test_geometry<polygon>("pg1",
+ "POLYGON((3480407.01 5483810.171,3480407.01 5483810.17,3480409.11 5483777.431,3480407.348 5483777.421,3480405.15 5483777.409,3480404.816 5483777.407,3480394.58 5483777.35,3480395.36 5483811.12,3480404.55 5483810.46,3480405.951 5483810.295,3480406.312 5483795.106,3480405.951 5483810.296,3480406.903 5483810.184,3480407.01 5483810.171))",
+ bg::select_gapped_spike<>(10.0, 0.1), 435.535, 92.8071);
+
+ /*
+ TODO: for this distance point-segment should be used during marking
+ test_geometry<polygon>("pg2",
+ "POLYGON((3415632.49 5291021.49,3415632.488 5291021.494,3415632.49 5291021.494,3415628.93 5291028.28,3415642.95 5291001.56,3415651.18 5290985.86,3415659.27 5290984.61,3415644.71 5290947.81,3415629.17 5290921.83,3415621.28 5290929.72,3415640.21 5290959.43,3415625.38 5290971.41,3415627.79 5290983.94,3415629.49 5290992.19,3415630.14 5290995.36,3415625.65 5291022.5,3415632.49 5291021.49))",
+ bg::select_gapped_spike<>(20.0, 0.5), 1535.72, 257.895);
+ */
+
+
+ // Testcases from original/previous "remove_spikes" test procedure (these are spikes with area 0.0)
+ {
+ bg::select_gapped_spike<> policy(0.001, 0.001);
+
+ test_geometry<polygon>("box",
+ "POLYGON((0 0,0 4,4 4,4 0,0 0))",
+ policy, 16, 16);
+ test_geometry<polygon>("spike_right",
+ "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))",
+ policy, 16, 16);
+ test_geometry<polygon>("spike_at_first",
+ "POLYGON((0 0,-1 3,0 0,0 4,4 4,4 0,0 0))",
+ policy, 16, 16);
+ test_geometry<polygon>("spike_at_closing",
+ "POLYGON((-1 0,0 0,0 4,4 4,4 0,0 0,-1 0))",
+ policy, 16, 16);
+ test_geometry<polygon>("double_spike",
+ "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4 2,4 0,0 0))",
+ policy, 16, 16);
+ test_geometry<polygon>("three_double_spike",
+ "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4.5 2,4 2,4 0,0 0))",
+ policy, 16, 16);
+ }
+}
+
+int test_main(int, char* [])
+{
+ test_all<bg::model::d2::point_xy<double> >();
+ return 0;
+}
+#endif

Added: trunk/libs/geometry/test/extensions/algorithms/mark_spikes.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/test/extensions/algorithms/mark_spikes.vcproj 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="mark_spikes"
+ ProjectGUID="{0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}"
+ RootNamespace="mark_spikes"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\mark_spikes"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ ExceptionHandling="2"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\mark_spikes"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\mark_spikes.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Deleted: trunk/libs/geometry/test/extensions/algorithms/remove_spikes.cpp
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/remove_spikes.cpp 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
+++ (empty file)
@@ -1,101 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library) test file
-//
-// Copyright Barend Gehrels 2010, Geodan, Amsterdam, the Netherlands
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <iostream>
-#include <string>
-
-
-#include <geometry_test_common.hpp>
-
-#include <boost/geometry/geometries/geometries.hpp>
-#include <boost/geometry/strategies/strategies.hpp>
-
-#include <boost/geometry/extensions/algorithms/remove_spikes.hpp>
-#include <boost/geometry/algorithms/num_points.hpp>
-#include <boost/geometry/algorithms/unique.hpp>
-
-#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
-#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
-
-
-
-#if defined(TEST_WITH_SVG)
-# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
-#endif
-
-template <typename Geometry>
-inline void test_remove_spikes(std::string const& id,
- Geometry const& geometry,
- int expected_count)
-{
- typedef typename bg::point_type<Geometry>::type point_type;
-
- Geometry processed = geometry;
- //bg::remove_spikes(processed, bg::remove_elongated_spikes<point_type>());
- bg::remove_spikes(processed, bg::remove_by_normalized<point_type>());
- bg::unique(processed);
-
-
- int detected = bg::num_points(processed);
-
- BOOST_CHECK_MESSAGE(detected == expected_count,
- "remove_spikes: " << bg::wkt(geometry)
- << " -> Expected: " << expected_count
- << " detected: " << detected);
-
-
-#if defined(TEST_WITH_SVG)
- {
- std::ostringstream filename;
- filename << "remove_spikes_" << id << ".svg";
- std::ofstream svg(filename.str().c_str());
-
- bg::svg_mapper<typename bg::point_type<Geometry>::type> mapper(svg, 500, 500);
- mapper.add(geometry);
- mapper.map(geometry, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,255);stroke-width:1");
- mapper.map(processed, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,255,0);stroke-width:1");
- }
-#endif
-}
-
-template <typename Geometry>
-void test_geometry(std::string const& id, std::string const& wkt, int expected_count)
-{
- Geometry geometry;
- bg::read_wkt(wkt, geometry);
- test_remove_spikes(id, geometry, expected_count);
-}
-
-
-#if ! defined(GGL_TEST_MULTI)
-
-template <typename P>
-void test_all()
-{
- typedef bg::model::linear_ring<P> ring;
- typedef bg::model::polygon<P> polygon;
-
- test_geometry<polygon>("box",
- "POLYGON((0 0,0 4,4 4,4 0,0 0))", 5);
- test_geometry<polygon>("spike_right",
- "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))", 6);
- test_geometry<polygon>("spike_at_first",
- "POLYGON((0 0,-1 3,0 0,0 4,4 4,4 0,0 0))", 5);
- test_geometry<polygon>("spike_at_closing",
- "POLYGON((-1 0,0 0,0 4,4 4,4 0,0 0,-1 0))", 5);
- test_geometry<polygon>("double_spike",
- "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4 2,4 0,0 0))", 6);
- test_geometry<polygon>("three_double_spike",
- "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4.5 2,4 2,4 0,0 0))", 6);
-}
-
-int test_main(int, char* [])
-{
- test_all<bg::model::d2::point_xy<double> >();
- return 0;
-}
-#endif

Deleted: trunk/libs/geometry/test/extensions/algorithms/remove_spikes.vcproj
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/remove_spikes.vcproj 2011-01-18 08:05:28 EST (Tue, 18 Jan 2011)
+++ (empty file)
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="remove_spikes"
- ProjectGUID="{3EA21C81-DE4A-410D-AABE-CDC5091DAB6E}"
- RootNamespace="remove_spikes"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\remove_spikes"
- ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=".;../../../../..;../.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
- ExceptionHandling="2"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- DebugInformationFormat="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\remove_spikes"
- ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;../../../../..;../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
- ExceptionHandling="2"
- UsePrecompiledHeader="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\remove_spikes.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk