G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsAABB.h
Go to the documentation of this file.
1 
15 # pragma once
16 
17 namespace gismo {
18 
29 template<short_t d, class Z = index_t>
30 struct gsAABB
31 {
32 public:
33  typedef gsVector<Z, d> point;
34 
35  gsAABB(const point & low, const point & upp, index_t lvl)
36  :
37  first(low), second(upp), level(lvl)
38  { }
39 
40  gsAABB(const point & low, const point & upp)
41  :
42  gsAABB(low, upp, -1)
43  { }
44 
45  gsAABB(const point & upp)
46  :
47  second(upp), level(-1)
48  {
49  first.setZero();
50  }
51 
52  gsAABB()
53  :
54  level(-1)
55  {
56  first.setZero();
57  second.setZero();
58  }
59 
61  gsAABB( const gsAABB<d,Z>& other )
62  {
63  operator=(other);
64  }
65 
67  gsAABB( gsAABB<d,Z>&& other )
68  {
69  operator=(give(other));
70  }
71 
74  {
75  if (this!=&other)
76  {
77  first = other.first;
78  second = other.second;
79  level = other.level;
80  }
81  return *this;
82  }
83 
86  {
87  first = give(other.first);
88  second = give(other.second);
89  level = give(other.level);
90  return *this;
91  }
92 
93 public:
94 
95  point first;
96  point second;
97 
100 
101  // see http://eigen.tuxfamily.org/dox-devel/group__TopicStructHavingEigenMembers.html
102 # define Eigen gsEigen
103  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
104 # undef Eigen
105 };
106 
107 } // namespace gismo
index_t level
Level in which the box lives.
Definition: gsAABB.h:99
S give(S &x)
Definition: gsMemory.h:266
#define index_t
Definition: gsConfig.h:32
gsAABB(const gsAABB< d, Z > &other)
Copy constructor (makes deep copy)
Definition: gsAABB.h:61
gsAABB< d, Z > & operator=(const gsAABB< d, Z > &other)
Assignment operator.
Definition: gsAABB.h:73
gsAABB(gsAABB< d, Z > &&other)
Move constructor.
Definition: gsAABB.h:67
Struct of for an Axis-aligned bounding box.
Definition: gsAABB.h:30