1 // Created on: 1994-02-17
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1994-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 under
9 // the terms of the GNU Lesser General Public License 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.
18 #include <Bnd_Box.hxx>
19 #include <BndLib_Add3dCurve.hxx>
20 #include <BRep_Tool.hxx>
21 #include <BRepTools.hxx>
23 #include <Precision.hxx>
24 #include <Standard_CString.hxx>
25 #include <TColStd_ListIteratorOfListOfInteger.hxx>
26 #include <TColStd_ListOfInteger.hxx>
29 #include <TopoDS_Face.hxx>
30 #include <TopoDS_Shape.hxx>
31 #include <TopOpeBRep.hxx>
32 #include <TopOpeBRep_define.hxx>
33 #include <TopOpeBRep_FacesFiller.hxx>
34 #include <TopOpeBRep_FacesIntersector.hxx>
35 #include <TopOpeBRep_FFDumper.hxx>
36 #include <TopOpeBRep_FFTransitionTool.hxx>
37 #include <TopOpeBRep_GeomTool.hxx>
38 #include <TopOpeBRep_LineInter.hxx>
39 #include <TopOpeBRep_PointClassifier.hxx>
40 #include <TopOpeBRep_PointGeomTool.hxx>
41 #include <TopOpeBRep_VPointInter.hxx>
42 #include <TopOpeBRep_VPointInterClassifier.hxx>
43 #include <TopOpeBRep_VPointInterIterator.hxx>
44 #include <TopOpeBRepDS_Curve.hxx>
45 #include <TopOpeBRepDS_DataStructure.hxx>
46 #include <TopOpeBRepDS_Dumper.hxx>
47 #include <TopOpeBRepDS_HDataStructure.hxx>
48 #include <TopOpeBRepDS_Interference.hxx>
49 #include <TopOpeBRepDS_InterferenceTool.hxx>
50 #include <TopOpeBRepDS_Point.hxx>
51 #include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
52 #include <TopOpeBRepDS_Transition.hxx>
53 #include <TopOpeBRepTool_defineG.hxx>
54 #include <TopOpeBRepTool_EXPORT.hxx>
55 #include <TopOpeBRepTool_makeTransition.hxx>
56 #include <TopOpeBRepTool_TOOL.hxx>
59 #include <TopOpeBRep_DRAW.hxx>
63 Standard_EXPORT void debrest(const Standard_Integer i) {cout<<"+ debrest "<<i<<endl;}
64 Standard_EXPORT void debrline() {cout<<"+ debrline"<<endl;}
66 extern Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer a,Standard_Integer b,Standard_Integer c,Standard_Integer d,Standard_Integer e);
67 extern Standard_Boolean GLOBAL_bvpr;
68 extern void debvprmess(Standard_Integer f1,Standard_Integer f2,Standard_Integer il,Standard_Integer vp,Standard_Integer si);
69 extern Standard_Boolean TopOpeBRep_GetcontextNOPUNK();
72 static void FUN_traceRLine(const TopOpeBRep_LineInter& L)
75 TCollection_AsciiString ee("Edofline"); ee.Cat(L.Index()); char* eee = ee.ToCString();
76 DBRep::Set(eee,L.Arc());
80 static void FUN_traceRLine(const TopOpeBRep_LineInter&)
87 static void FUN_traceGLine(const TopOpeBRep_LineInter& L)
89 static void FUN_traceGLine(const TopOpeBRep_LineInter&)
93 TCollection_AsciiString ll("Glineof"); ll.Cat(L.Index()); char* lll = ll.ToCString();
94 Handle(Geom_Curve) c = L.Curve();
95 Standard_Integer iINON1,iINONn,nINON; L.VPBounds(iINON1,iINONn,nINON);
96 Standard_Real par1 = L.VPoint(iINON1).ParameterOnLine();
97 Standard_Real parn = L.VPoint(iINONn).ParameterOnLine();
98 Standard_Boolean isperiodic = L.IsPeriodic();
99 Handle(Geom_TrimmedCurve) tc = new Geom_TrimmedCurve(c,par1,parn,Standard_True);
100 DrawTrSurf::Set(lll,tc);
105 #define M_FORWARD(o) (o == TopAbs_FORWARD)
106 #define M_REVERSED(o) (o == TopAbs_REVERSED)
114 Standard_EXPORT void FUN_GetdgData(TopOpeBRepDS_PDataStructure& pDS,const TopOpeBRep_LineInter& L,
115 const TopoDS_Face& F1,const TopoDS_Face& F2, TopTools_DataMapOfShapeListOfShape& datamap);
116 Standard_EXPORT void FUN_FillVof12(const TopOpeBRep_LineInter& L,TopOpeBRepDS_PDataStructure pDS);
118 #define M_FINDVP (0) // only look for new vp
119 #define M_MKNEWVP (1) // only make newvp
120 #define M_GETVP (2) // steps (0) [+(1) if (O) fails]
121 Standard_EXPORT void FUN_VPIndex(TopOpeBRep_FacesFiller& FF,
122 const TopOpeBRep_LineInter& L,
123 const TopOpeBRep_VPointInter& VP,
124 const Standard_Integer ShapeIndex,
125 const Handle(TopOpeBRepDS_HDataStructure)& HDS,
126 const TopOpeBRepDS_ListOfInterference& DSCIL,
127 TopOpeBRepDS_Kind& PVKind, Standard_Integer& PVIndex, // out
128 Standard_Boolean& EPIfound, Handle(TopOpeBRepDS_Interference)& IEPI, // out
129 Standard_Boolean& CPIfound, Handle(TopOpeBRepDS_Interference)& ICPI, // out
130 const Standard_Integer mkVP);
131 Standard_EXPORT Standard_Boolean FUN_newtransEdge(const Handle(TopOpeBRepDS_HDataStructure) HDS,
132 const TopOpeBRep_FacesFiller& FF,
133 const TopOpeBRep_LineInter& L,
134 const Standard_Boolean& Lonrest,
135 const TopOpeBRep_VPointInter& VP,
136 const TopOpeBRepDS_Kind PVKind, const Standard_Integer PVIndex,
137 const Standard_Integer& OOShapeIndex,
138 const TopoDS_Edge& edge, const TopTools_ListOfShape& ERL, TopOpeBRepDS_Transition& T);
139 #define M_INTERNAL(st) (st == TopAbs_INTERNAL)
142 static Standard_Boolean FUN_IwithsuppiS(const TopOpeBRepDS_ListOfInterference& loI, const Standard_Integer iS, TopOpeBRepDS_ListOfInterference& loIfound)
144 TopOpeBRepDS_ListIteratorOfListOfInterference it(loI);
145 for (; it.More(); it.Next()) {const Handle(TopOpeBRepDS_Interference)& I = it.Value();
146 if (I->Support() == iS) loIfound.Append(I);}
147 Standard_Boolean ok = (loIfound.Extent() > 0);
150 static Standard_Boolean FUN_IwithsuppkS(const TopOpeBRepDS_ListOfInterference& loI, const TopOpeBRepDS_Kind& kS, TopOpeBRepDS_ListOfInterference& loIfound)
152 TopOpeBRepDS_ListIteratorOfListOfInterference it(loI);
153 for (; it.More(); it.Next()) {const Handle(TopOpeBRepDS_Interference)& I = it.Value();
154 if (I->SupportType() == kS) loIfound.Append(I);}
155 Standard_Boolean ok = (loIfound.Extent() > 0);
158 static Standard_Boolean FUN_IwithToniS(const TopOpeBRepDS_ListOfInterference& loI, const Standard_Integer iS, TopOpeBRepDS_ListOfInterference& loIfound)
160 TopOpeBRepDS_ListIteratorOfListOfInterference it(loI);
161 for (; it.More(); it.Next()) {const Handle(TopOpeBRepDS_Interference)& I = it.Value();
162 if (I->Transition().Index() == iS) loIfound.Append(I);}
163 Standard_Boolean ok = (loIfound.Extent() > 0);
166 static Standard_Boolean FUN_supponF(const TopOpeBRepDS_PDataStructure pDS,
167 const TopOpeBRepDS_ListOfInterference& loI, const Standard_Integer iF,
168 TopOpeBRepDS_ListOfInterference& lIsupponF, TColStd_ListOfInteger& losupp)
170 //<losupp> = list of support S / I in <loI> : I = (T,G,S = Edge on <F>);
171 Standard_Boolean ok = (0 < iF) && (iF <= pDS->NbShapes());
172 if (!ok) return Standard_False;
174 TopTools_IndexedMapOfShape MOOE; TopExp::MapShapes(pDS->Shape(iF),TopAbs_EDGE,MOOE);
175 TopOpeBRepDS_ListIteratorOfListOfInterference it(loI);
176 for (; it.More(); it.Next()){
177 const Handle(TopOpeBRepDS_Interference)& I = it.Value(); Standard_Integer iS = I->Support();
178 TopOpeBRepDS_Kind skind = I->SupportType();
179 Standard_Boolean add = Standard_False;
180 if (skind == TopOpeBRepDS_EDGE) add = MOOE.Contains(pDS->Shape(iS));
181 if (add) {losupp.Append(iS); lIsupponF.Append(I);}
183 if (losupp.Extent() < 1) return Standard_False;
184 return Standard_True;
186 static Standard_Boolean FUN_IoflSsuppS(const TopOpeBRepDS_PDataStructure pDS,
187 const Standard_Integer iS,const TColStd_ListOfInteger& lShape,
188 TopOpeBRepDS_ListOfInterference& IsuppiS)
190 Standard_Boolean ok = Standard_False;
192 // I on E : I = (T, G, S=iS)
194 // looking for interferences attached to shapes of <lShape> with support <iS>
195 TColStd_ListIteratorOfListOfInteger iti(lShape);
196 for (; iti.More(); iti.Next()){
197 const TopOpeBRepDS_ListOfInterference& lI = pDS->ShapeInterferences(iti.Value());
198 ok = FUN_IwithsuppiS(lI,iS,IsuppiS);
203 //=======================================================================
205 // purpose : The compute of a transition edge/face given interferences
206 // attached to the edge (stored in the DS).
207 //=======================================================================
208 static Standard_Boolean FUN_findTF(const TopOpeBRepDS_PDataStructure pDS,
209 const Standard_Integer iE, const Standard_Integer, const Standard_Integer iOOF,
210 TopOpeBRepDS_Transition& TF)
212 Standard_Real factor = 0.5;
213 // ----------------------------------------------------------------------
214 // <Ifound> on <E> : Ifound = (T, S=OOF, G=POINT/VERTEX on <E>)
215 // (T, S=edge of OOF, G=POINT/VERTEX on <E>)
216 // ----------------------------------------------------------------------
219 TopOpeBRepDS_ListOfInterference lITonOOF;
220 Standard_Boolean ok = FUN_IwithToniS(pDS->ShapeInterferences(iE),iOOF,lITonOOF);
221 if (!ok) return Standard_False;
222 TopOpeBRepDS_ListOfInterference lITOOFskFACE;
223 Standard_Boolean found = FUN_IwithsuppkS(lITonOOF,TopOpeBRepDS_FACE,lITOOFskFACE);
225 // NYI : a deeper analysis is needed, for the moment, we make the following
226 // prequesitory : transition on E of F on point of ES is valid for
227 // all the ES (here restriction) ie :
228 // TF : transition face(F) / face(OOF) on G = ES =
229 // TE : transition edge(E) / face(OOF) at G = POINT/VERTEX
230 //Ifound on <E> : Ifound = (T(on face OOF), S=FACE, G=POINT/VERTEX on <E>)
231 const Handle(TopOpeBRepDS_Interference)& Ifound = lITOOFskFACE.First();
232 TF = Ifound->Transition();
235 Standard_Boolean done = Standard_False;
236 TopOpeBRepDS_ListOfInterference lITOOFskEDGE;
237 if (!found) done = FUN_IwithsuppkS(lITonOOF,TopOpeBRepDS_EDGE,lITOOFskEDGE);
239 // Ifound on <E> : Ifound = (T(on face OOF), S=FACE, G=POINT/VERTEX on <E>)
240 // if <Ifound> found : compute TE at G / <OOF>.
242 const Handle(TopOpeBRepDS_Interference)& Ifound = lITOOFskEDGE.First();
243 const TopoDS_Edge& OOE = TopoDS::Edge(pDS->Shape(Ifound->Support()));
244 Standard_Real paronE; Standard_Boolean OOdone = FDS_Parameter(Ifound,paronE);
245 if (!OOdone) return Standard_False;
247 const TopoDS_Edge& E = TopoDS::Edge(pDS->Shape(iE));
248 const TopoDS_Face& OOF = TopoDS::Face(pDS->Shape(iOOF));
250 Standard_Real f,l; FUN_tool_bounds(E,f,l);
251 TopOpeBRepTool_makeTransition MKT;
253 Standard_Boolean OOEboundOOF = FUN_tool_EboundF(OOE,OOF);
254 Standard_Boolean iscl = TopOpeBRepTool_TOOL::IsClosingE(OOE,OOF);
255 if (OOEboundOOF && (!iscl)) {
256 Standard_Real oopar; Standard_Boolean ok1 = FUN_tool_parE(E,paronE,OOE,oopar);
257 if (!ok1) return Standard_False;
258 gp_Pnt2d uv; ok1 = FUN_tool_paronEF(OOE,oopar,OOF,uv);
259 if (!ok1) return Standard_False;
261 ok = MKT.Initialize(E,f,l,paronE, OOF,uv, factor);
262 if (ok) ok = MKT.SetRest(OOE,oopar);
265 gp_Pnt2d uv; Standard_Boolean ok1 = FUN_tool_parF(E,paronE,OOF,uv);
266 if (!ok1) return Standard_False;
268 ok = MKT.Initialize(E,f,l,paronE, OOF,uv, factor);
270 TopAbs_State stb,sta; ok = MKT.MkTonE(stb,sta);
271 if (!ok) return Standard_False;
272 TF.Before(stb); TF.After(sta);
273 return Standard_True;
279 static Standard_Boolean FUN_findTOOF(const TopOpeBRepDS_PDataStructure pDS,
280 const Standard_Integer iE, const Standard_Integer iF, const Standard_Integer iOOF,
281 TopOpeBRepDS_Transition& TOOF)
283 Standard_Real factor = 0.5;
285 // ----------------------------------------------------------------------
288 // <OOIfound> on <OOE> : OOIfound = (T, S=iF, G=POINT/VERTEX on <E>)
289 // ----------------------------------------------------------------------
291 // <lIsuppOOE> = list of interferences attached to <E> of support S = edge of <OOF>
292 // <liOOE> = list of supports of <lIsuppOOE>.
293 const TopOpeBRepDS_ListOfInterference& loIE = pDS->ShapeInterferences(iE);
294 TopOpeBRepDS_ListOfInterference lITonOOF; Standard_Boolean ok = FUN_IwithToniS(loIE,iOOF,lITonOOF);
295 TopOpeBRepDS_ListOfInterference lIsuppOOE;
296 TColStd_ListOfInteger liOOEGonE;
298 ok = FUN_IwithsuppkS(lITonOOF,TopOpeBRepDS_EDGE,lIsuppOOE);
299 if (ok) {TopOpeBRepDS_ListIteratorOfListOfInterference it(lIsuppOOE);
300 for (; it.More(); it.Next()) liOOEGonE.Append(it.Value()->Support());}
302 else ok = FUN_supponF(pDS,loIE,iOOF,lIsuppOOE,liOOEGonE);
303 if (!ok) return Standard_False;
305 // TopAbs_Orientation oritransOOE;
307 // <lOOIfound> = list of I attached to shapes of <liOOE> /
308 // I = (T, S=F, G=POINT/VERTEX on <E>)
309 TopOpeBRepDS_ListOfInterference lIOOEsuppFGonE;
310 Standard_Boolean OOfound = FUN_IoflSsuppS(pDS,iF,liOOEGonE,lIOOEsuppFGonE);
312 // NYI : a deeper analysis is needed, for the moment, we make the following
313 // prequesitory : transition on OOE of OOF on point of ES is valid for
314 // all the ES (here restriction) ie :
315 // TOOF : transition face(OOF) / face(F) on (G == ES)
316 // <=> TOOE : transition edge(OOE) / face(F) at G = POINT/VERTEX
317 const Handle(TopOpeBRepDS_Interference)& OOIfound = lIOOEsuppFGonE.First();
318 TOOF = OOIfound->Transition();
321 Standard_Boolean OOdone = Standard_False;
323 // Ifound on <E> : Ifound = (T, S=EDGE on <OOF>, G=POINT/VERTEX on <E>)
324 // if <Ifound> found : compute TOOE at G / <F>
326 const Handle(TopOpeBRepDS_Interference)& Ifound = lIsuppOOE.First();
327 const TopoDS_Edge& OOE = TopoDS::Edge(pDS->Shape(Ifound->Support()));
328 Standard_Real paronE; OOdone = FDS_Parameter(Ifound,paronE);
329 if (!OOdone) return Standard_False;
331 const TopoDS_Edge& E = TopoDS::Edge(pDS->Shape(iE));
332 const TopoDS_Face& F = TopoDS::Face(pDS->Shape(iF));
334 Standard_Real oopar; Standard_Boolean ok1 = FUN_tool_parE(E,paronE,OOE,oopar);
335 if (!ok1) return Standard_False;
336 gp_Pnt2d uv; ok1 = FUN_tool_paronEF(E,paronE,F,uv);
337 if (!ok1) return Standard_False;
338 Standard_Real f,l; FUN_tool_bounds(OOE,f,l);
340 TopAbs_State stb = TopAbs_UNKNOWN,sta = TopAbs_UNKNOWN;
341 TopOpeBRepTool_makeTransition MKT;
342 OOdone = MKT.Initialize(OOE,f,l,oopar,F,uv,factor);
343 if (OOdone) OOdone = MKT.SetRest(E,paronE);
344 if (OOdone) OOdone = MKT.MkTonE(stb,sta);
345 if (OOdone) {TOOF.Before(stb); TOOF.After(sta);}
347 ok = OOfound || OOdone;
351 Standard_EXPORT Standard_Boolean GLOBAL_btcx = Standard_False;
352 Standard_EXPORT void debtcxmess(Standard_Integer f1,Standard_Integer f2,Standard_Integer il)
353 {cout<<"f1,f2,il : "<<f1<<","<<f2<<","<<il<<endl;cout.flush();}
355 //=======================================================================
356 //function : ProcessLine
358 //=======================================================================
359 void TopOpeBRep_FacesFiller::ProcessLine()
361 Standard_Boolean reject = ( !myLineOK || myLine==NULL );
365 Standard_Boolean HasVPonR = myLine->HasVPonR();
366 if (HasVPonR) FillLineVPonR();
369 Standard_Boolean inl = myLine->INL();
372 myHDS->SortOnParameter(myDSCIL);
377 //=======================================================================
378 //function : ResetDSC
380 //=======================================================================
381 void TopOpeBRep_FacesFiller::ResetDSC()
387 //=======================================================================
388 //function : ProcessVPInotonR
389 //purpose : Same as ProcessVPnotonR.
390 //=======================================================================
391 void TopOpeBRep_FacesFiller::ProcessVPInotonR(TopOpeBRep_VPointInterIterator& VPI)
393 const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
397 //=======================================================================
398 //function : ProcessVPnotonR
400 //=======================================================================
401 void TopOpeBRep_FacesFiller::ProcessVPnotonR(const TopOpeBRep_VPointInter& VP)
403 Standard_Integer ShapeIndex = 0;
404 Standard_Integer iVP = VP.Index();
407 Standard_Integer ili=myLine->Index(),ivp=iVP,isi=ShapeIndex;
408 GLOBAL_bvpr = TopOpeBRep_GettraceNVP(myexF1,myexF2,ili,ivp,isi);
409 if (GLOBAL_bvpr) debvprmess(myexF1,myexF2,ili,ivp,isi);
412 Standard_Integer iINON1,iINONn,nINON;
413 myLine->VPBounds(iINON1,iINONn,nINON);
414 TopOpeBRepDS_ListIteratorOfListOfInterference itCPIL(myDSCIL);
416 TopOpeBRepDS_Kind PVKind; Standard_Integer PVIndex;
417 Standard_Boolean CPIfound = GetGeometry(itCPIL,VP,PVIndex,PVKind);
419 if (iVP != iINON1 && iVP != iINONn) {
421 cout<<"VP "<<iVP<<" on "<<0<<" : point d'intersection anormal : rejet"<<endl;
428 Standard_Boolean found = GetFFGeometry(VP,PVKind,PVIndex);
429 if ( ! found ) PVIndex = MakeGeometry(VP,ShapeIndex,PVKind);
432 TopOpeBRepDS_Transition transLine;
434 const Handle(TopOpeBRepDS_Interference)& I = itCPIL.Value();
435 const TopOpeBRepDS_Transition& TI = I->Transition();
436 transLine = TI.Complement();
439 if (iVP == iINON1) transLine.Set(TopAbs_FORWARD);
440 else if (iVP == iINONn) transLine.Set(TopAbs_REVERSED);
443 Standard_Real parline = VP.ParameterOnLine();
444 Handle(TopOpeBRepDS_Interference) CPI = TopOpeBRepDS_InterferenceTool::MakeCurveInterference
445 (transLine,TopOpeBRepDS_CURVE,0,PVKind,PVIndex,parline);
446 StoreCurveInterference(CPI);
450 //=======================================================================
451 //function : ProcessVPR
453 //=======================================================================
454 void TopOpeBRep_FacesFiller::ProcessVPR(TopOpeBRep_FacesFiller& FF,const TopOpeBRep_VPointInter& VP)
456 TopOpeBRepDS_Transition LineTonF1 = FaceFaceTransition(1);
457 TopOpeBRepDS_Transition LineTonF2 = FaceFaceTransition(2);
458 TopoDS_Face F1 = myF1;
459 TopoDS_Face F2 = myF2;
460 // --- check interiority of VPoint to the restrictions
461 Standard_Boolean tokeep = VP.Keep();
462 if ( !tokeep ) return;
464 Standard_Integer ShapeIndex = VP.ShapeIndex();
466 if (ShapeIndex == 0) {
467 FF.ProcessVPnotonR(VP);
469 else if (ShapeIndex == 1) {
470 FF.ProcessVPonR(VP,LineTonF1,F1,1);
472 else if (ShapeIndex == 2) {
473 FF.ProcessVPonR(VP,LineTonF2,F2,2);
475 else if (ShapeIndex == 3) {
477 Standard_Boolean isV1 = VP.IsVertexOnS1();
478 Standard_Boolean isV2 = VP.IsVertexOnS2();
480 Standard_Integer shin1 = 1;
481 if (isV2 && !isV1) shin1 = 2;
484 FF.ProcessVPonR(VP,LineTonF1,F1,1);
485 FF.ProcessVPonR(VP,LineTonF2,F2,2);
487 else if (shin1 == 2) {
488 FF.ProcessVPonR(VP,LineTonF2,F2,2);
489 FF.ProcessVPonR(VP,LineTonF1,F1,1);
494 static Standard_Boolean FUN_brep_ONfirstP(const TopOpeBRep_VPointInter& vpf, const TopOpeBRep_VPointInter& VP)
495 // prequesitory : gline is on edge
497 Standard_Real parfirst = vpf.ParameterOnLine();
498 Standard_Real parcur = VP.ParameterOnLine();
499 Standard_Real d = parcur - parfirst;
500 Standard_Real tol = Precision::Confusion(); //nyixpu051098 : see lbr...
501 Standard_Boolean ONfirstP = (Abs(d) < tol);
505 //=======================================================================
506 //function : ProcessRLine
508 //=======================================================================
509 void TopOpeBRep_FacesFiller::ProcessRLine()
511 if (myLine->TypeLineCurve() != TopOpeBRep_RESTRICTION) {return;}
513 Standard_Boolean addIFE = Standard_True;
516 const TopoDS_Edge& Erest = TopoDS::Edge(myLine->Arc());
517 Standard_Boolean FIisrest = myFacesIntersector->IsRestriction(Erest);
518 if (!FIisrest) return;
520 Standard_Boolean isedge1 = myLine->ArcIsEdge(1);
521 Standard_Boolean isedge2 = myLine->ArcIsEdge(2);
522 Standard_Integer EShapeIndex = (isedge1) ? 1 : (isedge2) ? 2 : 0;
524 Standard_Integer iErest = myDS->AddShape(Erest,EShapeIndex);
525 Standard_Integer rank = myDS->AncestorRank(iErest);
526 Standard_Integer OOrank = (rank == 1)? 2: 1;
528 Standard_Integer iF1 = myDS->AddShape(myF1,1);
529 Standard_Integer iF2 = myDS->AddShape(myF2,2);
530 Handle(TopOpeBRepDS_Interference) IFE;
532 TopOpeBRepDS_Transition T1 = FaceFaceTransition(1); T1.Index(iF2);
533 TopOpeBRepDS_Transition T2 = FaceFaceTransition(2); T2.Index(iF1);
535 Standard_Boolean T1unk = T1.IsUnknown();
536 Standard_Boolean T2unk = T2.IsUnknown();
537 Standard_Boolean processUNK = Standard_False;
539 Standard_Boolean nopunk = TopOpeBRep_GetcontextNOPUNK();
540 if (nopunk) processUNK = Standard_False;
542 if (processUNK && (T1unk || T2unk)) {
543 TopoDS_Shape F = (*this).Face(rank); Standard_Integer iF = myDS->Shape(F);
544 TopoDS_Shape OOF = (*this).Face(OOrank); Standard_Integer iOOF = myDS->Shape(OOF);
545 Standard_Boolean findTOOF = (T1unk && (OOrank == 1)) || (T2unk && (OOrank == 2));
546 Standard_Boolean findTF = (T1unk && (rank == 1)) || (T2unk && (rank == 2));
551 // ?<OOIfound> on <OOE> : OOIfound = (T, S=iF, G=POINT/VERTEX on <Erest>)
552 TopOpeBRepDS_Transition T; Standard_Boolean OOTok = FUN_findTOOF(myDS,iErest,iF,iOOF,T);
554 if (OOrank == 1) FDS_SetT(T1,T);
559 // ?Ifound on <Erest> : Ifound = (T on FACE=iOOF, S, G=POINT/VERTEX on <Erest>)
560 // if <Ifound> found : compute TErest at G / <OOF>
561 TopOpeBRepDS_Transition T; Standard_Boolean Tok = FUN_findTF(myDS,iErest,iF,iOOF,T);
563 if (rank == 1) FDS_SetT(T1,T);
567 T1unk = T1.IsUnknown();
568 T2unk = T2.IsUnknown();
569 } // processUNK && (T1unk || T2unk)
571 IFE = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference
572 (T1,iF2,iErest,isedge1,TopOpeBRepDS_UNSHGEOMETRY);
573 myHDS->StoreInterference(IFE,iF1);
575 IFE = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference
576 (T2,iF1,iErest,isedge2,TopOpeBRepDS_UNSHGEOMETRY);
577 myHDS->StoreInterference(IFE,iF2);
579 //#################### Rline Processing ####################
581 TopOpeBRep_VPointInterIterator VPI;
583 Standard_Real tola = Precision::Angular()*1.e5;//NYIXPUTOL
584 const TopOpeBRep_VPointInter& vpf = VPI.CurrentVP();
585 for (; VPI.More(); VPI.Next()) {
586 const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
587 Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3
588 Standard_Real parRest;
589 Standard_Boolean okR = VP.ParonE(Erest,parRest);
590 if (!okR) parRest = VP.ParameterOnLine();
591 Standard_Boolean on2edges = (absindex == 3) || (absindex == OOrank);
594 // MSV: treat the case when an edge is touched by interior of a face
596 // MSV: the commented code below leads to exception on 1cto 025 H3
597 // (object and tool have same subshapes), so to enable it
598 // the debug is needed
600 // Standard_Boolean SIisvertex = VP.IsVertex(EShapeIndex);
601 // if (SIisvertex) continue;
602 // Standard_Integer ShapeIndex = EShapeIndex;
603 // Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1;
604 // TopoDS_Face OOFace = (*this).Face(OOShapeIndex);
605 // Standard_Integer iOOFace = myDS->Shape(OOFace);
608 // TopOpeBRepDS_Kind PVKind = TopOpeBRepDS_POINT;
609 // Standard_Integer PVIndex = 0;
610 // Standard_Boolean EPIfound=Standard_False,CPIfound=Standard_False;
611 // Handle(TopOpeBRepDS_Interference) IEPI,ICPI;
612 // FUN_VPIndex((*this),(*myLine),VP,ShapeIndex,myHDS,myDSCIL,
613 // PVKind,PVIndex,EPIfound,IEPI,CPIfound,ICPI,
615 // Standard_Boolean Efound = (EPIfound || CPIfound);
616 // Standard_Boolean Ifound = (PVIndex != 0);
617 // Standard_Boolean condmake = (!Efound && !Ifound);
619 // PVIndex = MakeGeometry(VP,ShapeIndex,PVKind);
621 // // make transition on edge
622 // TopOpeBRepDS_Transition transEdge;
623 // TopOpeBRepDS_Transition Trans = FaceFaceTransition(ShapeIndex);
624 // Standard_Boolean TransUNK = Trans.IsUnknown();
626 // TopAbs_Orientation oriErest = Erest.Orientation();
627 // transEdge = TopOpeBRep_FFTransitionTool::ProcessLineTransition(VP,ShapeIndex,oriErest);
628 // TransUNK = FDS_hasUNK(transEdge);
631 // Standard_Boolean ONfirstP = ::FUN_brep_ONfirstP(vpf,VP);
632 // TopAbs_Orientation OVP = ONfirstP ? TopAbs_FORWARD : TopAbs_REVERSED;
633 // transEdge.Set(OVP);
634 // if (ONfirstP) transEdge.StateAfter(TopAbs_ON);
635 // else transEdge.StateBefore(TopAbs_ON);
636 // TransUNK = FDS_hasUNK(transEdge);
638 // if (TransUNK) continue;
640 // // see if there is already such interference in DS
641 // TopAbs_Orientation otransEdge = transEdge.Orientation(TopAbs_IN);
642 // const TopOpeBRepDS_ListOfInterference& lIedge = myHDS->DS().ShapeInterferences(Erest);
643 // TopOpeBRepDS_ListOfInterference copy; FDS_copy(lIedge,copy);
644 // TopOpeBRepDS_ListOfInterference l1,l2;
645 // Standard_Integer nfound = FUN_selectGIinterference(copy,PVIndex,l1);
647 // if (iOOFace != 0) {
648 // TopOpeBRepDS_ListOfInterference l3,l4;
649 // nfound = FUN_selectITRASHAinterference(l2,iOOFace,l3);
650 // if (nfound != 0) nfound = FUN_selectTRAORIinterference(l3,otransEdge,l4);
651 // if (nfound) continue;
655 // // make and store interference
656 // Handle(TopOpeBRepDS_Interference) EPIf;
657 // if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex);
658 // TopOpeBRepDS_Transition T = transEdge; T.Index(iOOFace);
659 // EPIf = MakeEPVInterference(T,iOOFace,PVIndex,parRest,PVKind,
660 // TopOpeBRepDS_FACE,SIisvertex);
661 // myHDS->StoreInterference(EPIf,Erest);
666 TopoDS_Edge OOE = TopoDS::Edge(VP.Edge(OOrank));
667 Standard_Integer iOO = myDS->AddShape(OOE,OOrank);
670 VP.ParonE(OOE,OOpar);
672 // xpu091198 : 1d interf done in EdgesFiller processing (cto cylcong *)
673 Standard_Boolean sdmeds = FUN_ds_sdm((*myDS),Erest,OOE);
674 if (sdmeds) continue;
676 Standard_Integer obRest = TopOpeBRepTool_TOOL::OnBoundary(parRest,Erest); //vertex can be missed
677 Standard_Integer obOO = TopOpeBRepTool_TOOL::OnBoundary(OOpar,OOE); //vertex can be missed
679 if ((obRest == EXTERNAL)||(obOO == EXTERNAL)){
681 if(obRest==EXTERNAL) cout<<"***********ProcessRLine : faulty parameter on Erest"<<endl;
682 if(obOO==EXTERNAL) cout<<"***********ProcessRLine : faulty parameter on OOE"<<endl;
686 Standard_Boolean tgeds = FUN_tool_EtgOOE(parRest,Erest, OOpar,OOE, tola);
688 TopOpeBRepDS_Kind PVKind = TopOpeBRepDS_POINT; Standard_Integer PVIndex = 0; // POINT or VERTEX index
690 for (Standard_Integer ShapeIndex = 1; ShapeIndex<=2; ShapeIndex++) {
691 Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1;
692 Standard_Boolean SIErest = (ShapeIndex == rank);
694 Standard_Boolean SIisvertex = VP.IsVertex(ShapeIndex);
695 Standard_Boolean OOisvertex = VP.IsVertex(OOShapeIndex);
696 TopoDS_Face OOFace = (*this).Face(OOShapeIndex);
697 Standard_Integer iOOFace = myDS->Shape(OOFace);
699 TopoDS_Edge edge,OOedge; Standard_Integer OOedgeIndex;
700 Standard_Real paredge;
701 Standard_Integer onbound;
710 OOedgeIndex = iErest;
717 // xpu150399 : BUC60382
718 Standard_Boolean EPIfound=Standard_False,CPIfound=Standard_False; Handle(TopOpeBRepDS_Interference) IEPI,ICPI;
719 ProcessVPondgE(VP, ShapeIndex,
720 PVKind,PVIndex, // out
721 EPIfound,IEPI, // out
722 CPIfound,ICPI); // out
725 // Standard_Boolean EPIfound=Standard_False,CPIfound=Standard_False; Handle(TopOpeBRepDS_Interference) IEPI,ICPI;
726 FUN_VPIndex((*this),(*myLine),VP,ShapeIndex,myHDS,myDSCIL,
727 PVKind,PVIndex,EPIfound,IEPI,CPIfound,ICPI,
729 Standard_Boolean Efound = (EPIfound || CPIfound);
730 Standard_Boolean Ifound = (PVIndex != 0);
731 Standard_Boolean condmake = (!Efound && !Ifound);
733 if ( SIisvertex ) PVIndex = MakeGeometry(VP,ShapeIndex,PVKind);
734 else if ( OOisvertex ) PVIndex = MakeGeometry(VP,OOShapeIndex,PVKind);
735 else PVIndex = MakeGeometry(VP,ShapeIndex,PVKind);
741 if (OOedgeIndex == 0) OOedgeIndex = myDS->AddShape(OOedge,OOShapeIndex);
742 const TopOpeBRepDS_Transition& llt1 = FaceFaceTransition(1);
743 const TopOpeBRepDS_Transition& llt2 = FaceFaceTransition(2);
744 TopOpeBRepDS_Transition Trans = (ShapeIndex == 1)? llt1 : llt2;
745 Standard_Boolean TransUNK = Trans.IsUnknown();
747 TopOpeBRepDS_Transition transEdge; Standard_Boolean Tunk = Standard_True;
748 if (!TransUNK) { //xpu281098 PRO12875(edge9,OOface11)
749 if ((absindex==ShapeIndex)||(absindex==3)) {
751 // transition on Erest at VP / OOface = transition at VP on Line restriction
752 TopAbs_Orientation oriErest = Erest.Orientation();
753 transEdge = TopOpeBRep_FFTransitionTool::ProcessLineTransition(VP,ShapeIndex,oriErest);
755 if (((onbound == 1)||(onbound == 2))&&tgeds) // xpu290399 : edge is restriction,
756 // edge15,OOedge14,OOface13
757 {transEdge.Before(TopAbs_UNKNOWN); transEdge.After(TopAbs_UNKNOWN);}
760 // transition on edge at VP / OOface ?=
761 // TopOpeBRep_FFTransitionTool::ProcessEdgeTransition(VP,ShapeIndex,Transori);
765 Tunk = FDS_hasUNK(transEdge);
769 // As edge=Erest is on OOFace, we only compute 2d interferences
770 Standard_Boolean ONfirstP = ::FUN_brep_ONfirstP(vpf,VP);
771 TopAbs_Orientation OVP = ONfirstP ? TopAbs_FORWARD : TopAbs_REVERSED;
772 TopAbs_Orientation oOO; Standard_Boolean ok = FUN_tool_orientEinFFORWARD(OOedge,OOFace,oOO);
774 if (M_INTERNAL(oOO)) OVP = TopAbs_INTERNAL;
776 // xpu240399 : cto015I2 (e15,v16)
777 // edge and OOedge are tangent, we do not keep the orientation
778 if (!tgeds) transEdge.Set(OVP);
781 TopOpeBRepDS_Transition Tr;
782 Standard_Boolean ok = FUN_newtransEdge(myHDS,(*this),(*myLine),myLineIsonEdge,VP,PVKind,PVIndex,OOShapeIndex,
785 transEdge.Before(Tr.Before()); transEdge.After(Tr.After());
788 Tunk = FDS_hasUNK(transEdge);
791 TopAbs_Orientation otransEdge = transEdge.Orientation(TopAbs_IN);
792 const TopOpeBRepDS_ListOfInterference& lIedge = myHDS->DS().ShapeInterferences(edge);
793 TopOpeBRepDS_ListOfInterference copy; FDS_copy(lIedge,copy);
794 TopOpeBRepDS_ListOfInterference l1,l2; Standard_Integer nfound = FUN_selectGIinterference(copy,PVIndex,l1);
795 if (OOedgeIndex != 0) nfound = FUN_selectSIinterference(l1,OOedgeIndex,l2);
798 TopOpeBRepDS_ListOfInterference l3,l4; nfound = FUN_selectITRASHAinterference(l2,OOedgeIndex,l3);
799 if (nfound != 0) nfound = FUN_selectTRAORIinterference(l3,otransEdge,l4);
800 if (nfound) continue; // has I1d=(transEdge(OOedgeIndex),PVIndex,OOedgeIndex);
802 else if (iOOFace != 0) {
803 TopOpeBRepDS_ListOfInterference l3,l4; nfound = FUN_selectITRASHAinterference(l2,iOOFace,l3);
804 if (nfound != 0) nfound = FUN_selectTRAORIinterference(l3,otransEdge,l4);
805 if (nfound) continue; // has I2d=(transEdge(iOOFace),PVIndex,OOedgeIndex)
811 Handle(TopOpeBRepDS_Interference) EPI;
813 if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex);
814 TopOpeBRepDS_Transition T = transEdge; T.Index(iOOFace);
815 EPI = MakeEPVInterference(T,OOedgeIndex,PVIndex,paredge,PVKind,SIisvertex);
817 myHDS->StoreInterference(EPI,edge);
822 Handle(TopOpeBRepDS_Interference) EPIf;
823 TopOpeBRepDS_Transition T = transEdge; T.Index(iOOFace);
824 EPIf = MakeEPVInterference(T,iOOFace,PVIndex,paredge,PVKind,
825 TopOpeBRepDS_FACE,SIisvertex);
826 myHDS->StoreInterference(EPIf,edge);
831 //####################
834 static Standard_Boolean FUN_haslastvpon0(const TopOpeBRep_LineInter& L)
836 const Standard_Boolean wline = (L.TypeLineCurve() == TopOpeBRep_WALKING);
837 if (!wline) return Standard_False;
839 Standard_Integer iINON1,iINONn,nINON; L.VPBounds(iINON1,iINONn,nINON);
841 TopOpeBRep_VPointInterIterator VPI;
843 for (; VPI.More(); VPI.Next()) {
844 const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
845 const Standard_Integer absindex = VP.ShapeIndex();
846 const Standard_Integer iVP = VP.Index();
847 if (iVP == iINONn && absindex == 0) return Standard_True;
849 return Standard_False;
852 //=======================================================================
853 //function : FillLineVPonR
855 //=======================================================================
856 void TopOpeBRep_FacesFiller::FillLineVPonR()
859 Standard_Boolean trline = Standard_False;
861 // if a VP is on degenerated edge, adds the triplet
862 // (vertex, closing edge, degenerated edge) to the
863 // map as vertex for key.
864 // myDataforDegenEd.Clear();
865 FUN_GetdgData(myDS,(*myLine),myF1,myF2,myDataforDegenEd);
866 FUN_FillVof12((*myLine),myDS) ;
870 if (myLine->TypeLineCurve() == TopOpeBRep_RESTRICTION) {
872 if (trline) FUN_traceRLine(*myLine);
878 Standard_Integer iINON1,iINONn,nINON;
879 myLine->VPBounds(iINON1,iINONn,nINON);
885 if (trline) FUN_traceGLine(*myLine);
887 myLineIsonEdge = LSameDomainERL(*myLine, myERL);
889 // walking (case mouch1a 1 1) : line (vpfirst on 3,vplast on 0,nvpkept = 2) => kept
890 myLastVPison0 = ::FUN_haslastvpon0(*myLine);
892 //---------------------------------------------------------------------- // IMPORTANT :
893 // Some of Curve/Point transitions for vpoints keep on RESTRICTION lines
894 // sharing same domain with the current geometric line are computed here
895 //----------------------------------------------------------------------
899 Standard_Boolean trcd = Standard_False;
900 if (trcd) FUN_DrawMap(myDataforDegenEd);
904 TopOpeBRep_VPointInterIterator VPI;
906 for (; VPI.More(); VPI.Next()) {
907 const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
908 ProcessVPR((*this),VP);
911 if ( myLineIsonEdge && (!myDSCIL.IsEmpty()) ) {
916 //=======================================================================
917 //function : FillLine
919 //=======================================================================
920 void TopOpeBRep_FacesFiller::FillLine()
922 Standard_Integer iINON1,iINONn,nINON;
923 myLine->VPBounds(iINON1,iINONn,nINON);
924 if ( nINON == 0 ) return;
926 Standard_Integer ShapeIndex = 0;
927 Handle(TopOpeBRepDS_Interference) CPI;
929 TopOpeBRep_VPointInterIterator VPI;
930 for (VPI.Init((*myLine)); VPI.More(); VPI.Next()) {
932 const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
933 if ( ! VP.Keep() ) continue;
935 Standard_Integer PVIndex;
936 TopOpeBRepDS_Kind PVKind;
937 TopOpeBRepDS_ListIteratorOfListOfInterference itCPIL(myDSCIL);
938 Standard_Boolean CPIfound;
939 CPIfound = GetGeometry(itCPIL,VP,PVIndex,PVKind);
941 Standard_Boolean found = GetFFGeometry(VP,PVKind,PVIndex);
942 if ( !found ) PVIndex = MakeGeometry(VP,ShapeIndex,PVKind);
945 TopOpeBRepDS_Transition transLine;
947 Standard_Integer iVP = VPI.CurrentVPIndex();
948 if (iVP == iINON1) transLine.Set(TopAbs_FORWARD);
949 else if (iVP == iINONn) transLine.Set(TopAbs_REVERSED);
951 else transLine = itCPIL.Value()->Transition().Complement();
953 Standard_Real parline = VPI.CurrentVP().ParameterOnLine();
954 CPI = TopOpeBRepDS_InterferenceTool::MakeCurveInterference
955 (transLine,TopOpeBRepDS_CURVE,0,PVKind,PVIndex,parline);
956 StoreCurveInterference(CPI);
962 //=======================================================================
963 //function : AddShapesLine
965 //=======================================================================
966 void TopOpeBRep_FacesFiller::AddShapesLine()
968 Standard_Boolean dscilemp = myDSCIL.IsEmpty();
969 if (dscilemp) return;
971 Standard_Boolean inl = myLine->INL();
974 TopOpeBRepDS_Curve& DSC = myDS->ChangeCurve(myDSCIndex);
976 Handle(Geom_Curve) C3D;
977 Handle(Geom2d_Curve) PC1,PC2;
978 Handle(TopOpeBRepDS_Interference) FCI1, FCI2;
980 Standard_Integer iF1 = myDS->AddShape(myF1,1);
981 Standard_Integer iF2 = myDS->AddShape(myF2,2);
983 Standard_Real pmin,pmax;
984 myHDS->MinMaxOnParameter(myDSCIL,pmin,pmax);
986 Standard_Real d = Abs(pmin-pmax);
987 Standard_Boolean id = (d <= Precision::PConfusion());
988 Standard_Boolean isper = myLine->IsPeriodic();
991 Standard_Boolean wline = (myLine->TypeLineCurve() == TopOpeBRep_WALKING);
992 Standard_Boolean vclosed = myLine->IsVClosed();
993 if (wline && !isper && vclosed) {
994 //xpu240399 : USA60298 : avoid creating curve
995 // MSV: take into account that geometry can be of type VERTEX
996 Standard_Integer ipf = myDSCIL.First()->Geometry();
997 TopOpeBRepDS_Kind kpf = myDSCIL.First()->GeometryType();
999 Standard_Real tol,tolf, toll;
1000 if (kpf == TopOpeBRepDS_POINT) {
1001 TopOpeBRepDS_Point pf = myDS->Point(ipf);
1003 tolf = pf.Tolerance();
1006 TopoDS_Vertex vf = TopoDS::Vertex(myDS->Shape(ipf));
1007 ptf = BRep_Tool::Pnt(vf);
1008 tolf = BRep_Tool::Tolerance(vf);
1011 Standard_Integer ipl = myDSCIL.Last()->Geometry();
1012 TopOpeBRepDS_Kind kpl = myDSCIL.Last()->GeometryType();
1013 if (kpl == TopOpeBRepDS_POINT) {
1014 TopOpeBRepDS_Point pl = myDS->Point(ipl);
1015 toll = pl.Tolerance();
1018 TopoDS_Vertex vl = TopoDS::Vertex(myDS->Shape(ipl));
1019 toll = BRep_Tool::Tolerance(vl);
1022 tol = Max(tolf, toll);
1023 Standard_Boolean onsampt = Standard_True;
1024 for (Standard_Integer ii = 1; ii <= myLine->NbWPoint(); ii++) {
1025 TopOpeBRep_WPointInter wp = myLine->WPoint(ii);
1026 gp_Pnt pp = wp.Value();
1027 if (!pp.IsEqual(ptf,tol)) {onsampt = Standard_False;break;}
1029 if (onsampt) id = Standard_True;
1033 DSC.ChangeKeep(Standard_False);
1037 TopOpeBRep_GeomTool::MakeCurves(pmin,pmax,(*myLine),myF1,myF2,DSC,PC1,PC2);
1039 //Patch: avoid making too small edges. Made for the bug buc60926 by jgv, 14.06.01.
1040 Standard_Real fpar, lpar;
1041 DSC.Range(fpar, lpar);
1042 GeomAdaptor_Curve theCurve( DSC.Curve(), fpar, lpar );
1044 BndLib_Add3dCurve::Add( theCurve, 0., theBox );
1045 Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, MaxSide;
1046 theBox.Get( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
1047 MaxSide = Max( Max(Xmax-Xmin, Ymax-Ymin), Zmax-Zmin );
1048 Standard_Real MinTol = Min( BRep_Tool::Tolerance(myF1), BRep_Tool::Tolerance(myF2) );
1049 if (MaxSide < MinTol)
1051 DSC.ChangeKeep(Standard_False);
1055 Standard_Real tolDSC = 1.e-8;
1056 DSC.Tolerance(tolDSC);
1057 const TopOpeBRepDS_Transition& lllt1 = FaceFaceTransition(1);
1058 const TopOpeBRepDS_Transition& lllt2 = FaceFaceTransition(2);
1060 myDS->ChangeCurveInterferences(myDSCIndex).Append(myDSCIL);
1062 TopOpeBRepDS_Transition T1 = lllt1; T1.Index(iF2);
1063 FCI1 = TopOpeBRepDS_InterferenceTool::MakeFaceCurveInterference
1064 (T1,iF2,myDSCIndex,PC1);
1065 myHDS->StoreInterference(FCI1,myF1);
1069 TopOpeBRepDS_Transition T2 = lllt2; T2.Index(iF1);
1070 FCI2 = TopOpeBRepDS_InterferenceTool::MakeFaceCurveInterference
1071 (T2,iF1,myDSCIndex,PC2);
1072 myHDS->StoreInterference(FCI2,myF2);
1075 DSC.SetShapes(myF1,myF2);
1076 DSC.SetSCI(FCI1,FCI2);
1080 //=======================================================================
1081 //function : StoreCurveInterference
1083 //=======================================================================
1084 void TopOpeBRep_FacesFiller::StoreCurveInterference(const Handle(TopOpeBRepDS_Interference)& I)
1086 if ( myDSCIndex == 0 ) {
1087 TopOpeBRepDS_Curve DSC;
1088 myDSCIndex = myDS->AddCurve(DSC);
1091 I->Support(myDSCIndex);
1092 myHDS->StoreInterference(I,myDSCIL);
1095 //=======================================================================
1096 //function : GetGeometry
1098 //=======================================================================
1099 Standard_Boolean TopOpeBRep_FacesFiller::GetGeometry(TopOpeBRepDS_ListIteratorOfListOfInterference& IT,const TopOpeBRep_VPointInter& VP,Standard_Integer& G,TopOpeBRepDS_Kind& K)
1101 TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(VP);
1102 Standard_Boolean b = myHDS->GetGeometry(IT,DSP,G,K);
1106 //=======================================================================
1107 //function : MakeGeometry
1109 //=======================================================================
1110 Standard_Integer TopOpeBRep_FacesFiller::MakeGeometry(const TopOpeBRep_VPointInter& VP,const Standard_Integer ShapeIndex,TopOpeBRepDS_Kind& K)
1113 Standard_Boolean isvertex = VP.IsVertex(ShapeIndex);
1115 const TopoDS_Shape& S = VP.Vertex(ShapeIndex);
1116 G = myDS->AddShape(S,ShapeIndex);
1117 K = TopOpeBRepDS_VERTEX;
1120 TopOpeBRepDS_Point P = TopOpeBRep_PointGeomTool::MakePoint(VP);
1121 G = myDS->AddPoint(P);
1122 K = TopOpeBRepDS_POINT;
1128 //=======================================================================
1129 //function : GetFFGeometry
1131 //=======================================================================
1132 Standard_Boolean TopOpeBRep_FacesFiller::GetFFGeometry(const TopOpeBRepDS_Point& DSP,TopOpeBRepDS_Kind& K,Standard_Integer& G) const
1134 Standard_Boolean found = Standard_False;
1135 Standard_Integer i = myFFfirstDSP, n = myDS->NbPoints();
1136 for (; i <= n; i++) {
1137 const TopOpeBRepDS_Point& OODSP = myDS->Point(i);
1138 found = TopOpeBRep_PointGeomTool::IsEqual(DSP,OODSP);
1142 K = TopOpeBRepDS_POINT;
1148 //=======================================================================
1149 //function : GetFFGeometry
1151 //=======================================================================
1152 Standard_Boolean TopOpeBRep_FacesFiller::GetFFGeometry(const TopOpeBRep_VPointInter& VP,TopOpeBRepDS_Kind& K,Standard_Integer& G) const
1154 TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(VP);
1155 Standard_Boolean found = GetFFGeometry(DSP,K,G);