1 // Created on: 1996-03-07
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TopOpeBRepBuild_Builder.ixx>
19 #include <TopOpeBRepDS.hxx>
20 #include <TopOpeBRepDS_InterferenceTool.hxx>
21 #include <TopOpeBRepTool_TOOL.hxx>
22 #include <TopOpeBRepTool_ShapeExplorer.hxx>
23 #include <TopOpeBRepTool_ShapeTool.hxx>
25 #include <BRep_Tool.hxx>
28 #include <TopOpeBRepTool_2d.hxx>
29 #include <TopOpeBRepTool_EXPORT.hxx>
30 #include <TopOpeBRepDS_EXPORT.hxx>
31 #include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
32 #include <TopOpeBRepBuild_define.hxx>
35 #include <TopOpeBRepDS_DSX.hxx>
36 Standard_IMPORT void FUN_draw(const TopoDS_Shape& s);
37 Standard_IMPORT void FUN_draw2de (const TopoDS_Shape& ed,const TopoDS_Shape& fa);
41 extern void* GFABUMAKEFACEPWES_DEB;
42 #define DEBSHASET(sarg,meth,shaset,str) TCollection_AsciiString sarg((meth));(sarg)=(sarg)+(shaset).DEBNumber()+(str);
43 Standard_Integer GLOBAL_iexE = 0;
44 Standard_EXPORT void debfillw(const Standard_Integer /*i*/) {}
45 Standard_EXPORT void debfille(const Standard_Integer /*i*/) {}
46 Standard_EXPORT void debffwesON(const Standard_Integer i) {cout<<"++ debffwesON "<<i<<endl;}
47 Standard_EXPORT void debffwesmf(const Standard_Integer i) {cout<<"++ debffwesmf "<<i<<endl;}
48 Standard_EXPORT void debfillf(const Standard_Integer i) {cout<<"++ debfillf "<<i<<endl;}
49 Standard_EXPORT void debsplite(const Standard_Integer i) {cout<<"++ debsplite "<<i<<endl;}
50 Standard_EXPORT void debmergef(const Standard_Integer i) {cout<<"++ debmergef "<<i<<endl;}
51 Standard_IMPORT void debfctwesmess(const Standard_Integer i,
52 const TCollection_AsciiString& s = "");
53 extern void debaddpwes(const Standard_Integer iFOR, const TopAbs_State TB1, const Standard_Integer iEG,
54 const TopAbs_Orientation neworiE, const TopOpeBRepBuild_PBuilder& PB,
55 const TopOpeBRepBuild_PWireEdgeSet& PWES, const TCollection_AsciiString& str1,
56 const TCollection_AsciiString& str2);
59 Standard_Boolean GLOBAL_faces2d = Standard_False;
60 Standard_EXPORT Standard_Boolean GLOBAL_classifysplitedge = Standard_False;
62 #define M_IN(st ) (st == TopAbs_IN)
63 #define M_OUT(st) (st == TopAbs_OUT)
64 #define M_FORWARD(st ) (st == TopAbs_FORWARD)
65 #define M_REVERSED(st) (st == TopAbs_REVERSED)
66 #define M_INTERNAL(st) (st == TopAbs_INTERNAL)
67 #define M_EXTERNAL(st) (st == TopAbs_EXTERNAL)
69 Standard_IMPORT Standard_Boolean FUN_HDS_FACESINTERFER(const TopoDS_Shape& F1,
70 const TopoDS_Shape& F2,
71 const Handle(TopOpeBRepDS_HDataStructure)& HDS);
74 TopAbs_State ClassifyEdgeToSolidByOnePoint(const TopoDS_Edge& E,
75 const TopoDS_Shape& Ref);
77 Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
80 TopOpeBRepDS_PDataStructure& pDS2d);
82 Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
84 TopOpeBRepDS_PDataStructure& pDS2d);
86 //-------------------------------------------------------------
89 //=======================================================================
90 //function :FUN_BUI_FACESINTERFER
92 //=======================================================================
93 static Standard_Boolean FUN_BUI_FACESINTERFER(const TopoDS_Shape& F1,
94 const TopoDS_Shape& F2,
95 const TopOpeBRepBuild_Builder& B)
97 Standard_Boolean yainterf = Standard_False;
98 Handle(TopOpeBRepDS_HDataStructure) HDS = B.DataStructure();
102 Standard_Boolean ya1 = FUN_HDS_FACESINTERFER(F1,F2,HDS);
103 Standard_Boolean ya2 = FUN_HDS_FACESINTERFER(F2,F1,HDS);
104 yainterf = (ya1 && ya2);
109 //=======================================================================
110 //function :TopOpeBRepBuild_FUN_aresamegeom
112 //=======================================================================
113 Standard_Boolean TopOpeBRepBuild_FUN_aresamegeom (const TopoDS_Shape& S1,
114 const TopoDS_Shape& S2)
116 TopoDS_Shape SF1 = S1;
117 SF1.Orientation(TopAbs_FORWARD);
118 TopoDS_Shape SF2 = S2;
119 SF2.Orientation(TopAbs_FORWARD);
120 Standard_Boolean same = TopOpeBRepTool_ShapeTool::ShapesSameOriented(SF1,SF2);
124 //=======================================================================
125 //function :FUN_computeLIFfaces2d
127 //=======================================================================
128 Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
129 const TopoDS_Face& F,
130 const TopoDS_Edge& E,
131 TopOpeBRepDS_PDataStructure& pDS2d)
132 // purpose : compute new face/face interferences F FTRA,
133 // {I = (T(F),ES,FTRA)} / Fsdm F and ES interfers with E which has splits ON
137 Standard_Integer iF;Standard_Boolean tF=BU.GtraceSPS(F,iF);
140 const TopOpeBRepDS_DataStructure& BDS = BU.DataStructure()->DS();
141 const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(E);
142 Standard_Integer IE = BDS.Shape(E);
143 Standard_Integer IF = BDS.Shape(F);
144 Standard_Integer rkF = BDS.AncestorRank(F);
145 Standard_Boolean hasspE = BU.IsSplit(E,TopAbs_ON);
146 if (hasspE) hasspE = (BU.Splits(E,TopAbs_ON).Extent() > 0);
147 TopTools_MapOfShape Ffound;
149 TopTools_ListOfShape Fsdm; TopTools_ListIteratorOfListOfShape itf(BDS.ShapeSameDomain(F));
150 for (; itf.More(); itf.Next()){
151 const TopoDS_Shape& f = itf.Value();
152 Standard_Integer rkf = BDS.AncestorRank(f);
153 if (rkf == rkF) continue;
157 for (TopOpeBRepDS_ListIteratorOfListOfInterference itI(LI); itI.More(); itI.Next()){
158 const Handle(TopOpeBRepDS_Interference)& I = itI.Value();
159 // const TopOpeBRepDS_Transition& T = I->Transition();
160 TopAbs_ShapeEnum SB,SA;Standard_Integer IB,IA;TopOpeBRepDS_Kind GT,ST;Standard_Integer G,S;
161 FDS_Idata(I,SB,IB,SA,IA,GT,G,ST,S);
162 if (ST != TopOpeBRepDS_EDGE) return Standard_False;
164 TopoDS_Face FTRA; Standard_Integer ITRA = IB;
165 if (SB == TopAbs_FACE) FTRA = TopoDS::Face(BDS.Shape(IB));
166 else if (SB == TopAbs_EDGE) {
167 Standard_Boolean ok = FUN_tool_findAncestor(Fsdm,TopoDS::Edge(BDS.Shape(S)),FTRA);
168 ITRA = BDS.Shape(FTRA);
169 if (!ok) return Standard_False;
171 Standard_Boolean found = Ffound.Contains(FTRA);
173 // prequesitory : F and FTRA are SDSO
176 // attached to E : I = (T(FTRA),G,ES),
178 // GP : geometric point
179 // recall : rankE = rankF
180 // rankTRA = rankS != rankE
181 Standard_Real parE = FDS_Parameter(I);
182 const TopoDS_Edge& ES = TopoDS::Edge(BDS.Shape(S));
183 Standard_Boolean hasspES = BU.IsSplit(ES,TopAbs_ON);
184 if (hasspES) hasspE = (BU.Splits(ES,TopAbs_ON).Extent() > 0);
186 Standard_Boolean sdm = FUN_ds_sdm(BDS,E,ES);
187 Standard_Boolean mkTonEsdm = sdm && hasspE && !found;
188 Standard_Boolean hasfeiF_E_FTRA = FUN_ds_hasFEI(pDS2d,F,IE,ITRA); //xpu120698
189 mkTonEsdm = mkTonEsdm && !hasfeiF_E_FTRA; //xpu120698
192 TopoDS_Edge dummy; TopOpeBRepDS_Transition newT;
193 Standard_Boolean ok = FUN_ds_mkTonFsdm(BU.DataStructure(),IF,ITRA,S,IE,parE,dummy,Standard_True,newT);
196 newT.Index(ITRA); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
197 Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,ITRA,IE,Standard_True,C);
199 if (tF) {cout<<"f"<<IF<<" + ";newI->Dump(cout);cout<<endl;}
201 pDS2d->AddShapeInterference(F,newI);
204 Standard_Boolean mkTonESsdm = sdm && hasspES;
205 Standard_Boolean hasfeiFRA_E_F = FUN_ds_hasFEI(pDS2d,FTRA,IE,IF); //xpu120698
206 mkTonESsdm = mkTonESsdm && !hasfeiFRA_E_F; //xpu120698
207 if (mkTonESsdm) { // ff1, IE=3 has interferences, S=8 has none
208 TopoDS_Edge dummy; TopOpeBRepDS_Transition newT;
210 Standard_Real parES; Standard_Boolean ok = FUN_tool_parE(E,parE,ES,parES);
212 ok = FUN_ds_mkTonFsdm(BU.DataStructure(),ITRA,IF,IE,S,parES,dummy,Standard_True,newT);
214 newT.Index(IF); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
215 Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,IF,IE,Standard_False,C);
217 if (tF) {cout<<"f"<<ITRA<<" + ";newI->Dump(cout);cout<<endl;}
219 pDS2d->AddShapeInterference(FTRA,newI);
222 ok = FUN_ds_mkTonFsdm(BU.DataStructure(),ITRA,IF,IE,IE,parE,dummy,Standard_True,newT);
224 newT.Index(IF); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
225 Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,IF,S,Standard_True,C);
227 if (tF) {cout<<endl<<"f"<<ITRA<<" + ";newI->Dump(cout);cout<<endl;}
229 pDS2d->AddShapeInterference(FTRA,newI);
234 Standard_Boolean mkTonES = hasspES;
235 Standard_Boolean hasfeiF_S_FTRA = FUN_ds_hasFEI(pDS2d,F,S,ITRA); //xpu120698
236 mkTonES = mkTonES && !hasfeiF_S_FTRA;
238 Standard_Real parES; Standard_Boolean ok = FUN_tool_parE(E,parE,ES,parES);
241 TopoDS_Edge dummy; TopOpeBRepDS_Transition newT;
242 ok = FUN_ds_mkTonFsdm(BU.DataStructure(),IF,ITRA,S,S,parES,dummy,Standard_True,newT);
245 newT.Index(ITRA); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
246 Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,ITRA,S,Standard_False,C);
248 if (tF) {cout<<"f"<<iF<<" + ";newI->Dump(cout);cout<<endl;}
250 pDS2d->AddShapeInterference(F,newI);
255 return Standard_True;
257 //=======================================================================
258 //function :FUN_computeLIFfaces2d
260 //=======================================================================
261 Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
262 const TopoDS_Face& F,
263 TopOpeBRepDS_PDataStructure& pDS2d)
265 TopExp_Explorer ex(F, TopAbs_EDGE);
266 for (; ex.More(); ex.Next()){
267 const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
268 Standard_Boolean ok = FUN_computeLIFfaces2d(BU,F,E,pDS2d);
269 if (!ok) return Standard_False;
271 return Standard_True;
273 //=======================================================================
274 //variable : Standard_EXPORT TopOpeBRepDS_PDataStructure GLOBAL_DS2d
276 //=======================================================================
277 Standard_EXPORT TopOpeBRepDS_PDataStructure GLOBAL_DS2d = NULL;
279 //=======================================================================
280 //function : GMergeFaces
282 //=======================================================================
283 void TopOpeBRepBuild_Builder::GMergeFaces(const TopTools_ListOfShape& LF1,
284 const TopTools_ListOfShape& LF2,
285 const TopOpeBRepBuild_GTopo& G1)
287 if ( LF1.IsEmpty() ) return;
288 if (GLOBAL_DS2d == NULL) GLOBAL_DS2d = (TopOpeBRepDS_PDataStructure)new TopOpeBRepDS_DataStructure();
291 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
293 const TopoDS_Shape& F1 = LF1.First();
295 Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(F1,iF);
297 cout<<endl<<"--- GMergeFaces "<<endl;
298 GdumpSAMDOM(LF1, (char *) "1 : ");
299 GdumpSAMDOM(LF2, (char *) "2 : ");
304 // xpu070598 : filling up DS2
305 // for (TopTools_ListIteratorOfListOfShape itF1(LF1); itF1.More(); itF1.Next()) GLOBAL_DS2d->AddShape(itF1.Value(),1);
306 TopTools_ListIteratorOfListOfShape itF1(LF1) ;
307 for ( ; itF1.More(); itF1.Next()) GLOBAL_DS2d->AddShape(itF1.Value(),1);
308 // for (TopTools_ListIteratorOfListOfShape itF2(LF2); itF2.More(); itF2.Next()) GLOBAL_DS2d->AddShape(itF2.Value(),2);
309 TopTools_ListIteratorOfListOfShape itF2(LF2) ;
310 for ( ; itF2.More(); itF2.Next()) GLOBAL_DS2d->AddShape(itF2.Value(),2);
312 // for (itF1.Initialize(LF1); itF1.More(); itF1.Next()){
313 itF1.Initialize(LF1) ;
314 for ( ; itF1.More(); itF1.Next()){
315 const TopoDS_Face& FF1 = TopoDS::Face(itF1.Value());
316 FUN_computeLIFfaces2d((*this),TopoDS::Face(FF1),GLOBAL_DS2d);
318 // for (itF2.Initialize(LF2); itF2.More(); itF2.Next()){
319 itF2.Initialize(LF2) ;
320 for ( ; itF2.More(); itF2.Next()){
321 const TopoDS_Face& FF2 = TopoDS::Face(itF2.Value());
322 FUN_computeLIFfaces2d((*this),TopoDS::Face(FF2),GLOBAL_DS2d);
327 for (Standard_Integer ii=1; ii<=GLOBAL_DS2d->NbShapes(); ii++) {
328 TopOpeBRepDS_ListOfInterference& LI = GLOBAL_DS2d->ChangeShapeInterferences(ii);
329 FUN_reducedoublons(LI,(*GLOBAL_DS2d),ii);
333 myFaceReference = TopoDS::Face(F1);
334 TopOpeBRepBuild_WireEdgeSet WES(F1,this);
336 GLOBAL_faces2d = Standard_True;
337 Standard_Integer K1=1; GFillFacesWESK(LF1,LF2,G1,WES,K1);
338 Standard_Integer K3=3; GFillFacesWESK(LF1,LF2,G1,WES,K3); // xpu060598
339 GLOBAL_faces2d = Standard_False;
341 // Create a face builder FABU
342 TopoDS_Shape F1F = LF1.First(); F1F.Orientation(TopAbs_FORWARD);
343 Standard_Boolean ForceClass = Standard_True;
344 TopOpeBRepBuild_FaceBuilder FABU;
345 FABU.InitFaceBuilder(WES,F1F,ForceClass);
347 // Build new faces LFM
348 TopTools_ListOfShape LFM;
351 GFABUMAKEFACEPWES_DEB = (void*)&WES;
354 TopTools_DataMapOfShapeInteger MWisOld;
355 GFABUMakeFaces(F1F,FABU,LFM,MWisOld);
357 // xpu281098 : regularisation after GFABUMakeFaces
358 TopTools_ListOfShape newLFM; RegularizeFaces(F1F,LFM,newLFM);
359 LFM.Clear(); LFM.Assign(newLFM);
361 // connect new faces as faces built TB1 on LF1 faces
362 TopTools_ListIteratorOfListOfShape it1;
363 for (it1.Initialize(LF1); it1.More(); it1.Next()) {
364 const TopoDS_Shape& F1x = it1.Value();
365 Standard_Boolean tomerge = !IsMerged(F1x,TB1);
367 ChangeMerged(F1x, TB1) = LFM;
371 // connect new faces as faces built TB2 on LF2 faces
372 TopTools_ListIteratorOfListOfShape it2;
373 for (it2.Initialize(LF2); it2.More(); it2.Next()) {
374 const TopoDS_Shape& F2 = it2.Value();
375 Standard_Boolean tomerge = !IsMerged(F2,TB2);
376 if (tomerge) ChangeMerged(F2,TB2) = LFM;
381 //=======================================================================
382 //function : GFillFacesWES
384 //=======================================================================
385 void TopOpeBRepBuild_Builder::GFillFacesWES(const TopTools_ListOfShape& ,
386 const TopTools_ListOfShape& ,
387 const TopOpeBRepBuild_GTopo& ,
388 TopOpeBRepBuild_WireEdgeSet& )
392 static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
394 Standard_Integer nE = 0;
395 TopTools_IndexedMapOfShape mEt;
396 TopExp_Explorer exE(F, TopAbs_EDGE);
397 // for ( exE ; exE.More(); exE.Next()) {
398 for ( ; exE.More(); exE.Next()) {
399 const TopoDS_Shape& e = exE.Current();
400 if (mEt.Contains(e)) continue;
405 if (nE > 1) return Standard_True;
407 exE.Init(F, TopAbs_EDGE);
408 const TopoDS_Edge& e = TopoDS::Edge(exE.Current());
409 TopoDS_Vertex dummy; Standard_Boolean closed = TopOpeBRepTool_TOOL::ClosedE(e,dummy);
412 return Standard_False;
415 //=======================================================================
416 //function : GFillFacesWESMakeFaces
418 //=======================================================================
419 void TopOpeBRepBuild_Builder::GFillFacesWESMakeFaces(const TopTools_ListOfShape& LLF1,
420 const TopTools_ListOfShape& LF2,
421 const TopTools_ListOfShape& ,//LSO,
422 const TopOpeBRepBuild_GTopo& GM)
424 TopAbs_State TB1,TB2; GM.StatesON(TB1,TB2);
425 if (LLF1.IsEmpty()) return;
427 // xpu270898 : cto905E2 split(fref6,f33,f16) must be built on fref6
428 TopTools_ListOfShape LF1;
429 TopTools_ListIteratorOfListOfShape itf(LLF1);
430 const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
431 Standard_Integer iref = 0;
432 for (; itf.More(); itf.Next()){
433 const TopoDS_Shape& fcur = itf.Value();
434 Standard_Integer icur = BDS.Shape(fcur);
435 iref = BDS.SameDomainRef(fcur);
436 if (icur == iref) LF1.Prepend(fcur);
437 else LF1.Append(fcur);
439 // xpu270898 : cto905I1 split(f6,f30,fref14) must be built on fref6, f6 is in LFDO1
440 // Standard_Boolean FFinDO1 = (iFF == iref);
441 // const TopoDS_Shape& FF = BDS.Shape(iref);
442 const TopoDS_Shape& FF = LF1.First().Oriented(TopAbs_FORWARD);
443 Standard_Integer iFF = BDS.Shape(FF);
445 TopOpeBRepBuild_WireEdgeSet WES(FF,this);
448 Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FF,iF);
449 if(tSPS) GdumpSHASTA(iF,TB1,WES,"\n--- GFillFacesWESMakeFaces");
450 if(tSPS) debfillf(iF);
451 if(tSPS) debffwesmf(iF);
454 Standard_Integer n1 = 0;
455 GLOBAL_faces2d = Standard_True;
456 Standard_Integer K1=1; GFillFacesWESK(LF1,LF2,GM,WES,K1);
457 GLOBAL_faces2d = Standard_False;
458 n1 = WES.StartElements().Extent();
460 Standard_Integer K2=2; GFillFacesWESK(LF1,LF2,GM,WES,K2);
461 n1 = WES.StartElements().Extent();
463 Standard_Integer K3=3; GFillFacesWESK(LF1,LF2,GM,WES,K3);
464 n1 = WES.StartElements().Extent();
466 Standard_Integer n2 = WES.StartElements().Extent();
467 myEdgeAvoid.Clear(); // Start edges dues a GFillCurveTopologyWES
468 GCopyList(WES.StartElements(),(n1+1),n2,myEdgeAvoid);
469 TopTools_ListOfShape LOF; // LOF : toutes les faces construites sur WES
470 GWESMakeFaces(FF,WES,LOF);
473 //cto 001 F2 : spIN(f18)
474 TopTools_ListIteratorOfListOfShape itF(LOF);
476 const TopoDS_Shape& F = itF.Value();
477 Standard_Boolean valid = ::FUN_validF1edge(F);
478 if (!valid) LOF.Remove(itF);
483 TopTools_ListOfShape LOFS; // LOFS : LOF faces situees TB1/LSO2
484 GKeepShapes(FF,myEmptyShapeList,TB1,LOF,LOFS);
486 // les faces construites (LOFS) prennent l'orientation originale de FF
487 TopAbs_Orientation odsFF = myDataStructure->Shape(iFF).Orientation();
488 for(TopTools_ListIteratorOfListOfShape itt(LOFS);itt.More();itt.Next()) itt.Value().Orientation(odsFF);
490 TopTools_ListIteratorOfListOfShape it1;
491 for (it1.Initialize(LF1); it1.More(); it1.Next()) {
492 const TopoDS_Shape& S = it1.Value();
494 Standard_Integer iS; GtraceSPS(S,iS);
497 TopTools_ListOfShape& LS1 = ChangeSplit(S,TB1);
501 TopTools_ListIteratorOfListOfShape it2;
502 for (it2.Initialize(LF2); it2.More(); it2.Next()) {
503 const TopoDS_Shape& S = it2.Value();
505 Standard_Integer iS; GtraceSPS(S,iS);
508 TopTools_ListOfShape& LS2 = ChangeSplit(S,TB2);
511 } // GFillFacesWESMakeFaces
513 //=======================================================================
514 //function : GFillFaceWES
516 //=======================================================================
517 void TopOpeBRepBuild_Builder::GFillFaceWES(const TopoDS_Shape& FOR1,
518 const TopTools_ListOfShape& LFclass,
519 const TopOpeBRepBuild_GTopo& G1,
520 TopOpeBRepBuild_WireEdgeSet& WES)
522 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
523 Standard_Boolean RevOri1 = G1.IsToReverse1();
526 Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FOR1,iF);
527 if(tSPS) GdumpSHASTA(iF,TB1,WES,"--- GFillFaceWES","START");
528 if(tSPS) debfillf(iF);
531 // xpu200598 bcl1;bcl2; tsp(f9)
532 Standard_Boolean opeCut = Opec12() || Opec21(); //xpu200598
533 Standard_Boolean ComOfCut = opeCut && (TB1 == TB2) && (TB1 == TopAbs_IN); //xpu200598
534 Standard_Boolean hsdm = myDataStructure->HasSameDomain(FOR1);//xpu200598
535 if (hsdm && ComOfCut) return; //xpu200598
537 // work on a FORWARD face FF
538 TopoDS_Shape FF = FOR1; FF.Orientation(TopAbs_FORWARD);
539 myFaceToFill = TopoDS::Face(FF);
541 TopOpeBRepTool_ShapeExplorer exWire(FF,TopAbs_WIRE);
542 for (; exWire.More(); exWire.Next()) {
543 TopoDS_Shape W = exWire.Current();
544 Standard_Boolean hasshape = myDataStructure->HasShape(W);
547 // wire W is not in DS : classify it with LFclass faces
549 Standard_Boolean keep = GKeepShape1(W,LFclass,TB1,pos);
551 TopAbs_Orientation oriW = W.Orientation();
552 TopAbs_Orientation neworiW = Orient(oriW,RevOri1);
553 W.Orientation(neworiW);
556 else if (myProcessON && pos == TopAbs_ON)
559 else { // wire W has edges(s) with geometry : split W edges
560 GFillWireWES(W,LFclass,G1,WES);
565 if(tSPS) GdumpSHASTA(iF,TB1,WES,"--- GFillFaceWES","END");
571 //=======================================================================
572 //function : GFillWireWES
574 //=======================================================================
575 void TopOpeBRepBuild_Builder::GFillWireWES(const TopoDS_Shape& W,
576 const TopTools_ListOfShape& LSclass,
577 const TopOpeBRepBuild_GTopo& G1,
578 TopOpeBRepBuild_WireEdgeSet& WES)
580 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
583 Standard_Integer iW; Standard_Boolean tSPS = GtraceSPS(W,iW);
585 cout<<endl;DEBSHASET(s,"--- GFillWireWES ",WES," ");
586 GdumpSHA(W,(Standard_Address)s.ToCString()); cout<<endl;
587 Standard_Integer nbe = 0;
588 TopOpeBRepTool_ShapeExplorer exE(W,TopAbs_EDGE);for (;exE.More(); exE.Next()) nbe++;
589 cout<<"--- GFillWireWES on W "<<iW<<" with "<<nbe<<" edges "<<endl;
595 TopOpeBRepTool_ShapeExplorer exEdge(W,TopAbs_EDGE);
596 for (; exEdge.More(); exEdge.Next()) {
597 const TopoDS_Shape& EOR = exEdge.Current();
602 // const TopoDS_Edge& ed = TopoDS::Edge(EOR);
603 // Standard_Boolean isdegen = BRep_Tool::Degenerated(ed);
604 // TopLoc_Location L;
605 // Handle(Geom_Surface) S = BRep_Tool::Surface(myFaceToFill,L);
606 // Standard_Boolean isclosed = BRep_Tool::IsClosed(ed,S,L);
607 // TopAbs_Orientation oried = ed.Orientation();
608 // Standard_Boolean trc = Standard_False;
610 // if (trc) {FUN_draw(ed); FUN_draw2de(ed,myFaceReference);}
615 GFillEdgeWES(EOR,LSclass,G1,WES);
620 //=======================================================================
621 //function : GFillEdgeWES
623 //=======================================================================
624 void TopOpeBRepBuild_Builder::GFillEdgeWES(const TopoDS_Shape& EOR,
625 const TopTools_ListOfShape& LSclass,
626 const TopOpeBRepBuild_GTopo& G1,
627 TopOpeBRepBuild_WireEdgeSet& WES)
629 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
632 Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EOR,iE);
637 Standard_Boolean tosplit =
641 Standard_Boolean tomerge =
646 if(tSPS) GdumpSHASTA(iE,TB1,WES,"--- GFillEdgeWES ");
647 if(tSPS) cout<<" tosplit "<<tosplit<<" tomerge "<<tomerge<<endl;
648 if(tSPS) debfille(iE);
651 TopOpeBRepBuild_GTopo GME = G1;
652 GMergeEdgeWES(EOR,GME,WES);
654 TopOpeBRepBuild_GTopo GSE = G1;
655 GSE.ChangeConfig(TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY);
656 GSplitEdgeWES(EOR,LSclass,GSE,WES);
660 static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard_Integer iref, const Standard_Integer ifil,
661 Standard_Boolean& samgeomori)
663 TopOpeBRepDS_Config cfill = BDS.SameDomainOri(ifil);
664 TopAbs_Orientation oref=BDS.Shape(iref).Orientation(), ofil=BDS.Shape(ifil).Orientation();
665 samgeomori = (cfill == TopOpeBRepDS_SAMEORIENTED);
666 if (oref == TopAbs::Complement(ofil)) samgeomori = !samgeomori;
670 #define ONSAMESHA (1)
671 #define CLOSESAME (11)
672 #define ONOPPOSHA (2)
673 #define CLOSEOPPO (22)
674 #define FORREVOPPO (222)
676 //=======================================================================
677 //function : GSplitEdgeWES
679 //=======================================================================
680 void TopOpeBRepBuild_Builder::GSplitEdgeWES(const TopoDS_Shape& EOR,
681 const TopTools_ListOfShape& LSclass,
682 const TopOpeBRepBuild_GTopo& G1,
683 TopOpeBRepBuild_WireEdgeSet& WES)
685 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
686 Standard_Boolean RevOri1 = G1.IsToReverse1();
687 TopAbs_Orientation oriE = EOR.Orientation();
688 TopAbs_Orientation neworiE = Orient(oriE,RevOri1);
689 const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
691 TopAbs_Orientation oEinF;
692 Standard_Integer Oinref = 0;
693 Standard_Boolean hsdm = myDataStructure->HasSameDomain(myFaceToFill);
694 Standard_Boolean hsdmE = myDataStructure->HasSameDomain(EOR);
695 Standard_Integer ifil = myDataStructure->Shape(myFaceToFill);
696 Standard_Integer iref = myDataStructure->Shape(myFaceReference);
698 Oinref = FUN_ds_oriEinF(BDS,TopoDS::Edge(EOR),myFaceReference,oEinF); //xpu060598
700 // xpu150998 : cto900P6 : e35ou added to fref34,f53, oEinF=REVERSED, oEinfill=FORWARD
701 TopAbs_Orientation oEinfill;
702 Standard_Integer Oinfill = FUN_ds_oriEinF(BDS,TopoDS::Edge(EOR),myFaceToFill,oEinfill);
703 if (Oinref == Oinfill) {
705 Standard_Boolean reverse = Standard_False;
707 // xpu230299 : FRA60275 (e6,fref4,ffill7) + PRO16297
708 TopAbs_Orientation oref = myFaceReference.Orientation();
709 Standard_Boolean samegeomori; FUN_samgeomori(BDS,iref,ifil,samegeomori);
710 reverse = (!samegeomori);
711 if (oref == TopAbs_REVERSED) reverse = !reverse;
713 // TopAbs_Orientation oref=myFaceReference.Orientation(), ofill=myFaceToFill.Orientation();
714 // Standard_Boolean reverse = (oref != ofill);
716 TopAbs_Orientation oEinfillTOref = reverse ? TopAbs::Complement(oEinfill) : oEinfill;
717 Standard_Boolean same = (oEinF == oEinfillTOref);
718 if (!same && (oEinF!=TopAbs_INTERNAL) && (oEinF!=TopAbs_EXTERNAL)) oEinF = oEinfillTOref;
721 else Oinref = FUN_ds_oriEinF(BDS,TopoDS::Edge(EOR),myFaceToFill,oEinF); //xpu060598
722 Standard_Boolean newO = (Oinref == ONSAMESHA) || (Oinref == ONOPPOSHA); //xpu060598
724 Standard_Boolean isfafa = (myIsKPart == 3);
725 if (isfafa) newO = Standard_False;// xpu110598
727 // if (fus) : faces are SDSO : we keep original edge's orientation
728 // if (com) : faces are SDSO : we keep original edge's orientation
729 // if (cut && TBToFill==OUT) : myFaceToFill is the reference face,
730 // we keep original edge's orientation
733 Standard_Integer iEOR; Standard_Boolean tSPS = GtraceSPS(EOR,iEOR);
734 Standard_Integer iWESF; /*Standard_Boolean tSPSW = */GtraceSPS(WES.Face(),iWESF);
735 if(tSPS) GdumpSHASTA(iEOR,TB1,WES,"\n--- GSplitEdgeWES","START");
736 if(tSPS) cout<<" RevOri1 : "<<RevOri1<<endl;
737 if(tSPS) debsplite(iEOR);
740 Standard_Boolean tosplit = GToSplit(EOR,TB1);
742 GSplitEdge(EOR,G1,LSclass);
743 //modified by NIZNHY-PKV Mon Mar 19 16:53:40 2001 f
745 // Only solids are available here
747 Standard_Integer aRank1;
748 TopTools_ListOfShape anAuxList;
750 aRank1=ShapeRank(EOR);
751 const TopoDS_Shape& aSolid=(aRank1==1) ? myShape2 : myShape1;
753 TopTools_ListOfShape& aSplitList = ChangeSplit (EOR, TB1);
754 TopTools_ListIteratorOfListOfShape anIt(aSplitList);
755 for (; anIt.More(); anIt.Next()) {
756 const TopoDS_Edge& aSplitEdge=TopoDS::Edge (anIt.Value());
757 aState=ClassifyEdgeToSolidByOnePoint (aSplitEdge, aSolid);
759 anAuxList.Append (aSplitEdge);
765 anIt.Initialize(anAuxList);
766 for (; anIt.More(); anIt.Next()) {
767 const TopoDS_Shape& aShape=anIt.Value();
768 aSplitList.Append(aShape);
771 //modified by NIZNHY-PKV Mon Mar 19 16:53:44 2001 t
774 //xpu200598 : never add spIN in fusion
775 Standard_Boolean opeFus = Opefus(); //xpu200598
776 if (opeFus) //xpu200598
777 if (TB1 == TopAbs_IN) return; //xpu200598
779 Standard_Boolean issplit = IsSplit(EOR,TB1);
781 const TopTools_ListOfShape& LSE = Splits(EOR,TB1);
785 GdumpSHASTA(iEOR,TB1,WES,"--- GSplitEdgeWES","WES+ Split");
786 cout<<" ";TopAbs::Print(TB1,cout)<<" : "<<LSE.Extent()<<" edge(s) ";
787 TopAbs::Print(neworiE,cout); cout<<endl;
791 for (TopTools_ListIteratorOfListOfShape it(LSE);
792 it.More(); it.Next()) {
793 TopoDS_Edge newE = TopoDS::Edge(it.Value());
794 if (newO) {// xpu060598
795 // PRO13075 tspIN(f18), tspIN(e17)
796 // we add sp(EOR) to myFaceToFill with its orientation
797 newE.Orientation(oEinF);
798 Standard_Boolean dgE = BRep_Tool::Degenerated(TopoDS::Edge(EOR));
800 Standard_Real f,l; FUN_tool_bounds(newE,f,l);
801 Standard_Real x = 0.45678; Standard_Real par = (1-x)*f + x*l;
802 Standard_Boolean so = Standard_True;
803 Standard_Boolean ok = FUN_tool_curvesSO(newE,par,TopoDS::Edge(EOR),so);
806 cout<<"GSplitEdgeWES: cannot orient SDM split of an edge"<<endl;
808 //return; // nyiFUNRAISE
815 else newE.Orientation(neworiE);
818 if (tSPS) debaddpwes(iWESF,TB1,iEOR,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GSplitEdgeWES " ,"WES+ Eisspl ");
821 WES.AddStartElement(newE);
826 // EOR sans devenir de Split par TB1 : on la garde si elle est situee TB1 / LSclass
827 Standard_Boolean se = BDS.IsSectionEdge(TopoDS::Edge(EOR));
828 Standard_Boolean hs = myDataStructure->HasShape(EOR);
829 Standard_Boolean hg = myDataStructure->HasGeometry(EOR);
830 Standard_Boolean add = Standard_False;
831 Standard_Boolean addON = Standard_False;
833 Standard_Boolean isstart = Standard_False;
837 Standard_Boolean ftg = !LSclass.IsEmpty();
838 TopAbs_ShapeEnum tclass = LSclass.First().ShapeType();
839 ftg = ftg && (tclass == TopAbs_FACE);
842 Standard_Boolean keepse = GKeepShape1(EOR,LSclass,TB1,pos);
845 else if (myProcessON && pos == TopAbs_ON)
846 addON = Standard_True;
850 cout<<"o-o GridFF ffil F"<<ifil<<" se E"<<iEOR<<" / "<<iWESF<<" ";
851 TopAbs::Print(TB1,cout);cout.flush();
852 Standard_Boolean tse = TopOpeBRepDS_GettraceSPSX(iEOR);
853 TopOpeBRepDS_SettraceSPSX(iEOR,Standard_True);
854 if (!ftg) {cout<<" : !ftg --> "; GKeepShape(EOR,LSclass,TB1);cout.flush();}
855 else {cout<<" : ftg --> non gardee"<<endl;cout.flush();}
856 TopOpeBRepDS_SettraceSPSX(iEOR,tse);
862 Standard_Boolean testkeep = Standard_True;
863 testkeep = hs && (!hg);
866 if(tSPS){cout<<"--- GSplitEdgeWES ";}
869 Standard_Boolean keep = GKeepShape1(EOR,LSclass,TB1,pos);
871 Standard_Boolean testON = (!LSclass.IsEmpty());
872 if (testON) testON = (LSclass.First().ShapeType() == TopAbs_SOLID);
873 if (testON) keep = (pos == TopAbs_ON);
874 addON = myProcessON && keep;
881 TopoDS_Shape newE = EOR;
883 if (newO) newE.Orientation(oEinF);// xpu060598
884 else if (Oinref == FORREVOPPO) newE.Orientation(TopAbs_INTERNAL);// xpu120898 (PRO14785 : e36 shared by f34 & f39,
885 // faces sdm with f16)
886 else newE.Orientation(neworiE);
889 DEBSHASET(ss,"--- GSplitEdgeWES ",WES," WES+ edge ");
890 GdumpSHA(newE,(Standard_Address)ss.ToCString());
891 cout<<" ";TopAbs::Print(TB1,cout)<<" : 1 edge ";
892 TopAbs::Print(neworiE,cout); cout<<endl;
898 if (tSPS) debaddpwes(iWESF,TB1,iEOR,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GSplitEdgeWES " ,"WES+ Enospl ");
900 WES.AddStartElement(newE);
903 WES.AddElement(newE);
908 TopoDS_Shape newE = EOR;
909 newE.Orientation(neworiE);
910 myONElemMap.Add(newE);
914 if (myProcessON && IsSplit(EOR,TopAbs_ON)) {
915 const TopTools_ListOfShape& LSE = Splits(EOR,TopAbs_ON);
916 TopTools_ListIteratorOfListOfShape it(LSE);
917 for (; it.More(); it.Next()) {
918 TopoDS_Edge newE = TopoDS::Edge(it.Value());
920 newE.Orientation(oEinF);
921 Standard_Boolean dgE = BRep_Tool::Degenerated(TopoDS::Edge(EOR));
923 Standard_Real f,l; FUN_tool_bounds(newE,f,l);
924 Standard_Real x = 0.45678; Standard_Real par = (1-x)*f + x*l;
925 Standard_Boolean so = Standard_True;
926 Standard_Boolean ok = FUN_tool_curvesSO(newE,par,TopoDS::Edge(EOR),so);
929 cout<<"GSplitEdgeWES: cannot orient SDM split of an edge"<<endl;
932 if (!so) newE.Reverse();
935 else newE.Orientation(neworiE);
936 myONElemMap.Add(newE);
941 if(tSPS) GdumpSHASTA(iEOR,TB1,WES,"--- GSplitEdgeWES","END");
947 Standard_IMPORT Standard_Boolean FUN_ismotheropedef();
948 Standard_IMPORT const TopOpeBRepBuild_GTopo& FUN_motherope();
949 Standard_EXPORT Standard_Boolean GLOBAL_IEtoMERGE = 0; // xpu240498
952 void debmergee(const Standard_Integer /*i*/) {}
955 //=======================================================================
956 //function : GMergeEdgeWES
958 //=======================================================================
959 void TopOpeBRepBuild_Builder::GMergeEdgeWES(const TopoDS_Shape& EOR,
960 const TopOpeBRepBuild_GTopo& G1,
961 TopOpeBRepBuild_WireEdgeSet& WES)
964 Standard_Integer iWESF; /*Standard_Boolean tSPSW = */GtraceSPS(WES.Face(),iWESF);
965 Standard_Integer iEOR; Standard_Boolean tSPS = GtraceSPS(EOR,iEOR);
966 if(tSPS){ debmergee(iEOR);
967 DEBSHASET(s,"\n--- GMergeEdgeWES ",WES," START ");
968 GdumpSHAORIGEO(EOR,(Standard_Address)s.ToCString()); cout<<endl;
972 Standard_Boolean closing = BRep_Tool::IsClosed(TopoDS::Edge(EOR),myFaceToFill); // xpu050598
973 if (closing) return; // xpu050598
975 if (Opefus()) return;
977 // const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
978 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
979 Standard_Boolean RevOri1 = G1.IsToReverse1();
980 TopAbs_Orientation oriE = EOR.Orientation();
981 TopAbs_Orientation neworiE = Orient(oriE,RevOri1);
983 Standard_Boolean hassame = myDataStructure->HasSameDomain(EOR);
984 if (!hassame) return;
986 Standard_Boolean Eisref = Standard_False;
988 Standard_Integer iEref = myDataStructure->SameDomainReference(EOR);
989 const TopoDS_Shape& Eref = myDataStructure->Shape(iEref);
990 Eisref = EOR.IsSame(Eref);
993 TopAbs_State TBEOR = (Eisref) ? TB1 : TB2;
994 if (TBEOR == TopAbs_OUT) return; //xpu040598
996 Standard_Boolean ismerged = IsMerged(EOR,TBEOR);
1000 const TopTools_ListOfShape& ME = Merged(EOR,TBEOR);
1001 TopTools_ListIteratorOfListOfShape it(ME);
1002 for(; it.More(); it.Next()) {
1003 TopoDS_Shape newE = it.Value();
1004 newE.Orientation(neworiE);
1007 if (tSPS) debaddpwes(iWESF,TB1,iEOR,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GMergeEdgeWES " ,"WES+ Emerge ");
1010 WES.AddStartElement(newE);
1015 ChangeMerged(EOR,TBEOR) = myEmptyShapeList;
1016 TopAbs_State stspEOR;
1017 // if (isfafa) stspEOR = TBEOR; // xpu110598
1018 // else stspEOR = (TBEOR == TopAbs_IN) ? TopAbs_ON : TopAbs_OUT;
1019 stspEOR = TBEOR; // xpu120598
1021 Standard_Boolean issplit = IsSplit(EOR,stspEOR);
1022 if (!issplit) return;
1024 ChangeMerged(EOR,TBEOR) = Splits(EOR,stspEOR);
1026 const TopTools_ListOfShape& ME = Merged(EOR,TBEOR);
1029 DEBSHASET(s,"GMergeEdgeWES(1) ",WES," WES+ Merged ");
1030 GdumpSHA(EOR,(Standard_Address)s.ToCString());
1031 cout<<" ";TopAbs::Print(TBEOR,cout);
1032 cout<<" : "<<ME.Extent()<<" edge"<<endl;
1035 for(TopTools_ListIteratorOfListOfShape it(ME);it.More();it.Next()) {
1036 TopoDS_Shape newE = it.Value();
1037 newE.Orientation(neworiE);
1038 WES.AddStartElement(newE);
1043 DEBSHASET(sss,"GMergeEdgeWES ",WES," END ");
1044 GdumpSHA(EOR,(Standard_Address)sss.ToCString());cout<<endl;
1050 //=======================================================================
1051 //function : GSplitEdge
1053 //=======================================================================
1054 void TopOpeBRepBuild_Builder::GSplitEdge(const TopoDS_Shape& EOR,
1055 const TopOpeBRepBuild_GTopo& G1,
1056 const TopTools_ListOfShape& LSclass)
1058 TopAbs_ShapeEnum t1,t2;
1060 TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
1061 // work on a FORWARD edge <EF>
1062 TopoDS_Shape EF = EOR; EF.Orientation(TopAbs_FORWARD);
1065 Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EOR,iE);
1066 if (tSPS) GdumpSHASTA(EOR,TB1,"--- GSplitEdge ","\n");
1067 if (tSPS) GdumpEDG(EF);
1068 if (tSPS) debsplite(iE);
1071 const TopoDS_Edge& EEF = TopoDS::Edge(EF);
1072 Standard_Boolean isse = myDataStructure->DS().IsSectionEdge(EEF);
1073 Standard_Boolean issplitON = IsSplit(EEF,TopAbs_ON);
1074 Standard_Boolean takeON = (TB1 == TopAbs_IN) && (isse) && (issplitON);
1075 takeON = Standard_False;
1077 if (tSPS) cout<<"---- takeON mis a 0"<<endl;
1083 if (tSPS) GdumpSHASTA(EOR,TB1,"--- GSplitEdge takeON ","\n");
1087 TopTools_ListOfShape& SSEL = ChangeSplit(EF,TB1);
1089 SSEL = Splits(EEF,TopAbs_ON);
1093 TopTools_ListOfShape LOE;
1095 // Make a PaveSet PVS on edge EF
1096 TopOpeBRepBuild_PaveSet PVS(EF);
1098 // Add the point topology found on edge EF in PVS
1099 myEdgeReference = TopoDS::Edge(EF);
1100 GFillPointTopologyPVS(EF,G1,PVS);
1102 // mark EF as split TB1
1105 // build the new edges LOE on EF from the Parametrized Vertex set PVS
1106 GPVSMakeEdges(EF,PVS,LOE);
1108 Standard_Boolean novertex = LOE.IsEmpty();
1109 if (novertex) return;
1111 TopTools_ListOfShape& SEL = ChangeSplit(EF,TB1);
1113 // NYI ne pas faire de classification des aretes reconstruites / liste de solides
1114 // NYI dans le cas ou l'appel a SplitEdge est utilise pour construire les parties
1115 // NYI (TopAbs_ON,SOLID) (i.e par la construction des parties (TopAbs_IN,FACE)).
1116 TopOpeBRepDS_Config c1 = G1.Config1(),c2 = G1.Config2();
1117 Standard_Boolean UUFACE = (c1==TopOpeBRepDS_UNSHGEOMETRY && c2==TopOpeBRepDS_UNSHGEOMETRY);
1119 Standard_Boolean ONSOLID = Standard_False;
1120 if ( ! LSclass.IsEmpty() ) {
1121 TopAbs_ShapeEnum t = LSclass.First().ShapeType();
1122 ONSOLID = (t == TopAbs_SOLID);
1125 Standard_Boolean toclass = UUFACE;
1126 toclass = ! ONSOLID;
1128 TopTools_ListOfShape loos;
1129 const TopTools_ListOfShape* pls;
1130 if (GLOBAL_classifysplitedge) {
1131 Standard_Integer r=GShapeRank(EOR);
1132 TopoDS_Shape oos=myShape1;
1133 if (r==1) oos = myShape2;
1134 if (!oos.IsNull()) loos.Append(oos); // PMN 5/03/99 Nothing to append
1141 pls = &myEmptyShapeList;
1144 TopTools_ListOfShape aLON;
1145 TopTools_ListIteratorOfListOfShape it(LOE);
1146 for(;it.More();it.Next()) {
1147 const TopoDS_Shape& aE = it.Value();
1149 if (GKeepShape1(aE,*pls,TB1,pos))
1151 else if (myProcessON && pos == TopAbs_ON)
1155 if (!aLON.IsEmpty()) {
1156 MarkSplit(EF,TopAbs_ON);
1157 TopTools_ListOfShape& aSLON = ChangeSplit(EF,TopAbs_ON);
1164 //modified by NIZNHY-PKV Mon Mar 19 16:50:33 2001 f
1165 #include <BRepClass3d_SolidClassifier.hxx>
1166 //=======================================================================
1167 //function : ClassifyEdgeToSolidByOnePoint
1169 //=======================================================================
1170 TopAbs_State ClassifyEdgeToSolidByOnePoint(const TopoDS_Edge& E,
1171 const TopoDS_Shape& Ref)
1173 const Standard_Real PAR_T = 0.43213918;//10.*e^-PI
1174 Standard_Real f2 = 0., l2 = 0., par = 0.;
1176 Handle(Geom_Curve) C3D = BRep_Tool::Curve(E, f2, l2);
1180 //it means that we are in degenerated edge
1181 const TopoDS_Vertex& fv = TopExp::FirstVertex(E);
1183 return TopAbs_UNKNOWN;
1184 aP3d = BRep_Tool::Pnt(fv);
1187 par = f2*PAR_T + (1 - PAR_T)*l2;
1188 C3D -> D0(par, aP3d);
1191 BRepClass3d_SolidClassifier SC(Ref);
1192 SC.Perform(aP3d, 1e-7);
1196 //modified by NIZNHY-PKV Mon Mar 19 16:50:36 2001 t