NRE_Segment4D.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include "../../Vector/4D/NRE_Vector4D.hpp"
13  #include <Utility/Interfaces/Stringable/NRE_Stringable.hpp>
14 
19  namespace NRE {
24  namespace Math {
25 
30  template <class T>
31  class Segment4D : public Utility::Stringable<Segment4D<T>> {
32  private: //Fields
33  Point4D<T> start;
34  Point4D<T> end;
36  public: // Methods
37  //## Constructor ##//
41  constexpr Segment4D() = default;
47  template <class K, class L>
48  constexpr Segment4D(Point4D<K> const& s, Point4D<L> const& e);
54  template <class K, class L>
55  constexpr Segment4D(Point3D<K> const& s, Point3D<L> const& e);
65  template <class K, class L, class N, class M, class O, class P>
66  constexpr Segment4D(K sX, L sY, N sZ, M eX, O eY, P eZ);
67 
68  //## Copy-Constructor ##//
73  constexpr Segment4D(Segment4D const& s) = default;
74 
75  //## Move-Constructor ##//
80  constexpr Segment4D(Segment4D && s) = default;
81 
82  //## Deconstructor ##//
86  ~Segment4D() = default;
87 
88  //## Getter ##//
92  constexpr Point4D<T> const& getStart() const;
96  constexpr Point4D<T> const& getEnd() const;
100  constexpr Vector4D<T> getVector() const;
101 
102  //## Assignment Operator ##//
108  constexpr Segment4D& operator =(Segment4D const& s) = default;
114  constexpr Segment4D& operator =(Segment4D && s) = default;
115 
116  //## Comparison Operator ##//
122  template <class K>
123  constexpr bool operator ==(Segment4D<K> const& s) const;
129  template <class K>
130  constexpr bool operator !=(Segment4D<K> const& s) const;
131 
132  //## Stream Operator ##//
137  Utility::String toString() const;
138  };
139  }
140  }
141 
146  namespace std {
147  template <class T, class K>
148  struct common_type<NRE::Math::Segment4D<T>, NRE::Math::Segment4D<K>> {
150  };
151  }
152 
153  #include "NRE_Segment4D.tpp"
A 4D homogeneous segment.
Definition: NRE_Matrix4x4.hpp:35
constexpr Point4D< T > const & getEnd() const
constexpr Vector4D< T > getVector() const
Math&#39;s API.
constexpr bool operator==(Segment4D< K > const &s) const
The stl standard namespace.
The NearlyRealEngine&#39;s global namespace.
Utility::String toString() const
constexpr Segment4D()=default
constexpr bool operator!=(Segment4D< K > const &s) const
constexpr Point4D< T > const & getStart() const
constexpr Segment4D & operator=(Segment4D const &s)=default