Commit | Line | Data |
---|---|---|

b311480e | 1 | -- Created on: 1993-03-31 |

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 | deferred class Curve from Adaptor3d | |

18 | ||

19 | ---Purpose: Root class for 3D curves on which geometric | |

20 | -- algorithms work. | |

21 | -- An adapted curve is an interface between the | |

22 | -- services provided by a curve and those required of | |

23 | -- the curve by algorithms which use it. | |

24 | -- Two derived concrete classes are provided: | |

25 | -- - GeomAdaptor_Curve for a curve from the Geom package | |

26 | -- - Adaptor3d_CurveOnSurface for a curve lying on | |

27 | -- a surface from the Geom package. | |

28 | ||

29 | ||

30 | uses | |

31 | Array1OfReal from TColStd, | |

32 | Shape from GeomAbs, | |

33 | CurveType from GeomAbs, | |

34 | Vec from gp, | |

35 | Pnt from gp, | |

36 | Circ from gp, | |

37 | Elips from gp, | |

38 | Hypr from gp, | |

39 | Parab from gp, | |

40 | Lin from gp, | |

41 | BezierCurve from Geom, | |

42 | BSplineCurve from Geom, | |

43 | HCurve from Adaptor3d | |

44 | ||

45 | raises | |

46 | ||

47 | OutOfRange from Standard, | |

48 | NoSuchObject from Standard, | |

49 | DomainError from Standard | |

50 | ||

51 | is | |

52 | ||

53 | -- | |

54 | -- Global methods - Apply to the whole curve. | |

55 | -- | |

56 | ||

7fd59977 | 57 | FirstParameter(me) returns Real |

58 | is virtual; | |

59 | ||

60 | LastParameter(me) returns Real | |

61 | is virtual; | |

62 | ||

63 | -- | |

64 | -- Services to break the curves to the expected continuity | |

65 | -- | |

66 | -- If for example you need the curve to be C2 and the method | |

67 | -- Continuity returns you something lower than C2 (say C1 for | |

68 | -- example). | |

69 | -- | |

70 | -- First compute the number of intervals with the requested | |

71 | -- continuity with the method NbIntervals(). Note that if the | |

72 | -- continuity is higher than the one you need NbIntervals will | |

73 | -- return 1. | |

74 | -- | |

75 | -- Then you get the parameters bounding the intervals with the | |

76 | -- method Intervals, using an array of length at least | |

77 | -- NbIntervals()+1. | |

78 | -- | |

79 | -- If you need to create a curve with a restricted span you can | |

80 | -- use the method Trim(). | |

81 | ||

82 | ||

83 | Continuity(me) returns Shape from GeomAbs | |

84 | ---Purpose: | |

85 | is virtual; | |

86 | ||

31b1749c | 87 | NbIntervals(me; S : Shape from GeomAbs) returns Integer |

7fd59977 | 88 | ---Purpose: Returns the number of intervals for continuity |

89 | -- <S>. May be one if Continuity(me) >= <S> | |

90 | is virtual; | |

91 | ||

31b1749c | 92 | Intervals(me; T : in out Array1OfReal from TColStd; |

7fd59977 | 93 | S : Shape from GeomAbs) |

94 | ---Purpose: Stores in <T> the parameters bounding the intervals | |

95 | -- of continuity <S>. | |

96 | -- | |

97 | -- The array must provide enough room to accomodate | |

98 | -- for the parameters. i.e. T.Length() > NbIntervals() | |

99 | raises | |

100 | OutOfRange from Standard | |

101 | is virtual; | |

102 | ||

103 | Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d | |

104 | ---Purpose: Returns a curve equivalent of <me> between | |

105 | -- parameters <First> and <Last>. <Tol> is used to | |

106 | -- test for 3d points confusion. | |

107 | raises | |

108 | OutOfRange from Standard | |

109 | ---Purpose: If <First> >= <Last> | |

110 | is virtual; | |

111 | ||

112 | ||

113 | IsClosed(me) returns Boolean | |

114 | is virtual; | |

115 | ||

116 | IsPeriodic(me) returns Boolean | |

117 | is virtual; | |

118 | ||

119 | Period(me) returns Real | |

120 | raises | |

121 | DomainError from Standard -- if the curve is not periodic | |

122 | is virtual; | |

123 | ||

124 | Value(me; U : Real) returns Pnt from gp | |

125 | --- Purpose : Computes the point of parameter U on the curve. | |

126 | is virtual; | |

