Warning, file /include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYHEDRAL_SURFACE_CONCEPT_HPP
0012 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYHEDRAL_SURFACE_CONCEPT_HPP
0013
0014 #include <type_traits>
0015
0016 #include <boost/concept_check.hpp>
0017 #include <boost/range/concepts.hpp>
0018
0019 #include <boost/geometry/core/access.hpp>
0020 #include <boost/geometry/core/cs.hpp>
0021 #include <boost/geometry/core/ring_type.hpp>
0022 #include <boost/geometry/core/tags.hpp>
0023 #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
0024
0025 namespace boost { namespace geometry { namespace concepts
0026 {
0027
0028 template <typename Geometry>
0029 class PolyhedralSurface
0030 {
0031 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0032 using polygon_type = typename boost::range_value<Geometry>::type;
0033
0034 BOOST_CONCEPT_ASSERT( (concepts::Polygon<polygon_type>) );
0035 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0036 BOOST_STATIC_ASSERT( (geometry::dimension<Geometry>::value == 3) );
0037 BOOST_STATIC_ASSERT( (std::is_same<typename geometry::cs_tag_t<Geometry>,
0038 geometry::cartesian_tag>::value) );
0039
0040 public:
0041
0042 BOOST_CONCEPT_USAGE(PolyhedralSurface)
0043 {
0044 Geometry* ps = 0;
0045 traits::clear<Geometry>::apply(*ps);
0046 traits::resize<Geometry>::apply(*ps, 0);
0047
0048 polygon_type* poly = 0;
0049 traits::push_back<Geometry>::apply(*ps, std::move(*poly));
0050 }
0051 #endif
0052 };
0053
0054
0055 template <typename Geometry>
0056 class ConstPolyhedralSurface
0057 {
0058 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0059 using polygon_type = typename boost::range_value<Geometry>::type;
0060
0061 BOOST_CONCEPT_ASSERT( (concepts::ConstPolygon<polygon_type>) );
0062 BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
0063 BOOST_STATIC_ASSERT( (geometry::dimension<Geometry>::value == 3) );
0064 BOOST_STATIC_ASSERT( (std::is_same<typename geometry::cs_tag_t<Geometry>,
0065 geometry::cartesian_tag>::value) );
0066
0067 public:
0068
0069 BOOST_CONCEPT_USAGE(ConstPolyhedralSurface)
0070 {}
0071
0072 #endif
0073 };
0074
0075 template <typename Geometry>
0076 struct concept_type<Geometry, polyhedral_surface_tag>
0077 {
0078 using type = PolyhedralSurface<Geometry>;
0079 };
0080
0081 template <typename Geometry>
0082 struct concept_type<Geometry const, polyhedral_surface_tag>
0083 {
0084 using type = ConstPolyhedralSurface<Geometry>;
0085 };
0086
0087 }}}
0088 #endif