18#include <lagrange/common.h>
19#include <lagrange/utils/warning.h>
23template <
typename _VertexArray,
typename _FacetArray>
27 using VertexArray = _VertexArray;
28 using FacetArray = _FacetArray;
30 Eigen::Matrix<typename VertexArray::Scalar, 1, VertexArray::ColsAtCompileTime>;
33 using Scalar =
typename VertexArray::Scalar;
34 using Index =
typename FacetArray::Scalar;
41 virtual Index get_dim()
const = 0;
42 virtual Index get_num_vertices()
const = 0;
43 virtual Index get_num_facets()
const = 0;
44 virtual Index get_vertex_per_facet()
const = 0;
46 virtual const VertexArray& get_vertices()
const = 0;
47 virtual const FacetArray& get_facets()
const = 0;
49 virtual VertexArray& get_vertices_ref() = 0;
50 virtual FacetArray& get_facets_ref() = 0;
53 template <
typename Derived>
54 void import_vertices(Eigen::MatrixBase<Derived>& vertices)
56 auto& member_vertices = this->get_vertices_ref();
60 template <
typename Derived>
61 void import_facets(Eigen::MatrixBase<Derived>& facets)
63 auto& member_facets = this->get_facets_ref();
67 template <
typename Derived>
68 void export_vertices(Eigen::MatrixBase<Derived>& vertices)
70 auto& member_vertices = this->get_vertices_ref();
74 template <
typename Derived>
75 void export_facets(Eigen::MatrixBase<Derived>& facets)
77 auto& member_facets = this->get_facets_ref();
81 template <
typename Archive>
82 void serialize_impl(Archive& ar)
85 enum { VERTICES = 0, FACETS = 1 };
86 ar.object([&](
auto& ar) {
87 ar(
"vertices", VERTICES) & get_vertices_ref();
88 ar(
"facets", FACETS) & get_facets_ref();
90 LA_IGNORE_SHADOW_WARNING_END
94template <
typename _VertexArray,
typename _FacetArray,
typename Archive>
97 geometry.serialize_impl(ar);
Definition: MeshGeometry.h:25
#define LA_IGNORE_SHADOW_WARNING_BEGIN
Ignore shadow warnings.
Definition: warning.h:68
Main namespace for Lagrange.
Definition: AABBIGL.h:30
void move_data(Eigen::DenseBase< Derived1 > &from, Eigen::DenseBase< Derived2 > &to)
Move data from one Eigen obj to another.
Definition: common.h:61