NRE_BezierCurve3D.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/3D/NRE_Vector3D.hpp"
15 
16 
21  namespace NRE {
26  namespace Math {
27 
32  class BezierCurve3D : public Utility::Stringable<BezierCurve3D> {
33  private: //Fields
34  Utility::Vector<Point3D<float>> controls;
36  public: // Methods
37  //## Constructor ##//
41  BezierCurve3D() = default;
46  BezierCurve3D(std::initializer_list<Point3D<float>> points) : controls(points) {
47  }
52  BezierCurve3D(Utility::Vector<Point3D<float>> && c) : controls(std::move(c)) {
53  }
54 
55  //## Copy-Constructor ##//
60  BezierCurve3D(BezierCurve3D const& c) = default;
61 
62  //## Move-Constructor ##//
67  BezierCurve3D(BezierCurve3D && c) = default;
68 
69  //## Deconstructor ##//
73  ~BezierCurve3D() = default;
74 
75  //## Getter ##//
81  inline Point3D<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 Point3D<float>& operator [](std::size_t index) {
100  return controls[index];
101  }
108  inline Point3D<float> const& operator [](std::size_t index) const{
109  return controls[index];
110  }
111 
112  //## Assignment Operator ##//
118  BezierCurve3D& operator =(BezierCurve3D const& c) = default;
124  BezierCurve3D& operator =(BezierCurve3D && c) = default;
125 
126  //## Stream Operator ##//
131  Utility::String toString() const;
132  };
133  }
134  }
135 
136  #include "NRE_BezierCurve3D.tpp"
Represent a 2D homogeneous Bezier curves with a set of control points.
Definition: NRE_BezierCurve3D.hpp:32
Point3D< float > & operator[](std::size_t index)
Definition: NRE_BezierCurve3D.hpp:99
Math&#39;s API.
BezierCurve3D & operator=(BezierCurve3D const &c)=default
The stl standard namespace.
A cartesian 3D vector, 2D homogeneous.
Definition: NRE_Matrix3x3.hpp:33
std::size_t getSize() const
Definition: NRE_BezierCurve3D.hpp:88
Utility::String toString() const
Point3D< float > const & getPoint(std::size_t index) const
Definition: NRE_BezierCurve3D.hpp:81
BezierCurve3D(Utility::Vector< Point3D< float >> &&c)
Definition: NRE_BezierCurve3D.hpp:52
The NearlyRealEngine&#39;s global namespace.
BezierCurve3D(std::initializer_list< Point3D< float >> points)
Definition: NRE_BezierCurve3D.hpp:46