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

7fd59977 | 1 | -- File: BOPTools_PaveFiller.cdl |

2 | -- Created: Thu Feb 8 14:07:33 2001 | |

3 | -- Author: Peter KURNEV | |

4 | -- <pkv@irinox> | |

5 | ---Copyright: Matra Datavision 2001 | |

6 | ||

7 | ||

8 | class PaveFiller from BOPTools | |

9 | ||

10 | ---Purpose: The algorithm that provides | |

11 | --- 1. creation of the data structure (DS) | |

12 | --- 2. creation of the interferences' pool | |

13 | --- 3. invocation of Perform() to fill the DS | |

14 | --- | |

15 | --- | |

16 | uses | |

17 | ||

18 | PShapesDataStructure from BooleanOperations, | |

19 | ||

20 | InterferencePool from BOPTools, | |

21 | PInterferencePool from BOPTools, | |

22 | PavePool from BOPTools, | |

23 | CommonBlockPool from BOPTools, | |

24 | SplitShapesPool from BOPTools, | |

25 | ||

26 | Pave from BOPTools, | |

27 | PaveBlock from BOPTools, | |

28 | PaveSet from BOPTools, | |

29 | Curve from BOPTools, | |

30 | SSInterference from BOPTools, | |

31 | ListOfPaveBlock from BOPTools, | |

32 | IteratorOfCoupleOfShape from BOPTools, | |

33 | SSInterference from BOPTools, | |

34 | SSIntersectionAttribute from BOPTools, | |

35 | ShrunkRange from IntTools, | |

36 | Context from IntTools, | |

37 | ||

38 | ShapeEnum from TopAbs, | |

39 | ListOfInteger from TColStd, | |

40 | IndexedMapOfInteger from TColStd, | |

41 | ||

42 | Pnt from gp, | |

43 | Vertex from TopoDS, | |

44 | SetOfInteger from TColStd | |

45 | ||

46 | ||

47 | is | |

48 | ||

49 | Create | |

50 | returns PaveFiller from BOPTools; | |

51 | ---Purpose: | |

52 | --- Empty Contructor | |

53 | --- | |

54 | Create (aIP: InterferencePool from BOPTools) | |

55 | returns PaveFiller from BOPTools; | |

56 | ---Purpose: | |

57 | --- Constructor | |

58 | --- | |

59 | Create (theIP : InterferencePool from BOPTools; | |

60 | theSectionAttribute: SSIntersectionAttribute from BOPTools) | |

61 | returns PaveFiller from BOPTools; | |

62 | ---Purpose: | |

63 | --- Constructor | |

64 | --- | |

65 | Destroy (me: in out) | |

66 | is virtual; | |

67 | ---C++: alias "Standard_EXPORT virtual ~BOPTools_PaveFiller(){Destroy();}" | |

68 | ---Purpose: | |

69 | --- Destructor | |

70 | --- | |

71 | Perform (me:out) | |

72 | is virtual; | |

73 | ---Purpose: | |

74 | --- Fills the DS | |

75 | --- | |

76 | ||

77 | PartialPerform(me:out; anObjSubSet, aToolSubSet: SetOfInteger from TColStd) | |

78 | is virtual; | |

79 | ||

80 | ToCompletePerform(me:out) | |

81 | is virtual; | |

82 | ||

83 | PerformVV (me:out) | |

84 | is virtual protected; | |

85 | ---Purpose: | |

86 | --- Computes Vertex/Vertex interferences | |

87 | --- | |

88 | PerformVE (me:out) | |

89 | is virtual protected; | |

90 | ---Purpose: | |

91 | --- Computes Vertex/Edge interferences | |

92 | --- | |

93 | PerformVF (me:out) | |

94 | is virtual protected; | |

95 | ---Purpose: | |

96 | --- Computes Vertex/Face interferences | |

97 | --- | |

98 | PerformEE (me:out) | |

99 | is virtual protected; | |

100 | ---Purpose: | |

101 | --- Computes Edge/Edge interferences | |

102 | --- | |

103 | PerformEF (me:out) | |

104 | is virtual protected; | |

105 | ---Purpose: | |

106 | --- Computes Edge/Face interferences | |

107 | --- | |

108 | PerformFF (me:out) | |

