Blender V5.3
blender::VecSwizzleReadOnly< T, Size, x, y, z, w > Struct Template Reference

#include <BLI_math_vector_swizzle.hh>

Public Types

using VecT = VecBase<T, Size>

Public Member Functions

 VecSwizzleReadOnly ()=default
VecT operator() () const

Static Public Attributes

static constexpr int max_comp = std::max({x, y, z, w})
static constexpr int min_comp = std::min({x, y, z, w})
static constexpr int effective_len = max_comp - min_comp + 1

Detailed Description

template<typename T, int Size, int x, int y, int z = y, int w = z>
struct blender::VecSwizzleReadOnly< T, Size, x, y, z, w >

Swizzle class that supports reordering of component. Will decay to a vector of the same size. Does not support assignment (but is still copy & move constructible, see below).

IMPORTANT: Must be declared at the same memory location as the first component referenced in the swizzle. So for zzwy it is y. We do this to allow the copy constructor to copy only the referenced component in the case of something like a.zzy = b.zzy. This is because we do not want to override (or delete) the copy constructor as it would make the vector types non-trivial.

Definition at line 80 of file BLI_math_vector_swizzle.hh.

Member Typedef Documentation

◆ VecT

template<typename T, int Size, int x, int y, int z = y, int w = z>
using blender::VecSwizzleReadOnly< T, Size, x, y, z, w >::VecT = VecBase<T, Size>

Definition at line 81 of file BLI_math_vector_swizzle.hh.

Constructor & Destructor Documentation

◆ VecSwizzleReadOnly()

template<typename T, int Size, int x, int y, int z = y, int w = z>
blender::VecSwizzleReadOnly< T, Size, x, y, z, w >::VecSwizzleReadOnly ( )
default

Member Function Documentation

◆ operator()()

template<typename T, int Size, int x, int y, int z = y, int w = z>
VecT blender::VecSwizzleReadOnly< T, Size, x, y, z, w >::operator() ( ) const
inlinenodiscard

Definition at line 92 of file BLI_math_vector_swizzle.hh.

References blender::BLI_STATIC_ASSERT(), min_comp, T, w(), blender::x, y, and z().

Member Data Documentation

◆ effective_len

template<typename T, int Size, int x, int y, int z = y, int w = z>
int blender::VecSwizzleReadOnly< T, Size, x, y, z, w >::effective_len = max_comp - min_comp + 1
staticconstexpr

Definition at line 84 of file BLI_math_vector_swizzle.hh.

◆ max_comp

template<typename T, int Size, int x, int y, int z = y, int w = z>
int blender::VecSwizzleReadOnly< T, Size, x, y, z, w >::max_comp = std::max({x, y, z, w})
staticconstexpr

Definition at line 82 of file BLI_math_vector_swizzle.hh.

◆ min_comp

template<typename T, int Size, int x, int y, int z = y, int w = z>
int blender::VecSwizzleReadOnly< T, Size, x, y, z, w >::min_comp = std::min({x, y, z, w})
staticconstexpr

Definition at line 83 of file BLI_math_vector_swizzle.hh.

Referenced by operator()().


The documentation for this struct was generated from the following file: