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

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

2 | -- Created by: Isabelle GRIGNON | |

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 | -- |

973c2be1 | 8 | -- This library is free software; you can redistribute it and / or modify it |

9 | -- under the terms of the GNU Lesser General Public 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. | |

b311480e | 13 | -- |

973c2be1 | 14 | -- Alternatively, this file may be used under the terms of Open CASCADE |

15 | -- commercial license or contractual agreement. | |

b311480e | 16 | |

7fd59977 | 17 | -- modified 01-1994 by rob (time comsumption) |

7fd59977 | 18 | |

19 | ||

20 | class IsoCurve from Adaptor3d inherits Curve from Adaptor3d | |

21 | ||

22 | ---Purpose: Defines an isoparametric curve on a surface. The | |

23 | -- type of isoparametric curve (U or V) is defined | |

24 | -- with the enumeration IsoType from GeomAbs if | |

25 | -- NoneIso is given an error is raised. | |

26 | ||

27 | uses | |

28 | Array1OfReal from TColStd, | |

29 | IsoType from GeomAbs, | |

30 | Shape from GeomAbs, | |

31 | CurveType from GeomAbs, | |

32 | Vec from gp, | |

33 | Pnt from gp, | |

34 | Circ from gp, | |

35 | Elips from gp, | |

36 | Hypr from gp, | |

37 | Parab from gp, | |

38 | Lin from gp, | |

39 | BezierCurve from Geom, | |

40 | BSplineCurve from Geom, | |

41 | HCurve from Adaptor3d, | |

42 | HSurface from Adaptor3d | |

43 | ||

44 | raises | |

45 | NoSuchObject from Standard, | |

46 | OutOfRange from Standard, | |

47 | DomainError from Standard | |

48 | ||

49 | is | |

50 | ||

51 | -- | |

52 | -- Methods specific of IsoCurve | |

53 | -- | |

54 | ||

55 | Create returns IsoCurve from Adaptor3d; | |

56 | ---Purpose: The iso is set to NoneIso. | |

57 | ||

58 | Create(S : HSurface from Adaptor3d) returns IsoCurve from Adaptor3d; | |

59 | ---Purpose: The surface is loaded. The iso is set to NoneIso. | |

60 | ||

61 | Create(S : HSurface from Adaptor3d; | |

62 | Iso : IsoType from GeomAbs; Param : Real) | |

63 | returns IsoCurve from Adaptor3d; | |

64 | ---Purpose: Creates an IsoCurve curve. Iso defines the | |

65 | -- type (isoU or isoU) Param defines the value of | |

66 | -- the iso. The bounds of the iso are the bounds | |

67 | -- of the surface. | |

68 | ||

69 | Create(S : HSurface from Adaptor3d; | |

70 | Iso : IsoType from GeomAbs; Param : Real; WFirst,WLast : Real) | |

71 | returns IsoCurve from Adaptor3d; | |

72 | ---Purpose: Create an IsoCurve curve. Iso defines the type | |

73 | -- (isoU or isov). Param defines the value of the | |

74 | -- iso. WFirst,WLast define the bounds of the iso. | |

75 | ||

76 | ||

77 | Load( me:in out ;S : HSurface from Adaptor3d) | |

78 | ---Purpose: Changes the surface. The iso is reset to | |

79 | -- NoneIso. | |

80 | is static; | |

81 | ||

82 | Load (me : in out ; Iso : IsoType from GeomAbs; Param : Real) | |

83 | ---Purpose: Changes the iso on the current surface. | |

84 | is static; | |

85 | ||

86 | Load (me : in out ; | |

87 | Iso : IsoType from GeomAbs; Param : Real; WFirst,WLast : Real) | |

88 | ---Purpose: Changes the iso on the current surface. | |

89 | is static; | |

90 | ||

91 | Surface(me) returns HSurface from Adaptor3d | |

92 | ---C++: inline | |

93 | ---C++: return const & | |

94 | is static; | |

95 | ||

96 | Iso(me) returns IsoType from GeomAbs | |

97 | ---C++: inline | |

98 | is static; | |

99 | ||

100 | Parameter(me) returns Real | |

101 | ---C++: inline | |

102 | is static; | |

103 | ||

104 | -- | |

105 | -- Implementation of Curve from Adaptor3d methods | |

106 | -- | |

107 | ||

108 | -- | |

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

110 | -- | |

