Blender V4.3
blender::math::Axis Class Reference

#include <BLI_math_basis_types.hh>

Public Types

enum class  Value : int8_t { X = 0 , Y , Z }
 

Public Member Functions

 Axis ()=default
 
constexpr Axis (const Value axis)
 
constexpr operator Value () const
 
constexpr int as_int () const
 
 operator bool () const =delete
 

Static Public Member Functions

static constexpr Axis from_char (char axis_char)
 
static constexpr Axis from_int (const int axis_int)
 

Static Public Attributes

static constexpr Value X = Value::X
 
static constexpr Value Y = Value::Y
 
static constexpr Value Z = Value::Z
 

Friends

std::ostream & operator<< (std::ostream &stream, const Axis axis)
 

Detailed Description

An enum class representing one of the 3 basis axes. This is implemented using a class to allow operators and methods. NOTE: While this represents a 3D axis it can still be used to generate 2D basis vectors.

Definition at line 42 of file BLI_math_basis_types.hh.

Member Enumeration Documentation

◆ Value

enum class blender::math::Axis::Value : int8_t
strong
Enumerator

Definition at line 44 of file BLI_math_basis_types.hh.

Constructor & Destructor Documentation

◆ Axis() [1/2]

blender::math::Axis::Axis ( )
default

◆ Axis() [2/2]

blender::math::Axis::Axis ( const Value axis)
inlineconstexpr

Definition at line 61 of file BLI_math_basis_types.hh.

Member Function Documentation

◆ as_int()

◆ from_char()

static constexpr Axis blender::math::Axis::from_char ( char axis_char)
inlinestaticconstexpr

Convert an uppercase axis character 'X', 'Y' or 'Z' to an enum value.

Definition at line 64 of file BLI_math_basis_types.hh.

References BLI_assert, X, and Z.

◆ from_int()

◆ operator bool()

blender::math::Axis::operator bool ( ) const
explicitdelete

Avoid hell.

◆ operator Value()

blender::math::Axis::operator Value ( ) const
inlineconstexpr

Definition at line 80 of file BLI_math_basis_types.hh.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const Axis axis )
friend

Definition at line 11 of file math_basis_types.cc.

Member Data Documentation

◆ X

◆ Y

◆ Z


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