0022769: Optimization of sewing algorithm
[occt.git] / src / GeomAdaptor / GeomAdaptor_Curve.lxx
1 // File:      GeomAdaptor_Curve.lxx
2 // Created:   Thu Apr 29 11:54:32 1993
3 // Author:    Bruno DUMORTIER
4 // Copyright: OPEN CASCADE 1993
5
6 #include <gp_Pnt.hxx>
7 #include <Geom_Curve.hxx>
8 #include <Standard_NullObject.hxx>
9 #include <Standard_ConstructionError.hxx>
10
11
12 //=======================================================================
13 //function : GeomAdaptor_Curve
14 //purpose  : 
15 //=======================================================================
16
17 inline GeomAdaptor_Curve::GeomAdaptor_Curve()
18  : myTypeCurve(GeomAbs_OtherCurve),
19    myFirst(0.),
20    myLast(0.)
21 {
22 }
23
24 //=======================================================================
25 //function : GeomAdaptor_Curve
26 //purpose  : 
27 //=======================================================================
28
29 inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C)
30 {
31   Load(C);
32 }
33
34 //=======================================================================
35 //function : GeomAdaptor_Curve
36 //purpose  : 
37 //=======================================================================
38
39 inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C,
40                                             const Standard_Real UFirst,
41                                             const Standard_Real ULast)
42 {
43   Load(C,UFirst,ULast);
44 }
45
46 //=======================================================================
47 //function : Load
48 //purpose  : 
49 //=======================================================================
50
51 inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C)
52 {
53   if ( C.IsNull()) Standard_NullObject::Raise();
54   
55   load(C,C->FirstParameter(),C->LastParameter());
56 }
57
58 //=======================================================================
59 //function : Load
60 //purpose  : 
61 //=======================================================================
62
63 inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C,
64                                     const Standard_Real UFirst,
65                                     const Standard_Real ULast)
66 {
67   if ( C.IsNull()) Standard_NullObject::Raise();
68   
69   if ( UFirst > ULast) Standard_ConstructionError::Raise();
70   
71   load(C,UFirst,ULast);
72 }
73
74
75 //=======================================================================
76 //function : FirstParameter
77 //purpose  : 
78 //=======================================================================
79
80 inline Standard_Real GeomAdaptor_Curve::FirstParameter() const
81 {
82   return myFirst;
83 }
84
85 //=======================================================================
86 //function : LastParameter
87 //purpose  : 
88 //=======================================================================
89
90 inline Standard_Real GeomAdaptor_Curve::LastParameter() const
91 {
92   return myLast;
93 }
94
95 //=======================================================================
96 //function : Curve
97 //purpose  : 
98 //=======================================================================
99
100 inline const Handle(Geom_Curve)& GeomAdaptor_Curve::Curve() const 
101
102   return myCurve;
103 }
104
105 //=======================================================================
106 //function : GetType
107 //purpose  : 
108 //=======================================================================
109
110 inline GeomAbs_CurveType GeomAdaptor_Curve::GetType() const
111 {
112   return myTypeCurve;
113 }