14#include <lagrange/utils/invalid.h>
20#include <lagrange/utils/warnoff.h>
22#include <lagrange/utils/warnon.h>
27using Vertices2D = Eigen::Matrix<double, Eigen::Dynamic, 2, Eigen::RowMajor>;
28using Vertices3D = Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>;
29using Vertices2Df = Eigen::Matrix<float, Eigen::Dynamic, 2, Eigen::RowMajor>;
30using Vertices3Df = Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::RowMajor>;
31using Triangles = Eigen::Matrix<int, Eigen::Dynamic, 3, Eigen::RowMajor>;
32using Quads = Eigen::Matrix<int, Eigen::Dynamic, 4, Eigen::RowMajor>;
34template <
typename VertexArray,
typename FacetArray>
36using TriangleMesh3D = Mesh<Vertices3D, Triangles>;
37using TriangleMesh2D = Mesh<Vertices2D, Triangles>;
38using TriangleMesh3Df = Mesh<Vertices3Df, Triangles>;
39using TriangleMesh2Df = Mesh<Vertices2Df, Triangles>;
40using QuadMesh3D = Mesh<Vertices3D, Quads>;
41using QuadMesh2D = Mesh<Vertices2D, Quads>;
42using QuadMesh3Df = Mesh<Vertices3Df, Quads>;
43using QuadMesh2Df = Mesh<Vertices2Df, Quads>;
46using ScalarOf =
typename T::Scalar;
49using IndexOf =
typename T::Index;
52using VertexArrayOf =
typename T::VertexArray;
55using FacetArrayOf =
typename T::FacetArray;
58using AttributeArrayOf =
typename T::AttributeArray;
64template <
typename Derived1,
typename Derived2>
65void move_data(Eigen::DenseBase<Derived1>& from, Eigen::DenseBase<Derived2>& to)
73 SwapPointers = Eigen::internal::is_same<Derived1, Derived2>::value &&
74 Eigen::MatrixBase<Derived1>::SizeAtCompileTime == Eigen::Dynamic
76 static_assert(SwapPointers ==
true,
"cannot swap matrix data pointers");
78 to.derived() = std::move(from.derived());
79 from.derived().resize(0, Eigen::NoChange);
90 return std::shared_ptr<T>(ptr.release());
98template <
typename...
Args>
101 constexpr static bool False =
false;
102 constexpr static bool True =
true;
Main namespace for Lagrange.
Definition: AABBIGL.h:30
std::shared_ptr< T > to_shared_ptr(std::unique_ptr< T > &&ptr)
Helper for automatic type deduction for unique_ptr to shared_ptr conversion.
Definition: common.h:88
void move_data(Eigen::DenseBase< Derived1 > &from, Eigen::DenseBase< Derived2 > &to)
Move data from one Eigen obj to another.
Definition: common.h:65
Definition: project.cpp:27
Compilers might complain about static_assert(false, "").
Definition: common.h:100