111 | ||

112 | FirstParameter(me) returns Real | |

113 | ---C++: inline | |

114 | is redefined static; | |

115 | ||

116 | LastParameter(me) returns Real | |

117 | ---C++: inline | |

118 | is redefined static; | |

119 | ||

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

121 | is redefined static; | |

122 | ||

123 | NbIntervals(me:in out; S : Shape from GeomAbs) returns Integer | |

124 | ---Purpose: Returns the number of intervals for continuity | |

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

126 | is redefined static; | |

127 | ||

128 | Intervals(me:in out; T : in out Array1OfReal from TColStd; | |

129 | S : Shape from GeomAbs) | |

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

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

132 | -- | |

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

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

135 | raises | |

136 | OutOfRange from Standard | |

137 | is redefined static; | |

138 | ||

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

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

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

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

143 | raises | |

144 | OutOfRange from Standard | |

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

146 | is redefined static; | |

147 | ||

148 | ||

149 | IsClosed(me) returns Boolean | |

150 | is redefined static; | |

151 | ||

152 | IsPeriodic(me) returns Boolean | |

153 | is redefined static; | |

154 | ||

155 | Period(me) returns Real | |

156 | raises | |

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

158 | is redefined static; | |

159 | ||

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

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

162 | is redefined static; | |

163 | ||

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

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

166 | is redefined static; | |

167 | ||

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

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

170 | -- first derivative. | |

171 | raises | |

172 | DomainError from Standard | |

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

174 | -- is not C1. | |

175 | is redefined static; | |

176 | ||

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

178 | --- Purpose : | |

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

180 | -- derivatives V1 and V2. | |

181 | raises | |

182 | DomainError from Standard | |

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

184 | -- is not C2. | |

185 | is redefined static; | |

186 | ||

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

188 | --- Purpose : | |

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

190 | -- and the third derivative. | |

191 | raises | |

192 | DomainError from Standard | |

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

194 | -- is not C3. | |

195 | is redefined static; | |

196 | ||

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

198 | --- Purpose : | |

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

200 | -- order of derivation N. | |

201 | raises | |

202 | DomainError from Standard, | |

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

204 | -- is not CN. | |

205 | OutOfRange from Standard | |

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

207 | is redefined static; | |

208 | ||

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

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

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

212 | is redefined static; | |

213 | ||

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

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

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

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

218 | is redefined static; | |

219 | ||

220 | -- | |

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

222 | -- the corresponding type. | |

223 | -- | |

224 | ||

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

226 | raises | |

227 | NoSuchObject from Standard | |

228 | is redefined static; | |

229 | ||

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

231 | raises | |

232 | NoSuchObject from Standard | |

233 | is redefined static; | |

234 | ||

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

236 | raises | |

237 | NoSuchObject from Standard | |

238 | is redefined static; | |

239 | ||

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

241 | raises | |

242 | NoSuchObject from Standard | |

243 | is redefined static; | |

244 | ||

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

246 | raises | |

247 | NoSuchObject from Standard | |

248 | is redefined static; | |

249 | ||

250 | ||

251 | ||

252 | Degree(me) returns Integer | |

253 | raises | |

254 | NoSuchObject from Standard | |

255 | is redefined static; | |

256 | ||

257 | IsRational(me) returns Boolean | |

258 | raises | |

259 | NoSuchObject from Standard | |

260 | is redefined static; | |

261 | ||

262 | NbPoles(me) returns Integer | |

263 | raises | |

264 | NoSuchObject from Standard | |

265 | is redefined static; | |

266 | ||

267 | ||

268 | NbKnots(me) returns Integer | |

269 | raises | |

270 | NoSuchObject from Standard | |

271 | is redefined static; | |

272 | ||

273 | ||

274 | ||

275 | ||

276 | ||

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

278 | raises | |

279 | NoSuchObject from Standard | |

280 | is redefined static; | |

281 | ||

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

283 | raises | |

284 | NoSuchObject from Standard | |

285 | is redefined static; | |

286 | ||

287 | ||

288 | fields | |

289 | ||

290 | mySurface : HSurface from Adaptor3d; | |

291 | myIso : IsoType from GeomAbs; | |

292 | myFirst : Real; | |

293 | myLast : Real; | |

294 | myParameter : Real; | |

295 | end IsoCurve; | |

296 | ||

297 | ||

298 | ||

299 | ||

300 |