109 | is virtual protected; | |

110 | ---Purpose: | |

111 | --- Computes Face/Face interferences | |

112 | --- | |

113 | ||

114 | -------------------------------------------------------------- | |

115 | --- | |

116 | --- Selectors | |

117 | --- | |

4f189102 P |
118 | --- |

119 | SetContext(me:out; | |

120 | aContext: Context from IntTools); | |

121 | ---Purpose: | |

122 | --- Sets the intersecton context | |

123 | --- | |

7fd59977 | 124 | Context(me) |

125 | returns Context from IntTools; | |

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

127 | ---Purpose: | |

128 | --- Selector | |

129 | --- | |

4f189102 P |
130 | -- ChangeContext(me:out) |

131 | -- returns Context from IntTools; | |

132 | -- C++:return & | |

7fd59977 | 133 | ---Purpose: |

134 | --- Selector | |

135 | --- | |

136 | SetInterferencePool(me:out; | |

137 | aPool:InterferencePool from BOPTools); | |

138 | ---Purpose: | |

139 | --- Selector | |

140 | --- | |

141 | IsDone(me) | |

142 | returns Boolean from Standard; | |

143 | ---Purpose: | |

144 | --- Selector | |

145 | --- | |

146 | PavePool(me) | |

147 | returns PavePool from BOPTools; | |

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

149 | ---Purpose: | |

150 | --- Selector | |

151 | --- | |

152 | ChangePavePool(me:out) | |

153 | returns PavePool from BOPTools; | |

154 | ---C++:return & | |

155 | ---Purpose: | |

156 | --- Selector | |

157 | --- | |

158 | CommonBlockPool(me) | |

159 | returns CommonBlockPool from BOPTools; | |

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

161 | ---Purpose: | |

162 | --- Selector | |

163 | --- | |

164 | ChangeCommonBlockPool(me:out) | |

165 | returns CommonBlockPool from BOPTools; | |

166 | ---C++:return & | |

167 | ---Purpose: | |

168 | --- Selector | |

169 | --- | |

170 | SplitShapesPool(me) | |

171 | returns SplitShapesPool from BOPTools; | |

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

173 | ---Purpose: | |

174 | --- Selector | |

175 | --- | |

176 | ||

177 | ChangeSplitShapesPool(me:out) | |

178 | returns SplitShapesPool from BOPTools; | |

179 | ---C++:return & | |

180 | ---Purpose: | |

181 | --- Selector | |

182 | --- | |

183 | DS(me:out) | |

184 | returns PShapesDataStructure from BooleanOperations; | |

185 | ---Purpose: | |

186 | --- Selector | |

187 | --- | |

188 | InterfPool(me:out) | |

189 | returns PInterferencePool from BOPTools; | |

190 | ---Purpose: | |

191 | --- Selector | |

192 | --- | |

193 | ||

194 | IteratorOfCoupleOfShape(me) | |

195 | returns IteratorOfCoupleOfShape from BOPTools; | |

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

197 | ---Purpose: | |

198 | --- Selector | |

199 | --- | |

200 | ||

201 | SectionAttribute(me) | |

202 | returns SSIntersectionAttribute from BOPTools; | |

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

204 | ---Purpose: | |

205 | --- Selector | |

206 | --- | |

207 | ||

208 | SetSectionAttribute(me:out; | |

209 | anAtt : SSIntersectionAttribute from BOPTools); | |

210 | ---Purpose: | |

211 | --- Selector | |

212 | --- | |

213 | -------------------------------------------------------------- | |

214 | --- | |

215 | --- PaveBlocks for Split Parts of Edges. | |

216 | --- | |

217 | --- | |

218 | SortTypes (me; | |

219 | anInd1:in out Integer from Standard; | |

220 | anInd2:in out Integer from Standard) | |

221 | is protected; | |

222 | ---Purpose: | |

223 | --- Sorts the types of shapes with DS-indices | |

224 | --- <anInd1> and <anInd2> in increasing order of | |

225 | --- types of the shapes | |

226 | --- | |

227 | PerformNewVertices (me:out) | |

228 | is protected; | |

229 | ||

230 | IsSuccesstorsComputed (me; | |

231 | iF1:Integer from Standard; | |

232 | iF2:Integer from Standard) | |