127 | ||

128 | D0 (me; U : Real; P : out Pnt from gp) | |

129 | --- Purpose : Computes the point of parameter U on the curve. | |

130 | is virtual; | |

131 | ||

132 | D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp) | |

133 | --- Purpose : Computes the point of parameter U on the curve with its | |

134 | -- first derivative. | |

135 | raises | |

136 | DomainError from Standard | |

137 | --- Purpose : Raised if the continuity of the current interval | |

138 | -- is not C1. | |

139 | is virtual; | |

140 | ||

141 | D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp) | |

142 | --- Purpose : | |

143 | -- Returns the point P of parameter U, the first and second | |

144 | -- derivatives V1 and V2. | |

145 | raises | |

146 | DomainError from Standard | |

147 | --- Purpose : Raised if the continuity of the current interval | |

148 | -- is not C2. | |

149 | is virtual; | |

150 | ||

151 | D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp) | |

152 | --- Purpose : | |

153 | -- Returns the point P of parameter U, the first, the second | |

154 | -- and the third derivative. | |

155 | raises | |

156 | DomainError from Standard | |

157 | --- Purpose : Raised if the continuity of the current interval | |

158 | -- is not C3. | |

159 | is virtual; | |

160 | ||

161 | DN (me; U : Real; N : Integer) returns Vec from gp | |

162 | --- Purpose : | |

163 | -- The returned vector gives the value of the derivative for the | |

164 | -- order of derivation N. | |

165 | raises | |

166 | DomainError from Standard, | |

167 | --- Purpose : Raised if the continuity of the current interval | |

168 | -- is not CN. | |

169 | OutOfRange from Standard | |

170 | --- Purpose : Raised if N < 1. | |

171 | is virtual; | |

172 | ||

173 | Resolution(me; R3d : Real) returns Real | |

174 | ---Purpose : Returns the parametric resolution corresponding | |

175 | -- to the real space resolution <R3d>. | |

176 | is virtual; | |

177 | ||

178 | GetType(me) returns CurveType from GeomAbs | |

179 | ---Purpose: Returns the type of the curve in the current | |

180 | -- interval : Line, Circle, Ellipse, Hyperbola, | |

181 | -- Parabola, BezierCurve, BSplineCurve, OtherCurve. | |

182 | is virtual; | |

183 | ||

184 | -- | |

185 | -- The following methods must be called when GetType returned | |

186 | -- the corresponding type. | |

187 | -- | |

188 | ||

189 | Line(me) returns Lin from gp | |

190 | raises | |

191 | NoSuchObject from Standard | |

192 | is virtual; | |

193 | ||

194 | Circle(me) returns Circ from gp | |

195 | raises | |

196 | NoSuchObject from Standard | |

197 | is virtual; | |

198 | ||

199 | Ellipse(me) returns Elips from gp | |

200 | raises | |

201 | NoSuchObject from Standard | |

202 | is virtual; | |

203 | ||

204 | Hyperbola(me) returns Hypr from gp | |

205 | raises | |

206 | NoSuchObject from Standard | |

207 | is virtual; | |

208 | ||

209 | Parabola(me) returns Parab from gp | |

210 | raises | |

211 | NoSuchObject from Standard | |

212 | is virtual; | |

213 | ||

214 | ||

215 | Degree(me) returns Integer | |

216 | raises | |

217 | NoSuchObject from Standard | |

218 | is virtual; | |

219 | ||

220 | IsRational(me) returns Boolean | |

221 | raises | |

222 | NoSuchObject from Standard | |

223 | is virtual; | |

224 | ||

225 | NbPoles(me) returns Integer | |

226 | raises | |

227 | NoSuchObject from Standard | |

228 | is virtual; | |

229 | ||

230 | ||

231 | NbKnots(me) returns Integer | |

232 | raises | |

233 | NoSuchObject from Standard | |

234 | is virtual; | |

235 | ||

236 | Bezier(me) returns BezierCurve from Geom | |

237 | raises | |

238 | NoSuchObject from Standard | |

239 | is virtual; | |

240 | ||

241 | BSpline(me) returns BSplineCurve from Geom | |

242 | raises | |

243 | NoSuchObject from Standard | |

244 | is virtual; | |

6da30ff1 | 245 | |

246 | ---C++: alias " Standard_EXPORT virtual ~Adaptor3d_Curve();" | |

7fd59977 | 247 | |

248 | end Curve; | |

249 | ||

250 |