// Created on: 1993-05-04
// Created by: Philippe DAUTRY
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.

#include <PLib.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>

//=======================================================================
//function : MaxDegree
//purpose  : 
//=======================================================================

inline Standard_Integer BSplCLib::MaxDegree ()
{
  return 25;
}

//=======================================================================
//function : NoWeights
//purpose  : 
//=======================================================================

inline  TColStd_Array1OfReal*  BSplCLib::NoWeights()
{
  return NULL;
}

//=======================================================================
//function : NoMults
//purpose  : 
//=======================================================================

inline  TColStd_Array1OfInteger*  BSplCLib::NoMults()
{
  return NULL;
}

//=======================================================================
//function : CoefsD0
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD0(const Standard_Real         U,
			      const TColgp_Array1OfPnt&   Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt&                     P)
{
  BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P);
}

//=======================================================================
//function : CoefsD0
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD0(const Standard_Real         U,
			      const TColgp_Array1OfPnt2d& Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt2d&                   P)
{
  BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P);
}

//=======================================================================
//function : CoefsD1
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD1(const Standard_Real         U,
			      const TColgp_Array1OfPnt&   Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt&                     P,
			      gp_Vec&                     Vec)
{
  BSplCLib::CacheD1(U, Poles.Length() -1, 0., 1., Poles, Weights, P, Vec);
}

//=======================================================================
//function : CoefsD1
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD1(const Standard_Real         U,
			      const TColgp_Array1OfPnt2d& Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt2d&                   P,
			      gp_Vec2d&                   Vec)
{
  BSplCLib::CacheD1(U, Poles.Length() -1, 0., 1., Poles, Weights, P, Vec);
}

//=======================================================================
//function : CoefsD2
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD2(const Standard_Real         U,
			      const TColgp_Array1OfPnt&   Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt&                     P,
			      gp_Vec&                     Vec1,
			      gp_Vec&                     Vec2)
{
  BSplCLib::CacheD2(U, Poles.Length() -1, 0., 1., Poles, Weights, 
		    P, Vec1, Vec2);
}

//=======================================================================
//function : CoefsD2
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD2(const Standard_Real         U,
			      const TColgp_Array1OfPnt2d& Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt2d&                   P,
			      gp_Vec2d&                   Vec1,
			      gp_Vec2d&                   Vec2)
{
  BSplCLib::CacheD2(U, Poles.Length() -1, 0., 1., Poles, Weights, 
		    P, Vec1, Vec2);
}

//=======================================================================
//function : CoefsD3
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD3(const Standard_Real         U,
			      const TColgp_Array1OfPnt&   Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt&                     P,
			      gp_Vec&                     Vec1,
			      gp_Vec&                     Vec2,
			      gp_Vec&                     Vec3)
{
  BSplCLib::CacheD3(U, Poles.Length() -1, 0., 1., Poles, Weights, 
		    P, Vec1, Vec2, Vec3);
}

//=======================================================================
//function : CoefsD3
//purpose  : 
//=======================================================================

inline void BSplCLib::CoefsD3(const Standard_Real         U,
			      const TColgp_Array1OfPnt2d& Poles, 
			      const TColStd_Array1OfReal* Weights,
			      gp_Pnt2d&                   P,
			      gp_Vec2d&                   Vec1,
			      gp_Vec2d&                   Vec2,
			      gp_Vec2d&                   Vec3)
{
  BSplCLib::CacheD3(U, Poles.Length() -1, 0., 1., Poles, Weights, 
		    P, Vec1, Vec2, Vec3);
}

//=======================================================================
//function : PolesCoefficients
//purpose  : 
//=======================================================================

inline void BSplCLib::PolesCoefficients
(const TColgp_Array1OfPnt&   Poles, 
 TColgp_Array1OfPnt&         CachePoles)
{
  BSplCLib::PolesCoefficients(Poles, PLib::NoWeights(),
			      CachePoles, PLib::NoWeights());
}

//=======================================================================
//function : PolesCoefficients
//purpose  : 
//=======================================================================

inline void BSplCLib::PolesCoefficients
(const TColgp_Array1OfPnt2d&   Poles, 
 TColgp_Array1OfPnt2d&         CachePoles)
{
  BSplCLib::PolesCoefficients(Poles, PLib::NoWeights(),
			      CachePoles, PLib::NoWeights());
}

