// Created on: 1992-10-22
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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 "Adaptor2d_Curve2d.hxx"

#include "GeomAbs_CurveType.hxx"
#include "GeomAbs_Shape.hxx"

#include "gp_Vec2d.hxx"
#include "gp_Lin2d.hxx"
#include "gp_Circ2d.hxx"
#include "gp_Elips2d.hxx"
#include "gp_Parab2d.hxx"
#include "gp_Hypr2d.hxx"

#include "Geom2d_BezierCurve.hxx"
#include "Geom2d_BSplineCurve.hxx"

#include "NCollection_Array1.hxx"

//============================================================
inline double Contap_HCurve2dTool::FirstParameter(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->FirstParameter());
}

//============================================================
inline double Contap_HCurve2dTool::LastParameter(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->LastParameter());
}

//============================================================
inline GeomAbs_Shape Contap_HCurve2dTool::Continuity(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Continuity());
}

//============================================================
inline int Contap_HCurve2dTool::NbIntervals(const occ::handle<Adaptor2d_Curve2d>& C,
                                            const GeomAbs_Shape                   Sh)
{
  return (C->NbIntervals(Sh));
}

//============================================================
inline void Contap_HCurve2dTool::Intervals(const occ::handle<Adaptor2d_Curve2d>& C,
                                           NCollection_Array1<double>&           Tab,
                                           const GeomAbs_Shape                   Sh)
{
  C->Intervals(Tab, Sh);
}

//============================================================
inline bool Contap_HCurve2dTool::IsClosed(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->IsClosed());
}

//============================================================
inline bool Contap_HCurve2dTool::IsPeriodic(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->IsPeriodic());
}

//============================================================
inline double Contap_HCurve2dTool::Period(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Period());
}

//============================================================
inline gp_Pnt2d Contap_HCurve2dTool::Value(const occ::handle<Adaptor2d_Curve2d>& C, const double U)
{
  return (C->Value(U));
}

//============================================================
inline void Contap_HCurve2dTool::D0(const occ::handle<Adaptor2d_Curve2d>& C,
                                    const double                          U,
                                    gp_Pnt2d&                             P)
{
  C->D0(U, P);
}

//============================================================
inline void Contap_HCurve2dTool::D1(const occ::handle<Adaptor2d_Curve2d>& C,
                                    const double                          U,
                                    gp_Pnt2d&                             P,
                                    gp_Vec2d&                             T)
{
  C->D1(U, P, T);
}

//============================================================
inline void Contap_HCurve2dTool::D2(const occ::handle<Adaptor2d_Curve2d>& C,
                                    const double                          U,
                                    gp_Pnt2d&                             P,
                                    gp_Vec2d&                             T,
                                    gp_Vec2d&                             N)
{

  C->D2(U, P, T, N);
}

//============================================================
inline void Contap_HCurve2dTool::D3(const occ::handle<Adaptor2d_Curve2d>& C,
                                    const double                          U,
                                    gp_Pnt2d&                             P,
                                    gp_Vec2d&                             V1,
                                    gp_Vec2d&                             V2,
                                    gp_Vec2d&                             V3)
{

  C->D3(U, P, V1, V2, V3);
}

//============================================================
inline gp_Vec2d Contap_HCurve2dTool::DN(const occ::handle<Adaptor2d_Curve2d>& C,
                                        const double                          U,
                                        const int                             N)
{

  return (C->DN(U, N));
}

//============================================================
inline double Contap_HCurve2dTool::Resolution(const occ::handle<Adaptor2d_Curve2d>& C,
                                              const double                          R3d)
{
  return (C->Resolution(R3d));
}

//============================================================
inline GeomAbs_CurveType Contap_HCurve2dTool::GetType(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->GetType());
}

//============================================================
inline gp_Lin2d Contap_HCurve2dTool::Line(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Line());
}

//============================================================
inline gp_Circ2d Contap_HCurve2dTool::Circle(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Circle());
}

//============================================================
inline gp_Elips2d Contap_HCurve2dTool::Ellipse(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Ellipse());
}

//============================================================
inline gp_Parab2d Contap_HCurve2dTool::Parabola(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Parabola());
}

//============================================================
inline gp_Hypr2d Contap_HCurve2dTool::Hyperbola(const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Hyperbola());
}

//============================================================
inline occ::handle<Geom2d_BezierCurve> Contap_HCurve2dTool::Bezier(
  const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->Bezier());
}

//============================================================
inline occ::handle<Geom2d_BSplineCurve> Contap_HCurve2dTool::BSpline(
  const occ::handle<Adaptor2d_Curve2d>& C)
{
  return (C->BSpline());
}

//============================================================
