Salome HOME
NPAL17431: About WhatIs dialog box. Set font-dependent height.
[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(const BOPTools_PaveBlock& aPB,
87                                                                TColStd_ListOfInteger& aLB)
88 {
89   Standard_Integer nE, nSpx;
90   BOPTools_ListIteratorOfListOfPaveBlock aItPBx;
91   //
92   aLB.Clear();
93   nE=aPB.OriginalEdge();
94   const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
95   NMTTools_CommonBlockAPI aCBAPI(aLCBE);
96   if (aCBAPI.IsCommonBlock(aPB)) {
97     NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
98     //
99     const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
100     aItPBx.Initialize(aLPBx);
101     for (; aItPBx.More(); aItPBx.Next()) {
102       const BOPTools_PaveBlock& aPBx=aItPBx.Value();
103       nSpx=aPBx.Edge();
104       aLB.Append(nSpx);
105     }
106     //
107     const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1();
108     return aPBx;
109   }
110   return aPB;
111 }
112 //
113 //=======================================================================
114 // function: RealPaveBlock
115 // purpose:
116 //=======================================================================
117   const BOPTools_PaveBlock& NMTTools_PaveFiller::RealPaveBlock(const BOPTools_PaveBlock& aPB)
118 {
119   Standard_Integer nE;
120   //
121   nE=aPB.OriginalEdge();
122   const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
123   NMTTools_CommonBlockAPI aCBAPI(aLCBE);
124   if (aCBAPI.IsCommonBlock(aPB)) {
125     NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
126     const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1();
127     return aPBx;
128   }
129   return aPB;
130 }
131 //=======================================================================
132 // function: CommonBlocksFace
133 // purpose:
134 //=======================================================================
135   Standard_Integer NMTTools_PaveFiller::CommonBlocksFace(const Standard_Integer nF,
136                                                          NMTTools_ListOfCommonBlock& aLCB)
137 {
138   Standard_Integer nE;
139   TopAbs_ShapeEnum aT;
140   NMTTools_ListIteratorOfListOfCommonBlock anIt;
141   //
142   aT=myDS->GetShapeType(nF);
143   //
144   if (aT!=TopAbs_FACE) {
145     return 1; // Type mismatch
146   }
147   //
148   BooleanOperations_ShapesDataStructure *pDS=myDS;
149   BooleanOperations_OnceExplorer aExp(*pDS);
150   //
151   aExp.Init(nF, TopAbs_EDGE);
152   for (; aExp.More(); aExp.Next()) {
153     nE=aExp.Current();
154     const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
155     anIt.Initialize(aLCBE);
156     for (; anIt.More(); anIt.Next()) {
157       const NMTTools_CommonBlock& aCBE=anIt.Value();
158       aLCB.Append(aCBE);
159     }
160   }
161   return 0; //Ok
162 }
163 //
164 // 1 RealSplits
165 //
166 //
167 //=======================================================================
168 // function: RealSplitsFace
169 // purpose:
170 //=======================================================================
171   void NMTTools_PaveFiller::RealSplitsFace(const Standard_Integer nF,
172                                            BOPTools_ListOfPaveBlock& aLPB)
173 {
174   Standard_Integer nE;
175   BOPTools_ListIteratorOfListOfPaveBlock anIt;
176   //
177   BooleanOperations_ShapesDataStructure *pDS=myDS;
178   BooleanOperations_OnceExplorer aExp(*pDS);
179   //
180   aExp.Init(nF, TopAbs_EDGE);
181   for (; aExp.More(); aExp.Next()) {
182     nE=aExp.Current();
183     const BOPTools_ListOfPaveBlock& aLPBE=mySplitShapesPool(myDS->RefEdge(nE));
184     anIt.Initialize(aLPBE);
185     for (; anIt.More(); anIt.Next()) {
186       const BOPTools_PaveBlock& aPB=anIt.Value();
187       const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
188       aLPB.Append(aPBR);
189     }
190   }
191 }
192 //=======================================================================
193 // function: HasRealSplitsInOnFace
194 // purpose:
195 //=======================================================================
196   Standard_Boolean NMTTools_PaveFiller::HasRealSplitsInOnFace(const Standard_Integer nF1,
197                                                               const Standard_Integer nF2)
198 {
199   Standard_Boolean bFlag;
200   BOPTools_ListOfPaveBlock aLPB;
201   //
202   RealSplitsInFace(0, nF1, nF2, aLPB);
203   //
204   bFlag=!aLPB.IsEmpty();
205   if (bFlag) {
206     return bFlag;
207   }
208   //
209   RealSplitsInFace(0, nF1, nF2, aLPB);
210   //
211   bFlag=!aLPB.IsEmpty();
212   return bFlag;
213 }
214 //=======================================================================
215 // function: RealSplitsInFace
216 // purpose:
217 //=======================================================================
218   void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer ,//for overriding
219                                              const Standard_Integer nF1,
220                                              const Standard_Integer nF2,
221                                              BOPTools_ListOfPaveBlock& aLPB)
222 {
223   Standard_Integer nE1;
224   //
225   BooleanOperations_ShapesDataStructure *pDS=myDS;
226   BooleanOperations_OnceExplorer aExp(*pDS);
227   aExp.Init(nF1, TopAbs_EDGE);
228   for (; aExp.More(); aExp.Next()) {
229     nE1=aExp.Current();
230     RealSplitsInFace (nE1, nF2, aLPB);
231   }
232 }
233 //=======================================================================
234 // function: RealSplitsInFace
235 // purpose:
236 //=======================================================================
237   void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer nE1,
238                                              const Standard_Integer nF2,
239                                              BOPTools_ListOfPaveBlock& aLPB)
240 {
241   Standard_Integer nF1;
242   //
243   TColStd_ListIteratorOfListOfInteger anItLFCB;
244   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
245   //
246   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
247   //
248   anItCB.Initialize(aLCB);
249   for (; anItCB.More(); anItCB.Next()) {
250     NMTTools_CommonBlock& aCB=anItCB.Value();
251     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
252     const BOPTools_PaveBlock& aPB1R=RealPaveBlock(aPB1);
253
254     const TColStd_ListOfInteger& aLFCB=aCB.Faces();
255     anItLFCB.Initialize(aLFCB);
256     for (; anItLFCB.More(); anItLFCB.Next()) {
257       nF1=anItLFCB.Value();
258       if (nF1==nF2) {
259         aLPB.Append(aPB1R);
260       }
261     }
262   }
263 }
264 //=======================================================================
265 // function: RealSplitsOnEdge
266 // purpose:
267 //=======================================================================
268   void NMTTools_PaveFiller::RealSplitsOnEdge(const Standard_Integer nE1,
269                                              const Standard_Integer nE2,
270                                              BOPTools_ListOfPaveBlock& aLPB)
271 {
272   Standard_Integer nE;
273   //
274   BOPTools_ListIteratorOfListOfPaveBlock anIt;
275   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
276   //
277   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
278
279   anItCB.Initialize(aLCB);
280   for (; anItCB.More(); anItCB.Next()) {
281     NMTTools_CommonBlock& aCB=anItCB.Value();
282     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
283     const BOPTools_PaveBlock& aPB1R=RealPaveBlock(aPB1);
284     //
285     const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
286     anIt.Initialize(aLPBx);
287     for (; anIt.More(); anIt.Next()) {
288       const BOPTools_PaveBlock& aPB2=anIt.Value();
289       nE=aPB2.OriginalEdge();
290       if (nE==nE2) {
291         aLPB.Append(aPB1R);
292       }
293     }
294   }
295 }
296 //=======================================================================
297 // function: RealSplitsOnFace
298 // purpose:
299 //=======================================================================
300   void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer nE1,
301                                              const Standard_Integer nF2,
302                                              BOPTools_ListOfPaveBlock& aLPB)
303 {
304   Standard_Integer nE2;
305   //
306   BooleanOperations_ShapesDataStructure *pDS=myDS;
307   BooleanOperations_OnceExplorer aExp(*pDS);
308   aExp.Init(nF2, TopAbs_EDGE);
309   for (; aExp.More(); aExp.Next()) {
310     nE2=aExp.Current();
311     RealSplitsOnEdge(nE1, nE2, aLPB);
312   }
313 }
314 //=======================================================================
315 // function: RealSplitsOnFace
316 // purpose:
317 //=======================================================================
318   void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer ,//for overriding
319                                              const Standard_Integer nF1,
320                                              const Standard_Integer nF2,
321                                              BOPTools_ListOfPaveBlock& aLPB)
322 {
323   Standard_Integer nE1;
324   //
325   BooleanOperations_ShapesDataStructure *pDS=myDS;
326   BooleanOperations_OnceExplorer aExp(*myDS);
327   aExp.Init(nF1, TopAbs_EDGE);
328   for (; aExp.More(); aExp.Next()) {
329     nE1=aExp.Current();
330     RealSplitsOnFace(nE1, nF2, aLPB);
331   }
332 }
333
334 // 2 SimpleSplits
335 //=======================================================================
336 // function: SplitsFace
337 // purpose:
338 //=======================================================================
339   Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF,
340                                                    BOPTools_ListOfPaveBlock& aLPB)
341 {
342   Standard_Integer nE;
343   TopAbs_ShapeEnum aT;
344   BOPTools_ListIteratorOfListOfPaveBlock anIt;
345   //
346   aT=myDS->GetShapeType(nF);
347   //
348   if (aT!=TopAbs_FACE) {
349     return 1; // Type mismatch
350   }
351   //
352   BooleanOperations_ShapesDataStructure *pDS=myDS;
353   BooleanOperations_OnceExplorer aExp(*pDS);
354   //
355   aExp.Init(nF, TopAbs_EDGE);
356   for (; aExp.More(); aExp.Next()) {
357     nE=aExp.Current();
358     const BOPTools_ListOfPaveBlock& aLPBE=mySplitShapesPool(myDS->RefEdge(nE));
359     anIt.Initialize(aLPBE);
360     for (; anIt.More(); anIt.Next()) {
361       const BOPTools_PaveBlock& aPBE=anIt.Value();
362       aLPB.Append(aPBE);
363     }
364   }
365   return 0; //Ok
366 }
367
368 //=======================================================================
369 // function: SplitsInFace
370 // purpose: splits of edges from nF1 in nF2
371 //=======================================================================
372   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
373                                                      const Standard_Integer nF1,
374                                                      const Standard_Integer nF2,
375                                                      BOPTools_ListOfPaveBlock& aLPB)
376 {
377   Standard_Integer nE1;
378   TopAbs_ShapeEnum aT1, aT2;
379
380   aT1=myDS->GetShapeType(nF1);
381   aT2=myDS->GetShapeType(nF2);
382
383   if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
384     return 1; // Type mismatch
385   }
386   BooleanOperations_ShapesDataStructure *pDS=myDS;
387   BooleanOperations_OnceExplorer aExp(*pDS);
388   aExp.Init(nF1, TopAbs_EDGE);
389   for (; aExp.More(); aExp.Next()) {
390     nE1=aExp.Current();
391     SplitsInFace (nE1, nF2, aLPB);
392   }
393   return 0; //Ok
394 }
395 //=======================================================================
396 // function: SplitsInFace
397 // purpose: splits of edge nE1 in aFace2
398 //=======================================================================
399   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
400                                                      const Standard_Integer nF2,
401                                                      BOPTools_ListOfPaveBlock& aLPB)
402 {
403   Standard_Integer nF1;
404   TopAbs_ShapeEnum aT1, aT2;
405
406   aT1=myDS->GetShapeType(nE1);
407   aT2=myDS->GetShapeType(nF2);
408
409   if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
410     return 1; // Type mismatch
411   }
412   //
413   TColStd_ListIteratorOfListOfInteger anItLFCB;
414   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
415   //
416   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
417   //
418   anItCB.Initialize(aLCB);
419   for (; anItCB.More(); anItCB.Next()) {
420     NMTTools_CommonBlock& aCB=anItCB.Value();
421     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
422
423     const TColStd_ListOfInteger& aLFCB=aCB.Faces();
424     anItLFCB.Initialize(aLFCB);
425     for (; anItLFCB.More(); anItLFCB.Next()) {
426       nF1=anItLFCB.Value();
427       if (nF1==nF2) {
428         aLPB.Append(aPB1);
429       }
430     }
431   }
432   return 0; //Ok
433 }
434 //=======================================================================
435 // function: SplitsOnEdge
436 // purpose:  splits of edge nE1 on nE2
437 //=======================================================================
438   Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
439                                                      const Standard_Integer nE2,
440                                                      BOPTools_ListOfPaveBlock& aLPB)
441 {
442   Standard_Integer nE;
443   TopAbs_ShapeEnum aT1, aT2;
444
445   aT1=myDS->GetShapeType(nE1);
446   aT2=myDS->GetShapeType(nE2);
447
448   if (aT1!=TopAbs_EDGE || aT2!=TopAbs_EDGE) {
449     return 1; // Type mismatch
450   }
451   //
452   BOPTools_ListIteratorOfListOfPaveBlock anIt;
453   NMTTools_ListIteratorOfListOfCommonBlock anItCB;
454   //
455   const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
456
457   anItCB.Initialize(aLCB);
458   for (; anItCB.More(); anItCB.Next()) {
459     NMTTools_CommonBlock& aCB=anItCB.Value();
460     const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);//XXX
461     //
462     const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
463     anIt.Initialize(aLPBx);
464     for (; anIt.More(); anIt.Next()) {
465       const BOPTools_PaveBlock& aPB2=anIt.Value();
466       nE=aPB2.OriginalEdge();
467       if (nE==nE2) {
468         aLPB.Append(aPB1);
469       }
470     }
471   }
472   return 0; //Ok
473 }
474 //=======================================================================
475 // function: SplitsOnFace
476 // purpose:  splits of edge nE1 on face nF2
477 //=======================================================================
478   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
479                                                      const Standard_Integer nF2,
480                                                      BOPTools_ListOfPaveBlock& aLPB)
481 {
482   Standard_Integer nE2, ip;
483   TopAbs_ShapeEnum aT1, aT2;
484
485   aT1=myDS->GetShapeType(nE1);
486   aT2=myDS->GetShapeType(nF2);
487
488   if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
489     return 1; // Type mismatch
490   }
491   BooleanOperations_ShapesDataStructure *pDS=myDS;
492   BooleanOperations_OnceExplorer aExp(*pDS);
493   aExp.Init(nF2, TopAbs_EDGE);
494   for (; aExp.More(); aExp.Next()) {
495     nE2=aExp.Current();
496     ip=SplitsOnEdge(nE1, nE2, aLPB);
497     if (ip) {
498       return ip;
499     }
500   }
501   return 0; //Ok
502 }
503 //=======================================================================
504 // function: SplitsOnFace
505 // purpose:  splits of edges from face nF1 on face nF2
506 //=======================================================================
507   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
508                                                      const Standard_Integer nF1,
509                                                      const Standard_Integer nF2,
510                                                      BOPTools_ListOfPaveBlock& aLPB)
511 {
512   Standard_Integer nE1, ip;
513   TopAbs_ShapeEnum aT1, aT2;
514
515   aT1=myDS->GetShapeType(nF1);
516   aT2=myDS->GetShapeType(nF2);
517
518   if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
519     return 1; // Type mismatch
520   }
521   BooleanOperations_ShapesDataStructure *pDS=myDS;
522   BooleanOperations_OnceExplorer aExp(*myDS);
523   aExp.Init(nF1, TopAbs_EDGE);
524   for (; aExp.More(); aExp.Next()) {
525     nE1=aExp.Current();
526     ip=SplitsOnFace(nE1, nF2, aLPB);
527     if (ip) {
528       return ip;
529     }
530   }
531   return 0; //Ok
532 }
533
534 // 3 Simple Splits indices
535 //=======================================================================
536 // function: SplitsFace
537 // purpose:
538 //=======================================================================
539   Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF,
540                                                    TColStd_ListOfInteger& aSplits)
541 {
542   Standard_Integer nE, iErr;
543   BOPTools_ListIteratorOfListOfPaveBlock aIt;
544   BOPTools_ListOfPaveBlock aLPB;
545   //
546   iErr=SplitsFace(nF, aLPB);
547    if (iErr) {
548     return iErr;
549   }
550
551   aIt.Initialize(aLPB);
552   for (; aIt.More(); aIt.Next()) {
553     const BOPTools_PaveBlock& aPB=aIt.Value();
554     nE=aPB.Edge();
555     aSplits.Append(nE);
556   }
557   return 0; //Ok
558 }
559
560 //=======================================================================
561 // function: SplitsInFace
562 // purpose: splits of edges from nF1 in nF2
563 //=======================================================================
564   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
565                                                      const Standard_Integer nF1,
566                                                      const Standard_Integer nF2,
567                                                      TColStd_ListOfInteger& aSplits)
568 {
569   Standard_Integer nE, iErr;
570   BOPTools_ListIteratorOfListOfPaveBlock aIt;
571   BOPTools_ListOfPaveBlock aLPB;
572   //
573   iErr=SplitsInFace(0, nF1, nF2, aLPB);
574   if (iErr) {
575     return iErr;
576   }
577   aIt.Initialize(aLPB);
578   for (; aIt.More(); aIt.Next()) {
579     const BOPTools_PaveBlock& aPB=aIt.Value();
580     nE=aPB.Edge();
581     aSplits.Append(nE);
582   }
583   return iErr;
584 }
585 //=======================================================================
586 // function: SplitsInFace
587 // purpose: splits of edge nE1 in aFace2
588 //=======================================================================
589   Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
590                                                      const Standard_Integer nF2,
591                                                      TColStd_ListOfInteger& aSplits)
592 {
593   Standard_Integer nE, iErr;
594   BOPTools_ListIteratorOfListOfPaveBlock aIt;
595   BOPTools_ListOfPaveBlock aLPB;
596   //
597   iErr=SplitsInFace(nE1, nF2, aLPB);
598   if (iErr) {
599     return iErr;
600   }
601   aIt.Initialize(aLPB);
602   for (; aIt.More(); aIt.Next()) {
603     const BOPTools_PaveBlock& aPB=aIt.Value();
604     nE=aPB.Edge();
605     aSplits.Append(nE);
606   }
607   return iErr;
608 }
609 //=======================================================================
610 // function: SplitsOnEdge
611 // purpose:  splits of edge nE1 on nE2
612 //=======================================================================
613   Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
614                                                      const Standard_Integer nE2,
615                                                      TColStd_ListOfInteger& aSplits)
616 {
617   Standard_Integer nE, iErr;
618   BOPTools_ListIteratorOfListOfPaveBlock aIt;
619   BOPTools_ListOfPaveBlock aLPB;
620   //
621   iErr=SplitsOnEdge(nE1, nE2, aLPB);
622   if (iErr) {
623     return iErr;
624   }
625   aIt.Initialize(aLPB);
626   for (; aIt.More(); aIt.Next()) {
627     const BOPTools_PaveBlock& aPB=aIt.Value();
628     nE=aPB.Edge();
629     aSplits.Append(nE);
630   }
631   return iErr;
632 }
633 //=======================================================================
634 // function: SplitsOnFace
635 // purpose:  splits of edge nE1 on face nF2
636 //=======================================================================
637   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
638                                                      const Standard_Integer nF2,
639                                                      TColStd_ListOfInteger& aSplits)
640 {
641   Standard_Integer nE, iErr;
642   BOPTools_ListIteratorOfListOfPaveBlock aIt;
643   BOPTools_ListOfPaveBlock aLPB;
644   //
645   iErr=SplitsOnEdge(nE1, nF2, aLPB);
646   if (iErr) {
647     return iErr;
648   }
649   aIt.Initialize(aLPB);
650   for (; aIt.More(); aIt.Next()) {
651     const BOPTools_PaveBlock& aPB=aIt.Value();
652     nE=aPB.Edge();
653     aSplits.Append(nE);
654   }
655   return iErr;
656 }
657 //=======================================================================
658 // function: SplitsOnFace
659 // purpose:  splits of edges from face nF1 on face nF2
660 //=======================================================================
661   Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
662                                                      const Standard_Integer nF1,
663                                                      const Standard_Integer nF2,
664                                                      TColStd_ListOfInteger& aSplits)
665 {
666   Standard_Integer nE, iErr;
667   BOPTools_ListIteratorOfListOfPaveBlock aIt;
668   BOPTools_ListOfPaveBlock aLPB;
669   //
670   iErr=SplitsOnFace(0, nF1, nF2, aLPB);
671    if (iErr) {
672     return iErr;
673   }
674
675   aIt.Initialize(aLPB);
676   for (; aIt.More(); aIt.Next()) {
677     const BOPTools_PaveBlock& aPB=aIt.Value();
678     nE=aPB.Edge();
679     aSplits.Append(nE);
680   }
681   return 0; //Ok
682 }