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

b311480e | 1 | -- Created on: 1993-05-14 |

2 | -- Created by: Bruno DUMORTIER | |

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

22 | class Surface from GeomAdaptor inherits Surface from Adaptor3d | |

23 | ||

24 | ---Purpose: An interface between the services provided by any | |

25 | -- surface from the package Geom and those required | |

26 | -- of the surface by algorithms which use it. | |

27 | ||

28 | uses | |

29 | Pnt from gp, | |

30 | Vec from gp, | |

31 | Dir from gp, | |

32 | Pln from gp, | |

33 | Cone from gp, | |

34 | Cylinder from gp, | |

35 | Sphere from gp, | |

36 | Torus from gp, | |

37 | Ax1 from gp, | |

38 | Array1OfReal from TColStd, | |

39 | Surface from Geom, | |

40 | BezierSurface from Geom, | |

41 | BSplineSurface from Geom, | |

42 | SurfaceType from GeomAbs, | |

43 | Shape from GeomAbs, | |

44 | Curve from GeomAdaptor, | |

45 | HCurve from Adaptor3d, | |

46 | HSurface from Adaptor3d | |

47 | ||

48 | raises | |

49 | NoSuchObject from Standard, | |

50 | OutOfRange from Standard, | |

51 | ConstructionError from Standard, | |

52 | DomainError from Standard | |

53 | ||

54 | is | |

55 | ||

56 | Create returns Surface from GeomAdaptor; | |

57 | ---C++: inline | |

58 | ||

59 | Create( S : Surface from Geom) returns Surface from GeomAdaptor; | |

60 | ---C++: inline | |

61 | ||

62 | Create( S : Surface from Geom; UFirst,ULast,VFirst,VLast : Real; | |

63 | TolU : Real = 0.0; | |

64 | TolV : Real = 0.0) | |

65 | returns Surface from GeomAdaptor | |

66 | raises ConstructionError from Standard; | |

67 | ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast | |

68 | ---C++: inline | |

69 | ||

70 | Load(me : in out; S : Surface from Geom); | |

71 | ---C++: inline | |

72 | ||

73 | Load(me : in out; S : Surface from Geom; | |

74 | UFirst,ULast,VFirst,VLast : Real; | |

75 | TolU : Real = 0.0; | |

76 | TolV : Real = 0.0) | |

77 | raises ConstructionError from Standard; | |

041bfce9 | 78 | ---C++: inline |

79 | ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast | |

7fd59977 | 80 | |

81 | Surface(me) returns Surface from Geom | |

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

83 | ---C++: inline | |

84 | is static; | |

85 | ||

86 | ||

87 | -- | |

88 | -- Global methods - Apply to the whole surface. | |

89 | -- | |

90 | ||

91 | FirstUParameter(me) returns Real | |

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

93 | is redefined static; | |

94 | ||

95 | LastUParameter(me) returns Real | |

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

97 | is redefined static; | |

98 | ||

99 | FirstVParameter(me) returns Real | |

100 | ---C++:inline | |

101 | is redefined static; | |

102 | ||

103 | LastVParameter(me) returns Real | |

104 | ---C++:inline | |

105 | is redefined static; | |

106 | ||

107 | UContinuity(me) returns Shape from GeomAbs | |

108 | is redefined static; | |

109 | ||

110 | VContinuity(me) returns Shape from GeomAbs | |

111 | is redefined static; | |

112 | ||

113 | NbUIntervals(me; S : Shape from GeomAbs) returns Integer | |

114 | ---Purpose: Returns the number of U intervals for continuity | |

115 | -- <S>. May be one if UContinuity(me) >= <S> | |

116 | is redefined static; | |

117 | ||

118 | NbVIntervals(me; S : Shape from GeomAbs) returns Integer | |

119 | ---Purpose: Returns the number of V intervals for continuity | |

120 | -- <S>. May be one if VContinuity(me) >= <S> | |

121 | is redefined static; | |

122 | ||

123 | UIntervals(me; T : in out Array1OfReal from TColStd; | |

124 | S : Shape from GeomAbs ) | |

125 | ---Purpose: Returns the intervals with the requested continuity | |

126 | -- in the U direction. | |

127 | raises | |

128 | OutOfRange from Standard -- if the Length of the array does | |

129 | -- have enought slots to accomodate | |

130 | -- the result. | |

131 | is redefined static; | |

132 | ||

133 | VIntervals(me; T : in out Array1OfReal from TColStd; | |

134 | S : Shape from GeomAbs ) | |

135 | ---Purpose: Returns the intervals with the requested continuity | |

136 | -- in the V direction. | |

137 | raises | |

138 | OutOfRange from Standard -- if the Length of the array does | |

139 | -- have enought slots to accomodate | |

140 | -- the result. | |

141 | is redefined static; | |

142 | ||

143 | UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d | |

144 | ---Purpose: Returns a surface trimmed in the U direction | |

145 | -- equivalent of <me> between | |

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

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

148 | raises | |

