Salome HOME
IPAL19834: Incorrect result after make Partition of 2 objects. A fix by PKV.
[modules/geom.git] / src / NMTTools / NMTTools_PaveFiller_8.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 // File:        NMTTools_PaveFiller_8.cxx
21 // Created:     Fri Dec 19 11:15:53 2003
22 // Author:      Peter KURNEV
23 //              <pkv@irinox>
24
25
26 #include <NMTTools_PaveFiller.ixx>
27
28 #include <TColStd_MapOfInteger.hxx>
29 #include <TColStd_ListOfInteger.hxx>
30 #include <TColStd_ListIteratorOfListOfInteger.hxx>
31
32 #include <BooleanOperations_ShapesDataStructure.hxx>
33 #include <BooleanOperations_OnceExplorer.hxx>
34
35 #include <BOPTools_PaveBlock.hxx>
36 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
37 #include <BOPTools_ListOfPaveBlock.hxx>
38
39 #include <NMTDS_ShapesDataStructure.hxx>
40
41 #include <NMTTools_ListOfCommonBlock.hxx>
42 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
43 #include <NMTTools_CommonBlock.hxx>
44 #include <NMTTools_CommonBlockAPI.hxx>
45
46
47 // Modified  to add new method Thu Sep 14 14:35:18 2006 
48 // Contribution of Samtech www.samcef.com BEGIN
49 //=======================================================================
50 // function:  SharedEdges
51 // purpose:
52 //=======================================================================
53   void NMTTools_PaveFiller::SharedEdges(const Standard_Integer nF1,
54                                         const Standard_Integer nF2,
55                                         TColStd_ListOfInteger& aLNE,
56                                         TopTools_ListOfShape& aLSE)
57 {
58   Standard_Integer nE1, nE2;
59   TColStd_MapOfInteger aM1;
60   //
61   BooleanOperations_ShapesDataStructure *pDS=myDS;
62   BooleanOperations_OnceExplorer aExp(*pDS);
63   //
64   aExp.Init(nF1, TopAbs_EDGE);
65   for (; aExp.More(); aExp.Next()) {
66     nE1=aExp.Current();
67     aM1.Add(nE1);
68   }
69   
70   aExp.Init(nF2, TopAbs_EDGE);
71   for (; aExp.More(); aExp.Next()) {
72     nE2=aExp.Current();
73     if (aM1.Contains(nE2)) {
74       aLNE.Append(nE2);
75       const TopoDS_Shape& aE2=myDS->Shape(nE2);
76       aLSE.Append(aE2);
77     }
78   }
79 }
80 // Contribution of Samtech www.samcef.com END
81 //
82 //=======================================================================
83 // function: RealPaveBlock
84 // purpose:
85 //=======================================================================
86   const BOPTools_PaveBlock& NMTTools_PaveFiller::RealPaveBlock
87      (const BOPTools_PaveBlock& aPB,
88       TColStd_ListOfInteger& aLB,
89       Standard_Integer& aIsCommonBlock)
90 {
91   Standard_Integer nE, nSpx;
92   BOPTools_ListIteratorOfListOfPaveBlock aItPBx;
93   //
94   aIsCommonBlock=0;
95   aLB.Clear();
96   nE=aPB.OriginalEdge();
97   const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
98   NMTTools_CommonBlockAPI aCBAPI(aLCBE);
99   if (aCBAPI.IsCommonBlock(aPB)) {
100     NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
101     //
102     aIsCommonBlock=1;   
103     //
104     const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
105     aItPBx.Initialize(aLPBx);
106     for (; aItPBx.More(); aItPBx.Next()) {
107       const BOPTools_PaveBlock& aPBx=aItPBx.Value();
108       nSpx=aPBx.Edge();
109       aLB.Append(nSpx);
110     }
111     //
112     const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1();
113     return aPBx;
114   }
115   return aPB;
116 }
117 //
118 //=======================================================================
119 // function: RealPaveBlock
120 // purpose:
121 //=======================================================================
122   const BOPTools_PaveBlock& NMTTools_PaveFiller::RealPaveBlock(const BOPTools_PaveBlock& aPB)
123 {
124   Standard_Integer nE;
125   //
126   nE=aPB.OriginalEdge();
127   const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
128   NMTTools_CommonBlockAPI aCBAPI(aLCBE);
129   if (aCBAPI.IsCommonBlock(aPB)) {
130     NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
131     const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1();
132     return aPBx;
133   }
134   return aPB;
135 }
136 //=======================================================================
137 // function: CommonBlocksFace
138 // purpose:
139 //=======================================================================
140   Standard_Integer NMTTools_PaveFiller::CommonBlocksFace(const Standard_Integer nF,
141                                                          NMTTools_ListOfCommonBlock& aLCB)
142 {
143   Standard_Integer nE;
144   TopAbs_ShapeEnum aT;
145   NMTTools_ListIteratorOfListOfCommonBlock anIt;
146   //
147   aT=myDS->GetShapeType(nF);
148   //
149   if (aT!=TopAbs_FACE) {
150     return 1; // Type mismatch
151   }
152   //
153   BooleanOperations_ShapesDataStructure *pDS=myDS;
154   BooleanOperations_OnceExplorer aExp(*pDS);
155   //
156   aExp.Init(nF, TopAbs_EDGE);
157   for (; aExp.More(); aExp.Next()) {
158     nE=aExp.Current();
159     const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
160     anIt.Initialize(aLCBE);
161     for (; anIt.More(); anIt.Next()) {
162       const NMTTools_CommonBlock& aCBE=anIt.Value();
163       aLCB.Append(aCBE);
164     }
165   }
166   return 0; //Ok
167 }
168 //
169 // 1 RealSplits
170 //
171 //
172 //=======================================================================
173 // function: RealSplitsFace
174 // purpose:
175 //=======================================================================
176   void NMTTools_PaveFiller::RealSplitsFace(const Standard_Integer nF,
177                                            BOPTools_ListOfPaveBlock& aLPB)
178 {
179   Standard_Integer nE;
180   BOPTools_ListIteratorOfListOfPaveBlock anIt;
181   //
182   BooleanOperations_ShapesDataStructure *pDS=myDS;
183   BooleanOperations_OnceExplorer aExp(*pDS);
184   //
185   aExp.Init(nF, TopAbs_EDGE);
186   for (; aExp.More(); aExp.Next()) {
187     nE=aExp.Current();
188     const BOPTools_ListOfPaveBlock& aLPBE=mySplitShapesPool(myDS->RefEdge(nE));
189     anIt.Initialize(aLPBE);
190     for (; anIt.More(); anIt.Next()) {
191       const BOPTools_PaveBlock& aPB=anIt.Value();
192       const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
193       aLPB.Append(aPBR);
194     }
195   }
196 }
197 //=======================================================================
198 // function: HasRealSplitsInOnFace
199 // purpose:
200 //=======================================================================
201   Standard_Boolean NMTTools_PaveFiller::HasRealSplitsInOnFace(const Standard_Integer nF1,
202                                                               const Standard_Integer nF2)
203 {
204   Standard_Boolean bFlag;
205   BOPTools_ListOfPaveBlock aLPB;
206   //
207   RealSplitsInFace(0, nF1, nF2, aLPB);
208   //
209   bFlag=!aLPB.IsEmpty();
210   if (bFlag) {
211     return bFlag;
212   }
213   //
214   RealSplitsInFace(0, nF1, nF2, aLPB);
215   //
216   bFlag=!aLPB.IsEmpty();
217   return bFlag;
218 }
219 //=======================================================================
220 // function: RealSplitsInFace
221 // purpose:
222 //=======================================================================
223   void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer ,//for overriding
224                                              const Standard_Integer nF1,
225                                              const Standard_Integer nF2,
226                                              BOPTools_ListOfPaveBlock& aLPB)
227 {
228   Standard_Integer nE1;
229   //
230   BooleanOperations_ShapesDataStructure *pDS=myDS;
231   BooleanOperations_OnceExplorer aExp(*pDS);
232   aExp.Init(nF1, TopAbs_EDGE);
233   for (; aExp.More(); aExp.Next()) {
234     nE1=aExp.Current();
235     RealSplitsInFace (nE1, nF2, aLPB);
236   }
237 }
238 //=======================================================================
239 // function: RealSplitsInFace
240 // purpose:
241 //=======================================================================
242   void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer nE1,
243                                              const Standard_Integer nF2,
244                                              BOPTools_ListOfPaveBlock& aLPB)
245 {
246   Standard_Integer nF1;
247   //
248   TColStd_ListIteratorOfListOfInteger anItLFCB;
249   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
250   //
251   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
252   //
253   anItCB.Initialize(aLCB);
254   for (; anItCB.More(); anItCB.Next()) {
255     NMTTools_CommonBlock& aCB=anItCB.Value();
256     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
257     const BOPTools_PaveBlock& aPB1R=RealPaveBlock(aPB1);
258
259     const TColStd_ListOfInteger& aLFCB=aCB.Faces();
260     anItLFCB.Initialize(aLFCB);
261     for (; anItLFCB.More(); anItLFCB.Next()) {
262       nF1=anItLFCB.Value();
263       if (nF1==nF2) {
264         aLPB.Append(aPB1R);
265       }
266     }
267   }
268 }
269 //=======================================================================
270 // function: RealSplitsOnEdge
271 // purpose:
272 //=======================================================================
273   void NMTTools_PaveFiller::RealSplitsOnEdge(const Standard_Integer nE1,
274                                              const Standard_Integer nE2,
275                                              BOPTools_ListOfPaveBlock& aLPB)
276 {
277   Standard_Integer nE;
278   //
279   BOPTools_ListIteratorOfListOfPaveBlock anIt;
280   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
281   //
282   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
283
284   anItCB.Initialize(aLCB);
285   for (; anItCB.More(); anItCB.Next()) {
286     NMTTools_CommonBlock& aCB=anItCB.Value();
287     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
288     const BOPTools_PaveBlock& aPB1R=RealPaveBlock(aPB1);
289     //
290     const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
291     anIt.Initialize(aLPBx);
292     for (; anIt.More(); anIt.Next()) {
293       const BOPTools_PaveBlock& aPB2=anIt.Value();
294       nE=aPB2.OriginalEdge();
295       if (nE==nE2) {
296         aLPB.Append(aPB1R);
297       }
298     }
299   }
300 }
301 //=======================================================================
302 // function: RealSplitsOnFace
303 // purpose:
304 //=======================================================================
305   void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer nE1,
306                                              const Standard_Integer nF2,
307                                              BOPTools_ListOfPaveBlock& aLPB)
308 {
309   Standard_Integer nE2;
310   //
311   BooleanOperations_ShapesDataStructure *pDS=myDS;
312   BooleanOperations_OnceExplorer aExp(*pDS);
313   aExp.Init(nF2, TopAbs_EDGE);
314   for (; aExp.More(); aExp.Next()) {
315     nE2=aExp.Current();
316     RealSplitsOnEdge(nE1, nE2, aLPB);
317   }
318 }
319 //=======================================================================
320 // function: RealSplitsOnFace
321 // purpose:
322 //=======================================================================
323   void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer ,//for overriding
324                                              const Standard_Integer nF1,
325                                              const Standard_Integer nF2,
326                                              BOPTools_ListOfPaveBlock& aLPB)
327 {
328   Standard_Integer nE1;
329   //
330   BooleanOperations_ShapesDataStructure *pDS=myDS;
331   BooleanOperations_OnceExplorer aExp(*myDS);
332   aExp.Init(nF1, TopAbs_EDGE);
333   for (; aExp.More(); aExp.Next()) {
334     nE1=aExp.Current();
335     RealSplitsOnFace(nE1, nF2, aLPB);
336   }
337 }
338
339 // 2 SimpleSplits
340 //=======================================================================
341 // function: SplitsFace
342 // purpose:
343 //=======================================================================
344   Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF,
345                                                    BOPTools_ListOfPaveBlock& aLPB)
346 {
347   Standard_Integer nE;
348   TopAbs_ShapeEnum aT;
349   BOPTools_ListIteratorOfListOfPaveBlock anIt;
350   //
351   aT=myDS->GetShapeType(nF);
352   //
353   if (aT!=TopAbs_FACE) {
354     return 1; // Type mismatch
355   }
356   //
357   BooleanOperations_ShapesDataStructure *pDS=myDS;
358   BooleanOperations_OnceExplorer aExp(*pDS);
359   //
360   aExp.Init(nF, TopAbs_EDGE);
361   for (; aExp.More(); aExp.Next()) {
362     nE=aExp.Current();
363     const BOPTools_ListOfPaveBlock& aLPBE=mySplitShapesPool(myDS->RefEdge(nE));
364     anIt.Initialize(aLPBE);
365     for (; anIt.More(); anIt.Next()) {
366       const BOPTools_PaveBlock& aPBE=anIt.Value();
367       aLPB.Append(aPBE);
368     }
369   }
370   return 0; //Ok
371 }
372
373 //=======================================================================
374 // function: SplitsInFace
375 // purpose: splits of edges from nF1 in nF2
376 //=======================================================================
377   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
378                                                      const Standard_Integer nF1,
379                                                      const Standard_Integer nF2,
380                                                      BOPTools_ListOfPaveBlock& aLPB)
381 {
382   Standard_Integer nE1;
383   TopAbs_ShapeEnum aT1, aT2;
384
385   aT1=myDS->GetShapeType(nF1);
386   aT2=myDS->GetShapeType(nF2);
387
388   if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
389     return 1; // Type mismatch
390   }
391   BooleanOperations_ShapesDataStructure *pDS=myDS;
392   BooleanOperations_OnceExplorer aExp(*pDS);
393   aExp.Init(nF1, TopAbs_EDGE);
394   for (; aExp.More(); aExp.Next()) {
395     nE1=aExp.Current();
396     SplitsInFace (nE1, nF2, aLPB);
397   }
398   return 0; //Ok
399 }
400 //=======================================================================
401 // function: SplitsInFace
402 // purpose: splits of edge nE1 in aFace2
403 //=======================================================================
404   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
405                                                      const Standard_Integer nF2,
406                                                      BOPTools_ListOfPaveBlock& aLPB)
407 {
408   Standard_Integer nF1;
409   TopAbs_ShapeEnum aT1, aT2;
410
411   aT1=myDS->GetShapeType(nE1);
412   aT2=myDS->GetShapeType(nF2);
413
414   if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
415     return 1; // Type mismatch
416   }
417   //
418   TColStd_ListIteratorOfListOfInteger anItLFCB;
419   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
420   //
421   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
422   //
423   anItCB.Initialize(aLCB);
424   for (; anItCB.More(); anItCB.Next()) {
425     NMTTools_CommonBlock& aCB=anItCB.Value();
426     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
427
428     const TColStd_ListOfInteger& aLFCB=aCB.Faces();
429     anItLFCB.Initialize(aLFCB);
430     for (; anItLFCB.More(); anItLFCB.Next()) {
431       nF1=anItLFCB.Value();
432       if (nF1==nF2) {
433         aLPB.Append(aPB1);
434       }
435     }
436   }
437   return 0; //Ok
438 }
439 //=======================================================================
440 // function: SplitsOnEdge
441 // purpose:  splits of edge nE1 on nE2
442 //=======================================================================
443   Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
444                                                      const Standard_Integer nE2,
445                                                      BOPTools_ListOfPaveBlock& aLPB)
446 {
447   Standard_Integer nE;
448   TopAbs_ShapeEnum aT1, aT2;
449
450   aT1=myDS->GetShapeType(nE1);
451   aT2=myDS->GetShapeType(nE2);
452
453   if (aT1!=TopAbs_EDGE || aT2!=TopAbs_EDGE) {
454     return 1; // Type mismatch
455   }
456   //
457   BOPTools_ListIteratorOfListOfPaveBlock anIt;
458   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
459   //
460   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
461
462   anItCB.Initialize(aLCB);
463   for (; anItCB.More(); anItCB.Next()) {
464     NMTTools_CommonBlock& aCB=anItCB.Value();
465     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);//XXX
466     //
467     const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
468     anIt.Initialize(aLPBx);
469     for (; anIt.More(); anIt.Next()) {
470       const BOPTools_PaveBlock& aPB2=anIt.Value();
471       nE=aPB2.OriginalEdge();
472       if (nE==nE2) {
473         aLPB.Append(aPB1);
474       }
475     }
476   }
477   return 0; //Ok
478 }
479 //=======================================================================
480 // function: SplitsOnFace
481 // purpose:  splits of edge nE1 on face nF2
482 //=======================================================================
483   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
484                                                      const Standard_Integer nF2,
485                                                      BOPTools_ListOfPaveBlock& aLPB)
486 {
487   Standard_Integer nE2, ip;
488   TopAbs_ShapeEnum aT1, aT2;
489
490   aT1=myDS->GetShapeType(nE1);
491   aT2=myDS->GetShapeType(nF2);
492
493   if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
494     return 1; // Type mismatch
495   }
496   BooleanOperations_ShapesDataStructure *pDS=myDS;
497   BooleanOperations_OnceExplorer aExp(*pDS);
498   aExp.Init(nF2, TopAbs_EDGE);
499   for (; aExp.More(); aExp.Next()) {
500     nE2=aExp.Current();
501     ip=SplitsOnEdge(nE1, nE2, aLPB);
502     if (ip) {
503       return ip;
504     }
505   }
506   return 0; //Ok
507 }
508 //=======================================================================
509 // function: SplitsOnFace
510 // purpose:  splits of edges from face nF1 on face nF2
511 //=======================================================================
512   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
513                                                      const Standard_Integer nF1,
514                                                      const Standard_Integer nF2,
515                                                      BOPTools_ListOfPaveBlock& aLPB)
516 {
517   Standard_Integer nE1, ip;
518   TopAbs_ShapeEnum aT1, aT2;
519
520   aT1=myDS->GetShapeType(nF1);
521   aT2=myDS->GetShapeType(nF2);
522
523   if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
524     return 1; // Type mismatch
525   }
526   BooleanOperations_ShapesDataStructure *pDS=myDS;
527   BooleanOperations_OnceExplorer aExp(*myDS);
528   aExp.Init(nF1, TopAbs_EDGE);
529   for (; aExp.More(); aExp.Next()) {
530     nE1=aExp.Current();
531     ip=SplitsOnFace(nE1, nF2, aLPB);
532     if (ip) {
533       return ip;
534     }
535   }
536   return 0; //Ok
537 }
538
539 // 3 Simple Splits indices
540 //=======================================================================
541 // function: SplitsFace
542 // purpose:
543 //=======================================================================
544   Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF,
545                                                    TColStd_ListOfInteger& aSplits)
546 {
547   Standard_Integer nE, iErr;
548   BOPTools_ListIteratorOfListOfPaveBlock aIt;
549   BOPTools_ListOfPaveBlock aLPB;
550   //
551   iErr=SplitsFace(nF, aLPB);
552    if (iErr) {
553     return iErr;
554   }
555
556   aIt.Initialize(aLPB);
557   for (; aIt.More(); aIt.Next()) {
558     const BOPTools_PaveBlock& aPB=aIt.Value();
559     nE=aPB.Edge();
560     aSplits.Append(nE);
561   }
562   return 0; //Ok
563 }
564
565 //=======================================================================
566 // function: SplitsInFace
567 // purpose: splits of edges from nF1 in nF2
568 //=======================================================================
569   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
570                                                      const Standard_Integer nF1,
571                                                      const Standard_Integer nF2,
572                                                      TColStd_ListOfInteger& aSplits)
573 {
574   Standard_Integer nE, iErr;
575   BOPTools_ListIteratorOfListOfPaveBlock aIt;
576   BOPTools_ListOfPaveBlock aLPB;
577   //
578   iErr=SplitsInFace(0, nF1, nF2, aLPB);
579   if (iErr) {
580     return iErr;
581   }
582   aIt.Initialize(aLPB);
583   for (; aIt.More(); aIt.Next()) {
584     const BOPTools_PaveBlock& aPB=aIt.Value();
585     nE=aPB.Edge();
586     aSplits.Append(nE);
587   }
588   return iErr;
589 }
590 //=======================================================================
591 // function: SplitsInFace
592 // purpose: splits of edge nE1 in aFace2
593 //=======================================================================
594   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
595                                                      const Standard_Integer nF2,
596                                                      TColStd_ListOfInteger& aSplits)
597 {
598   Standard_Integer nE, iErr;
599   BOPTools_ListIteratorOfListOfPaveBlock aIt;
600   BOPTools_ListOfPaveBlock aLPB;
601   //
602   iErr=SplitsInFace(nE1, nF2, aLPB);
603   if (iErr) {
604     return iErr;
605   }
606   aIt.Initialize(aLPB);
607   for (; aIt.More(); aIt.Next()) {
608     const BOPTools_PaveBlock& aPB=aIt.Value();
609     nE=aPB.Edge();
610     aSplits.Append(nE);
611   }
612   return iErr;
613 }
614 //=======================================================================
615 // function: SplitsOnEdge
616 // purpose:  splits of edge nE1 on nE2
617 //=======================================================================
618   Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
619                                                      const Standard_Integer nE2,
620                                                      TColStd_ListOfInteger& aSplits)
621 {
622   Standard_Integer nE, iErr;
623   BOPTools_ListIteratorOfListOfPaveBlock aIt;
624   BOPTools_ListOfPaveBlock aLPB;
625   //
626   iErr=SplitsOnEdge(nE1, nE2, aLPB);
627   if (iErr) {
628     return iErr;
629   }
630   aIt.Initialize(aLPB);
631   for (; aIt.More(); aIt.Next()) {
632     const BOPTools_PaveBlock& aPB=aIt.Value();
633     nE=aPB.Edge();
634     aSplits.Append(nE);
635   }
636   return iErr;
637 }
638 //=======================================================================
639 // function: SplitsOnFace
640 // purpose:  splits of edge nE1 on face nF2
641 //=======================================================================
642   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
643                                                      const Standard_Integer nF2,
644                                                      TColStd_ListOfInteger& aSplits)
645 {
646   Standard_Integer nE, iErr;
647   BOPTools_ListIteratorOfListOfPaveBlock aIt;
648   BOPTools_ListOfPaveBlock aLPB;
649   //
650   iErr=SplitsOnEdge(nE1, nF2, aLPB);
651   if (iErr) {
652     return iErr;
653   }
654   aIt.Initialize(aLPB);
655   for (; aIt.More(); aIt.Next()) {
656     const BOPTools_PaveBlock& aPB=aIt.Value();
657     nE=aPB.Edge();
658     aSplits.Append(nE);
659   }
660   return iErr;
661 }
662 //=======================================================================
663 // function: SplitsOnFace
664 // purpose:  splits of edges from face nF1 on face nF2
665 //=======================================================================
666   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
667                                                      const Standard_Integer nF1,
668                                                      const Standard_Integer nF2,
669                                                      TColStd_ListOfInteger& aSplits)
670 {
671   Standard_Integer nE, iErr;
672   BOPTools_ListIteratorOfListOfPaveBlock aIt;
673   BOPTools_ListOfPaveBlock aLPB;
674   //
675   iErr=SplitsOnFace(0, nF1, nF2, aLPB);
676    if (iErr) {
677     return iErr;
678   }
679
680   aIt.Initialize(aLPB);
681   for (; aIt.More(); aIt.Next()) {
682     const BOPTools_PaveBlock& aPB=aIt.Value();
683     nE=aPB.Edge();
684     aSplits.Append(nE);
685   }
686   return 0; //Ok
687 }