0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / GeomAdaptor / GeomAdaptor_Curve.lxx
1 // Created on: 1993-04-29
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <gp_Pnt.hxx>
18 #include <Geom_Curve.hxx>
19 #include <Standard_NullObject.hxx>
20 #include <Standard_ConstructionError.hxx>
21
22
23 //=======================================================================
24 //function : GeomAdaptor_Curve
25 //purpose  : 
26 //=======================================================================
27
28 inline GeomAdaptor_Curve::GeomAdaptor_Curve()
29  : myTypeCurve(GeomAbs_OtherCurve),
30    myFirst(0.),
31    myLast(0.)
32 {
33 }
34
35 //=======================================================================
36 //function : GeomAdaptor_Curve
37 //purpose  : 
38 //=======================================================================
39
40 inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C)
41 {
42   Load(C);
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 {
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 {
64   if ( C.IsNull()) throw Standard_NullObject();
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()) throw Standard_NullObject();
79   
80   if ( UFirst > ULast) throw Standard_ConstructionError();
81   
82   load(C,UFirst,ULast);
83 }
84
85
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 }