149 | OutOfRange from Standard | |

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

151 | is redefined static ; | |

152 | ||

153 | VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d | |

154 | ---Purpose: Returns a surface trimmed in the V direction between | |

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

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

157 | raises | |

158 | OutOfRange from Standard | |

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

160 | is redefined static ; | |

161 | ||

162 | IsUClosed(me) returns Boolean | |

163 | is redefined static; | |

164 | ||

165 | IsVClosed(me) returns Boolean | |

166 | is redefined static; | |

167 | ||

168 | IsUPeriodic(me) returns Boolean | |

169 | is redefined static; | |

170 | ||

171 | UPeriod(me) returns Real | |

172 | raises | |

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

174 | is redefined static; | |

175 | ||

176 | IsVPeriodic(me) returns Boolean | |

177 | is redefined static; | |

178 | ||

179 | VPeriod(me) returns Real | |

180 | raises | |

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

182 | is redefined static; | |

183 | ||

184 | Value (me; U, V : Real) returns Pnt from gp | |

185 | --- Purpose : Computes the point of parameters U,V on the surface. | |

186 | is redefined static; | |

187 | ||

188 | D0 (me; U, V : Real; | |

189 | P : out Pnt from gp) | |

190 | --- Purpose : Computes the point of parameters U,V on the surface. | |

191 | is redefined static; | |

192 | ||

193 | D1 (me; U, V : Real; | |

194 | P : out Pnt from gp; | |

195 | D1U, D1V : out Vec from gp) | |

196 | --- Purpose : Computes the point and the first derivatives on | |

197 | -- the surface. | |

198 | -- | |

199 | -- Warning : On the specific case of BSplineSurface: | |

200 | -- if the surface is cut in interval of continuity at least C1, | |

201 | -- the derivatives are computed on the current interval. | |

202 | -- else the derivatives are computed on the basis surface. | |

203 | is redefined static; | |

204 | ||

205 | D2 (me; U, V : Real; | |

206 | P : out Pnt from gp; | |

207 | D1U, D1V : out Vec from gp; | |

208 | D2U, D2V : out Vec from gp; | |

209 | D2UV : out Vec from gp) | |

210 | --- Purpose : Computes the point, the first and second | |

211 | -- derivatives on the surface. | |

212 | -- | |

213 | -- Warning : On the specific case of BSplineSurface: | |

214 | -- if the surface is cut in interval of continuity at least C2, | |

215 | -- the derivatives are computed on the current interval. | |

216 | -- else the derivatives are computed on the basis surface. | |

217 | is redefined static; | |

218 | ||

219 | D3 (me; U, V : Real; | |

220 | P : out Pnt from gp; | |

221 | D1U, D1V : out Vec from gp; | |

222 | D2U, D2V : out Vec from gp; | |

223 | D2UV : out Vec from gp; | |

224 | D3U, D3V : out Vec from gp; | |

225 | D3UUV, D3UVV : out Vec from gp) | |

226 | --- Purpose : Computes the point, the first, second and third | |

227 | -- derivatives on the surface. | |

228 | -- | |

229 | -- Warning : On the specific case of BSplineSurface: | |

230 | -- if the surface is cut in interval of continuity at least C3, | |

231 | -- the derivatives are computed on the current interval. | |

232 | -- else the derivatives are computed on the basis surface. | |

233 | is redefined static; | |

234 | ||

235 | DN (me; U, V : Real; Nu, Nv : Integer) | |

236 | returns Vec from gp | |

237 | --- Purpose : Computes the derivative of order Nu in the | |

238 | -- direction U and Nv in the direction V at the point P(U, V). | |

239 | -- | |

240 | -- Warning : On the specific case of BSplineSurface: | |

241 | -- if the surface is cut in interval of continuity CN, | |

242 | -- the derivatives are computed on the current interval. | |

243 | -- else the derivatives are computed on the basis surface. | |

244 | raises | |

245 | OutOfRange from Standard | |

246 | --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0. | |

247 | is redefined static; | |

248 | ||

249 | UResolution(me; R3d : Real ) returns Real | |

250 | ---Purpose : Returns the parametric U resolution corresponding | |

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

252 | is redefined static; | |

253 | ||

254 | VResolution(me; R3d : Real ) returns Real | |

255 | ---Purpose : Returns the parametric V resolution corresponding | |

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

257 | is redefined static; | |

258 | ||

259 | GetType(me) returns SurfaceType from GeomAbs | |

260 | ---Purpose: Returns the type of the surface : Plane, Cylinder, | |

261 | -- Cone, Sphere, Torus, BezierSurface, | |

262 | -- BSplineSurface, SurfaceOfRevolution, | |

263 | -- SurfaceOfExtrusion, OtherSurface | |

264 | ---C++:inline | |

265 | is redefined static; | |

266 | ||

267 | -- | |

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

269 | -- the corresponding type. | |

270 | -- | |

271 | ||

272 | Plane(me) returns Pln from gp | |

273 | raises NoSuchObject from Standard | |

