1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2014, Oracle and/or its affiliates.
6 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
11 #ifndef BOOST_GEOMETRY_TEST_PRETTY_PRINT_GEOMETRY_HPP
12 #define BOOST_GEOMETRY_TEST_PRETTY_PRINT_GEOMETRY_HPP
16 #include <boost/geometry/core/tag.hpp>
17 #include <boost/geometry/core/tags.hpp>
19 #include <boost/geometry/io/dsv/write.hpp>
20 #include <boost/geometry/io/wkt/write.hpp>
26 typename Tag = typename boost::geometry::tag<Geometry>::type
28 struct pretty_print_geometry
30 static inline std::ostream&
31 apply(std::ostream& os, Geometry const& geometry)
33 os << boost::geometry::wkt(geometry);
38 template <typename Box>
39 struct pretty_print_geometry<Box, boost::geometry::box_tag>
41 static inline std::ostream&
42 apply(std::ostream& os, Box const& box)
44 return os << "BOX" << boost::geometry::dsv(box);
48 template <typename Segment>
49 struct pretty_print_geometry<Segment, boost::geometry::segment_tag>
51 static inline std::ostream&
52 apply(std::ostream& os, Segment const& segment)
54 return os << "SEGMENT" << boost::geometry::dsv(segment);
58 template <typename Ring>
59 struct pretty_print_geometry<Ring, boost::geometry::ring_tag>
61 static inline std::ostream&
62 apply(std::ostream& os, Ring const& ring)
64 return os << "RING" << boost::geometry::dsv(ring);
69 #endif // BOOST_GEOMETRY_TEST_PRETTY_PRINT_GEOMETRY_HPP