Reference documentation for deal.II version Git 0491297983 2019-09-23 09:31:59 +0200
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
bounding_box.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2018 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_boost_adaptor_bounding_box_h
17 #define dealii_boost_adaptor_bounding_box_h
18 
19 #include <deal.II/base/bounding_box.h>
20 
21 #include <deal.II/boost_adaptors/point.h>
22 
23 #include <boost/geometry.hpp>
24 #include <boost/geometry/geometries/geometries.hpp>
25 
26 namespace boost
27 {
28  namespace geometry
29  {
30  namespace traits
31  {
35  template <int dim, class Number>
36  struct tag<::BoundingBox<dim, Number>>
37  {
38  using type = box_tag;
39  };
40 
44  template <int dim, class Number>
45  struct point_type<::BoundingBox<dim, Number>>
46  {
47  using type = ::Point<dim, Number>;
48  };
49 
54  template <int dim, class Number, std::size_t D>
55  struct indexed_access<::BoundingBox<dim, Number>, min_corner, D>
56  {
61  static inline double
63  {
64  return box.get_boundary_points().first[D];
65  }
66 
71  static inline void
72  set(::BoundingBox<dim, Number> &box, Number value)
73  {
74  box.get_boundary_points().first[D] = value;
75  }
76  };
77 
82  template <int dim, class Number, std::size_t D>
83  struct indexed_access<::BoundingBox<dim, Number>, max_corner, D>
84  {
89  static inline double
91  {
92  return box.get_boundary_points().second[D];
93  }
94 
99  static inline void
100  set(::BoundingBox<dim, Number> &box, Number value)
101  {
102  box.get_boundary_points().second[D] = value;
103  }
104  };
105  } // namespace traits
106  } // namespace geometry
107 } // namespace boost
108 
109 #endif
Definition: point.h:110
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & get_boundary_points()