Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67391 - sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness
From: barend.gehrels_at_[hidden]
Date: 2010-12-21 14:27:32


Author: barendgehrels
Date: 2010-12-21 14:27:31 EST (Tue, 21 Dec 2010)
New Revision: 67391
URL: http://svn.boost.org/trac/boost/changeset/67391

Log:
Renamed recursive_boxes.cpp to recursive_polygons.cpp because they are not (necessarily) boxes anymore
Added:
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_polygons.cpp
      - copied unchanged from r67322, /sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_polygons.vcproj
      - copied, changed from r67322, /sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj
Removed:
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj
Text files modified:
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_polygons.vcproj | 10 +++++-----
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln | 2 +-
   2 files changed, 6 insertions(+), 6 deletions(-)

Deleted: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp 2010-12-21 14:27:31 EST (Tue, 21 Dec 2010)
+++ (empty file)
@@ -1,181 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library) test file
-//
-// Copyright Barend Gehrels 2009, 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 <sstream>
-#include <fstream>
-#include <iomanip>
-#include <string>
-
-#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR
-#define BOOST_GEOMETRY_NO_BOOST_TEST
-
-
-#include <boost/timer.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/random/linear_congruential.hpp>
-#include <boost/random/uniform_int.hpp>
-#include <boost/random/uniform_real.hpp>
-#include <boost/random/variate_generator.hpp>
-
-#include <test_overlay_p_q.hpp>
-
-#include <boost/geometry/geometry.hpp>
-#include <boost/geometry/multi/multi.hpp>
-//#include <boost/geometry/multi/algorithms/detail/overlay/assemble.hpp>
-#include <boost/geometry/multi/geometries/multi_polygon.hpp>
-#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
-#include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
-
-
-template <typename Polygon, typename Generator>
-inline void make_box(Polygon& polygon, Generator& generator)
-{
- typedef typename bg::point_type<Polygon>::type point_type;
- typedef typename bg::coordinate_type<Polygon>::type coordinate_type;
-
- coordinate_type x, y;
- x = generator();
- y = generator();
-
- typename bg::ring_type<Polygon>::type& ring = bg::exterior_ring(polygon);
-
- point_type p;
- bg::set<0>(p, x); bg::set<1>(p, y); ring.push_back(p);
- bg::set<0>(p, x); bg::set<1>(p, y + 1); ring.push_back(p);
- bg::set<0>(p, x + 1); bg::set<1>(p, y + 1); ring.push_back(p);
- bg::set<0>(p, x + 1); bg::set<1>(p, y); ring.push_back(p);
- bg::set<0>(p, x); bg::set<1>(p, y); ring.push_back(p);
-
- if (true)
- {
- // Remove a point depending on generator
- int c = generator() % 4;
- if (c >= 1 && c <= 3)
- {
- ring.erase(ring.begin() + c);
- }
- }
-}
-
-
-
-template <typename MultiPolygon, typename Generator>
-bool test_recursive_boxes(MultiPolygon& result, int& index,
- Generator& generator,
- bool svg, int level = 3)
-{
- MultiPolygon p, q;
-
- // Generate two boxes
- if (level == 0)
- {
- p.resize(1);
- q.resize(1);
- make_box(p.front(), generator);
- make_box(q.front(), generator);
- }
- else
- {
- bg::correct(p);
- bg::correct(q);
- if (! test_recursive_boxes(p, index, generator, svg, level - 1)
- || ! test_recursive_boxes(q, index, generator, svg, level - 1))
- {
- return false;
- }
- }
-
- typedef typename boost::range_value<MultiPolygon>::type polygon;
-
- std::ostringstream out;
- out << "recursive_box_" << index++ << "_" << level;
- if (! test_overlay_p_q
- <
- polygon,
- typename bg::coordinate_type<MultiPolygon>::type
- >(out.str(), p, q, svg, 0.001))
- {
- return false;
- }
-
- MultiPolygon mp;
- bg::union_inserter
- <
- polygon
- >(p, q, std::back_inserter(mp));
-
- bg::unique(mp);
- //result = mp;
- bg::simplify(mp, result, 0.01);
- return true;
-}
-
-
-template <typename T>
-void test_all(int seed, int count, bool svg, int level)
-{
- boost::timer t;
-
- typedef boost::minstd_rand base_generator_type;
-
- base_generator_type generator(seed);
-
- boost::uniform_int<> random_coordinate(0, 9);
- boost::variate_generator<base_generator_type&, boost::uniform_int<> >
- coordinate_generator(generator, random_coordinate);
-
- typedef bg::model::polygon
- <
- bg::model::d2::point_xy<T>
- //, true, false
- > polygon;
- typedef bg::model::multi_polygon<polygon> mp;
-
-
- int index = 0;
- for(int i = 0; i < count; i++)
- {
- mp p;
- test_recursive_boxes<mp>(p, index, coordinate_generator, svg, level);
- }
- std::cout
- << "boxes " << index
- << " type: " << string_from_type<T>::name()
- << " time: " << t.elapsed() << std::endl;
-}
-
-int main(int argc, char** argv)
-{
- try
- {
- int count = argc > 1 ? boost::lexical_cast<int>(argv[1]) : 10;
- int seed = (argc > 2 && std::string(argv[2]) != std::string("#"))
- ? boost::lexical_cast<int>(argv[2])
- : static_cast<unsigned int>(std::time(0));
- bool svg = argc > 3 && std::string(argv[3]) == std::string("svg");
- int level = argc > 4 && std::string(argv[4]) != std::string("#")
- ? boost::lexical_cast<int>(argv[4]): 3;
-
- //test_all<float>(seed, count, svg, 1e-3);
- test_all<double>(seed, count, svg, level);
-
-#if defined(HAVE_TTMATH)
- // test_recursive_boxes<ttmath_big>(selection, "t");
-#endif
- }
- catch(std::exception const& e)
- {
- std::cout << "Exception " << e.what() << std::endl;
- }
- catch(...)
- {
- std::cout << "Other exception" << std::endl;
- }
-
- return 0;
-}

