Blender
V5.0
source
blender
blenlib
intern
math_basis_types.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include "
BLI_math_basis_types.hh
"
10
11
#include <ostream>
12
13
namespace
blender::math
{
14
15
std::ostream &
operator<<
(std::ostream &stream,
const
Axis
axis)
16
{
17
switch
(axis.axis_) {
18
default
:
19
BLI_assert_unreachable
();
20
return
stream <<
"Invalid Axis"
;
21
case
Axis::Value::X
:
22
return
stream <<
'X'
;
23
case
Axis::Value::Y
:
24
return
stream <<
'Y'
;
25
case
Axis::Value::Z
:
26
return
stream <<
'Z'
;
27
}
28
}
29
std::ostream &
operator<<
(std::ostream &stream,
const
AxisSigned
axis
)
30
{
31
switch
(
axis
.axis_) {
32
default
:
33
BLI_assert_unreachable
();
34
return
stream <<
"Invalid AxisSigned"
;
35
case
AxisSigned::Value::X_POS
:
36
case
AxisSigned::Value::Y_POS
:
37
case
AxisSigned::Value::Z_POS
:
38
case
AxisSigned::Value::X_NEG
:
39
case
AxisSigned::Value::Y_NEG
:
40
case
AxisSigned::Value::Z_NEG
:
41
return
stream <<
axis
.axis() << (
axis
.sign() == -1 ?
'-'
:
'+'
);
42
}
43
}
44
std::ostream &
operator<<
(std::ostream &stream,
const
CartesianBasis
&
rot
)
45
{
46
return
stream <<
"CartesianBasis"
<<
rot
.axes;
47
}
48
49
}
// namespace blender::math
BLI_assert_unreachable
#define BLI_assert_unreachable()
Definition
BLI_assert.h:93
BLI_math_basis_types.hh
blender::math::AxisSigned::Value::X_POS
@ X_POS
Definition
BLI_math_basis_types.hh:106
blender::math::AxisSigned::Value::Z_NEG
@ Z_NEG
Definition
BLI_math_basis_types.hh:111
blender::math::AxisSigned::Value::Z_POS
@ Z_POS
Definition
BLI_math_basis_types.hh:108
blender::math::AxisSigned::Value::Y_NEG
@ Y_NEG
Definition
BLI_math_basis_types.hh:110
blender::math::AxisSigned::Value::Y_POS
@ Y_POS
Definition
BLI_math_basis_types.hh:107
blender::math::AxisSigned::Value::X_NEG
@ X_NEG
Definition
BLI_math_basis_types.hh:109
blender::math::AxisSigned::AxisSigned
AxisSigned()=default
blender::math::AxisSigned::axis
constexpr Axis axis() const
Definition
BLI_math_basis_types.hh:139
blender::math::Axis::Axis
Axis()=default
blender::math::Axis::Value::X
@ X
Definition
BLI_math_basis_types.hh:46
blender::math::Axis::Value::Z
@ Z
Definition
BLI_math_basis_types.hh:48
blender::math::Axis::Value::Y
@ Y
Definition
BLI_math_basis_types.hh:47
rot
#define rot(x, k)
blender::math
Definition
BLI_math_angle_types.hh:25
blender::math::operator<<
std::ostream & operator<<(std::ostream &stream, EulerOrder order)
Definition
math_rotation.cc:142
blender::math::CartesianBasis::CartesianBasis
CartesianBasis()=default
Generated on
for Blender by
doxygen
1.16.1