Lagrange
|
View mesh attributes as Eigen matrices. More...
Typedefs | |
template<typename Scalar > | |
using | RowMatrix = Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > |
Type alias for row-major Eigen matrices. | |
template<typename Scalar > | |
using | RowMatrixView = Eigen::Map< RowMatrix< Scalar >, Eigen::Unaligned > |
Type alias for row-major matrix views. | |
template<typename Scalar > | |
using | ConstRowMatrixView = const Eigen::Map< const RowMatrix< Scalar >, Eigen::Unaligned > |
Type alias for row-major const matrix view. | |
template<typename Scalar > | |
using | Vector = Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > |
Type alias for one-dimensional column Eigen vectors. | |
template<typename Scalar > | |
using | VectorView = Eigen::Map< Vector< Scalar >, Eigen::Unaligned > |
Type alias for row-major vector view. | |
template<typename Scalar > | |
using | ConstVectorView = const Eigen::Map< const Vector< Scalar >, Eigen::Unaligned > |
Type alias for row-major const vector view. | |
Generic attribute views | |
template<typename ValueType > | |
RowMatrixView< ValueType > | matrix_ref (Attribute< ValueType > &attribute) |
Returns a writable view of a given attribute in the form of an Eigen matrix. More... | |
template<typename ValueType > | |
ConstRowMatrixView< ValueType > | matrix_view (const Attribute< ValueType > &attribute) |
Returns a read-only view of a given attribute in the form of an Eigen matrix. More... | |
template<typename ValueType > | |
VectorView< ValueType > | vector_ref (Attribute< ValueType > &attribute) |
Returns a writable view of a scalar attribute in the form of an Eigen vector. More... | |
template<typename ValueType > | |
ConstVectorView< ValueType > | vector_view (const Attribute< ValueType > &attribute) |
Returns a read-only view of a scalar attribute in the form of an Eigen vector. More... | |
template<typename ValueType > | |
RowMatrixView< ValueType > | reshaped_ref (Attribute< ValueType > &attribute, size_t num_cols) |
Returns a writable view of a given single-channel attribute in the form of an Eigen matrix with a prescribed number of columns. More... | |
template<typename ValueType > | |
ConstRowMatrixView< ValueType > | reshaped_view (const Attribute< ValueType > &attribute, size_t num_cols) |
Returns a read-only view of a given single-channel attribute in the form of an Eigen matrix with a prescribed number of columns. More... | |
Generic attribute views (mesh) | |
template<typename ValueType , typename Scalar , typename Index > | |
RowMatrixView< ValueType > | attribute_matrix_ref (SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
Returns a writable view of a mesh attribute in the form of an Eigen matrix. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
RowMatrixView< ValueType > | attribute_matrix_ref (SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
Returns a writable view of a mesh attribute in the form of an Eigen matrix. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
ConstRowMatrixView< ValueType > | attribute_matrix_view (const SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
Returns a read-only view of a mesh attribute in the form of an Eigen matrix. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
ConstRowMatrixView< ValueType > | attribute_matrix_view (const SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
Returns a read-only view of a mesh attribute in the form of an Eigen matrix. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
VectorView< ValueType > | attribute_vector_ref (SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
Returns a writable view of a mesh attribute in the form of an Eigen vector. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
VectorView< ValueType > | attribute_vector_ref (SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
Returns a writable view of a mesh attribute in the form of an Eigen vector. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
ConstVectorView< ValueType > | attribute_vector_view (const SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
Returns a read-only view of a mesh attribute in the form of an Eigen vector. More... | |
template<typename ValueType , typename Scalar , typename Index > | |
ConstVectorView< ValueType > | attribute_vector_view (const SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
Returns a read-only view of a mesh attribute in the form of an Eigen vector. More... | |
Specific attribute views | |
template<typename Scalar , typename Index > | |
RowMatrixView< Scalar > | vertex_ref (SurfaceMesh< Scalar, Index > &mesh) |
Returns a writable view of the mesh vertices in the form of an Eigen matrix. More... | |
template<typename Scalar , typename Index > | |
ConstRowMatrixView< Scalar > | vertex_view (const SurfaceMesh< Scalar, Index > &mesh) |
Returns a read-only view of the mesh vertices in the form of an Eigen matrix. More... | |
template<typename Scalar , typename Index > | |
RowMatrixView< Index > | facet_ref (SurfaceMesh< Scalar, Index > &mesh) |
Returns a writable view of a mesh facets in the form of an Eigen matrix. More... | |
template<typename Scalar , typename Index > | |
ConstRowMatrixView< Index > | facet_view (const SurfaceMesh< Scalar, Index > &mesh) |
Returns a read-only view of a mesh facets in the form of an Eigen matrix. More... | |
View mesh attributes as Eigen matrices.
Mesh attributes such as positions and facet indices can be views as Eigen matrices. Specifically, we provide read-only views as Eigen::Map<const ...>
:
Writable reference are also available:
RowMatrixView< ValueType > matrix_ref | ( | Attribute< ValueType > & | attribute | ) |
ConstRowMatrixView< ValueType > matrix_view | ( | const Attribute< ValueType > & | attribute | ) |
VectorView< ValueType > vector_ref | ( | Attribute< ValueType > & | attribute | ) |
ConstVectorView< ValueType > vector_view | ( | const Attribute< ValueType > & | attribute | ) |
RowMatrixView< ValueType > reshaped_ref | ( | Attribute< ValueType > & | attribute, |
size_t | num_cols | ||
) |
#include <lagrange/views.h>
Returns a writable view of a given single-channel attribute in the form of an Eigen matrix with a prescribed number of columns.
This is useful to view arbitrary corner attributes as 2D matrices for regular meshes.
[in] | attribute | Attribute to view. |
[in] | num_cols | Number of columns to use. It must divide the number of elements of the prescribed attribute. |
ValueType | Attribute scalar type. |
ConstRowMatrixView< ValueType > reshaped_view | ( | const Attribute< ValueType > & | attribute, |
size_t | num_cols | ||
) |
#include <lagrange/views.h>
Returns a read-only view of a given single-channel attribute in the form of an Eigen matrix with a prescribed number of columns.
This is useful to view arbitrary corner attributes as 2D matrices for regular meshes.
[in] | attribute | Attribute to view. |
[in] | num_cols | Number of columns to use. It must divide the number of elements of the prescribed attribute. |
ValueType | Attribute scalar type. |
RowMatrixView< ValueType > attribute_matrix_ref | ( | SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name | ||
) |
#include <lagrange/views.h>
Returns a writable view of a mesh attribute in the form of an Eigen matrix.
[in] | mesh | Mesh whose attribute to view. |
[in] | name | Name of the mesh attribute to view. |
RowMatrixView< ValueType > attribute_matrix_ref | ( | SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id | ||
) |
#include <lagrange/views.h>
Returns a writable view of a mesh attribute in the form of an Eigen matrix.
[in] | mesh | Mesh whose attribute to view. |
[in] | id | Id of the mesh attribute to view. |
ConstRowMatrixView< ValueType > attribute_matrix_view | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name | ||
) |
#include <lagrange/views.h>
Returns a read-only view of a mesh attribute in the form of an Eigen matrix.
[in] | mesh | Mesh whose attribute to view. |
[in] | name | Name of the mesh attribute to view. |
ConstRowMatrixView< ValueType > attribute_matrix_view | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id | ||
) |
#include <lagrange/views.h>
Returns a read-only view of a mesh attribute in the form of an Eigen matrix.
[in] | mesh | Mesh whose attribute to view. |
[in] | id | Id of the mesh attribute to view. |
VectorView< ValueType > attribute_vector_ref | ( | SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name | ||
) |
#include <lagrange/views.h>
Returns a writable view of a mesh attribute in the form of an Eigen vector.
The attribute must have exactly one channel.
[in] | mesh | Mesh whose attribute to view. |
[in] | name | Name of the mesh attribute to view. |
VectorView< ValueType > attribute_vector_ref | ( | SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id | ||
) |
#include <lagrange/views.h>
Returns a writable view of a mesh attribute in the form of an Eigen vector.
The attribute must have exactly one channel.
[in] | mesh | Mesh whose attribute to view. |
[in] | id | Id of the mesh attribute to view. |
ConstVectorView< ValueType > attribute_vector_view | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name | ||
) |
#include <lagrange/views.h>
Returns a read-only view of a mesh attribute in the form of an Eigen vector.
The attribute must have exactly one channel.
[in] | mesh | Mesh whose attribute to view. |
[in] | name | Name of the mesh attribute to view. |
ConstVectorView< ValueType > attribute_vector_view | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id | ||
) |
#include <lagrange/views.h>
Returns a read-only view of a mesh attribute in the form of an Eigen vector.
The attribute must have exactly one channel.
[in] | mesh | Mesh whose attribute to view. |
[in] | id | Id of the mesh attribute to view. |
RowMatrixView< Scalar > vertex_ref | ( | SurfaceMesh< Scalar, Index > & | mesh | ) |
ConstRowMatrixView< Scalar > vertex_view | ( | const SurfaceMesh< Scalar, Index > & | mesh | ) |
RowMatrixView< Index > facet_ref | ( | SurfaceMesh< Scalar, Index > & | mesh | ) |
#include <lagrange/views.h>
Returns a writable view of a mesh facets in the form of an Eigen matrix.
This function only works for regular meshes. If the mesh does not have a fixed facet size, an exception is thrown.
[in] | mesh | Mesh whose facets to view. |
ConstRowMatrixView< Index > facet_view | ( | const SurfaceMesh< Scalar, Index > & | mesh | ) |
#include <lagrange/views.h>
Returns a read-only view of a mesh facets in the form of an Eigen matrix.
This function only works for regular meshes. If the mesh does not have a fixed facet size, an exception is thrown.
[in] | mesh | Mesh whose facets to view. |