Deleted: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj 2010-12-21 14:27:31 EST (Tue, 21 Dec 2010)
+++ (empty file)
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="recursive_boxes"
- ProjectGUID="{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}"
- RootNamespace="recursive_boxes"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\recursive_boxes"
- 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;_WINDOWS;TEST_WITH_SVG"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="2"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalLibraryDirectories=""
- 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)\recursive_boxes"
- ConfigurationType="1"
- InheritedPropertySheets="..\..\..\boost.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../../../..;../../..;."
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- />
- <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=".\recursive_boxes.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>

Copied: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_polygons.vcproj (from r67322, /sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj)
==============================================================================
--- /sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_polygons.vcproj 2010-12-21 14:27:31 EST (Tue, 21 Dec 2010)
@@ -2,9 +2,9 @@
 <VisualStudioProject
         ProjectType="Visual C++"
         Version="8.00"
- Name="recursive_boxes"
+ Name="recursive_polygons"
         ProjectGUID="{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}"
- RootNamespace="recursive_boxes"
+ RootNamespace="recursive_polygons"
         Keyword="Win32Proj"
>
         <Platforms>
@@ -18,7 +18,7 @@
                 <Configuration
                         Name="Debug|Win32"
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\recursive_boxes"
+ IntermediateDirectory="$(ConfigurationName)\recursive_polygons"
                         ConfigurationType="1"
                         InheritedPropertySheets="..\..\..\boost.vsprops"
                         CharacterSet="1"
@@ -94,7 +94,7 @@
                 <Configuration
                         Name="Release|Win32"
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\recursive_boxes"
+ IntermediateDirectory="$(ConfigurationName)\recursive_polygons"
                         ConfigurationType="1"
                         InheritedPropertySheets="..\..\..\boost.vsprops"
                         CharacterSet="1"
@@ -170,7 +170,7 @@
         </References>
         <Files>
                 <File
- RelativePath=".\recursive_boxes.cpp"
+ RelativePath=".\recursive_polygons.cpp"
>
                 </File>
         </Files>

Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln 2010-12-21 14:27:31 EST (Tue, 21 Dec 2010)
@@ -6,7 +6,7 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection_pies", "intersection_pies.vcproj", "{24D92478-7C66-4DD5-A501-30A3D4376E4F}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recursive_boxes", "recursive_boxes.vcproj", "{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recursive_polygons", "recursive_polygons.vcproj", "{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}"
 EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution


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