File: Nurbs.h
    1| #ifndef _Nurbs_h
    2| #define _Nurbs_h
    3| 
    4| #include "Path.h"
    5| #include <vector>
    6| 
    7| namespace Paths
    8| {
    9| 
   10| /**
   11|  * The Nurbs class. It implements a nurbs curve
   12|  * for the given order. It is a very powerful
   13|  * and flexible curve representation. For simpler
   14|  * cases you may prefer to use a @see Bezier curve.
   15|  */
   16| template <size_t Order>
   17| class Nurbs : public Path
   18| {
   19| public:
   20|   /**
   21|    * Create a new Nurbs curve.
   22|    */
   23|   Nurbs();
   24|   /**
   25|    * Inserts a control point with the given weight.
   26|    * The knot value determines the position in the sequence.
   27|    * @param knot the parameter value at which to insert a new knot
   28|    * @param vertex the control point
   29|    * @param weight the weight of the control point
   30|    */
   31|   void insert_control_point(double knot, const Vertex &vertex,
   32|                             double weight);
   33|   virtual void draw();
   34| private:
   35|   /**
   36|    * The data...
   37|    */
   38|   std::vector<Vertex_controls;
   39|   std::vector<double_weights;
   40|   std::vector<double_knots;
   41| };
   42| 
   43| }
   44| 
   45| #endif