Blender
V4.3
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
5
#include "
BLI_math_basis_types.hh
"
6
7
#include <ostream>
8
9
namespace
blender::math
{
10
11
std::ostream &
operator<<
(std::ostream &stream,
const
Axis
axis)
12
{
13
switch
(axis.axis_) {
14
default
:
15
BLI_assert_unreachable
();
16
return
stream <<
"Invalid Axis"
;
17
case
Axis::Value::X
:
18
return
stream <<
'X'
;
19
case
Axis::Value::Y
:
20
return
stream <<
'Y'
;
21
case
Axis::Value::Z
:
22
return
stream <<
'Z'
;
23
}
24
}
25
std::ostream &
operator<<
(std::ostream &stream,
const
AxisSigned
axis)
26
{
27
switch
(axis.axis_) {
28
default
:
29
BLI_assert_unreachable
();
30
return
stream <<
"Invalid AxisSigned"
;
31
case
AxisSigned::Value::X_POS
:
32
case
AxisSigned::Value::Y_POS
:
33
case
AxisSigned::Value::Z_POS
:
34
case
AxisSigned::Value::X_NEG
:
35
case
AxisSigned::Value::Y_NEG
:
36
case
AxisSigned::Value::Z_NEG
:
37
return
stream << axis.axis() << (axis.sign() == -1 ?
'-'
:
'+'
);
38
}
39
}
40
std::ostream &
operator<<
(std::ostream &stream,
const
CartesianBasis
&
rot
)
41
{
42
return
stream <<
"CartesianBasis"
<<
rot
.axes;
43
}
44
45
}
// namespace blender::math
BLI_assert_unreachable
#define BLI_assert_unreachable()
Definition
BLI_assert.h:97
BLI_math_basis_types.hh
blender::math::AxisSigned
Definition
BLI_math_basis_types.hh:101
blender::math::AxisSigned::Value::X_POS
@ X_POS
blender::math::AxisSigned::Value::Z_NEG
@ Z_NEG
blender::math::AxisSigned::Value::Z_POS
@ Z_POS
blender::math::AxisSigned::Value::Y_NEG
@ Y_NEG
blender::math::AxisSigned::Value::Y_POS
@ Y_POS
blender::math::AxisSigned::Value::X_NEG
@ X_NEG
blender::math::Axis
Definition
BLI_math_basis_types.hh:42
blender::math::Axis::Value::X
@ X
blender::math::Axis::Value::Z
@ Z
blender::math::Axis::Value::Y
@ Y
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
Definition
BLI_math_basis_types.hh:349
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0