summaryrefslogtreecommitdiff
path: root/libs/geometry/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'libs/geometry/doc/src')
-rw-r--r--libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp79
-rw-r--r--libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp31
-rw-r--r--libs/geometry/doc/src/examples/algorithms/Jamfile.v213
-rw-r--r--libs/geometry/doc/src/examples/algorithms/is_valid.cpp4
-rw-r--r--libs/geometry/doc/src/examples/algorithms/is_valid_failure.cpp68
-rw-r--r--libs/geometry/doc/src/examples/algorithms/is_valid_message.cpp55
6 files changed, 205 insertions, 45 deletions
diff --git a/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp b/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
index 16b1a5c59..17f20bf42 100644
--- a/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
+++ b/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
@@ -1,7 +1,13 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
//
-// Copyright (c) 2010-2013 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland.
+// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2012-2015 Adam Wulkiewicz, Lodz, Poland.
+
+// This file was modified by Oracle on 2014, 2015.
+// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+
// 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)
@@ -166,9 +172,27 @@ void quickbook_synopsis(enumeration const& e, std::ostream& out)
{
out << "``enum " << e.name;
bool first = true;
+
+ bool has_many_values = e.enumeration_values.size() > 4;
+
BOOST_FOREACH(enumeration_value const& value, e.enumeration_values)
{
- out << (first ? " {" : ", ") << value.name;
+ if (has_many_values)
+ {
+ if (first)
+ {
+ out << std::endl << "{";
+ }
+ else
+ {
+ out << ",";
+ }
+ out << std::endl << " " << value.name;
+ }
+ else
+ {
+ out << (first ? " {" : ", ") << value.name;
+ }
if (! value.initializer.empty())
{
// Doxygen 1.6 does not include "=" in the <initializer> tag, Doxygen 1.8 does.
@@ -179,6 +203,10 @@ void quickbook_synopsis(enumeration const& e, std::ostream& out)
}
if (! first)
{
+ if (has_many_values)
+ {
+ out << std::endl;
+ }
out << "};";
}
out << "``"
@@ -945,7 +973,11 @@ void quickbook_template_parameter_list_alt(std::vector<parameter> const& paramet
if ( !p.default_value.empty() )
{
out << " = ";
- inline_str_with_links(p.default_value, out);
+ // don't display default values from details
+ if ( p.default_value.find("detail") != std::string::npos )
+ out << "/default/";
+ else
+ inline_str_with_links(p.default_value, out);
}
first = false;
@@ -968,13 +1000,20 @@ void quickbook_synopsis_alt(function const& f, std::ostream& out)
offset += f.name.size();
break;
case function_member :
- inline_str_with_links(f.return_type, out);
- out << " `" << f.name << "`";
- offset += f.return_type_without_links.size() + 1 + f.name.size();
- break;
case function_free :
- inline_str_with_links(f.definition, out);
- offset += f.definition.size();
+ // don't display return types from details
+ if ( f.return_type.find("detail") != std::string::npos )
+ {
+ out << "/unspecified/";
+ offset += 11;
+ }
+ else
+ {
+ inline_str_with_links(f.return_type, out);
+ offset += f.return_type_without_links.size();
+ }
+ out << " `" << f.name << "`";
+ offset += 1 + f.name.size();
break;
case function_define :
out << "`#define " << f.name << "`";
@@ -1008,7 +1047,11 @@ void quickbook_synopsis_alt(function const& f, std::ostream& out)
if ( !p.default_value.empty() )
{
out << " = ";
- inline_str_with_links(p.default_value, out);
+ // don't display default values from details
+ if ( p.default_value.find("detail") != std::string::npos )
+ out << "/default/";
+ else
+ inline_str_with_links(p.default_value, out);
}
first = false;
}
@@ -1048,20 +1091,24 @@ void quickbook_synopsis_alt(class_or_struct const& cos, configuration const& con
if (! cos.base_classes.empty())
{
- out << "` : ";
bool first = true;
BOOST_FOREACH(base_class const& bc, cos.base_classes)
{
- if (! first)
- {
+ // don't display base classes from details
+ if ( bc.name.find("detail") != std::string::npos )
+ continue;
+
+ if (first)
+ out << "` : ";
+ else
out << std::endl << " , ";
- }
out << output_if_different(bc.derivation, "private")
<< output_if_different(bc.virtuality, "non-virtual")
<< namespace_skipped(bc.name, config);
first = false;
}
- out << "`" << std::endl;
+ if (!first)
+ out << "`" << std::endl;
}
out << "`{`" << std::endl
diff --git a/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp b/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp
index 9372a1967..6bf00b5d0 100644
--- a/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp
+++ b/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp
@@ -1,8 +1,8 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Tool reporting Implementation Support Status in QBK or plain text format
-// Copyright (c) 2011-2012 Bruno Lalande, Paris, France.
-// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2011-2015 Bruno Lalande, Paris, France.
+// Copyright (c) 2011-2015 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
@@ -48,26 +48,6 @@
#include <boost/geometry/algorithms/transform.hpp>
#include <boost/geometry/algorithms/unique.hpp>
#include <boost/geometry/io/wkt/wkt.hpp>
-#include <boost/geometry/multi/algorithms/append.hpp>
-#include <boost/geometry/multi/algorithms/area.hpp>
-#include <boost/geometry/multi/algorithms/centroid.hpp>
-#include <boost/geometry/multi/algorithms/clear.hpp>
-#include <boost/geometry/multi/algorithms/convert.hpp>
-#include <boost/geometry/multi/algorithms/correct.hpp>
-#include <boost/geometry/multi/algorithms/covered_by.hpp>
-#include <boost/geometry/multi/algorithms/distance.hpp>
-#include <boost/geometry/multi/algorithms/envelope.hpp>
-#include <boost/geometry/multi/algorithms/equals.hpp>
-#include <boost/geometry/multi/algorithms/for_each.hpp>
-#include <boost/geometry/multi/algorithms/length.hpp>
-#include <boost/geometry/multi/algorithms/num_geometries.hpp>
-#include <boost/geometry/multi/algorithms/num_interior_rings.hpp>
-#include <boost/geometry/multi/algorithms/num_points.hpp>
-#include <boost/geometry/multi/algorithms/perimeter.hpp>
-#include <boost/geometry/multi/algorithms/reverse.hpp>
-#include <boost/geometry/multi/algorithms/simplify.hpp>
-#include <boost/geometry/multi/algorithms/transform.hpp>
-#include <boost/geometry/multi/algorithms/unique.hpp>
#include <boost/geometry/strategies/strategies.hpp>
#include "text_outputter.hpp"
@@ -103,6 +83,11 @@ typedef boost::mpl::vector<
struct algorithm: boost::geometry::dispatch::algorithm<G> \
{};
+#define DECLARE_UNARY_ALGORITHM_WITH_BOOLEAN(algorithm) \
+ template <typename G> \
+ struct algorithm: boost::geometry::dispatch::algorithm<G,false> \
+ {};
+
#define DECLARE_BINARY_ALGORITHM(algorithm) \
template <typename G1, typename G2> \
struct algorithm: boost::geometry::dispatch::algorithm<G1, G2> \
@@ -129,7 +114,7 @@ DECLARE_UNARY_ALGORITHM(is_valid)
DECLARE_UNARY_ALGORITHM(length)
DECLARE_UNARY_ALGORITHM(num_geometries)
DECLARE_UNARY_ALGORITHM(num_interior_rings)
-DECLARE_UNARY_ALGORITHM(num_points)
+DECLARE_UNARY_ALGORITHM_WITH_BOOLEAN(num_points)
DECLARE_UNARY_ALGORITHM(num_segments)
DECLARE_BINARY_ALGORITHM(overlaps)
DECLARE_UNARY_ALGORITHM(perimeter)
diff --git a/libs/geometry/doc/src/examples/algorithms/Jamfile.v2 b/libs/geometry/doc/src/examples/algorithms/Jamfile.v2
index 946e66f39..cc277080a 100644
--- a/libs/geometry/doc/src/examples/algorithms/Jamfile.v2
+++ b/libs/geometry/doc/src/examples/algorithms/Jamfile.v2
@@ -1,8 +1,13 @@
# Boost.Geometry (aka GGL, Generic Geometry Library)
#
-# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
-# Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
-# Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
+# Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
+# Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
+
+# This file was modified by Oracle on 2014, 2015.
+# Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
+
+# Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -54,6 +59,8 @@ exe intersects_linestring : intersects_linestring.cpp ;
exe is_simple : is_simple.cpp ;
exe is_valid : is_valid.cpp ;
+exe is_valid_failure : is_valid_failure.cpp ;
+exe is_valid_message : is_valid_message.cpp ;
exe length : length.cpp ;
exe length_with_strategy : length_with_strategy.cpp ;
diff --git a/libs/geometry/doc/src/examples/algorithms/is_valid.cpp b/libs/geometry/doc/src/examples/algorithms/is_valid.cpp
index 2cb12f354..d802b3c45 100644
--- a/libs/geometry/doc/src/examples/algorithms/is_valid.cpp
+++ b/libs/geometry/doc/src/examples/algorithms/is_valid.cpp
@@ -24,9 +24,7 @@ int main()
typedef boost::geometry::model::polygon<point_type> polygon_type;
polygon_type poly;
- boost::geometry::read_wkt(
- "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 2,0 0),(0 0,2 9,1 9,0 0),(2 9,9 2,9 9,2 9))"
- , poly);
+ boost::geometry::read_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 2,0 0),(0 0,2 9,1 9,0 0),(2 9,9 2,9 9,2 9))", poly);
std::cout << "is valid? " << (boost::geometry::is_valid(poly) ? "yes" : "no") << std::endl;
/*<-*/ create_svg("is_valid_example.svg", poly); /*->*/
diff --git a/libs/geometry/doc/src/examples/algorithms/is_valid_failure.cpp b/libs/geometry/doc/src/examples/algorithms/is_valid_failure.cpp
new file mode 100644
index 000000000..f566e23a2
--- /dev/null
+++ b/libs/geometry/doc/src/examples/algorithms/is_valid_failure.cpp
@@ -0,0 +1,68 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2015, Oracle and/or its affiliates
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+
+// Licensed under the Boost Software License version 1.0.
+// http://www.boost.org/users/license.html
+
+//[is_valid_failure
+//` Checks whether a geometry is valid and, if not valid, checks if it could be fixed by bg::correct; if so bg::correct is called on the geometry
+
+#include <iostream>
+
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+/*<-*/ #include "create_svg_one.hpp" /*->*/
+
+int main()
+{
+ typedef boost::geometry::model::d2::point_xy<double> point_type;
+ typedef boost::geometry::model::polygon<point_type> polygon_type;
+
+ polygon_type poly;
+ boost::geometry::read_wkt("POLYGON((0 0,0 10,10 10,10 0),(0 0,9 2,9 1,0 0),(0 0,2 9,1 9,0 0))", poly);
+
+ std::cout << "original geometry: " << boost::geometry::dsv(poly) << std::endl;
+ boost::geometry::validity_failure_type failure;
+ bool valid = boost::geometry::is_valid(poly, failure);
+
+ // if the invalidity is only due to lack of closing points and/or wrongly oriented rings, then bg::correct can fix it
+ bool could_be_fixed = (failure == boost::geometry::failure_not_closed
+ || boost::geometry::failure_wrong_orientation);
+ std::cout << "is valid? " << (valid ? "yes" : "no") << std::endl;
+ if (! valid)
+ {
+ std::cout << "can boost::geometry::correct remedy invalidity? " << (could_be_fixed ? "possibly yes" : "no") << std::endl;
+ if (could_be_fixed)
+ {
+ boost::geometry::correct(poly);
+ std::cout << "after correction: " << (boost::geometry::is_valid(poly) ? "valid" : "still invalid") << std::endl;
+ std::cout << "corrected geometry: " << boost::geometry::dsv(poly) << std::endl;
+ }
+ }
+ /*<-*/ create_svg("is_valid_failure_example.svg", poly); /*->*/
+ return 0;
+}
+
+//]
+
+//[is_valid_failure_output
+/*`
+Output:
+[pre
+original geometry: (((0, 0), (0, 10), (10, 10), (10, 0)), ((0, 0), (9, 2), (9, 1), (0, 0)), ((0, 0), (2, 9), (1, 9), (0, 0)))
+is valid? no
+can boost::geometry::correct remedy invalidity? possibly yes
+after correction: valid
+corrected geometry: (((0, 0), (0, 10), (10, 10), (10, 0), (0, 0)), ((0, 0), (9, 1), (9, 2), (0, 0)), ((0, 0), (2, 9), (1, 9), (0, 0)))
+
+[$img/algorithms/is_valid_failure_example.png]
+
+]
+
+*/
+//]
diff --git a/libs/geometry/doc/src/examples/algorithms/is_valid_message.cpp b/libs/geometry/doc/src/examples/algorithms/is_valid_message.cpp
new file mode 100644
index 000000000..673657342
--- /dev/null
+++ b/libs/geometry/doc/src/examples/algorithms/is_valid_message.cpp
@@ -0,0 +1,55 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2015, Oracle and/or its affiliates
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+
+// Licensed under the Boost Software License version 1.0.
+// http://www.boost.org/users/license.html
+
+//[is_valid_message
+//` Checks whether a geometry is valid and, if not valid, prints a message describing the reason
+
+#include <iostream>
+#include <string>
+
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+/*<-*/ #include "create_svg_one.hpp" /*->*/
+
+int main()
+{
+ typedef boost::geometry::model::d2::point_xy<double> point_type;
+ typedef boost::geometry::model::polygon<point_type> polygon_type;
+
+ polygon_type poly;
+ boost::geometry::read_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 2,0 0),(0 0,2 9,1 9,0 0),(2 9,9 2,9 9,2 9))", poly);
+
+ std::string message;
+ bool valid = boost::geometry::is_valid(poly, message);
+ std::cout << "is valid? " << (valid ? "yes" : "no") << std::endl;
+ if (! valid)
+ {
+ std::cout << "why not valid? " << message << std::endl;
+ }
+ /*<-*/ create_svg("is_valid_example.svg", poly); /*->*/
+ return 0;
+}
+
+//]
+
+//[is_valid_message_output
+/*`
+Output:
+[pre
+is valid? no
+why not valid? Geometry has disconnected interior
+
+[$img/algorithms/is_valid_example.png]
+
+]
+
+*/
+//]