mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[doc][algorithms][is_empty] add documentation for is_empty algorithm
This commit is contained in:
parent
1e576d3a30
commit
bd6cc0e5d3
@ -40,6 +40,7 @@
|
||||
\defgroup interior_rings interior_rings: interior_rings
|
||||
\defgroup intersection intersection: calculate new geometry
|
||||
\defgroup intersects intersects: detect if a geometry self-intersects or if two geometries intersect
|
||||
\defgroup is_empty is_empty: detect if a geometry is the empty set
|
||||
\defgroup is_simple is_simple: detect if a geometry is simple
|
||||
\defgroup is_valid is_valid: detect if a geometry is valid
|
||||
\defgroup iterators iterators: iterators
|
||||
|
@ -45,6 +45,7 @@
|
||||
[import src/examples/algorithms/intersection_segment.cpp]
|
||||
[import src/examples/algorithms/intersection_poly_poly.cpp]
|
||||
[import src/examples/algorithms/intersects_linestring.cpp]
|
||||
[import src/examples/algorithms/is_empty.cpp]
|
||||
[import src/examples/algorithms/is_simple.cpp]
|
||||
[import src/examples/algorithms/is_valid.cpp]
|
||||
[import src/examples/algorithms/is_valid_failure.cpp]
|
||||
|
@ -86,10 +86,11 @@ call_doxygen()
|
||||
algorithms = ["append", "assign", "make", "clear"
|
||||
, "area", "buffer", "centroid", "convert", "correct", "covered_by"
|
||||
, "convex_hull", "crosses", "difference", "disjoint", "distance"
|
||||
, "envelope", "equals", "expand", "for_each", "is_simple", "is_valid"
|
||||
, "intersection", "intersects", "length", "num_geometries"
|
||||
, "num_interior_rings", "num_points", "num_segments", "overlaps"
|
||||
, "perimeter", "relate", "relation", "reverse", "simplify", "sym_difference", "touches"
|
||||
, "envelope", "equals", "expand", "for_each", "is_empty"
|
||||
, "is_simple", "is_valid", "intersection", "intersects", "length"
|
||||
, "num_geometries", "num_interior_rings", "num_points"
|
||||
, "num_segments", "overlaps", "perimeter", "relate", "relation"
|
||||
, "reverse", "simplify", "sym_difference", "touches"
|
||||
, "transform", "union", "unique", "within"]
|
||||
|
||||
access_functions = ["get", "set", "exterior_ring", "interior_rings"
|
||||
|
@ -329,6 +329,7 @@
|
||||
<member><link linkend="geometry.reference.algorithms.disjoint">disjoint</link></member>
|
||||
<member><link linkend="geometry.reference.algorithms.equals">equals</link></member>
|
||||
<member><link linkend="geometry.reference.algorithms.intersects">intersects</link></member>
|
||||
<member><link linkend="geometry.reference.algorithms.is_empty">is_empty</link></member>
|
||||
<member><link linkend="geometry.reference.algorithms.is_simple">is_simple</link></member>
|
||||
<member><link linkend="geometry.reference.algorithms.is_valid">is_valid</link></member>
|
||||
<member><link linkend="geometry.reference.algorithms.overlaps">overlaps</link></member>
|
||||
|
@ -122,6 +122,8 @@
|
||||
[include generated/intersects.qbk]
|
||||
[endsect]
|
||||
|
||||
[include generated/is_empty.qbk]
|
||||
|
||||
[include generated/is_simple.qbk]
|
||||
|
||||
[section:is_valid is_valid]
|
||||
|
26
doc/reference/algorithms/is_empty.qbk
Normal file
26
doc/reference/algorithms/is_empty.qbk
Normal file
@ -0,0 +1,26 @@
|
||||
[/============================================================================
|
||||
Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
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
|
||||
=============================================================================/]
|
||||
|
||||
[def __this_function__ is_empty]
|
||||
|
||||
[heading_conformance_no_ogc __this_function__]
|
||||
|
||||
[include reference/status/is_empty_status.qbk]
|
||||
|
||||
[heading Complexity]
|
||||
Constant-time
|
||||
|
||||
[heading Example]
|
||||
[is_empty]
|
||||
[is_empty_output]
|
||||
|
||||
[heading See also]
|
||||
* [link geometry.reference.algorithms.num_points num_points]
|
14
doc/reference/status/is_empty_status.qbk
Normal file
14
doc/reference/status/is_empty_status.qbk
Normal file
@ -0,0 +1,14 @@
|
||||
[heading Supported geometries]
|
||||
[table
|
||||
[[Geometry][Status]]
|
||||
[[Point][ [$img/ok.png] ]]
|
||||
[[Segment][ [$img/ok.png] ]]
|
||||
[[Box][ [$img/ok.png] ]]
|
||||
[[Linestring][ [$img/ok.png] ]]
|
||||
[[Ring][ [$img/ok.png] ]]
|
||||
[[Polygon][ [$img/ok.png] ]]
|
||||
[[MultiPoint][ [$img/ok.png] ]]
|
||||
[[MultiLinestring][ [$img/ok.png] ]]
|
||||
[[MultiPolygon][ [$img/ok.png] ]]
|
||||
[[Variant][ [$img/ok.png] ]]
|
||||
]
|
@ -34,6 +34,7 @@
|
||||
#include <boost/geometry/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/expand.hpp>
|
||||
#include <boost/geometry/algorithms/for_each.hpp>
|
||||
#include <boost/geometry/algorithms/is_empty.hpp>
|
||||
#include <boost/geometry/algorithms/is_simple.hpp>
|
||||
#include <boost/geometry/algorithms/is_valid.hpp>
|
||||
#include <boost/geometry/algorithms/length.hpp>
|
||||
@ -109,6 +110,7 @@ DECLARE_BINARY_ALGORITHM(equals)
|
||||
DECLARE_BINARY_ALGORITHM(expand)
|
||||
DECLARE_UNARY_ALGORITHM(for_each_point)
|
||||
DECLARE_UNARY_ALGORITHM(for_each_segment)
|
||||
DECLARE_UNARY_ALGORITHM(is_empty)
|
||||
DECLARE_UNARY_ALGORITHM(is_simple)
|
||||
DECLARE_UNARY_ALGORITHM(is_valid)
|
||||
DECLARE_UNARY_ALGORITHM(length)
|
||||
@ -248,6 +250,7 @@ void support_status()
|
||||
test_binary_algorithm<expand, all_types, all_types, OutputFactory>("expand");
|
||||
test_unary_algorithm<for_each_point, all_types, OutputFactory>("for_each_point");
|
||||
test_unary_algorithm<for_each_segment, all_types, OutputFactory>("for_each_segment");
|
||||
test_unary_algorithm<is_empty, all_types, OutputFactory>("is_empty");
|
||||
test_unary_algorithm<is_simple, all_types, OutputFactory>("is_simple");
|
||||
test_unary_algorithm<is_valid, all_types, OutputFactory>("is_valid");
|
||||
test_unary_algorithm<length, all_types, OutputFactory>("length");
|
||||
|
47
doc/src/examples/algorithms/is_empty.cpp
Normal file
47
doc/src/examples/algorithms/is_empty.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
// 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_empty
|
||||
//` Check if a geometry is the empty set
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/geometry.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::geometry::model::multi_linestring
|
||||
<
|
||||
boost::geometry::model::linestring
|
||||
<
|
||||
boost::geometry::model::d2::point_xy<double>
|
||||
>
|
||||
> mls;
|
||||
boost::geometry::read_wkt("MULTILINESTRING((0 0,0 10,10 0),(1 1,8 1,1 8))", mls);
|
||||
std::cout << "Is empty? " << (boost::geometry::is_empty(mls) ? "yes" : "no") << std::endl;
|
||||
boost::geometry::clear(mls);
|
||||
std::cout << "Is empty (after clearing)? " << (boost::geometry::is_empty(mls) ? "yes" : "no") << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//]
|
||||
|
||||
|
||||
//[is_empty_output
|
||||
/*`
|
||||
Output:
|
||||
[pre
|
||||
Is empty? no
|
||||
Is empty (after clearing)? yes
|
||||
]
|
||||
*/
|
||||
//]
|
Loading…
x
Reference in New Issue
Block a user