4 #include <boost/fusion/sequence/intrinsic/at_c.hpp>
5 #include <boost/fusion/include/at_c.hpp>
6 #include <boost/fusion/container/vector.hpp>
7 #include <boost/fusion/include/vector.hpp>
8 #include <boost/fusion/container/vector/vector_fwd.hpp>
9 #include <boost/fusion/include/vector_fwd.hpp>
10 #include "boost/multi_array.hpp"
11 #include "Point_orig.hpp"
12 #include "Grid/Encap.hpp"
13 #include "data_type/aggregate.hpp"
40 typedef boost::fusion::vector<T,T,T,T,T[2],T[2][2]>
type;
43 typedef boost::fusion::vector<T,T,T,T,T[2],T[2][2]>
type_real;
46 static constexpr
bool stag_mask[]={
false,
false,
false,
true,
true,
true};
52 static const unsigned int x = 0;
55 static const unsigned int y = 1;
58 static const unsigned int z = 2;
61 static const unsigned int s = 3;
64 static const unsigned int v = 4;
67 static const unsigned int t = 5;
112 typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3],SE3_ADD_PROP(6)>
type;
115 typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]>
type_real;
120 typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]>
type;
123 typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]>
type_real;
128 static constexpr
bool stag_mask[]={
false,
false,
false,
true,
true,
true};
134 static const unsigned int x = 0;
137 static const unsigned int y = 1;
140 static const unsigned int z = 2;
143 static const unsigned int s = 3;
146 static const unsigned int v = 4;
149 static const unsigned int t = 5;
154 static const unsigned int max_prop = SE3_MAX_PROP(6);
176 inline void setx(T x_) {boost::fusion::at_c<0>(
data) = x_;};
183 inline void sety(T y_) {boost::fusion::at_c<1>(
data) = y_;};
190 inline void setz(T z_) {boost::fusion::at_c<2>(
data) = z_;};
197 inline void sets(T s_) {boost::fusion::at_c<3>(
data) = s_;};
205 inline void setv(
size_t i,T v_) {boost::fusion::at_c<4>(
data)[i] = v_;}
214 inline void sett(
size_t i,
size_t j,T t_) {boost::fusion::at_c<5>(
data)[i][j] = t_;}
218 template<
unsigned int i>
inline typename boost::fusion::result_of::at<type, boost::mpl::int_<i> >
::type get() {
return boost::fusion::at_c<i>(
data);};
231 if (boost::fusion::at_c<0>(
data) != boost::fusion::at_c<0>(p.
data))
return false;
232 if (boost::fusion::at_c<1>(
data) != boost::fusion::at_c<1>(p.
data))
return false;
233 if (boost::fusion::at_c<2>(
data) != boost::fusion::at_c<2>(p.
data))
return false;
234 if (boost::fusion::at_c<3>(
data) != boost::fusion::at_c<3>(p.
data))
return false;
236 for (
size_t i = 0 ; i < 3 ; i++)
237 if (boost::fusion::at_c<4>(
data)[i] != boost::fusion::at_c<4>(p.
data)[i])
return false;
239 for (
size_t i = 0 ; i < 3 ; i++)
241 for (
size_t j = 0 ; j < 3 ; j++)
243 if (boost::fusion::at_c<5>(
data)[i][j] != boost::fusion::at_c<5>(p.
data)[i][j])
return false;
259 boost::fusion::at_c<0>(
data) += boost::fusion::at_c<0>(p.
data);
260 boost::fusion::at_c<1>(
data) += boost::fusion::at_c<1>(p.
data);
261 boost::fusion::at_c<2>(
data) += boost::fusion::at_c<2>(p.
data);
262 boost::fusion::at_c<3>(
data) += boost::fusion::at_c<3>(p.
data);
264 for (
size_t i = 0 ; i < 3 ; i++)
265 boost::fusion::at_c<4>(
data)[i] += boost::fusion::at_c<4>(p.
data)[i];
267 for (
size_t i = 0 ; i < 3 ; i++)
269 for (
size_t j = 0 ; j < 3 ; j++)
270 boost::fusion::at_c<5>(
data)[i][j] += boost::fusion::at_c<5>(p.
data)[i][j];
283 boost::fusion::at_c<0>(
data) = p.template get<0>();
284 boost::fusion::at_c<1>(
data) = p.template get<1>();
285 boost::fusion::at_c<2>(
data) = p.template get<2>();
286 boost::fusion::at_c<3>(
data) = p.template get<3>();
288 for (
size_t i = 0 ; i < 3 ; i++)
289 boost::fusion::at_c<4>(
data)[i] = p.template get<4>()[i];
291 for (
size_t i = 0 ; i < 3 ; i++)
293 for (
size_t j = 0 ; j < 3 ; j++)
295 boost::fusion::at_c<5>(
data)[i][j] = p.template get<5>()[i][j];
307 boost::fusion::at_c<0>(
data) = boost::fusion::at_c<0>(p.
data);
308 boost::fusion::at_c<1>(
data) = boost::fusion::at_c<1>(p.
data);
309 boost::fusion::at_c<2>(
data) = boost::fusion::at_c<2>(p.
data);
310 boost::fusion::at_c<3>(
data) = boost::fusion::at_c<3>(p.
data);
312 for (
size_t i = 0 ; i < 3 ; i++)
313 boost::fusion::at_c<4>(
data)[i] = boost::fusion::at_c<4>(p.
data)[i];
315 for (
size_t i = 0 ; i < 3 ; i++)
317 for (
size_t j = 0 ; j < 3 ; j++)
319 boost::fusion::at_c<5>(
data)[i][j] = boost::fusion::at_c<5>(p.
data)[i][j];
333 boost::fusion::at_c<0>(
data) = boost::fusion::at_c<0>(p.
data);
334 boost::fusion::at_c<1>(
data) = boost::fusion::at_c<1>(p.
data);
335 boost::fusion::at_c<2>(
data) = boost::fusion::at_c<2>(p.
data);
336 boost::fusion::at_c<3>(
data) = boost::fusion::at_c<3>(p.
data);
338 for (
size_t i = 0 ; i < 3 ; i++)
339 boost::fusion::at_c<4>(
data)[i] = boost::fusion::at_c<4>(p.
data)[i];
341 for (
size_t i = 0 ; i < 3 ; i++)
343 for (
size_t j = 0 ; j < 3 ; j++)
345 boost::fusion::at_c<5>(
data)[i][j] = boost::fusion::at_c<5>(p.
data)[i][j];
368 boost::fusion::at_c<0>(
data) = 1;
369 boost::fusion::at_c<1>(
data) = 2;
370 boost::fusion::at_c<2>(
data) = 3;
371 boost::fusion::at_c<3>(
data) = 4;
373 for (
size_t i = 0 ; i < 3 ; i++)
374 boost::fusion::at_c<4>(
data)[i] = 5;
376 for (
size_t i = 0 ; i < 3 ; i++)
378 for (
size_t j = 0 ; j < 3 ; j++)
380 boost::fusion::at_c<5>(
data)[i][j] = 6;
412 typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]>
type;
418 static const unsigned int x = 0;
421 static const unsigned int y = 1;
424 static const unsigned int z = 2;
427 static const unsigned int s = 3;
430 static const unsigned int v = 4;
433 static const unsigned int t = 5;
445 inline void setx(T x_) {boost::fusion::at_c<0>(
data) = x_;};
452 inline void sety(T y_) {boost::fusion::at_c<1>(
data) = y_;};
459 inline void setz(T z_) {boost::fusion::at_c<2>(
data) = z_;};
466 inline void sets(T s_) {boost::fusion::at_c<3>(
data) = s_;};
472 static const std::string
name[];
476 template<
unsigned int i>
inline typename boost::fusion::result_of::at<type, boost::mpl::int_<i> >
::type get() {
return boost::fusion::at_c<i>(
data);};
485 boost::fusion::at_c<0>(
data) = p.template get<0>();
486 boost::fusion::at_c<1>(
data) = p.template get<1>();
487 boost::fusion::at_c<2>(
data) = p.template get<2>();
488 boost::fusion::at_c<3>(
data) = p.template get<3>();
490 for (
size_t i = 0 ; i < 3 ; i++)
491 boost::fusion::at_c<4>(
data)[i] = p.template get<4>()[i];
493 for (
size_t i = 0 ; i < 3 ; i++)
495 for (
size_t j = 0 ; j < 3 ; j++)
497 boost::fusion::at_c<5>(
data)[i][j] = p.template get<5>()[i][j];
505 boost::fusion::at_c<0>(
data) = boost::fusion::at_c<0>(p.
data);
506 boost::fusion::at_c<1>(
data) = boost::fusion::at_c<1>(p.
data);
507 boost::fusion::at_c<2>(
data) = boost::fusion::at_c<2>(p.
data);
508 boost::fusion::at_c<3>(
data) = boost::fusion::at_c<3>(p.
data);
510 for (
size_t i = 0 ; i < 3 ; i++)
511 boost::fusion::at_c<4>(
data)[i] = boost::fusion::at_c<4>(p.
data)[i];
513 for (
size_t i = 0 ; i < 3 ; i++)
515 for (
size_t j = 0 ; j < 3 ; j++)
517 boost::fusion::at_c<5>(
data)[i][j] = boost::fusion::at_c<5>(p.
data)[i][j];
532 boost::fusion::at_c<0>(
data) = boost::fusion::at_c<0>(p.
data);
533 boost::fusion::at_c<1>(
data) = boost::fusion::at_c<1>(p.
data);
534 boost::fusion::at_c<2>(
data) = boost::fusion::at_c<2>(p.
data);
535 boost::fusion::at_c<3>(
data) = boost::fusion::at_c<3>(p.
data);
537 for (
size_t i = 0 ; i < 3 ; i++)
538 boost::fusion::at_c<4>(
data)[i] = boost::fusion::at_c<4>(p.
data)[i];
540 for (
size_t i = 0 ; i < 3 ; i++)
542 for (
size_t j = 0 ; j < 3 ; j++)
544 boost::fusion::at_c<5>(
data)[i][j] = boost::fusion::at_c<5>(p.
data)[i][j];
551 static inline bool noPointers()
565 typedef boost::fusion::vector<T,T,T,T>
type;
571 static const unsigned int x = 0;
574 static const unsigned int y = 1;
577 static const unsigned int z = 2;
580 static const unsigned int s = 3;
588 inline void setx(T x_) {boost::fusion::at_c<0>(
data) = x_;};
590 inline void sety(T y_) {boost::fusion::at_c<1>(
data) = y_;};
592 inline void setz(T z_) {boost::fusion::at_c<2>(
data) = z_;};
594 inline void sets(T s_) {boost::fusion::at_c<3>(
data) = s_;};
600 static const std::string
name[];
604 template<
unsigned int i>
inline typename boost::fusion::result_of::at<type, boost::mpl::int_<i> >
::type get() {
return boost::fusion::at_c<i>(
data);};
613 boost::fusion::at_c<0>(
data) = p.template get<0>();
614 boost::fusion::at_c<1>(
data) = p.template get<1>();
615 boost::fusion::at_c<2>(
data) = p.template get<2>();
616 boost::fusion::at_c<3>(
data) = p.template get<3>();
622 boost::fusion::at_c<0>(
data) = boost::fusion::at_c<0>(p.
data);
623 boost::fusion::at_c<1>(
data) = boost::fusion::at_c<1>(p.
data);
624 boost::fusion::at_c<2>(
data) = boost::fusion::at_c<2>(p.
data);
625 boost::fusion::at_c<3>(
data) = boost::fusion::at_c<3>(p.
data);
631 boost::fusion::at_c<0>(
data) = boost::fusion::at_c<0>(p.
data);
632 boost::fusion::at_c<1>(
data) = boost::fusion::at_c<1>(p.
data);
633 boost::fusion::at_c<2>(
data) = boost::fusion::at_c<2>(p.
data);
634 boost::fusion::at_c<3>(
data) = boost::fusion::at_c<3>(p.
data);
639 static inline bool noPointers()
Point_test_scal(const Point_test_scal< T > &p)
constructor from another point
static const unsigned int max_prop
maximum number of properties
void setv(size_t i, T v_)
set the v property
boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type
declaration of what the Point_test store
Point_test(const encapc< dim, Point_test< T >, Mem > &p)
Copy constructor from encapc (encapsulated point)
Test structure used for several test.
static constexpr bool stag_mask[]
in case usage with a staggered grid indicate which properties are staggered in the cell ...
static const unsigned int max_prop
the number of properties
static const unsigned int v
v property is at position 4 in the boost::fusion::vector
void setz(T z_)
set the z property
static const unsigned int s
s property is at position 3 in the boost::fusion::vector
Point_test_scal()
Default constructor.
static const unsigned int z
z property is at position 0 in the boost::fusion::vector
Point_test_prp(const Point_test_prp< T > &p)
constructor from another point
point test with only scalar properties
Point_test(const Point_test< T > &p)
constructor from another point
static const unsigned int t
t property is at position 5 in the boost::fusion::vector
void sets(T s_)
set the s property
static const unsigned int x
x property is at position 0 in the boost::fusion::vector
static const unsigned int x
x property is at position 0 in the boost::fusion::vector
bool operator==(const Point_test< float > &p) const
check if two point match
void sety(T y_)
set the property y
static const std::string name[]
array of attributes name
void setz(T z_)
set the z property
static const unsigned int v
v property is at position 4 in the boost::fusion::vector
Point_test< T > operator=(const Point_test< T > &p)
Copy the point.
type data
The data itself.
static const unsigned int s
s property is at position 3 in the boost::fusion::vector
void setx(T x_)
set the property x
boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type_real
declaration of what the Point_test store
void setx(T x_)
set the x property
static const unsigned int max_prop
number of properties in the boost::fusion::vector
static const unsigned int y
y property is at position 1 in the boost::fusion::vector
void sets(T s_)
set the property s
static const unsigned int s
s property is at position 0 in the boost::fusion::vector
Point_test_scal< T > operator=(const Point_test_scal< T > &p)
operator=
static const unsigned int s
s property is at position 3 in the boost::fusion::vector
Point_test_prp< T > operator=(const Point_test< T > &p)
Copy the point.
static const unsigned int max_prop_real
number of properties in the boost::fusion::vector
Point_test()
Default constructor.
static const unsigned int x
x property is at position 0 in the boost::fusion::vector
static constexpr bool stag_mask[]
in case of usage with staggered grid it define which properties are staggered in the cell grid ...
type data
The object itself.
static const unsigned int z
z property is at position 2 in the boost::fusion::vector
static bool noPointers()
noPointers function
static const unsigned int z
z property is at position 2 in the boost::fusion::vector
void setz(T z_)
set the property z
boost::fusion::vector< T, T, T, T, T[2], T[2][2]> type_real
declaration of what the Point2D_test store
static const unsigned int z
z property is at position 2 in the boost::fusion::vector
void setx(T x_)
set the x property
boost::fusion::vector< T, T, T, T > type
declaration of what the Point_test_scal store
static bool noPointers()
indicate that this structure has no pointers
static const std::string name[]
array of names
Test structure used for several test.
void sett(size_t i, size_t j, T t_)
set the t property
static const unsigned int t
t property is at position 5 in the boost::fusion::vector
static const unsigned int y
y property is at position 1 in the boost::fusion::vector
void sets(T s_)
set the s property
static const unsigned int max_prop
number of properties in the boost::fusion::vector
Point_test_prp()
Default constructor.
void sety(T y_)
set the y property
static const unsigned int y
y property is at position 1 in the boost::fusion::vector
void sety(T y_)
set the y property
Point_test_scal(const encapc< 1, Point_test_scal< T >, Mem > &p)
constructor from encapc
static const unsigned int t
t property is at position 5 in the boost::fusion::vector
Test structure used for several test.
Point_test< float > & operator+=(const Point_test< float > &p)
Sum the point.
Point_test_prp(const encapc< 1, Point_test_prp< T >, Mem > &p)
constructor from encapc
boost::fusion::vector< T, T, T, T, T[2], T[2][2]> type
declaration of what the Point2D_test store
static const unsigned int v
v property is at position 4 in the boost::fusion::vector
boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type
declaration of what the Point_test_prp store
static const unsigned int max_prop_real
number of properties in the boost::fusion::vector
static const unsigned int y
y property is at position 1 in the boost::fusion::vector
static const unsigned int x
x property is at position 0 in the boost::fusion::vector