summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/overlay/ring_properties.hpp
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 12:57:26 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 12:57:26 -0700
commit1a78a62555be32868418fe52f8e330c9d0f95d5a (patch)
treed3765a80e7d3b9640ec2e930743630cd6b9fce2b /boost/geometry/algorithms/detail/overlay/ring_properties.hpp
downloadboost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/ring_properties.hpp')
-rw-r--r--boost/geometry/algorithms/detail/overlay/ring_properties.hpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/ring_properties.hpp b/boost/geometry/algorithms/detail/overlay/ring_properties.hpp
new file mode 100644
index 0000000000..a6088694da
--- /dev/null
+++ b/boost/geometry/algorithms/detail/overlay/ring_properties.hpp
@@ -0,0 +1,78 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 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
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP
+
+
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/algorithms/detail/point_on_border.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+template <typename Point>
+struct ring_properties
+{
+ typedef Point point_type;
+ typedef typename default_area_result<Point>::type area_type;
+
+ // Filled by "select_rings"
+ Point point;
+ area_type area;
+
+ // Filled by "update_selection_map"
+ int within_code;
+ bool reversed;
+
+ // Filled/used by "assign_rings"
+ bool discarded;
+ ring_identifier parent;
+ area_type parent_area;
+ std::vector<ring_identifier> children;
+
+ inline ring_properties()
+ : area(area_type())
+ , within_code(-1)
+ , reversed(false)
+ , discarded(false)
+ , parent_area(-1)
+ {}
+
+ template <typename RingOrBox>
+ inline ring_properties(RingOrBox const& ring_or_box, bool midpoint)
+ : within_code(-1)
+ , reversed(false)
+ , discarded(false)
+ , parent_area(-1)
+ {
+ this->area = geometry::area(ring_or_box);
+ geometry::point_on_border(this->point, ring_or_box, midpoint);
+ }
+
+ inline area_type get_area() const
+ {
+ return reversed ? -area : area;
+ }
+};
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP