1 // Created on: 2001-03-27
2 // Created by: Peter KURNEV
3 // Copyright (c) 2001-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <BOPTools_PaveFiller.ixx>
24 #include <TColStd_ListOfInteger.hxx>
26 #include <BooleanOperations_ShapesDataStructure.hxx>
27 #include <BooleanOperations_OnceExplorer.hxx>
29 #include <BOPTools_ListOfCommonBlock.hxx>
30 #include <BOPTools_ListIteratorOfListOfCommonBlock.hxx>
31 #include <BOPTools_CommonBlock.hxx>
33 //=======================================================================
34 // A P I F U N C T I O N S
35 //=======================================================================
36 // function: SplitsInFace
37 // purpose: splits of edges from nF1 in nF2
38 //=======================================================================
39 Standard_Integer BOPTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
40 const Standard_Integer nF1,
41 const Standard_Integer nF2,
42 TColStd_ListOfInteger& aSplits)
45 TopAbs_ShapeEnum aT1, aT2;
47 aT1=myDS->GetShapeType(nF1);
48 aT2=myDS->GetShapeType(nF2);
50 if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
51 return 1; // Type mismatch
54 BooleanOperations_OnceExplorer aExp(*myDS);
55 aExp.Init(nF1, TopAbs_EDGE);
56 for (; aExp.More(); aExp.Next()) {
58 SplitsInFace (nE1, nF2, aSplits);
62 //=======================================================================
63 // function: SplitsInFace
64 // purpose: splits of edge nE1 in aFace2
65 //=======================================================================
66 Standard_Integer BOPTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
67 const Standard_Integer nF2,
68 TColStd_ListOfInteger& aSplits)
70 Standard_Integer nF1, nSp;
71 TopAbs_ShapeEnum aT1, aT2;
73 aT1=myDS->GetShapeType(nE1);
74 aT2=myDS->GetShapeType(nF2);
76 if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
77 return 1; // Type mismatch
80 const BOPTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
81 BOPTools_ListIteratorOfListOfCommonBlock anItCB(aLCB);
82 for (; anItCB.More(); anItCB.Next()) {
83 BOPTools_CommonBlock& aCB=anItCB.Value();
84 BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
95 //=======================================================================
96 // function: SplitsOnEdge
97 // purpose: splits of edge nE1 on nE2
98 //=======================================================================
99 Standard_Integer BOPTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
100 const Standard_Integer nE2,
101 TColStd_ListOfInteger& aSplits)
103 Standard_Integer nE, nSp;
104 TopAbs_ShapeEnum aT1, aT2;
106 aT1=myDS->GetShapeType(nE1);
107 aT2=myDS->GetShapeType(nE2);
109 if (aT1!=TopAbs_EDGE || aT2!=TopAbs_EDGE) {
110 return 1; // Type mismatch
113 const BOPTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
114 BOPTools_ListIteratorOfListOfCommonBlock anItCB(aLCB);
115 for (; anItCB.More(); anItCB.Next()) {
116 BOPTools_CommonBlock& aCB=anItCB.Value();
117 BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
118 BOPTools_PaveBlock& aPB2=aCB.PaveBlock2(nE1);
119 nE=aPB2.OriginalEdge();
127 //=======================================================================
128 // function: SplitsOnFace
129 // purpose: splits of edge nE1 on face nF2
130 //=======================================================================
131 Standard_Integer BOPTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
132 const Standard_Integer nF2,
133 TColStd_ListOfInteger& aSplits)
135 Standard_Integer nE2, ip;
136 TopAbs_ShapeEnum aT1, aT2;
138 aT1=myDS->GetShapeType(nE1);
139 aT2=myDS->GetShapeType(nF2);
141 if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
142 return 1; // Type mismatch
145 BooleanOperations_OnceExplorer aExp(*myDS);
146 aExp.Init(nF2, TopAbs_EDGE);
147 for (; aExp.More(); aExp.Next()) {
149 ip=SplitsOnEdge(nE1, nE2, aSplits);
156 //=======================================================================
157 // function: SplitsOnFace
158 // purpose: splits of edges from face nF1 on face nF2
159 //=======================================================================
160 Standard_Integer BOPTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
161 const Standard_Integer nF1,
162 const Standard_Integer nF2,
163 TColStd_ListOfInteger& aSplits)
165 Standard_Integer nE1, ip;
166 TopAbs_ShapeEnum aT1, aT2;
168 aT1=myDS->GetShapeType(nF1);
169 aT2=myDS->GetShapeType(nF2);
171 if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
172 return 1; // Type mismatch
175 BooleanOperations_OnceExplorer aExp(*myDS);
176 aExp.Init(nF1, TopAbs_EDGE);
177 for (; aExp.More(); aExp.Next()) {
179 ip=SplitsOnFace(nE1, nF2, aSplits);
186 ///////////////////////////////////////////////////////////////////////////////////
187 //=======================================================================
188 // function: SplitsInFace
189 // purpose: splits of edges from nF1 in nF2
190 //=======================================================================
191 Standard_Integer BOPTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
192 const Standard_Integer nF1,
193 const Standard_Integer nF2,
194 BOPTools_ListOfPaveBlock& aLPB)
196 Standard_Integer nE1;
197 TopAbs_ShapeEnum aT1, aT2;
199 aT1=myDS->GetShapeType(nF1);
200 aT2=myDS->GetShapeType(nF2);
202 if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
203 return 1; // Type mismatch
206 BooleanOperations_OnceExplorer aExp(*myDS);
207 aExp.Init(nF1, TopAbs_EDGE);
208 for (; aExp.More(); aExp.Next()) {
210 SplitsInFace (nE1, nF2, aLPB);
214 //=======================================================================
215 // function: SplitsInFace
216 // purpose: splits of edge nE1 in aFace2
217 //=======================================================================
218 Standard_Integer BOPTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
219 const Standard_Integer nF2,
220 BOPTools_ListOfPaveBlock& aLPB)
222 Standard_Integer nF1;
223 TopAbs_ShapeEnum aT1, aT2;
225 aT1=myDS->GetShapeType(nE1);
226 aT2=myDS->GetShapeType(nF2);
228 if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
229 return 1; // Type mismatch
232 const BOPTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
233 BOPTools_ListIteratorOfListOfCommonBlock anItCB(aLCB);
234 for (; anItCB.More(); anItCB.Next()) {
235 BOPTools_CommonBlock& aCB=anItCB.Value();
236 BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
246 //=======================================================================
247 // function: SplitsOnEdge
248 // purpose: splits of edge nE1 on nE2
249 //=======================================================================
250 Standard_Integer BOPTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
251 const Standard_Integer nE2,
252 BOPTools_ListOfPaveBlock& aLPB)
255 TopAbs_ShapeEnum aT1, aT2;
257 aT1=myDS->GetShapeType(nE1);
258 aT2=myDS->GetShapeType(nE2);
260 if (aT1!=TopAbs_EDGE || aT2!=TopAbs_EDGE) {
261 return 1; // Type mismatch
264 const BOPTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
265 BOPTools_ListIteratorOfListOfCommonBlock anItCB(aLCB);
266 for (; anItCB.More(); anItCB.Next()) {
267 BOPTools_CommonBlock& aCB=anItCB.Value();
268 //BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
269 BOPTools_PaveBlock& aPB2=aCB.PaveBlock2(nE1);
270 nE=aPB2.OriginalEdge();
272 //modified by NIZNHY-PKV Tue Apr 4 16:59:24 2006f
274 const BOPTools_PaveBlock& aPB1R=aCB.PaveBlock1();
276 //modified by NIZNHY-PKV Tue Apr 4 16:59:28 2006t
281 //=======================================================================
282 // function: SplitsOnFace
283 // purpose: splits of edge nE1 on face nF2
284 //=======================================================================
285 Standard_Integer BOPTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
286 const Standard_Integer nF2,
287 BOPTools_ListOfPaveBlock& aLPB)
289 Standard_Integer nE2, ip;
290 TopAbs_ShapeEnum aT1, aT2;
292 aT1=myDS->GetShapeType(nE1);
293 aT2=myDS->GetShapeType(nF2);
295 if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
296 return 1; // Type mismatch
299 BooleanOperations_OnceExplorer aExp(*myDS);
300 aExp.Init(nF2, TopAbs_EDGE);
301 for (; aExp.More(); aExp.Next()) {
303 ip=SplitsOnEdge(nE1, nE2, aLPB);
310 //=======================================================================
311 // function: SplitsOnFace
312 // purpose: splits of edges from face nF1 on face nF2
313 //=======================================================================
314 Standard_Integer BOPTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
315 const Standard_Integer nF1,
316 const Standard_Integer nF2,
317 BOPTools_ListOfPaveBlock& aLPB)
319 Standard_Integer nE1, ip;
320 TopAbs_ShapeEnum aT1, aT2;
322 aT1=myDS->GetShapeType(nF1);
323 aT2=myDS->GetShapeType(nF2);
325 if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
326 return 1; // Type mismatch
329 BooleanOperations_OnceExplorer aExp(*myDS);
330 aExp.Init(nF1, TopAbs_EDGE);
331 for (; aExp.More(); aExp.Next()) {
333 ip=SplitsOnFace(nE1, nF2, aLPB);