Reference documentation for deal.II version 9.1.0-pre
bounding_box.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2018 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 
25 namespace boost
26 {
27  namespace geometry
28  {
29  namespace traits
30  {
34  template <int dim, class Number>
35  struct tag<::BoundingBox<dim, Number>>
36  {
37  using type = box_tag;
38  };
39 
43  template <int dim, class Number>
44  struct point_type<::BoundingBox<dim, Number>>
45  {
46  using type = ::Point<dim, Number>;
47  };
48 
53  template <int dim, class Number, size_t D>
54  struct indexed_access<::BoundingBox<dim, Number>, min_corner, D>
55  {
60  static inline double
62  {
63  return box.get_boundary_points().first[D];
64  }
65 
70  static inline void
71  set(::BoundingBox<dim, Number> &box, Number value)
72  {
73  box.get_boundary_points().first[D] = value;
74  }
75  };
76 
81  template <int dim, class Number, size_t D>
82  struct indexed_access<::BoundingBox<dim, Number>, max_corner, D>
83  {
88  static inline double
90  {
91  return box.get_boundary_points().second[D];
92  }
93 
98  static inline void
99  set(::BoundingBox<dim, Number> &box, Number value)
100  {
101  box.get_boundary_points().second[D] = value;
102  }
103  };
104  } // namespace traits
105  } // namespace geometry
106 } // namespace boost
107 
108 #endif
Definition: point.h:106
const std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & get_boundary_points() const