(&config.output_member_variables),
+ "Output member variables inside the class")
;
po::variables_map varmap;
diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
index 0a98f4296..119a57364 100644
--- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
+++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
@@ -691,13 +691,44 @@ static void parse(rapidxml::xml_node<>* node, configuration const& config, docum
}
else if (kind == "variable")
{
- if (boost::equals(get_attribute(node, "static"), "yes")
- && boost::equals(get_attribute(node, "mutable"), "no")
- && boost::equals(get_attribute(node, "prot"), "public"))
+ if (boost::equals(get_attribute(node, "prot"), "public"))
{
- std::string name = parse_named_node(node->first_node(), "name");
- doc.cos.variables.push_back(base_element(name));
- doc.cos.variables.back().id = id;
+ parameter p;
+ p.id = id;
+ for(rapidxml::xml_node<>* var_node = node->first_node(); var_node; var_node=var_node->next_sibling())
+ {
+ if(boost::equals(var_node->name(), "name"))
+ {
+ p.name = var_node->value();
+ }
+ else if(boost::equals(var_node->name(), "type"))
+ {
+ get_contents(var_node->first_node(), p.fulltype);
+ p.type = p.fulltype;
+ //boost::replace_all(p.type, " const", "");
+ //boost::trim(p.type);
+ //boost::replace_all(p.type, "&", "");
+ //boost::replace_all(p.type, "*", "");
+ boost::trim(p.type);
+
+ // If alt output is used retrieve type with QBK links
+ if ( configuration::alt == config.output_style )
+ {
+ p.fulltype_without_links = p.fulltype;
+ p.fulltype.clear();
+ parse_para(var_node->first_node(), config, p.fulltype, p.skip);
+ }
+ }
+ else if(boost::equals(var_node->name(), "briefdescription"))
+ {
+ parse_para(var_node->first_node(), config, p.brief_description, p.skip);
+ }
+ else if(p.brief_description.empty() && boost::equals(var_node->name(), "detaileddescription"))
+ {
+ parse_para(var_node->first_node(), config, p.brief_description, p.skip);
+ }
+ }
+ doc.cos.variables.push_back(p);
}
}
diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
index 34295b7d4..0f2d9de2a 100644
--- a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
+++ b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
@@ -544,9 +544,38 @@ void quickbook_output(class_or_struct const& cos, configuration const& config, s
out << std::endl;
}
- out << "{" << std::endl
- << " // ..." << std::endl
- << "};" << std::endl
+ out << "{" << std::endl;
+ if (! cos.variables.empty() && config.output_member_variables)
+ {
+ size_t maxlength = 0;
+ BOOST_FOREACH(parameter const& p, cos.variables)
+ {
+ if (! p.skip)
+ {
+ size_t length = 6 + p.fulltype.size() + p.name.size();
+ if (length > maxlength) maxlength = length;
+ }
+ }
+ BOOST_FOREACH(parameter const& p, cos.variables)
+ {
+ if (! p.skip)
+ {
+ size_t length = 4 + p.fulltype.size() + p.name.size();
+ out << " " << p.fulltype << " " << p.name << ";";
+ if (! p.brief_description.empty())
+ {
+ while(length++ < maxlength) out << " ";
+ out << "// " << p.brief_description;
+ }
+ out << std::endl;
+ }
+ }
+ }
+ else
+ {
+ out << " // ..." << std::endl;
+ }
+ out << "};" << std::endl
<< "``" << std::endl << std::endl;
quickbook_markup(cos.qbk_markup, markup_after, markup_synopsis, out);
diff --git a/doc/src/examples/algorithms/length_with_strategy.cpp b/doc/src/examples/algorithms/length_with_strategy.cpp
index 99c15fb19..4a643c894 100644
--- a/doc/src/examples/algorithms/length_with_strategy.cpp
+++ b/doc/src/examples/algorithms/length_with_strategy.cpp
@@ -24,7 +24,7 @@ int main()
line.push_back(P(5, 52));
double const mean_radius = 6371.0; /*< [@http://en.wikipedia.org/wiki/Earth_radius Wiki] >*/
std::cout << "length is "
- << length(line, strategy::distance::haversine(mean_radius) )
+ << length(line, strategy::distance::haversine(mean_radius) )
<< " kilometers " << std::endl;
return 0;
diff --git a/doc/src/examples/algorithms/transform_with_strategy.cpp b/doc/src/examples/algorithms/transform_with_strategy.cpp
index df44d6336..d55e5e2d1 100644
--- a/doc/src/examples/algorithms/transform_with_strategy.cpp
+++ b/doc/src/examples/algorithms/transform_with_strategy.cpp
@@ -25,17 +25,17 @@ int main()
// Translate over (1.5, 1.5)
point_type p2;
- trans::translate_transformer translate(1.5, 1.5);
+ trans::translate_transformer translate(1.5, 1.5);
boost::geometry::transform(p1, p2, translate);
// Scale with factor 3.0
point_type p3;
- trans::scale_transformer scale(3.0);
+ trans::scale_transformer scale(3.0);
boost::geometry::transform(p1, p3, scale);
// Rotate with respect to the origin (0,0) over 90 degrees (clockwise)
point_type p4;
- trans::rotate_transformer rotate(90.0);
+ trans::rotate_transformer rotate(90.0);
boost::geometry::transform(p1, p4, rotate);
std::cout
diff --git a/example/06_a_transformation_example.cpp b/example/06_a_transformation_example.cpp
index 367d5e16f..01a560173 100644
--- a/example/06_a_transformation_example.cpp
+++ b/example/06_a_transformation_example.cpp
@@ -29,7 +29,7 @@ int main()
point_2d p2;
// Example: translate a point over (5,5)
- strategy::transform::translate_transformer translate(5, 5);
+ strategy::transform::translate_transformer translate(5, 5);
transform(p, p2, translate);
std::cout << "transformed point " << boost::geometry::dsv(p2) << std::endl;
diff --git a/example/06_b_transformation_example.cpp b/example/06_b_transformation_example.cpp
index 5dd972548..db125ff53 100644
--- a/example/06_b_transformation_example.cpp
+++ b/example/06_b_transformation_example.cpp
@@ -127,25 +127,25 @@ int main()
svg.put(g1, "g1");
// G1 - Translate -> G2
- translate_transformer translate(0, 250);
+ translate_transformer translate(0, 250);
model::polygon g2;
transform(g1, g2, translate);
std::clog << "translated:\t" << boost::geometry::dsv(g2) << std::endl;
svg.put(g2, "g2=g1.translate(0,250)");
// G2 - Scale -> G3
- scale_transformer scale(0.5, 0.5);
+ scale_transformer scale(0.5, 0.5);
model::polygon g3;
transform(g2, g3, scale);
std::clog << "scaled:\t" << boost::geometry::dsv(g3) << std::endl;
svg.put(g3, "g3=g2.scale(0.5,0.5)");
// G3 - Combine rotate and translate -> G4
- rotate_transformer rotate(45);
+ rotate_transformer rotate(45);
// Compose matrix for the two transformation
// Create transformer attached to the transformation matrix
- ublas_transformer
+ ublas_transformer
combined(boost::numeric::ublas::prod(rotate.matrix(), translate.matrix()));
//combined(rotate.matrix());
diff --git a/example/07_a_graph_route_example.cpp b/example/07_a_graph_route_example.cpp
index 735d2dfa7..5b476ffb5 100644
--- a/example/07_a_graph_route_example.cpp
+++ b/example/07_a_graph_route_example.cpp
@@ -306,7 +306,7 @@ int main()
<< std::fixed << std::setprecision(0);
// To calculate distance, declare and construct a strategy with average earth radius
- boost::geometry::strategy::distance::haversine haversine(6372795.0);
+ boost::geometry::strategy::distance::haversine haversine(6372795.0);
// Main functionality: calculate shortest routes from/to all cities
diff --git a/example/07_b_graph_route_example.cpp b/example/07_b_graph_route_example.cpp
index 843a84e6f..5490dc5fb 100644
--- a/example/07_b_graph_route_example.cpp
+++ b/example/07_b_graph_route_example.cpp
@@ -293,7 +293,7 @@ int main()
<< std::fixed << std::setprecision(0);
// To calculate distance, declare and construct a strategy with average earth radius
- boost::geometry::strategy::distance::haversine haversine(6372795.0);
+ boost::geometry::strategy::distance::haversine haversine(6372795.0);
// Main functionality: calculate shortest routes from/to all cities
diff --git a/example/boost.vsprops b/example/boost.vsprops
deleted file mode 100644
index e376ce44a..000000000
--- a/example/boost.vsprops
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
diff --git a/example/c04_b_custom_triangle_example.cpp b/example/c04_b_custom_triangle_example.cpp
index a48100529..320dc6ede 100644
--- a/example/c04_b_custom_triangle_example.cpp
+++ b/example/c04_b_custom_triangle_example.cpp
@@ -38,10 +38,11 @@ BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(triangle)
namespace boost { namespace geometry { namespace dispatch {
// Specializations of area dispatch structure, implement algorithm
-template
-struct area, S>
+template
+struct area, ring_tag>
{
- static inline double apply(triangle const& t, S const&)
+ template
+ static inline double apply(triangle const& t, Strategy const&)
{
return 0.5 * ((get<0>(t[1]) - get<0>(t[0])) * (get<1>(t[2]) - get<1>(t[0]))
- (get<0>(t[2]) - get<0>(t[0])) * (get<1>(t[1]) - get<1>(t[0])));
diff --git a/example/c08_custom_non_std_example.cpp b/example/c08_custom_non_std_example.cpp
index 966c6298b..d60f4a079 100644
--- a/example/c08_custom_non_std_example.cpp
+++ b/example/c08_custom_non_std_example.cpp
@@ -65,41 +65,59 @@ class my_polygon
// Adaption: implement iterator and range-extension, and register with Boost.Geometry
// 1) implement iterator (const and non-const versions)
-template
+template
struct custom_iterator : public boost::iterator_facade
<
- custom_iterator,
+ custom_iterator,
my_point,
boost::random_access_traversal_tag,
- typename boost::geometry::add_const_if_c::type&
+ typename boost::mpl::if_
+ <
+ boost::is_const,
+ my_point const,
+ my_point
+ >::type&
>
{
// Constructor for begin()
- explicit custom_iterator(typename boost::geometry::add_const_if_c::type& polygon)
+ explicit custom_iterator(MyPolygon& polygon)
: m_polygon(&polygon)
, m_index(0)
{}
// Constructor for end()
- explicit custom_iterator(bool, typename boost::geometry::add_const_if_c::type& polygon)
+ explicit custom_iterator(bool, MyPolygon& polygon)
: m_polygon(&polygon)
, m_index(polygon.point_count())
{}
+ // Default constructor
+ explicit custom_iterator()
+ : m_polygon(NULL)
+ , m_index(-1)
+ {}
+
+ typedef typename boost::mpl::if_
+ <
+ boost::is_const,
+ my_point const,
+ my_point
+ >::type my_point_type;
private:
friend class boost::iterator_core_access;
+
typedef boost::iterator_facade
<
- custom_iterator,
+ custom_iterator,
my_point,
boost::random_access_traversal_tag,
- typename boost::geometry::add_const_if_c::type&
+ my_point_type&
> facade;
- typename boost::geometry::add_const_if_c::type* m_polygon;
+ MyPolygon* m_polygon;
int m_index;
bool equal(custom_iterator const& other) const
@@ -134,7 +152,7 @@ private:
}
// const and non-const dereference of this iterator
- typename boost::geometry::add_const_if_c::type& dereference() const
+ my_point_type& dereference() const
{
return m_polygon->get_point(m_index);
}
@@ -150,12 +168,12 @@ namespace boost
{
template<> struct range_mutable_iterator
{
- typedef custom_iterator type;
+ typedef custom_iterator type;
};
template<> struct range_const_iterator
{
- typedef custom_iterator type;
+ typedef custom_iterator type;
};
// RangeEx
@@ -168,24 +186,24 @@ namespace boost
// 2b) free-standing function for Boost.Range ADP
-inline custom_iterator range_begin(my_polygon& polygon)
+inline custom_iterator range_begin(my_polygon& polygon)
{
- return custom_iterator(polygon);
+ return custom_iterator(polygon);
}
-inline custom_iterator range_begin(my_polygon const& polygon)
+inline custom_iterator range_begin(my_polygon const& polygon)
{
- return custom_iterator(polygon);
+ return custom_iterator(polygon);
}
-inline custom_iterator range_end(my_polygon& polygon)
+inline custom_iterator range_end(my_polygon& polygon)
{
- return custom_iterator(true, polygon);
+ return custom_iterator(true, polygon);
}
-inline custom_iterator range_end(my_polygon const& polygon)
+inline custom_iterator range_end(my_polygon const& polygon)
{
- return custom_iterator(true, polygon);
+ return custom_iterator(true, polygon);
}
@@ -210,6 +228,14 @@ template<> struct resize
}
};
+template<> struct clear
+{
+ static inline void apply(my_polygon& polygon)
+ {
+ polygon.erase_all();
+ }
+};
+
}}}
@@ -225,8 +251,8 @@ BOOST_GEOMETRY_REGISTER_RING(my_polygon)
void walk_using_iterator(my_polygon const& polygon)
{
- for (custom_iterator it = custom_iterator(polygon);
- it != custom_iterator(true, polygon);
+ for (custom_iterator it = custom_iterator(polygon);
+ it != custom_iterator(true, polygon);
++it)
{
std::cout << boost::geometry::dsv(*it) << std::endl;
diff --git a/example/c10_custom_cs_example.cpp b/example/c10_custom_cs_example.cpp
index b71ad8976..6676955d7 100644
--- a/example/c10_custom_cs_example.cpp
+++ b/example/c10_custom_cs_example.cpp
@@ -56,7 +56,7 @@ namespace boost { namespace geometry { namespace strategy { namespace distance {
template
struct default_strategy
{
- typedef haversine type;
+ typedef haversine type;
};
}}}}} // namespaces
diff --git a/example/c11_custom_cs_transform_example.cpp b/example/c11_custom_cs_transform_example.cpp
index 38a3f012a..896ee069a 100644
--- a/example/c11_custom_cs_transform_example.cpp
+++ b/example/c11_custom_cs_transform_example.cpp
@@ -32,9 +32,9 @@ template<> struct cs_tag { typedef cartesian_tag type; };
// 3: sample implementation of a shift
// to convert coordinate system "cart" to "cart_shirted5"
-template
struct shift
{
+ template
inline bool apply(P1 const& p1, P2& p2) const
{
namespace bg = boost::geometry;
@@ -52,16 +52,16 @@ namespace boost { namespace geometry { namespace strategy { namespace transform
template
struct default_strategy
{
- typedef shift type;
+ typedef shift type;
};
}}}}} // namespaces
// 5: implement a distance strategy between the two different ones
-template
struct shift_and_calc_distance
{
+ template
inline double apply(P1 const& p1, P2 const& p2) const
{
P2 p1_shifted;
@@ -77,14 +77,14 @@ typedef boost::geometry::model::point point2;
// 7: register the distance strategy
namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services
{
- template
- struct tag >
+ template <>
+ struct tag
{
typedef strategy_tag_distance_point_point type;
};
- template
- struct return_type >
+ template
+ struct return_type
{
typedef double type;
};
@@ -92,7 +92,7 @@ namespace boost { namespace geometry { namespace strategy { namespace distance {
template <>
struct default_strategy
{
- typedef shift_and_calc_distance type;
+ typedef shift_and_calc_distance type;
};
diff --git a/example/ml01_multipolygon_simplify.vcproj b/example/ml01_multipolygon_simplify.vcproj
deleted file mode 100644
index fe5492da9..000000000
--- a/example/ml01_multipolygon_simplify.vcproj
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/ml02_distance_strategy.vcproj b/example/ml02_distance_strategy.vcproj
deleted file mode 100644
index 0b04ecfac..000000000
--- a/example/ml02_distance_strategy.vcproj
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/gd.vsprops b/example/with_external_libs/gd.vsprops
deleted file mode 100644
index 209165c2e..000000000
--- a/example/with_external_libs/gd.vsprops
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
diff --git a/example/with_external_libs/postgresql.vsprops b/example/with_external_libs/postgresql.vsprops
deleted file mode 100644
index 6a95d3e1c..000000000
--- a/example/with_external_libs/postgresql.vsprops
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
diff --git a/example/with_external_libs/qt.vsprops b/example/with_external_libs/qt.vsprops
deleted file mode 100644
index 8de8e56ac..000000000
--- a/example/with_external_libs/qt.vsprops
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
diff --git a/example/with_external_libs/shapelib.vsprops b/example/with_external_libs/shapelib.vsprops
deleted file mode 100644
index fcd579559..000000000
--- a/example/with_external_libs/shapelib.vsprops
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
diff --git a/example/with_external_libs/soci.vsprops b/example/with_external_libs/soci.vsprops
deleted file mode 100644
index c397b1241..000000000
--- a/example/with_external_libs/soci.vsprops
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
diff --git a/example/with_external_libs/wxwidgets.vsprops b/example/with_external_libs/wxwidgets.vsprops
deleted file mode 100644
index a5a0836fc..000000000
--- a/example/with_external_libs/wxwidgets.vsprops
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
diff --git a/example/with_external_libs/x01_qt_example.sln b/example/with_external_libs/x01_qt_example.sln
deleted file mode 100644
index 6af3e9304..000000000
--- a/example/with_external_libs/x01_qt_example.sln
+++ /dev/null
@@ -1,19 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x01_qt_example", "x01_qt_example.vcproj", "{242C6ADC-3A10-4B69-81F7-5669E0582A8B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.ActiveCfg = Debug|Win32
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.Build.0 = Debug|Win32
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.ActiveCfg = Release|Win32
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/example/with_external_libs/x01_qt_example.vcproj b/example/with_external_libs/x01_qt_example.vcproj
deleted file mode 100644
index eba736e3f..000000000
--- a/example/with_external_libs/x01_qt_example.vcproj
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x02_gd_example.sln b/example/with_external_libs/x02_gd_example.sln
deleted file mode 100644
index 1ab96a86f..000000000
--- a/example/with_external_libs/x02_gd_example.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C++ Express 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x02_gd_example", "x02_gd_example.vcproj", "{A73F21AC-6F32-41A9-A86C-53BD4DC84B05}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Debug|Win32.ActiveCfg = Debug|Win32
- {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Debug|Win32.Build.0 = Debug|Win32
- {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Release|Win32.ActiveCfg = Release|Win32
- {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/example/with_external_libs/x02_gd_example.vcproj b/example/with_external_libs/x02_gd_example.vcproj
deleted file mode 100644
index 20471a0a6..000000000
--- a/example/with_external_libs/x02_gd_example.vcproj
+++ /dev/null
@@ -1,236 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x03_a_soci_example.vcproj b/example/with_external_libs/x03_a_soci_example.vcproj
deleted file mode 100644
index 2f6665a51..000000000
--- a/example/with_external_libs/x03_a_soci_example.vcproj
+++ /dev/null
@@ -1,744 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x03_b_soci_example.vcproj b/example/with_external_libs/x03_b_soci_example.vcproj
deleted file mode 100644
index 35781e542..000000000
--- a/example/with_external_libs/x03_b_soci_example.vcproj
+++ /dev/null
@@ -1,744 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x03_c_soci_example.vcproj b/example/with_external_libs/x03_c_soci_example.vcproj
deleted file mode 100644
index 05a4ae022..000000000
--- a/example/with_external_libs/x03_c_soci_example.vcproj
+++ /dev/null
@@ -1,744 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x03_d_soci_example.vcproj b/example/with_external_libs/x03_d_soci_example.vcproj
deleted file mode 100644
index d699d5186..000000000
--- a/example/with_external_libs/x03_d_soci_example.vcproj
+++ /dev/null
@@ -1,744 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x03_soci_examples.sln b/example/with_external_libs/x03_soci_examples.sln
deleted file mode 100644
index 49ea1a3be..000000000
--- a/example/with_external_libs/x03_soci_examples.sln
+++ /dev/null
@@ -1,37 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_a_soci_example", "x03_a_soci_example.vcproj", "{C3B3143D-F354-4036-9DA1-5975D8A4F166}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_b_soci_example", "x03_b_soci_example.vcproj", "{5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_c_soci_example", "x03_c_soci_example.vcproj", "{5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_d_soci_example", "x03_d_soci_example.vcproj", "{5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Debug|Win32.ActiveCfg = Debug|Win32
- {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Debug|Win32.Build.0 = Debug|Win32
- {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Release|Win32.ActiveCfg = Release|Win32
- {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Release|Win32.Build.0 = Release|Win32
- {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Debug|Win32.ActiveCfg = Debug|Win32
- {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Debug|Win32.Build.0 = Debug|Win32
- {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Release|Win32.ActiveCfg = Release|Win32
- {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Release|Win32.Build.0 = Release|Win32
- {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Debug|Win32.ActiveCfg = Debug|Win32
- {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Debug|Win32.Build.0 = Debug|Win32
- {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Release|Win32.ActiveCfg = Release|Win32
- {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Release|Win32.Build.0 = Release|Win32
- {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Debug|Win32.ActiveCfg = Debug|Win32
- {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Debug|Win32.Build.0 = Debug|Win32
- {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Release|Win32.ActiveCfg = Release|Win32
- {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp
index 1a8bde389..d3d2cc186 100644
--- a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp
+++ b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp
@@ -159,13 +159,13 @@ private:
typedef boost::geometry::strategy::transform::map_transformer
<
- point_2d, wxPoint,
+ double, 2, 2,
true, true
> map_transformer_type;
typedef boost::geometry::strategy::transform::inverse_transformer
<
- wxPoint, point_2d
+ double, 2, 2
> inverse_transformer_type;
boost::shared_ptr m_map_transformer;
diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.sln b/example/with_external_libs/x04_wxwidgets_world_mapper.sln
deleted file mode 100644
index 9761bba39..000000000
--- a/example/with_external_libs/x04_wxwidgets_world_mapper.sln
+++ /dev/null
@@ -1,19 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x04_wxwidgets_world_mapper", "x04_wxwidgets_world_mapper.vcproj", "{DD1D469B-29A8-4873-A596-9CCCB24F54FA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Debug|Win32.ActiveCfg = Debug|Win32
- {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Debug|Win32.Build.0 = Debug|Win32
- {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Release|Win32.ActiveCfg = Release|Win32
- {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.vcproj b/example/with_external_libs/x04_wxwidgets_world_mapper.vcproj
deleted file mode 100644
index 3d4ed9ab1..000000000
--- a/example/with_external_libs/x04_wxwidgets_world_mapper.vcproj
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt b/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt
index ed3df6cb0..cba0c8eeb 100644
--- a/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt
+++ b/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt
@@ -16,15 +16,7 @@ the mouse, and indicating position of the mouse in latitude/longitude and in pix
To compile this program:
Install wxWidgets (if not done before)
-Install Boost (if not done before)
-Using MSVC:
- - edit the file wxwidgets.vsprops
- - set the UserMacro WXWIDGETS to point to your wxWidgets distribution
- - edit the file boost.vsprops
- - set the UserMacro BOOST_ROOT to point to your Boost distribution
- - alternatively you can include Boost and/or wxWidgets in your standard include path
-
Using Linux/gcc
- check if installation is OK, http://wiki.wxwidgets.org/Installing_and_configuring_under_Ubuntu
- compile using e.g. gcc -o x04_wxwidgets -I../../../.. x04_wxwidgets_world_mapper.cpp `wx-config --cxxflags` `wx-config --libs`
diff --git a/example/with_external_libs/x05_shapelib_example.sln b/example/with_external_libs/x05_shapelib_example.sln
deleted file mode 100644
index 48693bb6a..000000000
--- a/example/with_external_libs/x05_shapelib_example.sln
+++ /dev/null
@@ -1,19 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C++ Express 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x05_shapelib_example", "x05_shapelib_example.vcproj", "{92ECE1AC-1A5D-4554-A8AD-690AC266210D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Debug|Win32.ActiveCfg = Debug|Win32
- {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Debug|Win32.Build.0 = Debug|Win32
- {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Release|Win32.ActiveCfg = Release|Win32
- {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/example/with_external_libs/x05_shapelib_example.vcproj b/example/with_external_libs/x05_shapelib_example.vcproj
deleted file mode 100644
index d9c6a1d3f..000000000
--- a/example/with_external_libs/x05_shapelib_example.vcproj
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x06_qt_world_mapper.cpp b/example/with_external_libs/x06_qt_world_mapper.cpp
index 8f0cf3477..b4a060c84 100644
--- a/example/with_external_libs/x06_qt_world_mapper.cpp
+++ b/example/with_external_libs/x06_qt_world_mapper.cpp
@@ -91,7 +91,7 @@ class WorldMapper : public QWidget
private:
typedef boost::geometry::strategy::transform::map_transformer
<
- point_2d, QPointF,
+ double, 2, 2,
true, true
> map_transformer_type;
diff --git a/example/with_external_libs/x06_qt_world_mapper.sln b/example/with_external_libs/x06_qt_world_mapper.sln
deleted file mode 100644
index 32cfaf4ad..000000000
--- a/example/with_external_libs/x06_qt_world_mapper.sln
+++ /dev/null
@@ -1,19 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x06_qt_world_mapper", "x06_qt_world_mapper.vcproj", "{242C6ADC-3A10-4B69-81F7-5669E0582A8B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.ActiveCfg = Debug|Win32
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.Build.0 = Debug|Win32
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.ActiveCfg = Release|Win32
- {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/example/with_external_libs/x06_qt_world_mapper.vcproj b/example/with_external_libs/x06_qt_world_mapper.vcproj
deleted file mode 100644
index efee2124e..000000000
--- a/example/with_external_libs/x06_qt_world_mapper.vcproj
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/with_external_libs/x06_qt_world_mapper_readme.txt b/example/with_external_libs/x06_qt_world_mapper_readme.txt
index 8c67025e2..131bcca21 100644
--- a/example/with_external_libs/x06_qt_world_mapper_readme.txt
+++ b/example/with_external_libs/x06_qt_world_mapper_readme.txt
@@ -12,14 +12,6 @@ It will show a basic Qt Widget, displaying world countries
To compile this program:
Install Qt (if not done before)
-Install Boost (if not done before)
-
-Using MSVC:
- - edit the file qt.vsprops
- - set the UserMacro QT to point to your Qt distribution
- - edit the file boost.vsprops
- - set the UserMacro BOOST_ROOT to point to your Boost distribution
- - alternatively you can include Boost and/or Qt in your standard include path
Using Linux/gcc
- install Qt with sudo apt-get install libqt4-dev
diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp
index 9be51f409..f673c133d 100644
--- a/include/boost/geometry/algorithms/centroid.hpp
+++ b/include/boost/geometry/algorithms/centroid.hpp
@@ -90,55 +90,56 @@ struct centroid_point
template
<
- typename Box,
+ typename Indexed,
typename Point,
std::size_t Dimension,
std::size_t DimensionCount
>
-struct centroid_box_calculator
+struct centroid_indexed_calculator
{
typedef typename select_coordinate_type
<
- Box, Point
+ Indexed, Point
>::type coordinate_type;
- static inline void apply(Box const& box, Point& centroid)
+ static inline void apply(Indexed const& indexed, Point& centroid)
{
- coordinate_type const c1 = get(box);
- coordinate_type const c2 = get(box);
+ coordinate_type const c1 = get(indexed);
+ coordinate_type const c2 = get(indexed);
coordinate_type m = c1 + c2;
- m /= 2.0;
+ coordinate_type const two = 2;
+ m /= two;
set(centroid, m);
- centroid_box_calculator
+ centroid_indexed_calculator
<
- Box, Point,
+ Indexed, Point,
Dimension + 1, DimensionCount
- >::apply(box, centroid);
+ >::apply(indexed, centroid);
}
};
-template
-struct centroid_box_calculator
+template
+struct centroid_indexed_calculator
{
- static inline void apply(Box const& , Point& )
+ static inline void apply(Indexed const& , Point& )
{
}
};
-struct centroid_box
+struct centroid_indexed
{
- template
- static inline void apply(Box const& box, Point& centroid,
+ template
+ static inline void apply(Indexed const& indexed, Point& centroid,
Strategy const&)
{
- centroid_box_calculator
+ centroid_indexed_calculator
<
- Box, Point,
- 0, dimension::type::value
- >::apply(box, centroid);
+ Indexed, Point,
+ 0, dimension::type::value
+ >::apply(indexed, centroid);
}
};
@@ -279,7 +280,12 @@ struct centroid
template
struct centroid
- : detail::centroid::centroid_box
+ : detail::centroid::centroid_indexed
+{};
+
+template
+struct centroid
+ : detail::centroid::centroid_indexed
{};
template
diff --git a/include/boost/geometry/algorithms/detail/assign_values.hpp b/include/boost/geometry/algorithms/detail/assign_values.hpp
index ed4713493..82dd6bec6 100644
--- a/include/boost/geometry/algorithms/detail/assign_values.hpp
+++ b/include/boost/geometry/algorithms/detail/assign_values.hpp
@@ -46,36 +46,30 @@ namespace detail { namespace assign
{
-template
-<
- typename Box, std::size_t Index,
- std::size_t Dimension, std::size_t DimensionCount
->
+template
struct initialize
{
- typedef typename coordinate_type::type coordinate_type;
-
- static inline void apply(Box& box, coordinate_type const& value)
+ template
+ static inline void apply(Box& box, typename coordinate_type::type const& value)
{
geometry::set(box, value);
- initialize::apply(box, value);
+ initialize::apply(box, value);
}
};
-template
-struct initialize
+template
+struct initialize
{
- typedef typename coordinate_type::type coordinate_type;
-
- static inline void apply(Box&, coordinate_type const& )
+ template
+ static inline void apply(Box&, typename coordinate_type::type const&)
{}
};
-template
struct assign_zero_point
{
+ template
static inline void apply(Point& point)
{
geometry::assign_value(point, 0);
@@ -83,44 +77,38 @@ struct assign_zero_point
};
-template
struct assign_inverse_box_or_segment
{
- typedef typename point_type::type point_type;
+ template
static inline void apply(BoxOrSegment& geometry)
{
+ typedef typename point_type::type point_type;
typedef typename coordinate_type::type bound_type;
- initialize
- <
- BoxOrSegment, 0, 0, dimension::type::value
- >::apply(
- geometry, boost::numeric::bounds::highest());
- initialize
- <
- BoxOrSegment, 1, 0, dimension::type::value
- >::apply(
- geometry, boost::numeric::bounds::lowest());
+ initialize<0, 0, dimension::type::value>::apply(
+ geometry, boost::numeric::bounds::highest()
+ );
+ initialize<1, 0, dimension::type::value>::apply(
+ geometry, boost::numeric::bounds::lowest()
+ );
}
};
-template
struct assign_zero_box_or_segment
{
+ template
static inline void apply(BoxOrSegment& geometry)
{
typedef typename coordinate_type::type coordinate_type;
- initialize
- <
- BoxOrSegment, 0, 0, dimension::type::value
- >::apply(geometry, coordinate_type());
- initialize
- <
- BoxOrSegment, 1, 0, dimension::type::value
- >::apply(geometry, coordinate_type());
+ initialize<0, 0, dimension::type::value>::apply(
+ geometry, coordinate_type()
+ );
+ initialize<1, 0, dimension::type::value>::apply(
+ geometry, coordinate_type()
+ );
}
};
@@ -312,17 +300,17 @@ struct assign_zero {};
template
struct assign_zero
- : detail::assign::assign_zero_point
+ : detail::assign::assign_zero_point
{};
template
struct assign_zero
- : detail::assign::assign_zero_box_or_segment
+ : detail::assign::assign_zero_box_or_segment
{};
template
struct assign_zero
- : detail::assign::assign_zero_box_or_segment
+ : detail::assign::assign_zero_box_or_segment
{};
@@ -331,12 +319,12 @@ struct assign_inverse {};
template
struct assign_inverse
- : detail::assign::assign_inverse_box_or_segment
+ : detail::assign::assign_inverse_box_or_segment
{};
template
struct assign_inverse
- : detail::assign::assign_inverse_box_or_segment
+ : detail::assign::assign_inverse_box_or_segment
{};
diff --git a/include/boost/geometry/algorithms/detail/disjoint.hpp b/include/boost/geometry/algorithms/detail/disjoint.hpp
index e944e5169..f25e8a843 100644
--- a/include/boost/geometry/algorithms/detail/disjoint.hpp
+++ b/include/boost/geometry/algorithms/detail/disjoint.hpp
@@ -165,6 +165,128 @@ struct box_box
}
};
+// Segment - Box intersection
+// Based on Ray-AABB intersection
+// http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter3.htm
+
+// TODO - later maybe move to strategy::intersects and add a policy to conditionally extract intersection points
+
+template
+struct segment_box_intersection_dim
+{
+ //BOOST_STATIC_ASSERT(I < dimension::value);
+ //BOOST_STATIC_ASSERT(I < dimension::value);
+ //BOOST_STATIC_ASSERT(dimension::value == dimension::value);
+
+ typedef typename coordinate_type::type point_coordinate;
+
+ template static inline
+ bool apply(Point const& p0, Point const& p1, Box const& b, RelativeDistance & t_near, RelativeDistance & t_far)
+ {
+ //// WARNING! - RelativeDistance must be IEEE float for this to work (division by 0)
+ //BOOST_STATIC_ASSERT(boost::is_float::value);
+ //// Ray origin is in segment point 0
+ //RelativeDistance ray_d = geometry::get(p1) - geometry::get(p0);
+ //RelativeDistance tn = ( geometry::get(b) - geometry::get(p0) ) / ray_d;
+ //RelativeDistance tf = ( geometry::get(b) - geometry::get(p0) ) / ray_d;
+
+ // TODO - should we support also unsigned integers?
+ BOOST_STATIC_ASSERT(!boost::is_unsigned::value);
+ point_coordinate ray_d = geometry::get(p1) - geometry::get(p0);
+ RelativeDistance tn, tf;
+ if ( is_zero(ray_d) )
+ {
+ tn = dist_div_by_zero(geometry::get(b) - geometry::get(p0));
+ tf = dist_div_by_zero(geometry::get(b) - geometry::get(p0));
+ }
+ else
+ {
+ tn = static_cast(geometry::get(b) - geometry::get(p0)) / ray_d;
+ tf = static_cast(geometry::get(b) - geometry::get(p0)) / ray_d;
+ }
+
+ if ( tf < tn )
+ ::std::swap(tn, tf);
+
+ if ( t_near < tn )
+ t_near = tn;
+ if ( tf < t_far )
+ t_far = tf;
+
+ return 0 <= t_far && t_near <= t_far && t_near <= 1;
+ }
+
+ template static inline
+ R dist_div_by_zero(T const& val)
+ {
+ if ( is_zero(val) )
+ return 0;
+ else if ( val < 0 )
+ return -(::std::numeric_limits::max)();
+ else
+ return (::std::numeric_limits::max)();
+ }
+
+ template static inline
+ bool is_zero(T const& val)
+ {
+ // ray_d == 0 is here because eps of rational is 0 which isn't < than 0
+ return val == 0 || math::abs(val) < ::std::numeric_limits::epsilon();
+ }
+};
+
+template
+struct segment_box_intersection_impl
+{
+ BOOST_STATIC_ASSERT(0 < CurrentDimension);
+
+ typedef segment_box_intersection_dim for_dim;
+
+ template
+ static inline bool apply(Point const& p0, Point const& p1, Box const& b,
+ RelativeDistance & t_near, RelativeDistance & t_far)
+ {
+ return segment_box_intersection_impl::apply(p0, p1, b, t_near, t_far)
+ && for_dim::apply(p0, p1, b, t_near, t_far);
+ }
+};
+
+template
+struct segment_box_intersection_impl
+{
+ typedef segment_box_intersection_dim for_dim;
+
+ template
+ static inline bool apply(Point const& p0, Point const& p1, Box const& b,
+ RelativeDistance & t_near, RelativeDistance & t_far)
+ {
+ return for_dim::apply(p0, p1, b, t_near, t_far);
+ }
+};
+
+template
+struct segment_box_intersection
+{
+ typedef segment_box_intersection_impl::value> impl;
+
+ static inline bool apply(Point const& p0, Point const& p1, Box const& b)
+ {
+ typedef
+ typename geometry::promote_floating_point<
+ typename geometry::select_most_precise<
+ typename coordinate_type::type,
+ typename coordinate_type::type
+ >::type
+ >::type relative_distance_type;
+
+ relative_distance_type t_near = -(::std::numeric_limits::max)();
+ relative_distance_type t_far = (::std::numeric_limits::max)();
+
+ // relative_distance = 0 < t_near ? t_near : 0;
+
+ return impl::apply(p0, p1, b, t_near, t_far);
+ }
+};
template
<
diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp
new file mode 100644
index 000000000..29094de90
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp
@@ -0,0 +1,66 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, 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)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP
+
+#include
+
+#include
+#include
+#include
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+template
+inline void append_no_dups_or_spikes(Range& range, Point const& point)
+{
+#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
+ std::cout << " add: ("
+ << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")"
+ << std::endl;
+#endif
+
+ traits::push_back::apply(range, point);
+
+ // If a point is equal, or forming a spike, remove the pen-ultimate point because this one caused the spike.
+ // If so, the now-new-pen-ultimate point can again cause a spike (possibly at a corner). So keep doing this.
+ // Besides spikes it will also avoid duplicates.
+ while(boost::size(range) >= 3
+ && point_is_spike_or_equal(point, *(boost::end(range) - 3), *(boost::end(range) - 2)))
+ {
+ // Use the Concept/traits, so resize and append again
+ traits::resize::apply(range, boost::size(range) - 2);
+ traits::push_back::apply(range, point);
+ }
+
+ // There might still be one duplicate not catched by the condition above
+ if (boost::size(range) == 2
+ && geometry::detail::equals::equals_point_point(*boost::begin(range), point))
+ {
+ traits::clear::apply(range);
+ traits::push_back::apply(range, point);
+ }
+}
+
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP
diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
index 5063f49eb..646219d46 100644
--- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
@@ -18,6 +18,10 @@
#include
+#ifdef BOOST_GEOMETRY_TIME_OVERLAY
+# include
+#endif
+
namespace boost { namespace geometry
{
diff --git a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp
index 012b3aca3..ef840d86a 100644
--- a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp
@@ -101,7 +101,7 @@ public :
// Make bad output clean
rings.resize(size_at_start);
- ring.clear();
+ geometry::traits::clear::type>::apply(ring);
// Reject this as a starting point
operation.visited.set_rejected();
diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
index 805f3923e..8d487d599 100644
--- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
@@ -27,7 +27,7 @@
#include
#include
-#include
+#include
namespace boost { namespace geometry
{
@@ -93,7 +93,7 @@ struct copy_segments_ring
for (size_type i = 0; i < count; ++i, ++it)
{
- detail::overlay::append_no_duplicates(current_output, *it);
+ detail::overlay::append_no_dups_or_spikes(current_output, *it);
}
}
};
@@ -129,7 +129,7 @@ struct copy_segments_linestring
for (size_type i = 0; i < count; ++i, ++it)
{
- detail::overlay::append_no_duplicates(current_output, *it);
+ detail::overlay::append_no_dups_or_spikes(current_output, *it);
}
}
};
@@ -195,7 +195,7 @@ struct copy_segments_box
// (see comments in ring-version)
for (int i = 0; i < count; i++, index++)
{
- detail::overlay::append_no_duplicates(current_output, bp[index % 5]);
+ detail::overlay::append_no_dups_or_spikes(current_output, bp[index % 5]);
}
}
diff --git a/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp b/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp
index 8c8ed9618..d92a0a969 100644
--- a/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp
@@ -40,7 +40,8 @@ struct enrichment_info
point_tag,
P
>::type
- >::type
+ >::type,
+ P, P
>::type distance_type;
inline enrichment_info()
diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp
index 782ea7fd2..23487872a 100644
--- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp
@@ -256,7 +256,6 @@ public :
advance_to_non_duplicate_next(nd_next2, it2, sec2);
typedef typename boost::range_value::type turn_info;
- typedef typename turn_info::point_type ip;
turn_info ti;
ti.operations[0].seg_id = segment_identifier(source_id1,
@@ -838,13 +837,13 @@ inline void get_turns(Geometry1 const& geometry1,
{
concept::check_concepts_and_equal_dimensions();
- typedef typename strategy_intersection
- <
- typename cs_tag::type,
- Geometry1,
- Geometry2,
- typename boost::range_value::type
- >::segment_intersection_strategy_type segment_intersection_strategy_type;
+ //typedef typename strategy_intersection
+ // <
+ // typename cs_tag::type,
+ // Geometry1,
+ // Geometry2,
+ // typename boost::range_value::type
+ // >::segment_intersection_strategy_type segment_intersection_strategy_type;
typedef detail::overlay::get_turn_info
<
diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp
index af9a8d991..39432dc50 100644
--- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp
@@ -40,6 +40,10 @@
# include
#endif
+#ifdef BOOST_GEOMETRY_TIME_OVERLAY
+# include