233 | returns Boolean from Standard | |

234 | is protected; | |

235 | ||

236 | PrepareEdges (me:out) | |

237 | is virtual protected; | |

238 | ---Purpose: | |

239 | --- Prepare end paves for each edge | |

240 | --- | |

241 | PreparePaveBlocks (me:out; | |

242 | aType1: ShapeEnum from TopAbs; | |

243 | aType2: ShapeEnum from TopAbs) | |

244 | is virtual protected; | |

245 | ---Purpose: | |

246 | --- Prepare PaveBlocks for each edge (EE-interferences) | |

247 | --- | |

248 | PreparePaveBlocks (me:out; | |

249 | anE:Integer from Standard) | |

250 | is virtual protected; | |

251 | ---Purpose: | |

252 | --- Prepare PaveBlocks for given edge (EE-interferences) | |

253 | --- | |

254 | RefinePavePool(me:out) | |

255 | is protected; | |

256 | ---Purpose: | |

257 | --- Refines myPavePool taking into account new Paves obtained from EE algo | |

258 | --- | |

259 | MakeSplitEdges(me:out) | |

260 | is protected; | |

261 | ---Purpose: | |

262 | --- Makes split edges from source edges | |

263 | --- | |

264 | DoSDEdges(me:out) | |

265 | is protected; | |

266 | ---Purpose: | |

267 | --- Update Lists of PaveBlocks with info about | |

268 | --- indices of split edges that are Same Domain | |

269 | --- with other splits or faces | |

270 | --- | |

271 | CorrectShrunkRanges(me:out; | |

272 | aSide: Integer from Standard; | |

273 | aPave: Pave from BOPTools; | |

274 | aSR : out ShrunkRange from IntTools) | |

275 | is protected; | |

276 | ---Purpose: | |

277 | --- Update Shrunk Range <aSR> for Pave <aPave> | |

278 | --- | |

279 | SplitIndex (me:out; aPB:PaveBlock from BOPTools) | |

280 | returns Integer from Standard | |

281 | is protected; | |

282 | ---Purpose: | |

283 | --- Returns the Index of Split edge for the PaveBlock <aPB> | |

284 | --- in DS. | |

285 | --- If the PaveBlock is not found, returns 0; | |

286 | --- | |

287 | IsBlocksCoinside (me; | |

288 | aPB1:PaveBlock from BOPTools; | |

289 | aPB2:PaveBlock from BOPTools) | |

290 | returns Boolean from Standard | |

291 | is protected; | |

292 | ---Purpose: | |

293 | --- Returns TRUE if the two PaveBlocks have vertices | |

294 | --- that touch each other in terms of Tolerances of | |

295 | --- the vertices | |

296 | --- | |

297 | -------------------------------------------------------------- | |

298 | --- | |

299 | --- Some of API FUNCTIONS | |

300 | --- | |

301 | --- | |

302 | SplitsInFace(me:out; | |

303 | aBid:Integer from Standard; | |

304 | nF1 :Integer from Standard; | |

305 | nF2 :Integer from Standard; | |

306 | aLs :out ListOfInteger from TColStd) | |

307 | returns Integer from Standard; | |

308 | ---Purpose: | |

309 | --- For the face <nF1> get all splits that are IN-2D | |

310 | --- to the face <nF2>; The result is in <aLs> | |

311 | --- Returns 0 if OK; | |

312 | --- | |

313 | SplitsInFace(me:out; | |

314 | nE1 :Integer from Standard; | |

315 | nF2 :Integer from Standard; | |

316 | aLs :out ListOfInteger from TColStd) | |

317 | returns Integer from Standard; | |

318 | ---Purpose: | |

319 | --- For the edge <nE1> get all splits that are IN-2D | |

320 | --- to the face <nF1>; The result is in <aLs> | |

321 | --- Returns 0 if OK; | |

322 | --- | |

323 | SplitsOnEdge(me:out; | |

324 | nE1 :Integer from Standard; | |

325 | nE2 :Integer from Standard; | |

326 | aLs :out ListOfInteger from TColStd) | |

327 | returns Integer from Standard; | |

328 | ---Purpose: | |

329 | --- For the edge <nE1> get all splits that are ON-3D | |

