Control Surface  1.2.0
MIDI Control Surface library for Arduino
Vector.cpp
Go to the documentation of this file.
1 #include "Vector.hpp"
2 
3 AH_DIAGNOSTIC_WERROR() // Enable errors on warnings
4 
5 #include <AH/PrintStream/PrintStream.hpp>
6 #ifndef ARDUINO
7 #include <ostream> // std::ostream, <<
8 #endif
9 
11 
12 // LCOV_EXCL_START
13 
14 #ifndef ARDUINO
15 
18 std::ostream &operator<<(std::ostream &os, Vec2f v) {
19  return os << "(" << v.x << ", " << v.y << ")";
20 }
21 
24 std::ostream &operator<<(std::ostream &os, Vec3f v) {
25  return os << "(" << v.x << ", " << v.y << ", " << v.z << ")";
26 }
27 
28 #endif
29 
32 Print &operator<<(Print &os, Vec2f v) {
33  return os << "(" << v.x << ", " << v.y << ")";
34 }
35 
38 Print &operator<<(Print &os, Vec3f v) {
39  return os << "(" << v.x << ", " << v.y << ", " << v.z << ")";
40 }
41 
42 // LCOV_EXCL_STOP
43 
45 
AH::Vec2f::y
float y
The y component of the vector.
Definition: Vector.hpp:45
AH::Vec2f::x
float x
The x component of the vector.
Definition: Vector.hpp:44
AH_DIAGNOSTIC_POP
#define AH_DIAGNOSTIC_POP()
Definition: Warnings.hpp:36
AH::Vec3f
Type for 3D vectors of floating point numbers.
Definition: Vector.hpp:144
AH::Vec3f::x
float x
The x component of the vector.
Definition: Vector.hpp:145
AH::Vec3f::operator<<
Print & operator<<(Print &os, Vec3f v)
Printing.
Definition: Vector.cpp:38
AH::Vec2f
Type for 2D vectors of floating point numbers.
Definition: Vector.hpp:43
AH_DIAGNOSTIC_WERROR
#define AH_DIAGNOSTIC_WERROR()
Definition: Warnings.hpp:35
AH::Vec2f::operator<<
Print & operator<<(Print &os, Vec2f v)
Printing.
Definition: Vector.cpp:32
BEGIN_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
Definition: AH/Settings/NamespaceSettings.hpp:9
AH::Vec3f::z
float z
The z component of the vector.
Definition: Vector.hpp:147
END_AH_NAMESPACE
#define END_AH_NAMESPACE
Definition: AH/Settings/NamespaceSettings.hpp:10
AH::Vec3f::y
float y
The y component of the vector.
Definition: Vector.hpp:146
AH::Quaternion::operator<<
Print & operator<<(Print &os, Quaternion e)
Printing.
Definition: Quaternion.cpp:28
Vector.hpp
Definition of Vec2f and Vec3f.