Blender V5.0
blender::eevee::AxisSigned Class Reference

#include <BLI_math_basis_types.hh>

Public Types

enum class  Value : int8_t {
  X_POS = 0 , Y_POS = 1 , Z_POS = 2 , X_NEG = 3 ,
  Y_NEG = 4 , Z_NEG = 5
}

Public Member Functions

 AxisSigned ()=default
constexpr AxisSigned (Value axis)
constexpr AxisSigned (Axis axis)
constexpr Axis axis () const
AxisSigned operator- () const
AxisSigned next_after () const
constexpr operator Value () const
constexpr int as_int () const
constexpr int sign () const
constexpr bool is_negative () const
 operator bool () const=delete

Static Public Member Functions

static constexpr AxisSigned from_int (int axis_int)

Static Public Attributes

static constexpr Value X_POS = Value::X_POS
static constexpr Value Y_POS = Value::Y_POS
static constexpr Value Z_POS = Value::Z_POS
static constexpr Value X_NEG = Value::X_NEG
static constexpr Value Y_NEG = Value::Y_NEG
static constexpr Value Z_NEG = Value::Z_NEG

Friends

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

Detailed Description

An enum class representing one of the 6 axis aligned direction. 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 101 of file BLI_math_basis_types.hh.

Member Enumeration Documentation

◆ Value

enum class blender::math::AxisSigned::Value : int8_t
strong
Enumerator
X_POS 
Y_POS 
Z_POS 
X_NEG 
Y_NEG 
Z_NEG 

Definition at line 103 of file BLI_math_basis_types.hh.

Constructor & Destructor Documentation

◆ AxisSigned() [1/3]

◆ AxisSigned() [2/3]

Definition at line 127 of file BLI_math_basis_types.hh.

◆ AxisSigned() [3/3]

Definition at line 128 of file BLI_math_basis_types.hh.

Member Function Documentation

◆ as_int()

int blender::math::AxisSigned::as_int ( ) const
inlineconstexpr

Definition at line 162 of file BLI_math_basis_types.hh.

◆ axis()

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

Return the axis without the sign. It changes the type whereas abs(axis) doesn't.

Definition at line 139 of file BLI_math_basis_types.hh.

◆ from_int()

constexpr AxisSigned blender::math::AxisSigned::from_int ( int axis_int)
inlinestaticconstexpr

Allow casting from DNA enums stored as short / int.

Definition at line 131 of file BLI_math_basis_types.hh.

◆ is_negative()

bool blender::math::AxisSigned::is_negative ( ) const
inlineconstexpr

Returns true if axis is negative, false otherwise.

Definition at line 174 of file BLI_math_basis_types.hh.

◆ next_after()

Return next enum value.

Definition at line 151 of file BLI_math_basis_types.hh.

◆ operator bool()

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

Avoid hell.

◆ operator Value()

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

Allow usage in switch() statements and comparisons.

Definition at line 157 of file BLI_math_basis_types.hh.

◆ operator-()

AxisSigned blender::math::AxisSigned::operator- ( ) const
inline

Return the opposing axis.

Definition at line 145 of file BLI_math_basis_types.hh.

◆ sign()

int blender::math::AxisSigned::sign ( ) const
inlineconstexpr

Returns -1 if axis is negative, 1 otherwise.

Definition at line 168 of file BLI_math_basis_types.hh.

◆ operator<<

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

Definition at line 29 of file math_basis_types.cc.

Member Data Documentation

◆ X_NEG

Value blender::math::AxisSigned::X_NEG = Value::X_NEG
staticconstexpr

Definition at line 117 of file BLI_math_basis_types.hh.

◆ X_POS

Value blender::math::AxisSigned::X_POS = Value::X_POS
staticconstexpr

Definition at line 114 of file BLI_math_basis_types.hh.

◆ Y_NEG

Value blender::math::AxisSigned::Y_NEG = Value::Y_NEG
staticconstexpr

Definition at line 118 of file BLI_math_basis_types.hh.

◆ Y_POS

Value blender::math::AxisSigned::Y_POS = Value::Y_POS
staticconstexpr

Definition at line 115 of file BLI_math_basis_types.hh.

◆ Z_NEG

Value blender::math::AxisSigned::Z_NEG = Value::Z_NEG
staticconstexpr

Definition at line 119 of file BLI_math_basis_types.hh.

◆ Z_POS

Value blender::math::AxisSigned::Z_POS = Value::Z_POS
staticconstexpr

Definition at line 116 of file BLI_math_basis_types.hh.


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