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

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

2 | -- Created by: Isabelle GRIGNON | |

3 | -- Copyright (c) 1993-1999 Matra Datavision | |

4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS | |

5 | -- | |

6 | -- The content of this file is subject to the Open CASCADE Technology Public | |

7 | -- License Version 6.5 (the "License"). You may not use the content of this file | |

8 | -- except in compliance with the License. Please obtain a copy of the License | |

9 | -- at http://www.opencascade.org and read it completely before using this file. | |

10 | -- | |

11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its | |

12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. | |

13 | -- | |

14 | -- The Original Code and all software distributed under the License is | |

15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the | |

16 | -- Initial Developer hereby disclaims all such warranties, including without | |

17 | -- limitation, any warranties of merchantability, fitness for a particular | |

18 | -- purpose or non-infringement. Please see the License for the specific terms | |

19 | -- and conditions governing the rights and limitations under the License. | |

20 | ||

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

7fd59977 | 22 | |

23 | ||

24 | class IsoCurve from Adaptor3d inherits Curve from Adaptor3d | |

25 | ||

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

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

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

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

30 | ||

31 | uses | |

32 | Array1OfReal from TColStd, | |

33 | IsoType from GeomAbs, | |

34 | Shape from GeomAbs, | |

35 | CurveType from GeomAbs, | |

36 | Vec from gp, | |

37 | Pnt from gp, | |

38 | Circ from gp, | |

39 | Elips from gp, | |

40 | Hypr from gp, | |

41 | Parab from gp, | |

42 | Lin from gp, | |

43 | BezierCurve from Geom, | |

44 | BSplineCurve from Geom, | |

45 | HCurve from Adaptor3d, | |

46 | HSurface from Adaptor3d | |

47 | ||

48 | raises | |

49 | NoSuchObject from Standard, | |

50 | OutOfRange from Standard, | |

51 | DomainError from Standard | |

52 | ||

53 | is | |

54 | ||

55 | -- | |

56 | -- Methods specific of IsoCurve | |

57 | -- | |

58 | ||

59 | Create returns IsoCurve from Adaptor3d; | |

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

61 | ||

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

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

64 | ||

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

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

67 | returns IsoCurve from Adaptor3d; | |

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

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

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

71 | -- of the surface. | |

72 | ||

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

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

75 | returns IsoCurve from Adaptor3d; | |

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

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

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

79 | ||

80 | ||

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

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

83 | -- NoneIso. | |

84 | is static; | |

85 | ||

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

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

88 | is static; | |

89 | ||

90 | Load (me : in out ; | |

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

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

93 | is static; | |

94 | ||

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

96 | ---C++: inline | |

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

98 | is static; | |

99 | ||

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

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

102 | is static; | |

103 | ||

104 | Parameter(me) returns Real | |

105 | ---C++: inline | |

106 | is static; | |

107 | ||

108 | -- | |

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

110 | -- | |

111 | ||

112 | -- | |

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

114 | -- | |

115 | ||

116 | FirstParameter(me) returns Real | |

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

118 | is redefined static; | |

119 | ||

120 | LastParameter(me) returns Real | |

121 | ---C++: inline | |

122 | is redefined static; | |

123 | ||

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

125 | is redefined static; | |

126 | ||

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

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

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

130 | is redefined static; | |

131 | ||

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

133 | S : Shape from GeomAbs) | |

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

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

136 | -- | |

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

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

139 | raises | |

140 | OutOfRange from Standard | |

141 | is redefined static; | |

142 | ||

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

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

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

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

147 | raises | |

148 | OutOfRange from Standard | |

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

150 | is redefined static; | |

151 | ||

152 | ||

153 | IsClosed(me) returns Boolean | |

154 | is redefined static; | |

155 | ||

156 | IsPeriodic(me) returns Boolean | |

157 | is redefined static; | |

158 | ||

159 | Period(me) returns Real | |

160 | raises | |

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

162 | is redefined static; | |

163 | ||

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

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

166 | is redefined static; | |

167 | ||

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

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

170 | is redefined static; | |

171 | ||

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

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

174 | -- first derivative. | |

175 | raises | |

176 | DomainError from Standard | |

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

178 | -- is not C1. | |

179 | is redefined static; | |

180 | ||

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

182 | --- Purpose : | |

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

184 | -- derivatives V1 and V2. | |

185 | raises | |

186 | DomainError from Standard | |

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

188 | -- is not C2. | |

189 | is redefined static; | |

190 | ||

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

192 | --- Purpose : | |

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

194 | -- and the third derivative. | |

195 | raises | |

196 | DomainError from Standard | |

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

198 | -- is not C3. | |

199 | is redefined static; | |

200 | ||

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

202 | --- Purpose : | |

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

204 | -- order of derivation N. | |

205 | raises | |

206 | DomainError from Standard, | |

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

208 | -- is not CN. | |

209 | OutOfRange from Standard | |

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

211 | is redefined static; | |

212 | ||

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

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

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

216 | is redefined static; | |

217 | ||

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

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

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

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

222 | is redefined static; | |

223 | ||

224 | -- | |

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

226 | -- the corresponding type. | |

227 | -- | |

228 | ||

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

230 | raises | |

231 | NoSuchObject from Standard | |

232 | is redefined static; | |

233 | ||

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

235 | raises | |

236 | NoSuchObject from Standard | |

237 | is redefined static; | |

238 | ||

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

240 | raises | |

241 | NoSuchObject from Standard | |

242 | is redefined static; | |

243 | ||

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

245 | raises | |

246 | NoSuchObject from Standard | |

247 | is redefined static; | |

248 | ||

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

250 | raises | |

251 | NoSuchObject from Standard | |

252 | is redefined static; | |

253 | ||

254 | ||

255 | ||

256 | Degree(me) returns Integer | |

257 | raises | |

258 | NoSuchObject from Standard | |

259 | is redefined static; | |

260 | ||

261 | IsRational(me) returns Boolean | |

262 | raises | |

263 | NoSuchObject from Standard | |

264 | is redefined static; | |

265 | ||

266 | NbPoles(me) returns Integer | |

267 | raises | |

268 | NoSuchObject from Standard | |

269 | is redefined static; | |

270 | ||

271 | ||

272 | NbKnots(me) returns Integer | |

273 | raises | |

274 | NoSuchObject from Standard | |

275 | is redefined static; | |

276 | ||

277 | ||

278 | ||

279 | ||

280 | ||

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

282 | raises | |

283 | NoSuchObject from Standard | |

284 | is redefined static; | |

285 | ||

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

287 | raises | |

288 | NoSuchObject from Standard | |

289 | is redefined static; | |

290 | ||

291 | ||

292 | fields | |

293 | ||

294 | mySurface : HSurface from Adaptor3d; | |

295 | myIso : IsoType from GeomAbs; | |

296 | myFirst : Real; | |

297 | myLast : Real; | |

298 | myParameter : Real; | |

299 | end IsoCurve; | |

300 | ||

301 | ||

302 | ||

303 | ||

304 |