|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79534 - in branches/release: boost/geometry boost/geometry/algorithms boost/geometry/arithmetic boost/geometry/core boost/geometry/geometries boost/geometry/io boost/geometry/io/dsv boost/geometry/iterators boost/geometry/multi boost/geometry/policies boost/geometry/strategies boost/geometry/strategies/cartesian boost/geometry/util boost/geometry/views libs/geometry/doc libs/geometry/doc/concept libs/geometry/doc/doxy libs/geometry/doc/generated libs/geometry/doc/html libs/geometry/doc/reference libs/geometry/doc/src libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk libs/geometry/example libs/geometry/test
From: barend.gehrels_at_[hidden]
Date: 2012-07-15 11:02:16
Author: barendgehrels
Date: 2012-07-15 11:02:16 EDT (Sun, 15 Jul 2012)
New Revision: 79534
URL: http://svn.boost.org/trac/boost/changeset/79534
Log:
[geometry] merged into release (two fixes, doc change) since r79395
Properties modified:
branches/release/boost/geometry/algorithms/ (props changed)
branches/release/boost/geometry/arithmetic/ (props changed)
branches/release/boost/geometry/core/ (props changed)
branches/release/boost/geometry/geometries/ (props changed)
branches/release/boost/geometry/geometry.hpp (props changed)
branches/release/boost/geometry/io/ (props changed)
branches/release/boost/geometry/io/dsv/ (props changed)
branches/release/boost/geometry/iterators/ (props changed)
branches/release/boost/geometry/multi/ (props changed)
branches/release/boost/geometry/policies/ (props changed)
branches/release/boost/geometry/strategies/ (props changed)
branches/release/boost/geometry/util/ (props changed)
branches/release/boost/geometry/views/ (props changed)
branches/release/libs/geometry/doc/ (props changed)
branches/release/libs/geometry/doc/Jamfile.v2 (contents, props changed)
branches/release/libs/geometry/doc/about_documentation.qbk (props changed)
branches/release/libs/geometry/doc/acknowledgments.qbk (props changed)
branches/release/libs/geometry/doc/compiling.qbk (props changed)
branches/release/libs/geometry/doc/concept/ (props changed)
branches/release/libs/geometry/doc/copyright_note_policy.txt (props changed)
branches/release/libs/geometry/doc/design_rationale.qbk (props changed)
branches/release/libs/geometry/doc/doxy/ (props changed)
branches/release/libs/geometry/doc/generated/ (props changed)
branches/release/libs/geometry/doc/geometry.qbk (props changed)
branches/release/libs/geometry/doc/html/ (props changed)
branches/release/libs/geometry/doc/imports.qbk (props changed)
branches/release/libs/geometry/doc/introduction.qbk (props changed)
branches/release/libs/geometry/doc/make_qbk.py (props changed)
branches/release/libs/geometry/doc/matrix.qbk (props changed)
branches/release/libs/geometry/doc/quickref.xml (props changed)
branches/release/libs/geometry/doc/quickstart.qbk (props changed)
branches/release/libs/geometry/doc/readme.txt (props changed)
branches/release/libs/geometry/doc/reference/ (props changed)
branches/release/libs/geometry/doc/reference.qbk (props changed)
branches/release/libs/geometry/doc/release_notes.qbk (contents, props changed)
branches/release/libs/geometry/doc/src/ (props changed)
branches/release/libs/geometry/example/ (props changed)
branches/release/libs/geometry/test/ (props changed)
Text files modified:
branches/release/boost/geometry/strategies/cartesian/cart_intersect.hpp | 168 ++++++++++++++++++++--------------------
branches/release/libs/geometry/doc/Jamfile.v2 | 4
branches/release/libs/geometry/doc/release_notes.qbk | 24 ++++-
branches/release/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp | 54 ++++++++++++
4 files changed, 157 insertions(+), 93 deletions(-)
Modified: branches/release/boost/geometry/strategies/cartesian/cart_intersect.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/cartesian/cart_intersect.hpp (original)
+++ branches/release/boost/geometry/strategies/cartesian/cart_intersect.hpp 2012-07-15 11:02:16 EDT (Sun, 15 Jul 2012)
@@ -172,28 +172,28 @@
>::type promoted_type;
// r: ratio 0-1 where intersection divides A/B
- // (only calculated for non-collinear segments)
- promoted_type r;
- if (! collinear)
- {
- // Calculate determinants - Cramers rule
- coordinate_type const wx = get<0, 0>(a) - get<0, 0>(b);
- coordinate_type const wy = get<0, 1>(a) - get<0, 1>(b);
- coordinate_type const d = geometry::detail::determinant<coordinate_type>(dx_a, dy_a, dx_b, dy_b);
- coordinate_type const da = geometry::detail::determinant<coordinate_type>(dx_b, dy_b, wx, wy);
-
- coordinate_type const zero = coordinate_type();
- if (math::equals(d, zero))
- {
- // This is still a collinear case (because of FP imprecision this can occur here)
- // sides.debug();
- sides.set<0>(0,0);
- sides.set<1>(0,0);
- collinear = true;
- }
- else
- {
- r = da / d;
+ // (only calculated for non-collinear segments)
+ promoted_type r;
+ if (! collinear)
+ {
+ // Calculate determinants - Cramers rule
+ coordinate_type const wx = get<0, 0>(a) - get<0, 0>(b);
+ coordinate_type const wy = get<0, 1>(a) - get<0, 1>(b);
+ coordinate_type const d = geometry::detail::determinant<coordinate_type>(dx_a, dy_a, dx_b, dy_b);
+ coordinate_type const da = geometry::detail::determinant<coordinate_type>(dx_b, dy_b, wx, wy);
+
+ coordinate_type const zero = coordinate_type();
+ if (math::equals(d, zero))
+ {
+ // This is still a collinear case (because of FP imprecision this can occur here)
+ // sides.debug();
+ sides.set<0>(0,0);
+ sides.set<1>(0,0);
+ collinear = true;
+ }
+ else
+ {
+ r = promoted_type(da) / promoted_type(d);
if (! robustness_verify_r(a, b, r))
{
@@ -207,8 +207,8 @@
return Policy::disjoint();
}
- }
- }
+ }
+ }
if(collinear)
{
@@ -218,7 +218,7 @@
}
else
{
- // Y direction contains larger segments (maybe dx is zero)
+ // Y direction contains larger segments (maybe dx is zero)
return relate_collinear<1>(a, b);
}
}
@@ -231,23 +231,23 @@
private :
- // Ratio should lie between 0 and 1
- // Also these three conditions might be of FP imprecision, the segments were actually (nearly) collinear
+ // Ratio should lie between 0 and 1
+ // Also these three conditions might be of FP imprecision, the segments were actually (nearly) collinear
template <typename T>
static inline bool robustness_verify_r(
segment_type1 const& a, segment_type2 const& b,
T& r)
{
- T const zero = 0;
- T const one = 1;
+ T const zero = 0;
+ T const one = 1;
if (r < zero || r > one)
{
- if (verify_disjoint<0>(a, b) || verify_disjoint<1>(a, b))
- {
- // Can still be disjoint (even if not one is left or right from another)
+ if (verify_disjoint<0>(a, b) || verify_disjoint<1>(a, b))
+ {
+ // Can still be disjoint (even if not one is left or right from another)
// This is e.g. in case #snake4 of buffer test.
- return false;
- }
+ return false;
+ }
//std::cout << "ROBUSTNESS: correction of r " << r << std::endl;
// sides.debug();
@@ -273,7 +273,7 @@
}
else if (r < zero)
{
- r = zero;
+ r = zero;
}
}
return true;
@@ -284,16 +284,16 @@
side_info& sides,
bool& collinear)
{
- if ((sides.zero<0>() && ! sides.zero<1>()) || (sides.zero<1>() && ! sides.zero<0>()))
- {
- // If one of the segments is collinear, the other must be as well.
- // So handle it as collinear.
- // (In float/double epsilon margins it can easily occur that one or two of them are -1/1)
- // sides.debug();
+ if ((sides.zero<0>() && ! sides.zero<1>()) || (sides.zero<1>() && ! sides.zero<0>()))
+ {
+ // If one of the segments is collinear, the other must be as well.
+ // So handle it as collinear.
+ // (In float/double epsilon margins it can easily occur that one or two of them are -1/1)
+ // sides.debug();
sides.set<0>(0,0);
sides.set<1>(0,0);
collinear = true;
- }
+ }
}
static inline void robustness_verify_meeting(
@@ -389,11 +389,11 @@
{
if (sides.one_of_all_zero())
{
- if (verify_disjoint<0>(a, b) || verify_disjoint<1>(a, b))
- {
- return true;
+ if (verify_disjoint<0>(a, b) || verify_disjoint<1>(a, b))
+ {
+ return true;
}
- }
+ }
return false;
}
@@ -412,11 +412,11 @@
T const db = geometry::detail::determinant<T>(dx_a, dy_a, wx, wy);
- R const zero = 0;
- R const one = 1;
+ R const zero = 0;
+ R const one = 1;
if (math::equals(r, zero) || math::equals(r, one))
{
- R rb = db / d;
+ R rb = db / d;
if (rb <= 0 || rb >= 1 || math::equals(rb, 0) || math::equals(rb, 1))
{
if (sides.one_zero<0>() && ! sides.one_zero<1>()) // or vice versa
@@ -432,16 +432,16 @@
}
}
- template <std::size_t Dimension>
+ template <std::size_t Dimension>
static inline bool verify_disjoint(segment_type1 const& a,
- segment_type2 const& b)
- {
- coordinate_type a_1, a_2, b_1, b_2;
- bool a_swapped = false, b_swapped = false;
- detail::segment_arrange<Dimension>(a, a_1, a_2, a_swapped);
- detail::segment_arrange<Dimension>(b, b_1, b_2, b_swapped);
- return math::smaller(a_2, b_1) || math::larger(a_1, b_2);
- }
+ segment_type2 const& b)
+ {
+ coordinate_type a_1, a_2, b_1, b_2;
+ bool a_swapped = false, b_swapped = false;
+ detail::segment_arrange<Dimension>(a, a_1, a_2, a_swapped);
+ detail::segment_arrange<Dimension>(b, b_1, b_2, b_swapped);
+ return math::smaller(a_2, b_1) || math::larger(a_1, b_2);
+ }
template <typename Segment>
static inline typename point_type<Segment>::type select(int index, Segment const& segment)
@@ -476,10 +476,10 @@
template <std::size_t Dimension>
static inline bool analyse_equal(segment_type1 const& a, segment_type2 const& b)
{
- coordinate_type const a_1 = geometry::get<0, Dimension>(a);
- coordinate_type const a_2 = geometry::get<1, Dimension>(a);
- coordinate_type const b_1 = geometry::get<0, Dimension>(b);
- coordinate_type const b_2 = geometry::get<1, Dimension>(b);
+ coordinate_type const a_1 = geometry::get<0, Dimension>(a);
+ coordinate_type const a_2 = geometry::get<1, Dimension>(a);
+ coordinate_type const b_1 = geometry::get<0, Dimension>(b);
+ coordinate_type const b_2 = geometry::get<1, Dimension>(b);
return math::equals(a_1, b_1)
|| math::equals(a_2, b_1)
|| math::equals(a_1, b_2)
@@ -487,21 +487,21 @@
;
}
- template <std::size_t Dimension>
+ template <std::size_t Dimension>
static inline return_type relate_collinear(segment_type1 const& a,
- segment_type2 const& b)
- {
- coordinate_type a_1, a_2, b_1, b_2;
- bool a_swapped = false, b_swapped = false;
- detail::segment_arrange<Dimension>(a, a_1, a_2, a_swapped);
- detail::segment_arrange<Dimension>(b, b_1, b_2, b_swapped);
- if (math::smaller(a_2, b_1) || math::larger(a_1, b_2))
- //if (a_2 < b_1 || a_1 > b_2)
- {
- return Policy::disjoint();
- }
+ segment_type2 const& b)
+ {
+ coordinate_type a_1, a_2, b_1, b_2;
+ bool a_swapped = false, b_swapped = false;
+ detail::segment_arrange<Dimension>(a, a_1, a_2, a_swapped);
+ detail::segment_arrange<Dimension>(b, b_1, b_2, b_swapped);
+ if (math::smaller(a_2, b_1) || math::larger(a_1, b_2))
+ //if (a_2 < b_1 || a_1 > b_2)
+ {
+ return Policy::disjoint();
+ }
return relate_collinear(a, b, a_1, a_2, b_1, b_2, a_swapped, b_swapped);
- }
+ }
/// Relate segments known collinear
static inline return_type relate_collinear(segment_type1 const& a
@@ -535,22 +535,22 @@
bool const both_swapped = a_swapped && b_swapped;
// Check if segments are equal or opposite equal...
- bool const swapped_a1_eq_b1 = math::equals(a_1, b_1);
- bool const swapped_a2_eq_b2 = math::equals(a_2, b_2);
+ bool const swapped_a1_eq_b1 = math::equals(a_1, b_1);
+ bool const swapped_a2_eq_b2 = math::equals(a_2, b_2);
if (swapped_a1_eq_b1 && swapped_a2_eq_b2)
{
return Policy::segment_equal(a, opposite);
}
- bool const swapped_a2_eq_b1 = math::equals(a_2, b_1);
- bool const swapped_a1_eq_b2 = math::equals(a_1, b_2);
+ bool const swapped_a2_eq_b1 = math::equals(a_2, b_1);
+ bool const swapped_a1_eq_b2 = math::equals(a_1, b_2);
- bool const a1_eq_b1 = both_swapped ? swapped_a2_eq_b2 : a_swapped ? swapped_a2_eq_b1 : b_swapped ? swapped_a1_eq_b2 : swapped_a1_eq_b1;
- bool const a2_eq_b2 = both_swapped ? swapped_a1_eq_b1 : a_swapped ? swapped_a1_eq_b2 : b_swapped ? swapped_a2_eq_b1 : swapped_a2_eq_b2;
+ bool const a1_eq_b1 = both_swapped ? swapped_a2_eq_b2 : a_swapped ? swapped_a2_eq_b1 : b_swapped ? swapped_a1_eq_b2 : swapped_a1_eq_b1;
+ bool const a2_eq_b2 = both_swapped ? swapped_a1_eq_b1 : a_swapped ? swapped_a1_eq_b2 : b_swapped ? swapped_a2_eq_b1 : swapped_a2_eq_b2;
- bool const a1_eq_b2 = both_swapped ? swapped_a2_eq_b1 : a_swapped ? swapped_a2_eq_b2 : b_swapped ? swapped_a1_eq_b1 : swapped_a1_eq_b2;
- bool const a2_eq_b1 = both_swapped ? swapped_a1_eq_b2 : a_swapped ? swapped_a1_eq_b1 : b_swapped ? swapped_a2_eq_b2 : swapped_a2_eq_b1;
+ bool const a1_eq_b2 = both_swapped ? swapped_a2_eq_b1 : a_swapped ? swapped_a2_eq_b2 : b_swapped ? swapped_a1_eq_b1 : swapped_a1_eq_b2;
+ bool const a2_eq_b1 = both_swapped ? swapped_a1_eq_b2 : a_swapped ? swapped_a1_eq_b1 : b_swapped ? swapped_a2_eq_b2 : swapped_a2_eq_b1;
@@ -722,7 +722,7 @@
;
}
// Nothing should goes through. If any we have made an error
- // std::cout << "Robustness issue, non-logical behaviour" << std::endl;
+ // std::cout << "Robustness issue, non-logical behaviour" << std::endl;
return Policy::error("Robustness issue, non-logical behaviour");
}
};
Modified: branches/release/libs/geometry/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/geometry/doc/Jamfile.v2 (original)
+++ branches/release/libs/geometry/doc/Jamfile.v2 2012-07-15 11:02:16 EDT (Sun, 15 Jul 2012)
@@ -41,5 +41,5 @@
<format>pdf:<xsl:param>img.src.path=$(images_location)/
;
-install pdf-install : geometry : <location>. <name>geometry.pdf <install-type>PDF ;
-explicit pdf-install ;
+install pdfinstall : geometry/<format>pdf : <location>. <name>geometry.pdf <install-type>PDF ;
+explicit pdfinstall ;
Modified: branches/release/libs/geometry/doc/release_notes.qbk
==============================================================================
--- branches/release/libs/geometry/doc/release_notes.qbk (original)
+++ branches/release/libs/geometry/doc/release_notes.qbk 2012-07-15 11:02:16 EDT (Sun, 15 Jul 2012)
@@ -12,12 +12,29 @@
[section:release_notes Release Notes]
+
[/=================]
-[heading Boost 1.50]
+[heading Boost 1.51]
[/=================]
[*Breaking changes]
+* points accessed through a pointer (e.g. in a linestring) should now be specialized without the pointer. In previous versions a type `my_point` used like `linestring<my_point*>` had to be specalized like: `template<> struct tag<my_point*>`. Now the library itself removes the pointer before calling the traits class, so now it should be like: `template<> struct tag<my_point>`
+
+[*Bugfixes]
+
+* intersection was sometimes wrong for integer points, fixed
+* documentation, order of parameters in simplify was wrong, fixed
+
+[*Solved tickets]
+
+* [@https://svn.boost.org/trac/boost/ticket/7030 7030] spherical distance, fixed (by patch of Karsten Ahnert)
+
+
+[/=================]
+[heading Boost 1.50]
+[/=================]
+
[*Bugfixes]
* the return type of comparable projected point strategy for integer points was wrong (integer), fixed
@@ -37,11 +54,6 @@
* added algorithm "touches" (OGC SF compliant) for *polygon/*polygon
-[*Documentation]
-
-[*Internal changes]
-
-
[/=================]
[heading Boost 1.49]
[/=================]
Modified: branches/release/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
==============================================================================
--- branches/release/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp (original)
+++ branches/release/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp 2012-07-15 11:02:16 EDT (Sun, 15 Jul 2012)
@@ -228,6 +228,46 @@
}
}
+static void copy_string_property(std::string const& source, std::string& target)
+{
+ if (target.empty())
+ {
+ target = source;
+ }
+}
+
+
+template <typename Parameters>
+static void copy_parameter_properties(parameter const& source, Parameters& target)
+{
+ BOOST_FOREACH(parameter& t, target)
+ {
+ if (source.name == t.name)
+ {
+ t.skip = source.skip;
+ copy_string_property(source.brief_description, t.brief_description);
+ copy_string_property(source.type, t.type);
+ copy_string_property(source.default_value, t.default_value);
+ copy_string_property(source.fulltype, t.fulltype);
+
+ return;
+ }
+ }
+ // If not found, write a warning
+ std::cerr << "Parameter not found: " << source.name << std::endl;
+}
+
+
+template <typename Parameters>
+static void copy_parameters_properties(Parameters const& source, Parameters& target)
+{
+ BOOST_FOREACH(parameter const& s, source)
+ {
+ copy_parameter_properties(s, target);
+ }
+}
+
+
template <typename Element>
static void parse_element(rapidxml::xml_node<>* node, configuration const& config, std::string const& parent, Element& el)
@@ -290,13 +330,25 @@
std::string kind = get_attribute(node, "kind");
if (kind == "param")
{
- parse_parameter_list(node->first_node(), el.parameters);
+ // Parse parameters and their descriptions.
+ // NOTE: they are listed here, but the order might not be the order in the function call
+ std::vector<parameter> parameters;
+ parse_parameter_list(node->first_node(), parameters);
+ copy_parameters_properties(parameters, el.parameters);
}
else if (kind == "templateparam")
{
parse_parameter_list(node->first_node(), el.template_parameters);
}
}
+ else if (full == ".param")
+ {
+ // Parse one parameter, and add it to el.parameters
+ parameter p;
+ parse_parameter(node->first_node(), p);
+ el.parameters.push_back(p);
+ }
+
parse_element(node->first_node(), config, full, el);
parse_element(node->next_sibling(), config, parent, el);
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