1 // Boost.Polygon library voronoi_geometry_type.hpp header file
3 // Copyright Andrii Sydorchuk 2010-2012.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org for updates, documentation, and revision history.
10 #ifndef BOOST_POLYGON_VORONOI_GEOMETRY_TYPE
11 #define BOOST_POLYGON_VORONOI_GEOMETRY_TYPE
17 // Represents topology type of the voronoi site.
18 enum GeometryCategory {
19 GEOMETRY_CATEGORY_POINT = 0x0,
20 GEOMETRY_CATEGORY_SEGMENT = 0x1
23 // Represents category of the input source that forms Voronoi cell.
26 SOURCE_CATEGORY_SINGLE_POINT = 0x0,
27 SOURCE_CATEGORY_SEGMENT_START_POINT = 0x1,
28 SOURCE_CATEGORY_SEGMENT_END_POINT = 0x2,
31 SOURCE_CATEGORY_INITIAL_SEGMENT = 0x8,
32 SOURCE_CATEGORY_REVERSE_SEGMENT = 0x9,
34 SOURCE_CATEGORY_GEOMETRY_SHIFT = 0x3,
35 SOURCE_CATEGORY_BITMASK = 0x1F
39 SourceCategory source_category,
40 GeometryCategory geometry_category) {
41 return (static_cast<std::size_t>(source_category) >>
42 SOURCE_CATEGORY_GEOMETRY_SHIFT) ==
43 static_cast<std::size_t>(geometry_category);
48 #endif // BOOST_POLYGON_VORONOI_GEOMETRY_TYPE