stim::mesh_vertices_scalar_description struct

Initialization parameters for a single scalar in a channel of mesh vertex data.

Public types

using func_type = void(const void*, size_t, void*)
A function that can be called by the library when it requires vertex scalar data.

Constructors, destructors, conversion operators

mesh_vertices_scalar_description() defaulted noexcept
Default constructor. Does not initialize the members.
template<typename T>
mesh_vertices_scalar_description(const T* first_scalar, size_t bytes_between_vertices = sizeof(T)) constexpr noexcept
Constructs a mesh vertex scalar description from a pointer to scalar data.
mesh_vertices_scalar_description(func_type* func_, scalar_type type_, const void* ptr_ = nullptr) noexcept
Constructs a mesh vertex scalar description from a callback.
template<typename T>
mesh_vertices_scalar_description(func_type* func_, const T* ptr_) noexcept
Constructs a mesh vertex scalar description from a callback.
operator bool() const explicit constexpr noexcept
Returns true if the fields of this description are sufficient to describe a scalar component in a mesh vertex channel.

Public variables

const void* ptr
Pointer to the first scalar in the source data.
size_t stride
The number of bytes between subsequent instances of the data when copying from ptr.
func_type* func
Pointer to the function to invoke when requesting vertex scalar data.
scalar_type type
The fundamental data type of the scalar.

Friends

auto operator!=(const mesh_vertices_scalar_description& lhs, const mesh_vertices_scalar_description& rhs) -> bool constexpr noexcept
Returns true if two descriptions do not describe the same mesh vertex scalar.
auto operator==(const mesh_vertices_scalar_description& lhs, const mesh_vertices_scalar_description& rhs) -> bool constexpr noexcept
Returns true if two descriptions describe the same mesh vertex scalar.

Typedef documentation

using stim::mesh_vertices_scalar_description::func_type = void(const void*, size_t, void*)

A function that can be called by the library when it requires vertex scalar data.

Parameters:

  1. const void*: The value specified for ptr.
  2. size_t: The index of the vertex for which the scalar data is being requested.
  3. void*: The destination buffer to recieve the scalar data.

Function documentation

stim::mesh_vertices_scalar_description::mesh_vertices_scalar_description() defaulted noexcept

Default constructor. Does not initialize the members.

template<typename T>
stim::mesh_vertices_scalar_description::mesh_vertices_scalar_description(const T* first_scalar, size_t bytes_between_vertices = sizeof(T)) constexpr noexcept

Constructs a mesh vertex scalar description from a pointer to scalar data.

Template parameters
T The vertex scalar type.
Parameters
first_scalar Pointer to the first scalar in the source data.
bytes_between_vertices The number of bytes between subsequent instances of the data (stride).

stim::mesh_vertices_scalar_description::mesh_vertices_scalar_description(func_type* func_, scalar_type type_, const void* ptr_ = nullptr) noexcept

Constructs a mesh vertex scalar description from a callback.

Parameters
func_ The function callback to invoke when requesting scalar data.
type_ The fundamental scalar type of the data that will be written by the callback.
ptr_ Data pointer to pass into callback invocations.

template<typename T>
stim::mesh_vertices_scalar_description::mesh_vertices_scalar_description(func_type* func_, const T* ptr_) noexcept

Constructs a mesh vertex scalar description from a callback.

Parameters
func_ The function callback to invoke when requesting scalar data.
ptr_ Scalar data pointer to pass into callback invocations.

Variable documentation

const void* stim::mesh_vertices_scalar_description::ptr

Pointer to the first scalar in the source data.

size_t stim::mesh_vertices_scalar_description::stride

The number of bytes between subsequent instances of the data when copying from ptr.

func_type* stim::mesh_vertices_scalar_description::func

Pointer to the function to invoke when requesting vertex scalar data.

scalar_type stim::mesh_vertices_scalar_description::type

The fundamental data type of the scalar.