14#include <lagrange/common.h>
15#include <lagrange/experimental/Attribute.h>
16#include <lagrange/utils/warning.h>
19namespace experimental {
26 template <
typename ValueArrayDerived,
typename IndexArrayDerived>
28 : m_values(std::forward<ValueArrayDerived>(values))
29 , m_indices(std::forward<IndexArrayDerived>(indices))
33 std::shared_ptr<const ArrayBase> get_values()
const {
return m_values.get(); }
34 std::shared_ptr<ArrayBase> get_values() {
return m_values.get(); }
36 template <
typename Derived>
37 decltype(
auto) get_values()
const
39 return m_values.template get<Derived>();
42 template <
typename Derived>
43 decltype(
auto) get_values()
45 return m_values.template get<Derived>();
48 template <
typename Derived>
49 decltype(
auto) view_values()
const
51 return m_values.template view<Derived>();
54 template <
typename Derived>
55 decltype(
auto) view_values()
57 return m_values.template view<Derived>();
60 template <
typename Derived>
61 void set_values(Derived&& values)
63 m_values.set(std::forward<Derived>(values));
66 std::shared_ptr<const ArrayBase> get_indices()
const {
return m_indices.get(); }
68 std::shared_ptr<ArrayBase> get_indices() {
return m_indices.get(); }
70 template <
typename Derived>
71 decltype(
auto) get_indices()
const
73 return m_indices.template get<Derived>();
76 template <
typename Derived>
77 decltype(
auto) get_indices()
79 return m_indices.template get<Derived>();
82 template <
typename Derived>
83 decltype(
auto) view_indices()
const
85 return m_indices.template view<Derived>();
88 template <
typename Derived>
89 decltype(
auto) view_indices()
91 return m_indices.template view<Derived>();
94 template <
typename Derived>
95 void set_indices(Derived&& indices)
97 m_indices.set(std::forward<Derived>(indices));
100 template <
typename Archive>
101 void serialize_impl(Archive& ar)
104 enum { VALUES = 0, INDICES = 1 };
105 ar.object([&](
auto& ar) {
106 ar(
"values", VALUES) & m_values;
107 ar(
"indices", INDICES) & m_indices;
109 LA_IGNORE_SHADOW_WARNING_END
117template <
typename Archive>
120 attribute.serialize_impl(ar);
Definition: Attribute.h:23
Definition: IndexedAttribute.h:22
#define LA_IGNORE_SHADOW_WARNING_BEGIN
Ignore shadow warnings.
Definition: warning.h:68
Main namespace for Lagrange.
Definition: AABBIGL.h:30