40 lines
758 B
C++
40 lines
758 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include "i_bspline.hpp"
|
|
|
|
namespace cvpr
|
|
{
|
|
class BSpline : public IBSpline
|
|
{
|
|
public:
|
|
BSpline();
|
|
|
|
BSpline(const std::vector<std::vector<double>>& points, int degree);
|
|
|
|
void create(const std::vector<std::vector<double>>& points, int degree) override;
|
|
|
|
bool isValid() override;
|
|
|
|
std::vector<double> eval(double t) override;
|
|
|
|
private:
|
|
void createImpl(const std::vector<std::vector<double>>& points, int degree);
|
|
|
|
private:
|
|
bool m_isValid;
|
|
|
|
std::pair<int, int> m_domain;
|
|
|
|
std::vector<double> m_knots;
|
|
|
|
std::vector<double> m_weights;
|
|
|
|
std::vector<std::vector<double>> m_v;
|
|
|
|
int m_dim;
|
|
|
|
int m_degree;
|
|
};
|
|
}
|