330 | --- to the edge <nE2>; The result is in <aLs> | |

331 | --- Returns 0 if OK; | |

332 | --- | |

333 | SplitsOnFace(me:out; | |

334 | nE1 :Integer from Standard; | |

335 | nF2 :Integer from Standard; | |

336 | aLs :out ListOfInteger from TColStd) | |

337 | returns Integer from Standard; | |

338 | ---Purpose: | |

339 | --- For the edge <nE1> get all splits that are ON-3D | |

340 | --- to the face <nF2>; The result is in <aLs> | |

341 | --- Returns 0 if OK; | |

342 | --- | |

343 | SplitsOnFace(me:out; | |

344 | aBid:Integer from Standard; | |

345 | nF1 :Integer from Standard; | |

346 | nF2 :Integer from Standard; | |

347 | aLs :out ListOfInteger from TColStd) | |

348 | returns Integer from Standard; | |

349 | ---Purpose: | |

350 | --- For the face <nF1> get all splits that are ON-3D | |

351 | --- to the face <nF2>; The result is in <aLs> | |

352 | --- Returns 0 if OK; | |

353 | --- | |

354 | ||

355 | SplitsInFace(me:out; | |

356 | aBid:Integer from Standard; | |

357 | nF1 :Integer from Standard; | |

358 | nF2 :Integer from Standard; | |

359 | aLs :out ListOfPaveBlock from BOPTools) | |

360 | returns Integer from Standard; | |

361 | ---Purpose: | |

362 | --- For the face <nF1> get all PaveBlocks that are IN-2D | |

363 | --- to the face <nF2>; The result is in <aLs> | |

364 | --- Returns 0 if OK; | |

365 | --- | |

366 | ||

367 | SplitsInFace(me:out; | |

368 | nE1 :Integer from Standard; | |

369 | nF2 :Integer from Standard; | |

370 | aLs :out ListOfPaveBlock from BOPTools) | |

371 | returns Integer from Standard; | |

372 | ---Purpose: | |

373 | --- For the edge <nE1> get all PaveBlocks that are IN-2D | |

374 | --- to the face <nF1>; The result is in <aLs> | |

375 | --- Returns 0 if OK; | |

376 | --- | |

377 | ||

378 | SplitsOnEdge(me:out; | |

379 | nE1 :Integer from Standard; | |

380 | nE2 :Integer from Standard; | |

381 | aLs :out ListOfPaveBlock from BOPTools) | |

382 | returns Integer from Standard; | |

383 | ---Purpose: | |

384 | --- For the edge <nE1> get all PaveBlocks that are ON-3D | |

385 | --- to the edge <nE2>; The result is in <aLs> | |

386 | --- Returns 0 if OK; | |

387 | --- | |

388 | ||

389 | SplitsOnFace(me:out; | |

390 | nE1 :Integer from Standard; | |

391 | nF2 :Integer from Standard; | |

392 | aLs :out ListOfPaveBlock from BOPTools) | |

393 | returns Integer from Standard; | |

394 | ---Purpose: | |

395 | --- For the edge <nE1> get all PaveBlocks that are ON-3D | |

396 | --- to the face <nF2>; The result is in <aLs> | |

397 | --- Returns 0 if OK; | |

398 | --- | |

399 | ||

400 | SplitsOnFace(me:out; | |

401 | aBid:Integer from Standard; | |

402 | nF1 :Integer from Standard; | |

403 | nF2 :Integer from Standard; | |

404 | aLs :out ListOfPaveBlock from BOPTools) | |

405 | returns Integer from Standard; | |

406 | ---Purpose: | |

407 | --- For the face <nF1> get all PaveBlocks that are ON-3D | |

408 | --- to the face <nF2>; The result is in <aLs> | |

409 | --- Returns 0 if OK; | |

410 | --- | |

411 | FindSDVertex (me; | |

412 | nV: Integer from Standard) | |

413 | returns Integer from Standard; | |

414 | ---Purpose: | |

415 | --- Find for the vertex <nV> SD-vertex (if possible) and return | |

416 | --- its DS-index. Otherwise it returns 0. | |

417 | --- | |

418 | ||

419 | --------------------------------------------------------------- | |

420 | --- | |

