0023945: GeomAdaptor_Surface fails to compute the first derivatives on the surface...
[occt.git] / src / GeomAdaptor / GeomAdaptor_Curve.lxx
CommitLineData
b311480e 1// Created on: 1993-04-29
2// Created by: Bruno DUMORTIER
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
22#include <gp_Pnt.hxx>
23#include <Geom_Curve.hxx>
041bfce9 24#include <Standard_NullObject.hxx>
25#include <Standard_ConstructionError.hxx>
26
7fd59977 27
28//=======================================================================
29//function : GeomAdaptor_Curve
30//purpose :
31//=======================================================================
32
33inline GeomAdaptor_Curve::GeomAdaptor_Curve()
041bfce9 34 : myTypeCurve(GeomAbs_OtherCurve),
35 myFirst(0.),
36 myLast(0.)
7fd59977 37{
38}
39
40//=======================================================================
41//function : GeomAdaptor_Curve
42//purpose :
43//=======================================================================
44
45inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C)
46{
041bfce9 47 Load(C);
7fd59977 48}
49
50//=======================================================================
51//function : GeomAdaptor_Curve
52//purpose :
53//=======================================================================
54
55inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C,
56 const Standard_Real UFirst,
57 const Standard_Real ULast)
58{
7fd59977 59 Load(C,UFirst,ULast);
60}
61
62//=======================================================================
63//function : Load
64//purpose :
65//=======================================================================
66
67inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C)
68{
041bfce9 69 if ( C.IsNull()) Standard_NullObject::Raise();
70
71 load(C,C->FirstParameter(),C->LastParameter());
72}
73
74//=======================================================================
75//function : Load
76//purpose :
77//=======================================================================
78
79inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C,
80 const Standard_Real UFirst,
81 const Standard_Real ULast)
82{
83 if ( C.IsNull()) Standard_NullObject::Raise();
84
85 if ( UFirst > ULast) Standard_ConstructionError::Raise();
86
87 load(C,UFirst,ULast);
7fd59977 88}
89
041bfce9 90
7fd59977 91//=======================================================================
92//function : FirstParameter
93//purpose :
94//=======================================================================
95
96inline Standard_Real GeomAdaptor_Curve::FirstParameter() const
97{
98 return myFirst;
99}
100
101//=======================================================================
102//function : LastParameter
103//purpose :
104//=======================================================================
105
106inline Standard_Real GeomAdaptor_Curve::LastParameter() const
107{
108 return myLast;
109}
110
111//=======================================================================
112//function : Curve
113//purpose :
114//=======================================================================
115
116inline const Handle(Geom_Curve)& GeomAdaptor_Curve::Curve() const
117{
118 return myCurve;
119}
120
121//=======================================================================
122//function : GetType
123//purpose :
124//=======================================================================
125
126inline GeomAbs_CurveType GeomAdaptor_Curve::GetType() const
127{
128 return myTypeCurve;
129}