NRE_Segment3D.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include "../../Vector/3D/NRE_Vector3D.hpp"
13  #include <Utility/Interfaces/Stringable/NRE_Stringable.hpp>
14 
19  namespace NRE {
24  namespace Math {
25 
30  template <class T>
31  class Segment3D : public Utility::Stringable<Segment3D<T>> {
32  private: //Fields
33  Point3D<T> start;
34  Point3D<T> end;
36  public: // Methods
37  //## Constructor ##//
41  constexpr Segment3D() = default;
47  template <class K, class L>
48  constexpr Segment3D(Point3D<K> const& s, Point3D<L> const& e);
54  template <class K, class L>
55  constexpr Segment3D(Point2D<K> const& s, Point2D<L> const& e);
63  template <class K, class L, class N, class M>
64  constexpr Segment3D(K sX, L sY, N eX, M eY);
65 
66  //## Copy-Constructor ##//
71  constexpr Segment3D(Segment3D const& s) = default;
72 
73  //## Move-Constructor ##//
78  constexpr Segment3D(Segment3D && s) = default;
79 
80  //## Deconstructor ##//
84  ~Segment3D() = default;
85 
86  //## Getter ##//
90  constexpr Point3D<T> const& getStart() const;
94  constexpr Point3D<T> const& getEnd() const;
98  constexpr Vector3D<T> getVector() const;
99 
100  //## Assignment Operator ##//
106  constexpr Segment3D& operator =(Segment3D const& s) = default;
112  constexpr Segment3D& operator =(Segment3D && s) = default;
113 
114  //## Comparison Operator ##//
120  template <class K>
121  constexpr bool operator ==(Segment3D<K> const& s) const;
127  template <class K>
128  constexpr bool operator !=(Segment3D<K> const& s) const;
129 
130  //## Stream Operator ##//
135  Utility::String toString() const;
136  };
137  }
138  }
139 
144  namespace std {
145  template <class T, class K>
146  struct common_type<NRE::Math::Segment3D<T>, NRE::Math::Segment3D<K>> {
148  };
149  }
150 
151  #include "NRE_Segment3D.tpp"
constexpr Point3D< T > const & getStart() const
Utility::String toString() const
constexpr Vector3D< T > getVector() const
Math&#39;s API.
The stl standard namespace.
constexpr Point3D< T > const & getEnd() const
A 3D homogeneous segment.
Definition: NRE_Matrix3x3.hpp:34
constexpr bool operator==(Segment3D< K > const &s) const
The NearlyRealEngine&#39;s global namespace.
constexpr bool operator!=(Segment3D< K > const &s) const
constexpr Segment3D()=default
constexpr Segment3D & operator=(Segment3D const &s)=default