274 | is redefined static; | |

275 | ||

276 | Cylinder(me) returns Cylinder from gp | |

277 | raises NoSuchObject from Standard | |

278 | is redefined static; | |

279 | ||

280 | Cone(me) returns Cone from gp | |

281 | raises NoSuchObject from Standard | |

282 | is redefined static; | |

283 | ||

284 | Sphere(me) returns Sphere from gp | |

285 | raises NoSuchObject from Standard | |

286 | is redefined static; | |

287 | ||

288 | Torus(me) returns Torus from gp | |

289 | raises NoSuchObject from Standard | |

290 | is redefined static; | |

291 | ||

292 | UDegree(me) returns Integer | |

293 | raises NoSuchObject from Standard | |

294 | is redefined static; | |

295 | ||

296 | NbUPoles(me) returns Integer | |

297 | raises NoSuchObject from Standard | |

298 | is redefined static; | |

299 | ||

300 | VDegree(me) returns Integer | |

301 | raises NoSuchObject from Standard | |

302 | is redefined static; | |

303 | ||

304 | NbVPoles(me) returns Integer | |

305 | raises NoSuchObject from Standard | |

306 | is redefined static; | |

307 | ||

308 | NbUKnots(me) returns Integer | |

309 | raises | |

310 | NoSuchObject from Standard | |

311 | is redefined static; | |

312 | ||

313 | ||

314 | NbVKnots(me) returns Integer | |

315 | raises | |

316 | NoSuchObject from Standard | |

317 | is redefined static; | |

318 | ||

319 | ||

320 | IsURational(me) returns Boolean | |

321 | raises | |

322 | NoSuchObject from Standard | |

323 | is redefined static; | |

324 | ||

325 | IsVRational(me) returns Boolean | |

326 | raises | |

327 | NoSuchObject from Standard | |

328 | is redefined static; | |

329 | ||

330 | ||

331 | Bezier(me) returns BezierSurface from Geom | |

332 | ---Purpose: This will NOT make a copy of the | |

333 | -- Bezier Surface : If you want to modify | |

334 | -- the Surface please make a copy yourself | |

335 | -- Also it will NOT trim the surface to | |

336 | -- myU/VFirst/Last. | |

337 | raises | |

338 | NoSuchObject from Standard | |

339 | is redefined static; | |

340 | ||

341 | BSpline(me) returns BSplineSurface from Geom | |

342 | ---Purpose: This will NOT make a copy of the | |

343 | -- BSpline Surface : If you want to modify | |

344 | -- the Surface please make a copy yourself | |

345 | -- Also it will NOT trim the surface to | |

346 | -- myU/VFirst/Last. | |

347 | raises | |

348 | NoSuchObject from Standard | |

349 | is redefined static; | |

350 | ||

351 | AxeOfRevolution(me) returns Ax1 from gp | |

352 | raises | |

353 | NoSuchObject from Standard -- only for SurfaceOfRevolution | |

354 | is redefined static; | |

355 | ||

356 | Direction(me) returns Dir from gp | |

357 | raises | |

358 | NoSuchObject from Standard -- only for SurfaceOfExtrusion | |

359 | is redefined static; | |

360 | ||

361 | BasisCurve(me) returns HCurve from Adaptor3d | |

362 | raises | |

363 | NoSuchObject from Standard -- only for SurfaceOfExtrusion | |

364 | is redefined static; | |

365 | ||

366 | ||

367 | BasisSurface(me) returns HSurface from Adaptor3d | |

368 | raises | |

369 | NoSuchObject from Standard -- only for Offset Surface | |

370 | is redefined static; | |

371 | ||

372 | OffsetValue(me) returns Real from Standard | |

373 | raises | |

374 | NoSuchObject from Standard -- only for Offset Surface | |

375 | is redefined static; | |

376 | ||

377 | ||

041bfce9 | 378 | Span (me;Side :Integer; Ideb,Ifin:Integer; |

379 | OutIdeb,OutIfin:out Integer; | |

470ebb43 | 380 | FKIndx, LKIndx : Integer ) |

041bfce9 | 381 | is private; |

7fd59977 | 382 | |

383 | IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer; | |

384 | USide,VSide: Integer) | |

385 | returns Boolean from Standard | |

041bfce9 | 386 | is private; |

387 | ||

388 | load (me : in out; S : Surface from Geom; | |

389 | UFirst,ULast,VFirst,VLast : Real; | |

390 | TolU : Real = 0.0; | |

391 | TolV : Real = 0.0) | |

392 | is private; | |

393 | ||

7fd59977 | 394 | fields |

395 | ||

396 | mySurface : Surface from Geom; | |

397 | mySurfaceType : SurfaceType from GeomAbs; | |

398 | myUFirst : Real from Standard; | |

399 | myULast : Real from Standard; | |

400 | myVFirst : Real from Standard; | |

401 | myVLast : Real from Standard; | |

402 | myTolU, myTolV : Real from Standard; | |

403 | ||

404 | end Surface; |