421 | --- Section Edges. Protected Block. | |

422 | --- | |

423 | --- | |

424 | MakeBlocks(me:out) | |

425 | is protected; | |

426 | ---Purpose: | |

427 | --- Make Pave Blocks for intersection curves | |

428 | --- | |

429 | MakeAloneVertices(me:out) | |

430 | is protected; | |

431 | ---Purpose: | |

432 | --- Make vertices that are place of intersection | |

433 | --- between faces | |

434 | --- | |

435 | PutPaveOnCurve(me:out; | |

436 | aPaveSet: PaveSet from BOPTools; | |

437 | aTolR3D : Real from Standard; | |

438 | aBCurve :out Curve from BOPTools) | |

439 | is protected; | |

440 | ---Purpose: | |

441 | --- Among Paves from <aPaveSet> find ones that belong | |

442 | --- to intersection curve <aBCurve> with 3D-tolerance | |

443 | --- value <aTolR3D> | |

444 | --- | |

445 | PutPaveOnCurve(me:out; | |

446 | aPave : Pave from BOPTools; | |

447 | aTolR3D : Real from Standard; | |

448 | aBCurve :out Curve from BOPTools) | |

449 | is protected; | |

450 | ---Purpose: | |

451 | --- Try to put Pave <aPave> on intersection curve <aBCurve> | |

452 | --- with 3D-tolerance value <aTolR3D> | |

453 | --- | |

454 | ||

455 | PutPavesOnCurves(me:out) | |

456 | is protected; | |

457 | ||

458 | PrepareSetForFace(me:out; | |

459 | nF1 :Integer from Standard; | |

460 | nF2 :Integer from Standard; | |

461 | aPaveSet:out PaveSet from BOPTools); | |

462 | ---Purpose: | |

463 | --- For couple of faces <nF1>, <nF2> prepare set of all paves | |

464 | --- of all edges <aPaveSet> | |

465 | --- | |

466 | MakeSectionEdges(me:out) | |

467 | is protected; | |

468 | ---Purpose: | |

469 | --- For all inrefered faces make section edges from | |

470 | --- intersection curves and corresp. Paves on them | |

471 | --- | |

472 | PutBoundPaveOnCurve (me:out; | |

473 | aBC :out Curve from BOPTools; | |

474 | aFF :out SSInterference from BOPTools) | |

475 | is protected; | |

476 | ---Purpose: | |

477 | --- Try to put own bounds of the curve on the curve <aBC> | |

478 | --- | |

479 | PutBoundPaveOnCurve (me:out; | |

480 | aP : Pnt from gp; | |

481 | aT : Real from Standard; | |

482 | aBC :out Curve from BOPTools; | |

483 | aFF :out SSInterference from BOPTools) | |

484 | is protected; | |

485 | ---Purpose: | |

486 | --- Try to put 3D-point <aP> (parameter aT) on the curve <aBC> | |

487 | --- | |

488 | PutBoundPaveOnCurveSpec (me:out; | |

489 | aBC :out Curve from BOPTools; | |

490 | aFF :out SSInterference from BOPTools) | |

491 | is protected; | |

492 | ---Purpose: | |

493 | --- Try to put own bounds of the curve on the curve <aBC> | |

494 | --- | |

495 | PutBoundPaveOnCurveSpec (me:out; | |

496 | aP : Pnt from gp; | |

497 | aT : Real from Standard; | |

498 | aBC :out Curve from BOPTools; | |

499 | aFF :out SSInterference from BOPTools) | |

500 | is protected; | |

501 | ---Purpose: | |

502 | --- Try to put 3D-point <aP> (parameter aT) on the curve <aBC> | |

3928aec6 P |
503 | --- |

504 | ||

505 | --modified by NIZNHY-PKV Thu Oct 20 07:17:11 2011f | |

506 | PutClosingPaveOnCurve (me:out; | |

507 | aBC :out Curve from BOPTools; | |

508 | aFF :out SSInterference from BOPTools) | |

509 | is protected; | |

510 | ---Purpose: | |

511 | --- Put paves on the curve <aBC> in case when <aBC> | |

512 | -- is closed 3D-curve | |

513 | --- | |

514 | --modified by NIZNHY-PKV Thu Oct 20 07:17:11 2011t | |

