Wildmeshing Toolkit
TupleAccessor.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Accessor.hpp"
4 
5 
6 namespace wmtk::attribute {
7 
8 
9 template <typename MeshType, int Dim = Eigen::Dynamic>
11 {
12 public:
13  TupleAccessor(MeshType& m, const TypedAttributeHandle<int64_t>& handle);
14  TupleAccessor(const MeshType& m, const TypedAttributeHandle<int64_t>& handle);
15  template <int Dim2>
17 
18  // Eigen::Map<VectorX<T>>
19  template <int D = Dim>
21  // Eigen::Map<const VectorX<T>>
22  template <int D = Dim>
24 
25 
26  const Tuple& const_scalar_attribute(const Tuple& t) const;
27  Tuple& scalar_attribute(const Tuple& t);
28 
29  template <int D = Dim>
31  template <int D = Dim>
33 
34  Eigen::Index dimension() const { return m_dimension; }
35 
36 private:
38  Eigen::Index m_dimension;
39 };
40 
41 
42 template <typename MeshType>
44 template <typename MeshType>
45 TupleAccessor(const MeshType& m, const TypedAttributeHandle<int64_t>& handle)
47 
48 } // namespace wmtk::attribute
49 #include "TupleAccessor.hxx"
A CachingAccessor that uses tuples for accessing attributes instead of indices.
Definition: Accessor.hpp:25
ConstMapResult< D > const_vector_attribute(const Tuple &t) const
const Tuple & const_scalar_attribute(const Tuple &t) const
internal::ConstMapResult< Tuple, D > ConstMapResult
MapResult< D > vector_attribute(const Tuple &t)
Eigen::Index dimension() const
TupleAccessor(MeshType &m, const TypedAttributeHandle< int64_t > &handle)
Tuple & scalar_attribute(const Tuple &t)
Accessor< int64_t, MeshType > m_base_accessor
internal::MapResult< Tuple, D > MapResult
typename VectorResult< T, R >::MapType MapResult
the default map type used by attributes is a map of our vector type.
Definition: MapTypes.hpp:21
typename VectorResult< T, R >::ConstMapType ConstMapResult
Definition: MapTypes.hpp:23
TupleAccessor(MeshType &m, const TypedAttributeHandle< int64_t > &handle) -> TupleAccessor< MeshType >