mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-13 00:22:10 +00:00
Last changes in buffer before moving it to extensions
Changes in dissolver/split rings Added extensions/offset Added const behaviour for for_each_coordinate Aded reverse test for intersection [SVN r61508]
This commit is contained in:
@@ -23,9 +23,19 @@
|
||||
#include <test_buffer.hpp>
|
||||
|
||||
static std::string const simplex = "LINESTRING(0 0,4 5)";
|
||||
static std::string const straight = "LINESTRING(0 0,4 5,8 10)";
|
||||
static std::string const one_bend = "LINESTRING(0 0,4 5,7 4)";
|
||||
static std::string const two_bends = "LINESTRING(0 0,4 5,7 4,10 6)";
|
||||
static std::string const overlapping = "LINESTRING(0 0,4 5,7 4,10 6, 10 2,2 2)";
|
||||
static std::string const curve = "LINESTRING(2 7,3 5,5 4,7 5,8 7)";
|
||||
|
||||
static std::string const chained2 = "LINESTRING(0 0,1 1,2 2)";
|
||||
static std::string const chained3 = "LINESTRING(0 0,1 1,2 2,3 3)";
|
||||
static std::string const chained4 = "LINESTRING(0 0,1 1,2 2,3 3,4 4)";
|
||||
|
||||
static std::string const reallife1 = "LINESTRING(76396.40464822574 410095.6795147947,76397.85016212701 410095.211865792,76401.30666443033 410095.0466387949,76405.05892643372 410096.1007777959,76409.45103273794 410098.257640797,76412.96309264141 410101.6522238015)";
|
||||
|
||||
|
||||
|
||||
template <typename P>
|
||||
void test_all()
|
||||
@@ -35,11 +45,15 @@ void test_all()
|
||||
typedef bg::linestring<P> linestring;
|
||||
typedef bg::polygon<P> polygon;
|
||||
|
||||
double right = 1.5;
|
||||
double factor = +1.0; // does NOT yet work for negative buffer
|
||||
double right = factor * 1.0;
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("simplex", simplex, 'r', 19.2093727122985, 1.5, right);
|
||||
test_one<linestring, buf::join_miter, polygon>("simplex", simplex, 'm', 19.2093727122985, 1.5, right);
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("straight", straight, 'r', 19.2093727122985, 1.5, right);
|
||||
test_one<linestring, buf::join_miter, polygon>("straight", straight, 'm', 19.2093727122985, 1.5, right);
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("one_bend", one_bend, 'r', 28.4879539312069, 1.5, right);
|
||||
test_one<linestring, buf::join_miter, polygon>("one_bend", one_bend, 'm', 28.6962056928037, 1.5, right);
|
||||
|
||||
@@ -48,12 +62,29 @@ void test_all()
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("overlapping", overlapping, 'r', 65.646005724872, 1.5, right);
|
||||
test_one<linestring, buf::join_miter, polygon>("overlapping", overlapping, 'm', 68.1395194809293, 1.5, right);
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("curve", curve, 'r', 65.646005724872, 5.0, factor * 3.0);
|
||||
test_one<linestring, buf::join_miter, polygon>("curve", curve, 'm', 68.1395194809293, 5.0, factor * 3.0);
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("chained2", chained2, 'r', 65.646005724872, 2.5, factor * 1.5);
|
||||
test_one<linestring, buf::join_round, polygon>("chained3", chained3, 'r', 65.646005724872, 2.5, factor * 1.5);
|
||||
test_one<linestring, buf::join_round, polygon>("chained4", chained4, 'r', 65.646005724872, 2.5, factor * 1.5);
|
||||
|
||||
test_one<linestring, buf::join_round, polygon>("reallife1", reallife1, 'r', 65.646005724872, 16.5, factor * 6.5);
|
||||
}
|
||||
|
||||
|
||||
//#define HAVE_TTMATH
|
||||
#ifdef HAVE_TTMATH
|
||||
#include <ttmath_stub.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
namespace bg = boost::geometry;
|
||||
test_all<bg::point<double, 2, bg::cs::cartesian> >();
|
||||
//test_all<bg::point<tt, 2, bg::cs::cartesian> >();
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user