Ceetron Data Provider Framework
CDPVec3.h
1 //##################################################################################################
2 //
3 // Ceetron Data Provider Framework
4 //
5 // --------------------------------------------------------------------------------------------
6 // Copyright (C) 2018, Ceetron AS
7 //##################################################################################################
8 
9 #pragma once
10 
11 #include "CDPBaseTypes.h"
12 
13 
14 //==================================================================================================
15 //
16 //
17 //
18 //==================================================================================================
19 class CDPVec3
20 {
21 public:
22  inline CDPVec3();
23  inline CDPVec3(const CDPVec3& other);
24  inline CDPVec3(double x, double y, double z);
25 
26  inline CDPVec3& operator=(const CDPVec3& rhs);
27 
28  inline const CDPVec3 operator+(const CDPVec3& rhs) const;
29  inline const CDPVec3 operator-(const CDPVec3& rhs) const;
30 
31  inline double operator*(const CDPVec3& rhs) const;
32  inline const CDPVec3 operator^(const CDPVec3& rhs) const;
33 
34  inline const double& x() const;
35  inline const double& y() const;
36  inline const double& z() const;
37  inline double& x();
38  inline double& y();
39  inline double& z();
40  inline void set(double x, double y, double z);
41 
42 private:
43  double m_v[3];
44 };
45 
46 
47 #include "CDPVec3.inl"
48 
49 
const double & z() const
Z element of the vector.
Definition: CDPVec3.inl:111
double operator*(const CDPVec3 &rhs) const
Computes the dot product of this and rhs and return the result.
Definition: CDPVec3.inl:77
const CDPVec3 operator^(const CDPVec3 &rhs) const
Computes the cross product of this and rhs and return the result.
Definition: CDPVec3.inl:85
const CDPVec3 operator-(const CDPVec3 &rhs) const
Returns vector that is this vector subtracted with rhs.
Definition: CDPVec3.inl:69
void set(double x, double y, double z)
Sets x, y and z value.
Definition: CDPVec3.inl:147
const CDPVec3 operator+(const CDPVec3 &rhs) const
Returns vector that is this vector added with rhs.
Definition: CDPVec3.inl:61
const double & y() const
Y element of the vector.
Definition: CDPVec3.inl:102
const double & x() const
X element of the vector.
Definition: CDPVec3.inl:93
Definition: CDPVec3.h:19
CDPVec3()
Default constructor.
Definition: CDPVec3.inl:19
CDPVec3 & operator=(const CDPVec3 &rhs)
Assignment operator.
Definition: CDPVec3.inl:49