515 | ||

7fd59977 | 516 | FindPave (me:out; |

517 | aP :Pnt from gp; | |

518 | aTpV: Real from Standard; | |

519 | aPS: PaveSet from BOPTools; | |

520 | aPV:out Pave from BOPTools) | |

521 | returns Boolean from Standard | |

522 | is protected; | |

523 | ---Purpose: | |

524 | --- Returns TRUE if 3D-point <aP> coinsides with some Pave | |

525 | --- from <aPS> (with 3D-tolerance value <aTpV>); | |

526 | --- In TRUE case <aPV> will contain the Pave . | |

527 | --- | |

528 | CheckCoincidence(me:out; | |

529 | aPB: PaveBlock from BOPTools; | |

530 | aFF: SSInterference from BOPTools) | |

531 | returns Boolean from Standard | |

532 | is protected; | |

533 | ---Purpose: | |

534 | --- Returns TRUE if PaveBlock <aPB> lays on the faces | |

535 | --- from FF-interference <aFF> | |

536 | --- | |

537 | CheckIntermediatePoint(me:out; | |

538 | aPB : PaveBlock from BOPTools; | |

539 | aPBR: PaveBlock from BOPTools; | |

540 | aTol: Real from Standard) | |

541 | returns Integer from Standard | |

542 | is protected; | |

543 | ---Purpose: | |

544 | --- Returns 0 if some arbitrary intermediate point from | |

545 | --- PaveBlock <aPB> lays on the PaveBlock <aPBR> | |

546 | --- (with 3D-tolerance value <aTol>) | |

547 | --- | |

548 | ||

549 | CheckFacePaves(me:out; | |

550 | aV : Vertex from TopoDS; | |

551 | nF: Integer from Standard) | |

552 | returns Integer from Standard | |

553 | is protected; | |

554 | ---Purpose: | |

555 | --- Internal usage | |

556 | --- | |

557 | StickVertices (me:out; | |

558 | nF1: Integer from Standard; | |

559 | nF2: Integer from Standard; | |

560 | aMV:out IndexedMapOfInteger from TColStd) | |

561 | is protected; | |

562 | ---Purpose: | |

563 | --- Internal usage | |

564 | --- | |

565 | ExpectedPoolLength(me) | |

566 | returns Integer from Standard | |

567 | is protected; | |

568 | ---Purpose: | |

569 | --- Returns the value of expected length of array of interferences | |

570 | --- | |

571 | ||

572 | RestrictCurveIn2d(me: in out; nE, nF1, nF2 : Integer from Standard; | |

573 | theTolerance: Real from Standard; | |

574 | theBC : in out Curve from BOPTools) | |

575 | is private; | |

576 | ||

577 | RecomputeCommonBlocks(me: in out; nE: Integer from Standard) | |

578 | is private; | |

579 | ||

7fd59977 | 580 | ExtendedTolerance(me:out; |

581 | nV : Integer from Standard; | |

582 | aTolExt : out Real from Standard) | |

583 | returns Boolean from Standard | |

584 | is protected; | |

7fd59977 | 585 | |

586 | fields | |

587 | ||

588 | myIntrPool : PInterferencePool from BOPTools | |

589 | is protected; | |

590 | myDS : PShapesDataStructure from BooleanOperations | |

591 | is protected; | |

592 | myPavePool : PavePool from BOPTools | |

593 | is protected; | |

594 | myPavePoolNew : PavePool from BOPTools | |

595 | is protected; | |

596 | myCommonBlockPool : CommonBlockPool from BOPTools | |

597 | is protected; | |

598 | mySplitShapesPool : SplitShapesPool from BOPTools | |

599 | is protected; | |

600 | mySectionAttribute : SSIntersectionAttribute from BOPTools | |

601 | is protected; | |

602 | myNbSources : Integer from Standard | |

603 | is protected; | |

604 | myNbEdges : Integer from Standard | |

605 | is protected; | |

606 | myIsDone : Boolean from Standard | |

607 | is protected; | |

608 | myDSIt : IteratorOfCoupleOfShape from BOPTools | |

609 | is protected; | |

610 | myContext : Context from IntTools | |

611 | is protected; | |

612 | ||

613 | end PaveFiller; |