// Reconstruction - A tool for building cad models from meshes
// Copyright (C) 2010-2026 Eric Bechet, Borhen Louhichi
//
// See the LICENSE file for license information and contributions.
// Please report all bugs and problems to <bechet@cadxfem.org>.


#include "RecIncludes.h"
#include <vector>


#ifndef __OUTIL_SPLINE_H
#define __OUTIL_SPLINE_H


///********************************************************************************
/// Outil Interpolation Spline
///********************************************************************************
class Spline
{
private:


public:

  int findspan(const std::vector<double> &knots, int deg,double u);
  void basisfuns(const std::vector<double> &knots,int deg, int i, double para, std::vector<double> &N);

  std::vector<double> chord_length(const std::vector<gp_Pnt > Pnts);
  std::vector<double> centripetal(const std::vector<gp_Pnt > Pnts);
  std::vector<double> equally_spaced(const std::vector<double > Uk, int deg);
  std::vector<double> averaging(const std::vector<double > Uk, int deg);
  void OCCKnot_multiplicity(const std::vector<double > Knots, std::vector<double > &KnotsOCC, std::vector<int > &Multiples);


};


class CurveSpline
{
private:

public:
  void GlobalCurveInterp(const std::vector<gp_Pnt > Pnts, int &deg, std::vector<double > &Knots, std::vector<gp_Pnt > &CPnts, int Interp_method=0);


};

class SurfaceSpline
{
private:
  void SurfMeshParams(std::vector<std::vector<gp_Pnt > > Qkl, std::vector<double > &Uk, std::vector<double > &Vl);

public:
  void GlobalSurfInterp(std::vector<std::vector<gp_Pnt > > Qkl, int &degU, int &degV, std::vector<std::vector<gp_Pnt > > &Pij, std::vector<double > &KnotsU, std::vector<double > &KnotsV);


};












#endif //__OUTIL_SPLINE_H
