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