NRE_BezierCurve4D.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <Utility/Vector/NRE_Vector.hpp>
13  #include <Utility/Interfaces/Stringable/NRE_Stringable.hpp>
14  #include "../../../Vector/4D/NRE_Vector4D.hpp"
15 
16 
21  namespace NRE {
26  namespace Math {
27 
32  class BezierCurve4D : public Utility::Stringable<BezierCurve4D> {
33  private: //Fields
34  Utility::Vector<Point4D<float>> controls;
36  public: // Methods
37  //## Constructor ##//
41  BezierCurve4D() = default;
46  BezierCurve4D(std::initializer_list<Point4D<float>> points) : controls(points) {
47  }
52  BezierCurve4D(Utility::Vector<Point4D<float>> && c) : controls(c) {
53  }
54 
55  //## Copy-Constructor ##//
60  BezierCurve4D(BezierCurve4D const& c) = default;
61 
62  //## Move-Constructor ##//
67  BezierCurve4D(BezierCurve4D && c) = default;
68 
69  //## Deconstructor ##//
73  ~BezierCurve4D() = default;
74 
75  //## Getter ##//
81  inline Point4D<float> const& getPoint(std::size_t index) const {
82  return controls[index];
83  }
88  inline std::size_t getSize() const {
89  return controls.getSize();
90  }
91 
92  //## Access Operator ##//
99  inline Point4D<float>& operator [](std::size_t index) {
100  return controls[index];
101  }
108  inline Point4D<float> const& operator [](std::size_t index) const{
109  return controls[index];
110  }
111 
112  //## Assignment Operator ##//
118  BezierCurve4D& operator =(BezierCurve4D const& c) = default;
124  BezierCurve4D& operator =(BezierCurve4D && c) = default;
125 
126  //## Stream Operator ##//
131  Utility::String toString() const;
132  };
133  }
134  }
135 
136  #include "NRE_BezierCurve4D.tpp"
BezierCurve4D & operator=(BezierCurve4D const &c)=default
Point4D< float > const & getPoint(std::size_t index) const
Definition: NRE_BezierCurve4D.hpp:81
Math&#39;s API.
BezierCurve4D(Utility::Vector< Point4D< float >> &&c)
Definition: NRE_BezierCurve4D.hpp:52
Utility::String toString() const
The NearlyRealEngine&#39;s global namespace.
A cartesian 4D vector, 3D homogeneous.
Definition: NRE_Matrix4x4.hpp:34
Point4D< float > & operator[](std::size_t index)
Definition: NRE_BezierCurve4D.hpp:99
std::size_t getSize() const
Definition: NRE_BezierCurve4D.hpp:88
BezierCurve4D(std::initializer_list< Point4D< float >> points)
Definition: NRE_BezierCurve4D.hpp:46
Represent a 3D homogeneous Bezier curves with a set of control points.
Definition: NRE_BezierCurve4D.hpp:32