b311480e |
1 | // Created on: 1993-04-29 |
2 | // Created by: Bruno DUMORTIER |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <gp_Pnt.hxx> |
18 | #include <Geom_Curve.hxx> |
041bfce9 |
19 | #include <Standard_NullObject.hxx> |
20 | #include <Standard_ConstructionError.hxx> |
21 | |
7fd59977 |
22 | |
23 | //======================================================================= |
24 | //function : GeomAdaptor_Curve |
25 | //purpose : |
26 | //======================================================================= |
27 | |
28 | inline GeomAdaptor_Curve::GeomAdaptor_Curve() |
041bfce9 |
29 | : myTypeCurve(GeomAbs_OtherCurve), |
30 | myFirst(0.), |
31 | myLast(0.) |
7fd59977 |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : GeomAdaptor_Curve |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C) |
41 | { |
041bfce9 |
42 | Load(C); |
7fd59977 |
43 | } |
44 | |
45 | //======================================================================= |
46 | //function : GeomAdaptor_Curve |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C, |
51 | const Standard_Real UFirst, |
52 | const Standard_Real ULast) |
53 | { |
7fd59977 |
54 | Load(C,UFirst,ULast); |
55 | } |
56 | |
57 | //======================================================================= |
58 | //function : Load |
59 | //purpose : |
60 | //======================================================================= |
61 | |
62 | inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C) |
63 | { |
041bfce9 |
64 | if ( C.IsNull()) Standard_NullObject::Raise(); |
65 | |
66 | load(C,C->FirstParameter(),C->LastParameter()); |
67 | } |
68 | |
69 | //======================================================================= |
70 | //function : Load |
71 | //purpose : |
72 | //======================================================================= |
73 | |
74 | inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C, |
75 | const Standard_Real UFirst, |
76 | const Standard_Real ULast) |
77 | { |
78 | if ( C.IsNull()) Standard_NullObject::Raise(); |
79 | |
80 | if ( UFirst > ULast) Standard_ConstructionError::Raise(); |
81 | |
82 | load(C,UFirst,ULast); |
7fd59977 |
83 | } |
84 | |
041bfce9 |
85 | |
7fd59977 |
86 | //======================================================================= |
87 | //function : FirstParameter |
88 | //purpose : |
89 | //======================================================================= |
90 | |
91 | inline Standard_Real GeomAdaptor_Curve::FirstParameter() const |
92 | { |
93 | return myFirst; |
94 | } |
95 | |
96 | //======================================================================= |
97 | //function : LastParameter |
98 | //purpose : |
99 | //======================================================================= |
100 | |
101 | inline Standard_Real GeomAdaptor_Curve::LastParameter() const |
102 | { |
103 | return myLast; |
104 | } |
105 | |
106 | //======================================================================= |
107 | //function : Curve |
108 | //purpose : |
109 | //======================================================================= |
110 | |
111 | inline const Handle(Geom_Curve)& GeomAdaptor_Curve::Curve() const |
112 | { |
113 | return myCurve; |
114 | } |
115 | |
116 | //======================================================================= |
117 | //function : GetType |
118 | //purpose : |
119 | //======================================================================= |
120 | |
121 | inline GeomAbs_CurveType GeomAdaptor_Curve::GetType() const |
122 | { |
123 | return myTypeCurve; |
124 | } |