File indexing completed on 2025-01-18 09:35:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP
0012 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP
0013
0014 #include <boost/core/ignore_unused.hpp>
0015 #include <boost/range/empty.hpp>
0016
0017 #include <boost/geometry/core/tags.hpp>
0018
0019 #include <boost/geometry/algorithms/validity_failure_type.hpp>
0020 #include <boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp>
0021 #include <boost/geometry/algorithms/dispatch/is_valid.hpp>
0022
0023 #include <boost/geometry/util/condition.hpp>
0024
0025
0026 namespace boost { namespace geometry
0027 {
0028
0029
0030
0031 #ifndef DOXYGEN_NO_DISPATCH
0032 namespace dispatch
0033 {
0034
0035
0036 template <typename Point>
0037 struct is_valid<Point, point_tag>
0038 {
0039 template <typename VisitPolicy, typename Strategy>
0040 static inline bool apply(Point const& point, VisitPolicy& visitor, Strategy const&)
0041 {
0042 boost::ignore_unused(visitor);
0043 return ! detail::is_valid::has_invalid_coordinate
0044 <
0045 Point
0046 >::apply(point, visitor);
0047 }
0048 };
0049
0050
0051
0052
0053
0054
0055
0056 template <typename MultiPoint, bool AllowEmptyMultiGeometries>
0057 struct is_valid<MultiPoint, multi_point_tag, AllowEmptyMultiGeometries>
0058 {
0059 template <typename VisitPolicy, typename Strategy>
0060 static inline bool apply(MultiPoint const& multipoint,
0061 VisitPolicy& visitor,
0062 Strategy const&)
0063 {
0064 boost::ignore_unused(multipoint, visitor);
0065
0066 if (BOOST_GEOMETRY_CONDITION(
0067 AllowEmptyMultiGeometries || !boost::empty(multipoint)))
0068 {
0069
0070
0071 return ! detail::is_valid::has_invalid_coordinate
0072 <
0073 MultiPoint
0074 >::apply(multipoint, visitor);
0075 }
0076 else
0077 {
0078
0079 return visitor.template apply<failure_few_points>();
0080 }
0081 }
0082 };
0083
0084
0085 }
0086 #endif
0087
0088
0089 }}
0090
0091
0092 #endif