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