b311480e |
1 | // Created on: 1995-08-04 |
2 | // Created by: Jean Yves LEBEY |
3 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
42cf5bc1 |
17 | |
18 | #include <gp_Pnt.hxx> |
19 | #include <TopoDS_Face.hxx> |
20 | #include <TopoDS_Shape.hxx> |
21 | #include <TopOpeBRep_FacesFiller.hxx> |
22 | #include <TopOpeBRep_FacesIntersector.hxx> |
23 | #include <TopOpeBRep_FFDumper.hxx> |
24 | #include <TopOpeBRep_LineInter.hxx> |
25 | #include <TopOpeBRep_PointClassifier.hxx> |
26 | #include <TopOpeBRep_VPointInter.hxx> |
27 | #include <TopOpeBRep_VPointInterClassifier.hxx> |
28 | #include <TopOpeBRep_VPointInterIterator.hxx> |
29 | #include <TopOpeBRepDS_DataStructure.hxx> |
30 | #include <TopOpeBRepDS_HDataStructure.hxx> |
31 | #include <TopOpeBRepDS_Interference.hxx> |
32 | #include <TopOpeBRepDS_Point.hxx> |
33 | #include <TopOpeBRepDS_Transition.hxx> |
7fd59977 |
34 | |
35 | #ifdef DRAW |
36 | #include <TopOpeBRepDS_DRAW.hxx> |
37 | #endif |
38 | |
39 | #include <Standard_DomainError.hxx> |
40 | #include <Geom_Surface.hxx> |
41 | #include <Geom_Curve.hxx> |
42 | #include <Geom2d_Curve.hxx> |
43 | #include <Precision.hxx> |
44 | #include <TopoDS.hxx> |
45 | #include <TopExp.hxx> |
46 | #include <BRep_Tool.hxx> |
47 | #include <gp_Vec.hxx> |
48 | |
49 | #include <TopOpeBRepTool_EXPORT.hxx> |
50 | #include <TopOpeBRepTool_SC.hxx> |
51 | #include <TopOpeBRepTool_TOOL.hxx> |
52 | #include <TopOpeBRepTool_ShapeTool.hxx> |
53 | #include <TopOpeBRepTool_makeTransition.hxx> |
54 | |
55 | #include <TopOpeBRepDS_define.hxx> |
56 | #include <TopOpeBRepDS_EXPORT.hxx> |
57 | #include <TopOpeBRepDS_ProcessInterferencesTool.hxx> |
58 | #include <TopOpeBRepDS_Config.hxx> |
59 | #include <TopOpeBRepDS_Curve.hxx> |
60 | #include <TopOpeBRepDS_PointIterator.hxx> |
61 | #include <TopOpeBRepDS_Dumper.hxx> |
62 | |
63 | #include <TopOpeBRep_define.hxx> |
64 | #include <TopOpeBRep_FFTransitionTool.hxx> |
65 | #include <TopOpeBRep_PointGeomTool.hxx> |
66 | #include <TopOpeBRep.hxx> |
67 | |
68 | #define M_ON(st) (st == TopAbs_ON) |
69 | #define M_UNKNOWN(st) (st == TopAbs_UNKNOWN) |
70 | #define M_REVERSED(st) (st == TopAbs_REVERSED) |
71 | |
0797d9d3 |
72 | #ifdef OCCT_DEBUG |
1d0a9d4d |
73 | extern Standard_Boolean TopOpeBRepDS_GettraceISTO(); |
74 | extern Standard_Boolean TopOpeBRepDS_GettraceDSF(); |
75 | extern Standard_Boolean TopOpeBRepDS_GettraceDSP(); |
76 | extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer i); |
77 | extern Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer a,Standard_Integer b,Standard_Integer c,Standard_Integer d,Standard_Integer e); |
1896126e |
78 | |
79 | Standard_Boolean GLOBAL_bvpr = Standard_False; |
80 | |
81 | void debvpr(){}; |
1d0a9d4d |
82 | void debvprmess(Standard_Integer f1,Standard_Integer f2,Standard_Integer il,Standard_Integer vp,Standard_Integer si) |
7fd59977 |
83 | {cout<<"f1,f2,il,vp,si : "<<f1<<","<<f2<<","<<il<<","<<vp<<","<<si<<endl;cout.flush();debvpr();} |
84 | void debpoint(Standard_Integer i) {cout<<"+ debpoint"<<i<<endl;} |
85 | void debvertex(Standard_Integer i){cout<<"+ debvertex"<<i<<endl;} |
7fd59977 |
86 | |
87 | Standard_EXPORT void debarc(const Standard_Integer i) {cout<<"+ debarc "<<i<<endl;} |
88 | Standard_EXPORT void debooarc(const Standard_Integer i) {cout<<"+ debooarc "<<i<<endl;} |
89 | #endif |
90 | |
91 | Standard_EXPORT Standard_Boolean FDS_LOIinfsup(const TopOpeBRepDS_DataStructure& BDS,const TopoDS_Edge& E,const Standard_Real pE,const Standard_Integer GIP, |
92 | const TopOpeBRepDS_ListOfInterference& LOI, Standard_Real& pbef, Standard_Real& paft, Standard_Boolean& isonboundper); |
93 | Standard_EXPORT Standard_Boolean FUNBREP_topokpart |
94 | (const Handle(TopOpeBRepDS_Interference)& Ifound,const TopOpeBRepDS_ListOfInterference& DSCIL, |
95 | const TopOpeBRep_LineInter& L,const TopOpeBRep_VPointInter& VP, |
96 | const TopOpeBRepDS_DataStructure& BDS,const TopoDS_Shape& E,const TopoDS_Shape& F,const Standard_Real toluv, |
97 | Standard_Real& parline,TopOpeBRepDS_Transition& transLine); |
98 | |
99 | //----------------------------------------------------------------------- |
100 | // Search, among a list of interferences accessed by the iterator <IT>, |
101 | // a geometry whose parameter on edge point is identical to <par>. |
102 | // return True if such an interference has been found, False else. |
103 | // if True, iterator <IT> points (by the Value() method) on the first |
104 | // interference found. |
105 | //----------------------------------------------------------------------- |
106 | |
107 | Standard_EXPORT Standard_Boolean FUN_GetGonParameter |
108 | (TopOpeBRepDS_ListIteratorOfListOfInterference& it, const Standard_Real& par, const Standard_Real& tolp, |
109 | Standard_Integer& G, TopOpeBRepDS_Kind& GT) |
110 | { |
111 | while (it.More()) { |
112 | const Handle(TopOpeBRepDS_Interference)& I = it.Value(); |
113 | Standard_Real ipar; Standard_Boolean haspar = FDS_Parameter(I,ipar); |
114 | if (!haspar) {it.Next(); continue;} |
115 | Standard_Boolean samepar = (Abs(par-ipar) < tolp); |
116 | if (!samepar){it.Next(); continue;} |
117 | TopOpeBRepDS_Kind ST; Standard_Integer S; FDS_data(I,GT,G,ST,S); |
118 | return Standard_True; |
119 | } |
120 | return Standard_False; |
121 | } |
122 | |
123 | static Standard_Boolean FUN_INlos(const TopoDS_Shape& S, const TopTools_ListOfShape& loS) |
124 | { |
125 | TopTools_ListIteratorOfListOfShape it(loS); |
126 | for (; it.More(); it.Next()) |
127 | if (it.Value().IsSame(S)) return Standard_True; |
128 | return Standard_False; |
129 | } |
130 | |
131 | //======================================================================= |
132 | //function : ProcessVPIonR |
133 | //purpose : |
134 | //======================================================================= |
135 | |
136 | void TopOpeBRep_FacesFiller::ProcessVPIonR |
137 | (TopOpeBRep_VPointInterIterator& VPI, |
138 | const TopOpeBRepDS_Transition& Trans, |
139 | const TopoDS_Shape& Face, |
140 | const Standard_Integer ShapeIndex) //1,2 |
141 | { |
142 | const TopOpeBRep_VPointInter& VP = VPI.CurrentVP(); |
143 | ProcessVPonR(VP,Trans,Face,ShapeIndex); |
144 | } // ProcessVPIonR |
145 | |
146 | //----------------------------------------------------------------------- |
147 | static void FUN_transForWL |
148 | (const TopOpeBRep_LineInter& L, |
149 | const Standard_Integer iVP, |
150 | const Standard_Integer ShapeIndex, |
151 | TopOpeBRepDS_Transition& transLine) |
152 | //----------------------------------------------------------------------- |
153 | { |
154 | // premier VP avec indetermine : on prend le complement |
155 | // du suivant determine |
156 | TopOpeBRep_VPointInterIterator VPIbis; |
157 | for (VPIbis.Init(L); |
158 | VPIbis.More(); VPIbis.Next()) { |
159 | const TopOpeBRep_VPointInter& VPbis = VPIbis.CurrentVP(); |
160 | Standard_Boolean tokeep = VPbis.Keep(); |
161 | if ( !tokeep ) continue; |
162 | Standard_Integer iVPbis = VPIbis.CurrentVPIndex(); |
163 | if ( iVPbis <= iVP ) continue; |
164 | Standard_Integer absindexbis = VPbis.ShapeIndex(); // 0,1,2,3 |
165 | Standard_Integer shapeindexbis = (absindexbis == 3) ? ShapeIndex : absindexbis; |
166 | if ( shapeindexbis == 0 ) continue; |
167 | const TopoDS_Shape& edgebis = VPbis.Edge(shapeindexbis); |
168 | TopAbs_Orientation edgeoribis = edgebis.Orientation(); |
169 | TopOpeBRepDS_Transition transLinebis; |
170 | transLinebis = |
171 | TopOpeBRep_FFTransitionTool::ProcessLineTransition |
172 | (VPbis,shapeindexbis,edgeoribis); |
173 | Standard_Boolean trliunkbis = transLinebis.IsUnknown(); |
174 | if ( trliunkbis ) continue; |
175 | transLine = transLinebis.Complement(); |
176 | break; |
177 | } |
178 | } |
179 | |
180 | //----------------------------------------------------------------------- |
181 | static void FUN_VPgeometryfound |
182 | (TopOpeBRep_FacesFiller& FF, |
183 | const TopOpeBRep_LineInter& L, |
184 | const TopOpeBRep_VPointInter& VP, |
185 | const Standard_Integer ShapeIndex, |
186 | const Handle(TopOpeBRepDS_HDataStructure)& HDS, |
187 | const TopOpeBRepDS_ListOfInterference& DSCIL, |
188 | TopOpeBRepDS_Kind& PVKind, Standard_Integer& PVIndex, |
189 | Standard_Boolean& EPIfound, Handle(TopOpeBRepDS_Interference)& IEPI, |
190 | Standard_Boolean& CPIfound, Handle(TopOpeBRepDS_Interference)& ICPI, |
191 | Standard_Boolean& OOEPIfound, Handle(TopOpeBRepDS_Interference)& IOOEPI) // (only if on2edges) |
192 | //----------------------------------------------------------------------- |
193 | { |
194 | Standard_Boolean Lrest = (L.TypeLineCurve() == TopOpeBRep_RESTRICTION); |
195 | TopoDS_Shape Erest; Standard_Real parErest=0; Standard_Integer rkErest=0; |
196 | if (Lrest) { |
197 | Erest = L.Arc(); parErest = VP.ParameterOnLine(); |
198 | Standard_Boolean isedge1 = L.ArcIsEdge(1); Standard_Boolean isedge2 = L.ArcIsEdge(2); |
199 | rkErest = (isedge1) ? 1 : (isedge2) ? 2 : 0; |
200 | } |
201 | |
202 | Standard_Integer absindex = VP.ShapeIndex(); |
203 | Standard_Integer OOabsindex = (absindex == 1) ? 2 : 1; |
498ce76b |
204 | Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; |
7fd59977 |
205 | Standard_Boolean on2edges = (absindex == 3) || (Lrest && (rkErest == OOabsindex)); |
206 | TopoDS_Shape edge = (rkErest == ShapeIndex)? Erest : VP.Edge(ShapeIndex); |
207 | |
208 | PVIndex = 0; // POINT or VERTEX index |
209 | EPIfound = CPIfound = OOEPIfound = Standard_False; |
210 | Standard_Real par = (rkErest == ShapeIndex)? parErest : VP.EdgeParameter(ShapeIndex); |
211 | Standard_Real tole = FUN_tool_maxtol(edge); |
212 | Standard_Real tolp = Precision::Parametric(tole); |
213 | |
214 | const TopOpeBRepDS_DataStructure& BDS = HDS->DS(); |
215 | if (BDS.HasShape(edge)) { |
7fd59977 |
216 | const TopOpeBRepDS_ListOfInterference& EPIL = BDS.ShapeInterferences(edge); |
217 | TopOpeBRepDS_ListIteratorOfListOfInterference itEPIL(EPIL); |
218 | EPIfound = FF.GetGeometry(itEPIL,VP,PVIndex,PVKind); |
219 | if (!EPIfound) { |
220 | itEPIL.Initialize(EPIL); |
221 | EPIfound = FUN_GetGonParameter(itEPIL,par,tolp,PVIndex,PVKind); |
222 | } |
223 | if (EPIfound) IEPI = itEPIL.Value(); |
224 | } |
225 | |
226 | TopOpeBRepDS_ListIteratorOfListOfInterference itCPIL(DSCIL); |
0797d9d3 |
227 | #ifdef OCCT_DEBUG |
7fd59977 |
228 | Standard_Boolean trc = Standard_False; |
229 | if (trc) {TopOpeBRepDS_Dumper DSD(HDS); TCollection_AsciiString aa("DSCIL :"); |
230 | DSD.DumpLOI(DSCIL,cout,aa);} |
231 | #endif |
232 | CPIfound = FF.GetGeometry(itCPIL,VP,PVIndex,PVKind); |
233 | if (CPIfound) ICPI = itCPIL.Value(); |
234 | |
235 | // - <VP> is of shapeindex 3 : is on <edge> and <OOedge>, |
236 | // - <VP> is of shapeindex <ShapeIndex> and <VP> is given ON another edge <OOedge> |
237 | // If <OOedge> is defined, we look among the list of interferences attached |
238 | // to the other edge <OOedge> for an interference of geometry falling into <VP>'s. |
239 | |
240 | Standard_Boolean hasOOedge = Standard_True; |
241 | if (on2edges) hasOOedge = Standard_True; |
242 | else hasOOedge = (VP.State(OOShapeIndex) == TopAbs_ON); |
243 | if ( hasOOedge ) { |
244 | TopoDS_Shape OOedge; |
498ce76b |
245 | |
7fd59977 |
246 | if (on2edges) OOedge = (rkErest == OOShapeIndex)? Erest : VP.Edge(OOShapeIndex); |
7fd59977 |
247 | else OOedge = VP.EdgeON(OOShapeIndex); |
498ce76b |
248 | |
7fd59977 |
249 | Standard_Real OOpar = 0.; |
498ce76b |
250 | |
7fd59977 |
251 | if (on2edges) OOpar = (rkErest == OOShapeIndex)? parErest : VP.EdgeParameter(OOShapeIndex); |
7fd59977 |
252 | else OOpar = VP.EdgeONParameter(OOShapeIndex); |
498ce76b |
253 | |
7fd59977 |
254 | Standard_Real tolOOe = FUN_tool_maxtol(OOedge); |
255 | Standard_Real OOtolp = Precision::Parametric(tolOOe); |
256 | if (BDS.HasShape(OOedge)) { |
7fd59977 |
257 | const TopOpeBRepDS_ListOfInterference& OOEPIL = BDS.ShapeInterferences(OOedge); |
258 | TopOpeBRepDS_ListIteratorOfListOfInterference OOitEPIL(OOEPIL); |
259 | OOEPIfound = FF.GetGeometry(OOitEPIL,VP,PVIndex,PVKind); |
260 | if (!OOEPIfound) { |
261 | OOitEPIL.Initialize(OOEPIL); |
262 | FUN_GetGonParameter(OOitEPIL,OOpar,OOtolp,PVIndex,PVKind); |
263 | } |
264 | if (OOEPIfound) IOOEPI = OOitEPIL.Value(); |
265 | } |
266 | } |
267 | } |
268 | |
269 | #define M_FINDVP (0) // only look for new vp |
270 | #define M_MKNEWVP (1) // only make newvp |
271 | #define M_GETVP (2) // steps (0) [+(1) if (O) fails] |
272 | |
273 | //----------------------------------------------------------------------- |
274 | Standard_EXPORT void FUN_VPIndex |
275 | (TopOpeBRep_FacesFiller& FF, |
276 | const TopOpeBRep_LineInter& L, |
277 | const TopOpeBRep_VPointInter& VP, |
278 | const Standard_Integer ShapeIndex, |
279 | const Handle(TopOpeBRepDS_HDataStructure)& HDS, |
280 | const TopOpeBRepDS_ListOfInterference& DSCIL, |
281 | TopOpeBRepDS_Kind& PVKind, Standard_Integer& PVIndex, // out |
282 | Standard_Boolean& EPIfound, Handle(TopOpeBRepDS_Interference)& IEPI, // out |
283 | Standard_Boolean& CPIfound, Handle(TopOpeBRepDS_Interference)& ICPI, // out |
284 | const Standard_Integer mkVP) |
285 | //----------------------------------------------------------------------- |
286 | { |
287 | PVIndex = 0; // POINT or VERTEX index |
288 | Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; |
289 | Standard_Boolean SIisvertex = VP.IsVertex(ShapeIndex); |
290 | Standard_Boolean OOisvertex = VP.IsVertex(OOShapeIndex); |
291 | |
292 | // search for an interference with a equal 3D geometry |
293 | // if found, set PVIndex to index of geometry found |
294 | // if not found, make a new geometry PVIndex with 3d point or vertex |
295 | |
296 | Standard_Boolean OOEPIfound = Standard_False; |
297 | Handle(TopOpeBRepDS_Interference) IOOEPI; |
298 | if ((mkVP == M_FINDVP)||(mkVP == M_GETVP)) { |
299 | FUN_VPgeometryfound (FF,L,VP,ShapeIndex,HDS,DSCIL, //in |
300 | PVKind,PVIndex, // out |
301 | EPIfound,IEPI, // out |
302 | CPIfound,ICPI, // out |
303 | OOEPIfound,IOOEPI); // out (only if on2edges) |
304 | if (mkVP == M_FINDVP) { |
305 | //JMB 27 Dec 1999 |
306 | //modified by NIZHNY-MZV Tue Apr 25 09:27:15 2000 |
307 | if (!EPIfound && !CPIfound && !OOEPIfound) |
308 | PVIndex = 0; // if we just want to find (M_FINDVP) then we must readjust PVIndex to 0 |
309 | // because OOEPIfound is not treated in the upper function. The upper function |
310 | // will detect that we found a geometry because PVIndex != 0 but as EPIfound and |
311 | // CPIfound are FALSE, the resulting VP geometry give unpredictable results. |
312 | return; |
313 | } |
314 | } |
315 | // Gfound = VP corresponds with an existing geometry of ShapeIndex |
316 | Standard_Boolean Gfound = ( EPIfound || CPIfound); |
317 | // Gfound = or with an existing geometry of OOShapeIndex |
318 | Gfound = Gfound || OOEPIfound; |
319 | |
320 | Standard_Boolean on2edges = (VP.ShapeIndex() == 3); |
321 | Standard_Boolean hasOOedge = Standard_True; |
322 | if (on2edges) hasOOedge = Standard_True; |
323 | else hasOOedge = (VP.State(OOShapeIndex) == TopAbs_ON); |
324 | // If v shares same domain with a vertex of the other shape, |
325 | // v has already been stored in the DS |
326 | |
327 | if (PVIndex == 0) PVKind = (SIisvertex || OOisvertex) ? TopOpeBRepDS_VERTEX : TopOpeBRepDS_POINT; |
328 | |
329 | if ( hasOOedge && !Gfound ) { |
330 | if ( !OOEPIfound ) { |
331 | if ( SIisvertex ) PVIndex = FF.MakeGeometry(VP,ShapeIndex,PVKind); |
332 | else if ( OOisvertex ) PVIndex = FF.MakeGeometry(VP,OOShapeIndex,PVKind); |
333 | else PVIndex = FF.MakeGeometry(VP,ShapeIndex,PVKind); |
334 | } |
335 | } |
336 | if ( !hasOOedge && !Gfound ) { |
337 | Standard_Boolean found = FF.GetFFGeometry(VP,PVKind,PVIndex); |
338 | if ( !found) { |
339 | if ( SIisvertex ) PVIndex = FF.MakeGeometry(VP,ShapeIndex,PVKind); |
340 | else if ( OOisvertex ) PVIndex = FF.MakeGeometry(VP,OOShapeIndex,PVKind); |
341 | else PVIndex = FF.MakeGeometry(VP,ShapeIndex,PVKind); |
342 | } |
343 | } |
344 | } // FUN_VPIndex |
345 | |
346 | //----------------------------------------------------------------------- |
347 | static Standard_Boolean FUN_LineRestF |
348 | (const TopoDS_Face& F, const TopOpeBRep_LineInter& L, |
349 | const TopTools_ListOfShape& ERL, TopoDS_Edge& ER) |
350 | //----------------------------------------------------------------------- |
351 | { |
352 | // returns true if <L> is ON a restriction <ER> of <F> |
353 | // <ERL> is the list of the faces intersector. |
354 | // prequesitory : <L> is on edge |
355 | TopTools_IndexedMapOfShape mapE; |
356 | TopExp::MapShapes(F,TopAbs_EDGE,mapE); |
357 | TopTools_ListIteratorOfListOfShape itER(ERL); |
358 | TopTools_ListOfShape ERLonF; |
359 | for (; itER.More(); itER.Next()){ |
360 | const TopoDS_Shape& e = itER.Value(); |
361 | if (mapE.Contains(e)) ERLonF.Append(e); |
362 | } |
363 | itER.Initialize(ERLonF); |
364 | TopTools_ListOfShape ERLonFonL; |
365 | for (; itER.More(); itER.Next()){ |
366 | const TopoDS_Shape& e = itER.Value(); |
367 | TopTools_ListOfShape eL; eL.Append(e); |
368 | Standard_Boolean isonL = TopOpeBRep_FacesFiller::LSameDomainERL(L,eL); |
369 | if (isonL) ERLonFonL.Append(e); |
370 | } |
371 | // <L> is on at most one edge restriction. |
372 | if (ERLonFonL.Extent() != 1) return Standard_False; |
373 | ER = TopoDS::Edge(ERLonFonL.First()); |
374 | return Standard_True; |
375 | } |
376 | |
377 | //----------------------------------------------------------------------- |
378 | Standard_EXPORT Standard_Boolean FUN_newtransEdge |
379 | (const Handle(TopOpeBRepDS_HDataStructure) HDS, |
380 | const TopOpeBRep_FacesFiller& FF, |
381 | const TopOpeBRep_LineInter& L, |
382 | const Standard_Boolean& Lonrest, |
383 | const TopOpeBRep_VPointInter& VP, |
384 | const TopOpeBRepDS_Kind PVKind,const Standard_Integer PVIndex, |
385 | const Standard_Integer& OOShapeIndex, |
386 | const TopoDS_Edge& edge, const TopTools_ListOfShape& ERL, TopOpeBRepDS_Transition& T) |
387 | //----------------------------------------------------------------------- |
388 | { |
389 | T.Before(TopAbs_UNKNOWN); T.After(TopAbs_UNKNOWN); |
390 | const TopoDS_Face& OOface = FF.Face(OOShapeIndex); |
391 | TopoDS_Face FIE = OOface; |
392 | { |
393 | TopAbs_Orientation oFIE = FIE.Orientation(); |
394 | if (oFIE == TopAbs_INTERNAL || oFIE == TopAbs_EXTERNAL) { |
395 | T.Set(oFIE); |
396 | return Standard_True; |
397 | } |
398 | } |
399 | |
400 | // compute of transition on edge <edge> while crossing <VP>. |
401 | // <VP> given by <paredge> on <edge>, <uv> on <OOface>, |
402 | // <paronline> on Line. |
403 | |
404 | // <C>, <pf>, <pl>, <paredge> : |
405 | Standard_Real paredge; Standard_Boolean ok = VP.ParonE(edge,paredge); if (!ok) return Standard_False; |
406 | |
407 | Standard_Real par1,par2; |
408 | if (HDS->HasShape(edge)) { |
409 | Standard_Boolean isonper; |
410 | if (PVIndex == 0) FDS_getupperlower(HDS,HDS->DS().Shape(edge),paredge,par1,par2); |
411 | else FDS_LOIinfsup(HDS->DS(),edge,paredge,PVKind,PVIndex, |
412 | HDS->DS().ShapeInterferences(edge), |
413 | par1,par2,isonper); |
414 | } |
415 | else |
416 | FUN_tool_bounds(edge,par1,par2); |
417 | |
418 | gp_Pnt2d uv = VP.SurfaceParameters(OOShapeIndex); |
419 | |
0797d9d3 |
420 | #ifdef OCCT_DEBUG |
7fd59977 |
421 | TopOpeBRepDS_Transition Tr; |
422 | #endif |
423 | // <Tr> relative to 3d <OOface> matter, |
424 | // we take into account <Tr> / 2d <OOface> only if <edge> is normal to <OOface> |
425 | Standard_Real tola = Precision::Angular()*1.e+4; //dealing with tolerances |
426 | Standard_Boolean EtgOOF = FUN_tool_EtgF(paredge,edge,uv,OOface,tola); |
427 | Standard_Boolean inERL = FUN_INlos(edge,ERL); |
428 | Standard_Boolean isse = HDS->DS().IsSectionEdge(edge); |
429 | Standard_Boolean rest = inERL || isse; |
430 | Standard_Boolean interf2d = EtgOOF && Lonrest && rest; |
431 | Standard_Boolean interf3dtg = EtgOOF && rest && !interf2d; // xpu260898 :cto902D6,(e15,p3,f9) |
7fd59977 |
432 | |
433 | Standard_Real factor = 1.e-2; |
434 | TopOpeBRepTool_makeTransition MKT; |
435 | ok = MKT.Initialize(edge,par1,par2,paredge, OOface,uv, factor); |
436 | if (!ok) return Standard_False; |
437 | Standard_Boolean isT2d = MKT.IsT2d(); |
438 | interf2d = interf2d && isT2d; |
439 | |
440 | TopAbs_State stb,sta; |
441 | if (interf2d) { |
442 | // <tgLine> : |
443 | TopoDS_Edge OOER; Standard_Boolean onOOface = Standard_False; |
444 | TopOpeBRep_TypeLineCurve typL = L.TypeLineCurve(); |
445 | if (typL == TopOpeBRep_RESTRICTION) {onOOface = Standard_True; OOER = TopoDS::Edge(L.Arc());} |
446 | else {onOOface = ::FUN_LineRestF(OOface,L,ERL,OOER);} |
447 | if (!onOOface) return Standard_False; |
448 | |
449 | Standard_Real OOpar; ok = VP.ParonE(OOER,OOpar); |
450 | if (!ok) ok = FUN_tool_parE(edge,paredge,OOER,OOpar); |
451 | if (!ok) return Standard_False; |
452 | |
453 | //xpu051098 : cto900L4 (edge18,OOface5) |
454 | ok = MKT.SetRest(OOER,OOpar); |
455 | if (!ok) return Standard_False; |
456 | } |
457 | else if (interf3dtg) { |
458 | Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3 |
459 | Standard_Boolean on2edges = (absindex == 3); |
460 | Standard_Boolean hasONedge = (VP.State(OOShapeIndex) == TopAbs_ON); |
461 | Standard_Boolean hasOOedge = (on2edges) ? Standard_True : hasONedge; |
462 | |
463 | if ( hasOOedge ) { |
464 | TopoDS_Edge OOedge; Standard_Real OOpar = 1.e7; |
465 | if (on2edges) |
466 | {OOedge = TopoDS::Edge(VP.Edge(OOShapeIndex)); OOpar = VP.EdgeParameter(OOShapeIndex);} |
467 | else |
468 | {OOedge = TopoDS::Edge(VP.EdgeON(OOShapeIndex)); OOpar = VP.EdgeONParameter(OOShapeIndex);} |
469 | |
470 | ok = MKT.SetRest(OOedge,OOpar); |
471 | if (!ok) return Standard_False; |
472 | } |
473 | } |
474 | |
475 | ok = MKT.MkTonE(stb,sta); |
476 | if (!ok) return Standard_False; |
477 | T.Before(stb); T.After(sta); |
478 | return Standard_True; |
479 | } // FUN_newtransEdge |
480 | |
481 | //----------------------------------------------------------------------- |
482 | static void FUN_ScanInterfList(const TopOpeBRepDS_Point& PDS, const Handle(TopOpeBRepDS_HDataStructure) HDS, |
483 | const TopOpeBRepDS_ListOfInterference& loI, TopOpeBRepDS_ListOfInterference& loIfound) |
484 | //----------------------------------------------------------------------- |
485 | { |
486 | // looks among the list of interferences <loI> for interferences |
487 | // of geometry falling into <PDS>, add them to <loIfound> |
488 | TopOpeBRepDS_ListIteratorOfListOfInterference it(loI); |
489 | while ( it.More()) { |
490 | Standard_Boolean found = HDS->ScanInterfList(it,PDS); |
491 | if (found) { |
492 | loIfound.Append(it.Value()); |
493 | if (it.More()) it.Next(); |
494 | } |
495 | else return; |
496 | } |
497 | } |
498 | |
499 | static Standard_Boolean FUN_selectTRAISHAinterference(const TopOpeBRepDS_ListOfInterference& lI, const Standard_Integer ITRASHA, |
500 | TopOpeBRepDS_ListOfInterference& lITRAonISHA) |
501 | // purpose : <lITRAonISHA> = {I = (T on ITRASHA,G,S)} |
502 | { |
503 | lITRAonISHA.Clear(); |
504 | TopOpeBRepDS_ListIteratorOfListOfInterference it(lI); |
505 | for (; it.More(); it.Next()) { |
506 | const Handle(TopOpeBRepDS_Interference)& I = it.Value(); |
507 | const TopOpeBRepDS_Transition& T = I->Transition(); |
508 | Standard_Integer iTRASHA = T.Index(); |
509 | // BUG : |
510 | //POP : pb : comparaison entre 2 enum differentes : on prend la valeur correspondante |
511 | if (T.Orientation(TopAbs_IN) == TopAbs_EXTERNAL) continue; //xpu030998 |
512 | // if (T.Orientation(TopAbs_IN) == TopAbs_UNKNOWN) continue; //xpu030998 |
513 | if (iTRASHA == ITRASHA) lITRAonISHA.Append(I); |
514 | } |
515 | Standard_Boolean noIfound = lITRAonISHA.IsEmpty(); |
516 | return !noIfound; |
517 | } |
518 | |
519 | static Standard_Boolean FUN_selectGinterference(const TopOpeBRepDS_ListOfInterference& lI, const Standard_Integer G, |
520 | TopOpeBRepDS_ListOfInterference& lIonG) |
521 | { |
522 | lIonG.Clear(); |
523 | TopOpeBRepDS_ListIteratorOfListOfInterference it(lI); |
524 | for (; it.More(); it.Next()) { |
525 | const Handle(TopOpeBRepDS_Interference)& I = it.Value(); |
526 | if (I->Geometry() == G) lIonG.Append(I); |
527 | } |
528 | Standard_Boolean noIfound = lIonG.IsEmpty(); |
529 | return !noIfound; |
530 | } |
531 | |
532 | static Standard_Boolean FUN_sameGsameS(const TopOpeBRepDS_ListOfInterference& loI, const Standard_Integer& G, const Standard_Integer& S, |
533 | TopOpeBRepDS_ListOfInterference& loIfound) |
534 | { |
535 | loIfound.Clear(); |
536 | // Gets among the list <loI> the interferences of : |
537 | // geometry <G>, and support <S> |
538 | TopOpeBRepDS_PointIterator PI(loI); |
539 | for (; PI.More(); PI.Next()) { |
540 | Handle(TopOpeBRepDS_Interference) EPI = PI.Value(); |
541 | Standard_Integer GEPI = EPI->Geometry(); Standard_Integer SEPI = EPI->Support(); |
542 | if (GEPI == G && SEPI == S) loIfound.Append(EPI); |
543 | } |
544 | return (loIfound.Extent() > 0); |
545 | } |
546 | |
547 | //----------------------------------------------------------------------- |
548 | static void FUN_processCPI |
549 | (TopOpeBRep_FacesFiller& FF, |
550 | const TopOpeBRep_VPointInter& VP, |
551 | const TopoDS_Shape& F, |
552 | const Standard_Integer ShapeIndex, |
553 | const TopOpeBRep_LineInter& L, |
554 | TopOpeBRepDS_PDataStructure pDS, |
555 | const TopOpeBRepDS_Transition& transLine, |
556 | const TopOpeBRepDS_ListOfInterference& DSCIL, |
557 | const Handle(TopOpeBRepDS_Interference)& Ifound, |
558 | const Standard_Boolean& Gfound, |
559 | const TopOpeBRepDS_Kind& PVKind,const Standard_Integer& PVIndex, |
560 | Standard_Integer& keptVPnbr) |
561 | //----------------------------------------------------------------------- |
562 | { |
7fd59977 |
563 | Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; |
564 | |
565 | TopOpeBRepDS_Transition ttransLine = transLine; |
566 | // prequesitory : current line is not on edge. |
567 | Standard_Real parline = VP.ParameterOnLine(); |
568 | Standard_Boolean SIisvertex = VP.IsVertex(ShapeIndex); |
569 | Standard_Boolean OOisvertex = VP.IsVertex(OOShapeIndex); |
570 | const TopoDS_Shape& E = VP.Edge(ShapeIndex); |
571 | |
572 | // xpu010299 : we do not keep interferences with same parameters on curve |
573 | // PRO16120(f3,f4 -> null c1) |
574 | if (!DSCIL.IsEmpty()) { |
575 | Standard_Real par = FDS_Parameter(DSCIL.Last()); // parameter on curve |
576 | Standard_Real dd = Abs(par-parline); // en fait, ce sont des entiers |
577 | if (dd == 0) return; |
578 | } |
579 | |
580 | // dist(p2d1,p2d2) < toluv => p2d1, p2d2 are considered equal. |
581 | // NYI : compute uvtol with the original faces. By default, we set toluv = TolClass |
582 | Standard_Real toluv = 1.e-8; |
583 | Standard_Boolean keep = FUNBREP_topokpart(Ifound,DSCIL,L,VP,(*pDS),E,F,toluv,parline,ttransLine); |
584 | |
0797d9d3 |
585 | #ifdef OCCT_DEBUG |
7fd59977 |
586 | Standard_Integer trc=TopOpeBRepDS_GettraceDSF(); |
587 | if (trc){if(keep)cout<<"\t-> on garde";else cout<<"\t-> on jette";cout<<endl;} |
588 | #endif |
589 | |
590 | if (keep) { |
591 | keptVPnbr++; |
592 | if (keptVPnbr > 2) keep = Standard_False; |
593 | } |
594 | if (!keep) return; |
595 | |
596 | Handle(TopOpeBRepDS_Interference) CPI; |
597 | { |
598 | TopOpeBRepDS_Kind GKCPV; |
599 | if (Gfound) GKCPV = PVKind; |
600 | else GKCPV = (SIisvertex || OOisvertex) ? TopOpeBRepDS_VERTEX : TopOpeBRepDS_POINT; |
601 | |
602 | CPI = ::MakeCPVInterference(ttransLine,0,PVIndex,parline,GKCPV); |
603 | FF.StoreCurveInterference(CPI); |
604 | } |
605 | } |
606 | |
607 | static Standard_Boolean FUN_onedge(const TopOpeBRepDS_Point& PDS, const TopoDS_Edge& E) |
608 | { |
609 | gp_Pnt P = PDS.Point(); |
610 | Standard_Real tolP = PDS.Tolerance(); Standard_Real tolE = BRep_Tool::Tolerance(E); |
611 | Standard_Real tol = Max(tolP,tolE); |
612 | TopoDS_Vertex vf,vl; TopExp::Vertices(E,vf,vl); |
613 | gp_Pnt pf = BRep_Tool::Pnt(vf); Standard_Boolean isonf = P.IsEqual(pf,tol); |
614 | gp_Pnt pl = BRep_Tool::Pnt(vl); Standard_Boolean isonl = P.IsEqual(pl,tol); |
615 | return isonf || isonl; |
616 | } |
617 | |
0797d9d3 |
618 | #ifdef OCCT_DEBUG |
7fd59977 |
619 | Standard_EXPORT void funraise() {cout<<"!!!!!!!!!! PVIndex = 0 !!!!!!!!!!"<<endl;} |
620 | #endif |
621 | |
622 | //======================================================================= |
623 | //function : ProcessVPonR |
624 | //purpose : |
625 | //======================================================================= |
626 | |
627 | void TopOpeBRep_FacesFiller::ProcessVPonR |
628 | (const TopOpeBRep_VPointInter& VP, |
629 | const TopOpeBRepDS_Transition& Trans, |
630 | // const TopoDS_Shape& GFace, |
631 | const TopoDS_Shape& , |
632 | const Standard_Integer ShapeIndex) //1,2 |
633 | { |
634 | Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3 |
635 | Standard_Integer iVP = VP.Index(); |
636 | Standard_Boolean OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; |
637 | Standard_Boolean on2edges = (absindex == 3); |
638 | Standard_Boolean hasONedge = (VP.State(OOShapeIndex) == TopAbs_ON); |
639 | Standard_Boolean hasOOedge = (on2edges) ? Standard_True : hasONedge; |
640 | |
641 | TopoDS_Face Face = (*this).Face(ShapeIndex); |
642 | Standard_Integer iSIFace = myDS->Shape(Face); |
643 | if (iSIFace == 0) iSIFace = myDS->AddShape(Face,ShapeIndex); |
644 | TopoDS_Face OOFace = (*this).Face(OOShapeIndex); |
645 | Standard_Integer iOOFace = myDS->Shape(OOFace); |
646 | if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex); |
647 | |
648 | // current VPoint is on <edge> |
649 | Standard_Integer SIedgeIndex = 0; |
650 | const TopoDS_Edge& edge = TopoDS::Edge(VP.Edge(ShapeIndex)); |
651 | if (myDS->HasShape(edge)) SIedgeIndex = myDS->Shape(edge); |
652 | Standard_Real paredge = VP.EdgeParameter(ShapeIndex); |
653 | Standard_Boolean isrest = myDS->IsSectionEdge(edge); |
654 | Standard_Boolean closing = TopOpeBRepTool_ShapeTool::Closed(edge,Face); |
655 | Standard_Boolean dge = BRep_Tool::Degenerated(edge); |
656 | |
657 | // dummy if !<hasOOedge> |
658 | Standard_Integer OOedgeIndex = 0; |
659 | Standard_Boolean OOclosing,OOisrest; OOclosing = OOisrest = Standard_False; |
660 | TopoDS_Edge OOedge; Standard_Real OOparedge = 0.; Standard_Boolean dgOOe = Standard_False; |
661 | if ( hasOOedge ) { |
662 | if (on2edges) OOparedge = VP.EdgeParameter(OOShapeIndex); |
663 | else OOparedge = VP.EdgeONParameter(OOShapeIndex); |
664 | TopoDS_Shape OOe; |
665 | if (on2edges) OOe = VP.Edge(OOShapeIndex); |
666 | else OOe = VP.EdgeON(OOShapeIndex); |
667 | OOedge = TopoDS::Edge(OOe); |
668 | if (myDS->HasShape(OOedge)) OOedgeIndex = myDS->Shape(OOedge); |
669 | OOisrest = myDS->IsSectionEdge(OOedge); |
670 | OOclosing = TopOpeBRepTool_ShapeTool::Closed(OOedge,OOFace); |
671 | dgOOe = BRep_Tool::Degenerated(OOedge); |
672 | } |
673 | |
0797d9d3 |
674 | #ifdef OCCT_DEBUG |
7fd59977 |
675 | Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF(); |
676 | Standard_Boolean traceDSP = TopOpeBRepDS_GettraceDSP(); |
677 | Standard_Integer ili=myLine->Index(),ivp=iVP,isi=ShapeIndex; |
678 | if(traceDSF || traceDSP){ |
679 | cout<<endl; |
680 | cout<<"trc tnvp 1 "<<myexF1<<" "<<myexF2<<" "<<ili<<" "<<ivp<<" "<<isi; |
681 | cout<<"; # VPonR "<<iVP<<" on "<<ShapeIndex<<" from "<<absindex<<endl; |
682 | } |
683 | GLOBAL_bvpr = TopOpeBRep_GettraceNVP(myexF1,myexF2,ili,ivp,isi); |
684 | if (TopOpeBRepDS_GettraceISTO()) { |
685 | cout<<"f1,f2,l,vp,si : "; |
686 | cout<<myexF1<<","<<myexF2<<","<<ili<<","<<ivp<<","<<isi<<endl; |
687 | } |
688 | if (GLOBAL_bvpr) debvprmess(myexF1,myexF2,ili,ivp,isi); |
689 | if (traceDSF){ |
690 | cout<<"VP is on";if (closing) cout<<" CLOSING"; |
691 | cout<<" edge "<<SIedgeIndex; |
692 | if(isrest) cout<<" RESTRICTION"; cout<<endl; |
693 | if (OOclosing) cout<<" on CLOSING OOedge "<<OOedgeIndex; |
694 | if(OOisrest) cout<<" RESTRICTION"; cout<<endl; |
695 | } |
696 | #endif |
697 | |
698 | // degenerated edge processing |
699 | // --------------------------- |
700 | Standard_Integer PVIndex = 0; // POINT or VERTEX index |
701 | TopOpeBRepDS_Kind PVKind; |
702 | Standard_Boolean EPIfound,CPIfound; |
703 | EPIfound = CPIfound = Standard_False; |
704 | Handle(TopOpeBRepDS_Interference) IEPI,ICPI; |
705 | ProcessVPondgE(VP, ShapeIndex, |
706 | PVKind,PVIndex, // out |
707 | EPIfound,IEPI, // out |
708 | CPIfound,ICPI); // out |
709 | Standard_Boolean foundPVIndex = (PVIndex != 0); |
710 | |
711 | |
712 | // =================================================================== |
713 | // <TransLine>, <transEdge> |
714 | // =================================================================== |
715 | |
716 | Standard_Boolean wline = (myLine->TypeLineCurve() == TopOpeBRep_WALKING); |
717 | Standard_Boolean grestriction = (myLine->TypeLineCurve() == TopOpeBRep_RESTRICTION); |
718 | Standard_Boolean glinenotoned = !wline && !grestriction && !myLineIsonEdge; |
719 | |
720 | // lasttransLine (for walking line) |
721 | // ------------- |
722 | // set lasttransLine for a WALKING line |
723 | Standard_Boolean dscilempty = myDSCIL.IsEmpty(); |
724 | Standard_Boolean setlastonwl = wline && !dscilempty; |
725 | if (setlastonwl) { //xpu171198, FRA61896 (f7,f13-> null DSC1) |
726 | Standard_Real parline = VP.ParameterOnLine(); |
727 | Standard_Real par = FDS_Parameter(myDSCIL.Last()); // parameter on curve |
728 | Standard_Real dd = Abs(par-parline); // en fait, ce sont des entiers |
729 | if (dd == 0) setlastonwl=Standard_False; |
730 | } |
731 | TopOpeBRepDS_Transition lasttransLine; if (setlastonwl) lasttransLine = myDSCIL.Last()->Transition(); |
732 | |
733 | // edgeori, transLine |
734 | // ------------------ |
735 | TopAbs_Orientation edgeori = edge.Orientation(); |
736 | TopOpeBRepDS_Transition transLine; |
737 | transLine = TopOpeBRep_FFTransitionTool::ProcessLineTransition |
738 | (VP,ShapeIndex,edgeori); |
739 | Standard_Boolean trliunk = transLine.IsUnknown(); |
740 | |
741 | // 1_ If vpmin has transition OUT/IN, and vpmax is UNKNOWN, |
742 | // we change vpmax transition as IN/OUT |
743 | // |
744 | // 2_ If vpmin is UNKNOWN (if vp is first on line and transition is UNKNOWN, |
745 | // vpmin's transition is ON/ON the OOshape) |
746 | // we change vpmin transition as OUT/IN |
747 | // |
748 | // (kpart : sphere/box, with the sphere's sewing edge lying on one boxe's |
749 | // face and one of the edge's vertices IN the same face) |
750 | |
751 | Standard_Integer iINON1,iINONn,nINON; myLine->VPBounds(iINON1,iINONn,nINON); |
752 | Standard_Boolean islastvp = (iVP == iINONn); |
753 | Standard_Boolean isfirstvp = (iVP == iINON1); |
754 | |
755 | Standard_Boolean keepvp = Standard_False; |
756 | Standard_Boolean ret1 = Standard_False; |
757 | if ( trliunk ) { |
758 | // <transLine> is unknown : |
759 | // for a walking -> |
760 | // - if <myDSCIL> is not empty, |
761 | // we set it as the last transition complemented |
762 | // - else, |
763 | // we look after an determinate transition on VP(i>iVP) |
764 | // and set transLine as this last complemented. |
765 | // |
766 | // for a gline not on edge -> |
767 | // - if the transition on edge is unknown too and !<keepvp>, |
768 | // we do not keep it. |
769 | // elsewhere -> we do not keep <VP> |
770 | |
771 | if ( wline ) { |
772 | if (setlastonwl) transLine = lasttransLine.Complement(); |
773 | else ::FUN_transForWL(*myLine,iVP,ShapeIndex,transLine); |
774 | |
775 | // walki vpfirst on 3, vplast on 0, nvpkept = 2 kept |
776 | if (transLine.IsUnknown()) { |
777 | //modified by NIZHNY-MKK Mon Jul 3 11:30:03 2000.BEGIN |
778 | Standard_Boolean keepvpfirst = dscilempty && isfirstvp && (nINON == 2); |
779 | if(absindex==3) |
780 | keepvpfirst = keepvpfirst && myLastVPison0; |
781 | //modified by NIZHNY-MKK Mon Jul 3 11:30:21 2000.END |
782 | if (keepvpfirst) transLine.Set(TopAbs_FORWARD); |
0797d9d3 |
783 | #ifdef OCCT_DEBUG |
7fd59977 |
784 | if (traceDSF) cout<<"myLastVPison0 ->"<<endl; |
785 | #endif |
786 | ret1 = Standard_False; |
787 | } |
788 | } |
789 | else if ( glinenotoned ) { |
790 | // if (islastvp) keepvp = !dscilempty; |
791 | // if (isfirstvp) keepvp = Standard_True; |
792 | if (isfirstvp) keepvp = Standard_True; |
793 | else { |
794 | if (islastvp) keepvp = !dscilempty; |
795 | else { |
796 | if(!dge && !dgOOe && (VP.IsVertexOnS1() || VP.IsVertexOnS2())) { |
797 | // If VP is on vertex we should compute at least one interference for the edge. |
798 | // This interference is necessary at least to indicate that the edge intersect something. |
799 | const TopOpeBRep_VPointInter& aFirstPoint = myLine->VPoint(iINON1); |
800 | const TopOpeBRep_VPointInter& aLastPoint = myLine->VPoint(iINONn); |
801 | |
802 | for(Standard_Integer faceindex = 1; !keepvp && faceindex <=2; faceindex++) { |
803 | Standard_Boolean VPIsVertex = (faceindex==1) ? VP.IsVertexOnS1() : VP.IsVertexOnS2(); |
804 | Standard_Boolean FirstPointIsVertex = (faceindex==1) ? aFirstPoint.IsVertexOnS1() : aFirstPoint.IsVertexOnS2(); |
805 | Standard_Boolean LastPointIsVertex = (faceindex==1) ? aLastPoint.IsVertexOnS1() : aLastPoint.IsVertexOnS2(); |
806 | if(VPIsVertex) { |
807 | const TopoDS_Shape& aV1 = (faceindex==1) ? VP.VertexOnS1() : VP.VertexOnS2(); |
808 | if(FirstPointIsVertex) { |
809 | const TopoDS_Shape& aV2 = (faceindex==1) ? aFirstPoint.VertexOnS1(): aFirstPoint.VertexOnS2(); |
810 | if(aV1.IsSame(aV2)) { |
811 | keepvp = Standard_True; |
812 | } |
813 | } |
814 | if(!keepvp && LastPointIsVertex) { |
815 | const TopoDS_Shape& aV2 = (faceindex==1) ? aLastPoint.VertexOnS1() : aLastPoint.VertexOnS2(); |
816 | if(aV1.IsSame(aV2)) { |
817 | keepvp = !dscilempty; |
818 | } |
819 | } |
820 | } |
821 | } |
822 | } |
823 | } |
824 | } |
825 | ret1 = !keepvp; |
826 | } |
827 | else |
828 | ret1 = Standard_True; |
829 | } |
830 | trliunk = transLine.IsUnknown(); |
831 | if (ret1) return; |
832 | |
833 | // Transori, transEdge |
834 | // ------------------- |
835 | TopAbs_Orientation Transori = Trans.Orientation(TopAbs_IN); |
836 | TopOpeBRepDS_Transition transEdge = TopOpeBRep_FFTransitionTool::ProcessEdgeTransition(VP,ShapeIndex,Transori); |
0797d9d3 |
837 | #ifdef OCCT_DEBUG |
7fd59977 |
838 | if(traceDSF){cout<<"trans edge on f"<<ShapeIndex<<" / f"<<OOShapeIndex<<" : "; |
839 | transEdge.Dump(cout);cout<<endl;} |
840 | #endif |
841 | |
842 | Standard_Boolean Tunknown = FDS_hasUNK(transEdge); |
843 | TopOpeBRepDS_Point PDS = TopOpeBRep_PointGeomTool::MakePoint(VP);// <VP>'s geometry |
844 | TopOpeBRepDS_ListOfInterference lITOOFonVP; // {I on <edge> = (T on <OOface>, G on <VP>, S)} |
845 | Standard_Boolean found = Standard_False; |
846 | if (SIedgeIndex != 0) { |
847 | TopOpeBRepDS_ListOfInterference lI; |
848 | const TopOpeBRepDS_ListOfInterference& lIedge = myDS->ShapeInterferences(edge); |
849 | if (PVIndex == 0) ::FUN_ScanInterfList(PDS,myHDS,lIedge,lI); |
850 | else ::FUN_selectGinterference(lIedge,PVIndex,lI); |
851 | found = ::FUN_selectTRAISHAinterference(lI,iOOFace,lITOOFonVP); |
852 | } |
853 | |
854 | // if (found && myLineINL && Tunknown) return; //xpu220998 : cto cylcong A1 (edge8,OOface4) |
855 | |
856 | // <Transori> = INTERNAL or EXTERNAL (tangent cases), compute <transEdge> |
857 | Standard_Boolean newtransEdge = (Transori == TopAbs_INTERNAL) || (Transori == TopAbs_EXTERNAL); |
858 | TopAbs_Orientation otransEdge = transEdge.Orientation(TopAbs_IN); |
859 | Standard_Boolean allINT = (Transori == TopAbs_INTERNAL) || (otransEdge == TopAbs_INTERNAL); |
860 | Standard_Boolean allEXT = (Transori == TopAbs_EXTERNAL) || (otransEdge == TopAbs_EXTERNAL); |
861 | |
862 | |
863 | newtransEdge = newtransEdge && (!allINT) && (!allEXT); |
864 | newtransEdge = newtransEdge || Tunknown; |
865 | // -> intersection fails for closing edges |
866 | // 1. <edge> touches closing <OOedge> at <VP> && <OOedge> is tangent to <OOFace>, |
867 | // intersection -> 1 forward && 1 reversed instead of internal/external. |
868 | // 2. if <edge> is tangent to <OOFace> at <VP> on walking |
869 | newtransEdge = newtransEdge || closing || OOclosing; |
870 | newtransEdge = newtransEdge && (!myLineINL); |
871 | if (newtransEdge){ |
0797d9d3 |
872 | #ifdef OCCT_DEBUG |
7fd59977 |
873 | Standard_Integer iedge = |
874 | #endif |
875 | myDS->Shape(edge); |
876 | newtransEdge = !found; |
877 | if (found) { |
878 | // Getting first transition found |
879 | // prequesitory : transition on edge / <OOF> on same geometry point is unchanged |
880 | TopOpeBRepDS_Transition Tr = lITOOFonVP.First()->Transition(); |
881 | transEdge.Before(Tr.Before()); transEdge.After(Tr.After()); |
882 | } |
883 | if (newtransEdge) { |
884 | // Compute of <transEdge> : transition on <edge> at geometry <VP> / <OOface> |
885 | // if line on a restriction OOedge of <OOface> : gets <edge> transition/<OOface> when |
886 | // at <VP> on OOedge. |
887 | // if line is not on restriction : gets <edge> transition/<OOface>. |
888 | TopOpeBRepDS_Transition Tr; |
889 | Standard_Boolean ok = FUN_newtransEdge(myHDS,(*this),(*myLine),myLineIsonEdge,VP, |
890 | PVKind,PVIndex,OOShapeIndex,edge,myERL,Tr); |
891 | if (ok) {transEdge.Before(Tr.Before()); transEdge.After(Tr.After());} |
892 | newtransEdge = ok; |
893 | } |
0797d9d3 |
894 | #ifdef OCCT_DEBUG |
7fd59977 |
895 | if (traceDSF && (found || newtransEdge)) |
896 | {if (found) cout<<"*-> found "; if (newtransEdge) cout<<"*-> new "; |
897 | cout<<"transEdge (edge "<<iedge<<",face"<<iOOFace<<") = "; TopAbs::Print(transEdge.Before(),cout); |
898 | cout<<" ";TopAbs::Print(transEdge.After(),cout);cout<<endl;} |
899 | #endif |
900 | } // newtransEdge |
901 | |
902 | Standard_Boolean tredunk = transEdge.IsUnknown(); |
903 | Standard_Boolean ret2 = Standard_False; |
904 | if ( tredunk ) { |
905 | if (!trliunk) transEdge = transLine.Complement(); |
906 | if (trliunk && !keepvp) ret2 = Standard_True; |
907 | } |
908 | if (ret2) return; |
909 | tredunk = transEdge.IsUnknown(); |
910 | |
911 | // =================================================================== |
912 | // DS geometry Management |
913 | // =================================================================== |
914 | // SI*** : data issued from shape ShapeIndex |
915 | // OO*** : data issued from other shape |
916 | |
917 | if (SIedgeIndex == 0) SIedgeIndex = myDS->AddShape(edge,ShapeIndex); |
0797d9d3 |
918 | #ifdef OCCT_DEBUG |
7fd59977 |
919 | Standard_Boolean trce = TopOpeBRepDS_GettraceSPSX(SIedgeIndex); if(trce) debarc(SIedgeIndex); |
920 | #endif |
921 | |
922 | Standard_Boolean SIisvertex = VP.IsVertex(ShapeIndex); |
923 | Standard_Boolean OOisvertex = VP.IsVertex(OOShapeIndex); |
924 | |
925 | // <PVIndex>, <PVKind> : |
926 | // -------------------- |
927 | // search for an interference with a equal 3D geometry |
928 | // if found, set <PVIndex> to index of geometry found |
929 | // if not found, make a new geometry PVIndex with 3d point or vertex |
930 | |
931 | // modified by NIZHNY-MKK Tue Apr 3 12:08:38 2001.BEGIN |
932 | Standard_Boolean ismultiplekind = foundPVIndex && !EPIfound && !CPIfound && |
933 | (SIisvertex || OOisvertex) && (PVKind == TopOpeBRepDS_POINT); |
934 | |
935 | // if (!foundPVIndex) FUN_VPIndex ((*this),(*myLine),VP,ShapeIndex,myHDS,myDSCIL, //in |
936 | if (!foundPVIndex || ismultiplekind) FUN_VPIndex ((*this),(*myLine),VP,ShapeIndex,myHDS,myDSCIL, //in |
937 | // modified by NIZHNY-MKK Tue Apr 3 12:13:17 2001.END |
938 | PVKind,PVIndex, // out |
939 | EPIfound,IEPI, // out |
940 | CPIfound,ICPI, // out |
941 | M_MKNEWVP); |
942 | if (PVIndex == 0){ |
0797d9d3 |
943 | #ifdef OCCT_DEBUG |
7fd59977 |
944 | funraise(); |
945 | #endif |
946 | } |
947 | |
948 | Standard_Boolean VPonedge=Standard_False; if (PVKind == TopOpeBRepDS_VERTEX) VPonedge=::FUN_onedge(PDS,edge); |
949 | if (myLineINL) { |
950 | Standard_Real tolang = Precision::Angular()*1.e5;//=1.e-7 NYITOLXPU |
951 | |
952 | gp_Vec tgE = FUN_tool_tggeomE(paredge,edge); |
953 | gp_Pnt2d OOuv; Standard_Boolean ok = Standard_False; |
954 | if (VPonedge) {OOuv = VP.SurfaceParameters(OOShapeIndex); ok = Standard_True;} |
955 | else {ok = FUN_tool_paronEF(OOedge,OOparedge,OOFace, OOuv);} |
956 | gp_Vec ntOOF; |
957 | if (ok) ntOOF = FUN_tool_nggeomF(OOuv,OOFace); |
958 | if (OOFace.Orientation() == TopAbs_REVERSED) ntOOF.Reverse(); |
959 | |
960 | Standard_Real tol = 1.e-7; |
961 | if (ok) ok = (tgE.Magnitude() > tol)&&(ntOOF.Magnitude() > tol); |
962 | Standard_Real dot = 1.e7; if (ok) dot = gp_Dir(tgE).Dot(gp_Dir(ntOOF)); |
963 | |
964 | |
965 | Handle(Geom_Surface) su = BRep_Tool::Surface(OOFace); |
966 | Standard_Boolean apex = FUN_tool_onapex(OOuv,su); |
967 | TopOpeBRepDS_Transition T; |
968 | if (!apex && ok && (Abs(dot) > tolang)) { |
969 | TopAbs_Orientation ori = (dot < 0.) ? TopAbs_FORWARD : TopAbs_REVERSED; |
970 | T.Set(ori); |
971 | } |
972 | |
973 | if (VPonedge && (!dge)) { |
974 | //xpu231098 : cto904C8(edge11) |
975 | // xpu131198 : CTS21802(edge31) |
976 | if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex); |
977 | Handle(TopOpeBRepDS_Interference) EPIf; |
978 | { |
979 | T.Index(iOOFace); |
980 | EPIf = MakeEPVInterference(T,iOOFace,PVIndex,paredge,PVKind,TopOpeBRepDS_FACE,SIisvertex); |
981 | } |
982 | myHDS->StoreInterference(EPIf,edge); |
983 | if (on2edges || hasONedge) { |
984 | if (OOedgeIndex == 0) OOedgeIndex = myDS->AddShape(OOedge,OOShapeIndex); |
985 | Handle(TopOpeBRepDS_Interference) EPI; |
986 | { |
987 | T.Index(iOOFace); |
988 | EPI = MakeEPVInterference(T,OOedgeIndex,PVIndex,paredge,PVKind,SIisvertex); |
989 | } |
990 | myHDS->StoreInterference(EPI,edge); |
991 | } |
992 | return; |
993 | }//VPonedge |
994 | else { |
995 | // compute interferences later on |
996 | //modified by NIZHNY-MZV Thu Dec 23 13:27:10 1999 |
997 | if(!T.IsUnknown()) { |
998 | transEdge.Before(T.Before()); |
999 | transEdge.After(T.After()); |
1000 | } |
1001 | } |
1002 | }//myLineINL |
1003 | |
7fd59977 |
1004 | // Gfound = VP corresponds with an existing geometry of ShapeIndex |
1005 | Standard_Boolean Gfound = ( EPIfound || CPIfound ); |
0797d9d3 |
1006 | #ifdef OCCT_DEBUG |
7fd59977 |
1007 | Standard_Boolean trcpv = TopOpeBRepDS_GettraceSPSX(PVIndex); |
1008 | Standard_Boolean ispoint = (PVKind == TopOpeBRepDS_POINT); |
1009 | if(trcpv && ispoint) debpoint(PVIndex); |
1010 | if(trcpv && !ispoint) debvertex(PVIndex); |
1011 | if (GLOBAL_bvpr) debvprmess(myexF1,myexF2,ili,ivp,isi); |
1012 | #endif |
1013 | |
1014 | // =================================================================== |
1015 | // Current VPoint VP is kept |
1016 | // =================================================================== |
1017 | |
1018 | // ------------------------------------------ |
1019 | // -- Curve/(POINT,VERTEX) Interference (CPI) |
1020 | // ------------------------------------------ |
1021 | |
1022 | Standard_Boolean noCPI = myLineIsonEdge; |
1023 | noCPI = noCPI || (!on2edges && hasOOedge && (OOisrest || isrest)); |
1024 | |
1025 | Standard_Boolean condi = (!noCPI); |
1026 | condi = condi && (!myLineINL); // INL |
1027 | if (condi) { |
1028 | Standard_Integer keptVPnbr = mykeptVPnbr; |
1029 | FUN_processCPI((*this),VP,Face,ShapeIndex,(*myLine),myDS, |
1030 | transLine,myDSCIL,ICPI,Gfound,PVKind,PVIndex, |
1031 | keptVPnbr); |
1032 | mykeptVPnbr = keptVPnbr; |
1033 | } |
1034 | |
1035 | // ------------------------------------------ |
1036 | // --- Edge/(POINT,VERTEX) Interference (EPI) |
1037 | // ------------------------------------------ |
1038 | |
1039 | // if (on2edges && !Gfound && !closing) { |
1040 | Standard_Boolean condi2 = (on2edges && !closing); |
1041 | condi2 = condi2 || (hasONedge && !closing); |
1042 | if (condi2 && (!dge)) { |
1043 | if (OOedgeIndex == 0) OOedgeIndex = myDS->AddShape(OOedge,OOShapeIndex); |
1044 | |
1045 | Handle(TopOpeBRepDS_Interference) EPI; |
1046 | { |
1047 | TopOpeBRepDS_Transition T = transEdge; |
1048 | if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex); |
1049 | T.Index(iOOFace); |
1050 | EPI = MakeEPVInterference(T,OOedgeIndex,PVIndex,paredge,PVKind,SIisvertex); |
1051 | } |
1052 | myHDS->StoreInterference(EPI,edge); |
1053 | } //condi2 |
1054 | |
1055 | // =================================================================== |
1056 | // manip corrective d'un pb. d'intersection |
1057 | // - le VPoint est donne sur une restriction de ShapeIndex (1 ou 2), |
1058 | // - le VPoint est ON une restriction de l'autre shape (OOShapeIndex) |
1059 | // --> le VPoint n'est PAS donne sur restriction de OOShapeIndex NYI |
1060 | // par les intersections (a ameliorer). NYI |
1061 | // L'etat ON sur OOShapeIndex indique que le point est sur une |
1062 | // de ses restrictions : |
1063 | // - on ne met PAS le point dans les CPIs |
1064 | // - on met le point dans les EPIs de l'arete de OOShapeIndex |
1065 | // =================================================================== |
1066 | |
1067 | Standard_Boolean correctON = !on2edges && hasONedge && !dgOOe; |
1068 | Standard_Boolean correctedON = Standard_False; |
1069 | if ( correctON ) { |
1070 | TopOpeBRepDS_ListOfInterference lITFonVP; Standard_Boolean OOfound = Standard_False; |
1071 | if (OOedgeIndex != 0) { |
1072 | const TopOpeBRepDS_ListOfInterference& lIOOedge = myDS->ShapeInterferences(OOedge); |
1073 | TopOpeBRepDS_ListOfInterference lI; ::FUN_ScanInterfList(PDS,myHDS,lIOOedge,lI); |
1074 | OOfound = ::FUN_selectTRAISHAinterference(lI,iSIFace,lITFonVP); |
1075 | correctON = !OOfound; |
1076 | } |
1077 | } |
1078 | if ( correctON ) { |
0797d9d3 |
1079 | #ifdef OCCT_DEBUG |
7fd59977 |
1080 | Standard_Boolean trcooe=TopOpeBRepDS_GettraceSPSX(OOedgeIndex);if (trcooe) debooarc(OOedgeIndex); |
1081 | #endif |
1082 | if (OOedgeIndex == 0) OOedgeIndex = myDS->AddShape(OOedge,OOShapeIndex); |
1083 | |
1084 | // VP a ete classifie ON sur l'edge <OOedge>. |
1085 | // calcul de la transition <tOOedge> sur l'arete <OOedge> |
1086 | // (de l'autre face en jeu, OOShapeIndex) ou le VP est donne ON. |
1087 | // On tient compte de l'orientation de <edge> dans <Face>. |
1088 | // (bug IntPatch_Line : VP n'a pas de donnees en OOShapeIndex |
1089 | // alors qu'il est dessus) |
1090 | |
1091 | TopOpeBRepDS_Transition tOOedge; |
1092 | // distinguish wether OOedge is the edge on which geometric line lies. |
1093 | // OOedge == edge(line) ==> tOOedge = f(orientation of <edge> in <Face> FORWARD) |
1094 | // OOedge != edge(line) ==> tOOedge = f(orientation of <Face>) |
1095 | Standard_Real OOpar1,OOpar2; Standard_Boolean isonper; FDS_LOIinfsup((*myDS),OOedge,OOparedge,PVKind,PVIndex, |
1096 | myDS->ShapeInterferences(OOedge), |
1097 | OOpar1,OOpar2,isonper); |
1098 | //FDS_getupperlower(myHDS,OOedgeIndex,OOparedge,par1,par2); |
1099 | gp_Pnt2d OOuv = VP.SurfaceParameters(ShapeIndex); |
1100 | |
1101 | // <Tr> relative to 3d <OOface> matter, |
1102 | // we take into account <Tr> / 2d <OOface> only if <edge> is normal to <OOface> |
1103 | Standard_Real tola = Precision::Angular()*1.e+2; //dealing with tolerances |
1104 | |
1105 | // KK : supplying tolerances pbm (tola too small) |
1106 | Standard_Boolean EsdmEofF = myHDS->HasSameDomain(OOedge); |
1107 | if (EsdmEofF) { |
1108 | TopExp_Explorer ex; |
1109 | for (ex.Init(Face, TopAbs_EDGE); ex.More(); ex.Next()) |
1110 | if (FUN_ds_sdm(*myDS,ex.Current(),OOedge)) {EsdmEofF = Standard_True; break;} |
1111 | } |
1112 | Standard_Boolean OOEtgF = Standard_True; |
1113 | if (!EsdmEofF) OOEtgF = FUN_tool_EtgF(OOparedge,OOedge,OOuv,Face,tola); |
1114 | Standard_Boolean OOrest = FUN_INlos(edge,myERL); |
1115 | Standard_Boolean interf2d = OOEtgF && (OOisrest || OOrest); |
1116 | |
1117 | Standard_Real factor = 1.e-2; |
1118 | TopOpeBRepTool_makeTransition MKT; |
1119 | Standard_Boolean ok = MKT.Initialize(OOedge,OOpar1,OOpar2,OOparedge,Face,OOuv, factor); |
1120 | |
1121 | if (ok && !(interf2d && !MKT.IsT2d())) { |
1122 | MKT.SetRest(edge,paredge); |
1123 | TopAbs_State stb,sta; ok = MKT.MkTonE(stb,sta); |
1124 | if (ok) { |
1125 | tOOedge.Before(stb); tOOedge.After(sta); |
0797d9d3 |
1126 | #ifdef OCCT_DEBUG |
7fd59977 |
1127 | if(traceDSF){ |
1128 | cout<<"* !on2edges && TopAbs_ON *\n"; |
1129 | if(OOisrest) cout<<"* edge "<<OOedgeIndex<<" RESTRICTION *\n"; |
1130 | cout<<"Transition sur <OOedge> "<<OOedgeIndex<<" croisant <edge> "<<SIedgeIndex<<" "; |
1131 | TopAbs::Print(edgeori,cout);cout<<" ";tOOedge.Dump(cout);cout<<endl;} |
1132 | #endif |
1133 | Handle(TopOpeBRepDS_Interference) OOEPIe; |
1134 | { |
1135 | if (iSIFace == 0) iSIFace = myDS->AddShape(Face,ShapeIndex); |
1136 | TopOpeBRepDS_Transition OOT = tOOedge; OOT.Index(iSIFace); |
1137 | OOEPIe = MakeEPVInterference(OOT,SIedgeIndex,PVIndex,OOparedge,PVKind,OOisvertex); |
1138 | } |
1139 | myHDS->StoreInterference(OOEPIe,OOedge); |
1140 | |
1141 | // xpu : 09-03-98 |
1142 | // hsd3d => interf2d : only IwithSkEDGE interf |
1143 | // elsewhere : add an IwithSkFACE interference. |
1144 | Standard_Boolean addEPIf = !myLineIsonEdge; |
1145 | TopTools_ListOfShape dummy; Standard_Boolean hsd3d = FDS_HasSameDomain3d(*myDS,OOedge,&dummy); |
1146 | if (hsd3d) addEPIf = Standard_False; |
1147 | if (addEPIf) { |
1148 | TopOpeBRepDS_Transition OOT = tOOedge; OOT.Index(iSIFace); |
1149 | Handle(TopOpeBRepDS_Interference) OOEPIf = MakeEPVInterference(OOT,iSIFace,PVIndex,OOparedge,PVKind, |
1150 | TopOpeBRepDS_FACE,OOisvertex); |
1151 | myHDS->StoreInterference(OOEPIf,OOedge); |
1152 | } |
1153 | // xpu : 09-03-98 |
1154 | correctedON = Standard_True; |
1155 | } // ok |
1156 | } |
1157 | } // correctON |
1158 | |
1159 | if (correctON && !correctedON && noCPI && !myLineIsonEdge) { |
1160 | // MSV: correct ON failed, so store CPI |
1161 | Standard_Integer keptVPnbr = mykeptVPnbr; |
1162 | FUN_processCPI((*this),VP,Face,ShapeIndex,(*myLine),myDS, |
1163 | transLine,myDSCIL,ICPI,Gfound,PVKind,PVIndex, |
1164 | keptVPnbr); |
1165 | mykeptVPnbr = keptVPnbr; |
1166 | } |
1167 | |
1168 | // closing edge processing |
1169 | // ----------------------- |
1170 | if ((OOclosing || closing)&& !found) { |
1171 | ProcessVPonclosingR(VP,Face,ShapeIndex, |
1172 | transEdge, |
1173 | PVKind,PVIndex, |
1174 | EPIfound,IEPI); |
1175 | return; |
1176 | } |
1177 | |
1178 | // VP processing |
1179 | // ------------- |
1180 | |
1181 | Standard_Boolean addEPI = Standard_False; |
1182 | if (!Gfound) { |
1183 | addEPI = Standard_True; |
1184 | } |
1185 | else { // EPIfound |
51740958 |
1186 | TopAbs_Orientation anOtransEdge = transEdge.Orientation(TopAbs_IN); |
7fd59977 |
1187 | |
1188 | Standard_Boolean opporifound,memorifound; opporifound = memorifound = Standard_False; |
1189 | TopOpeBRepDS_ListOfInterference loIfound; |
1190 | const TopOpeBRepDS_ListOfInterference& EPIL = myDS->ShapeInterferences(edge); |
1191 | Standard_Boolean ok = FUN_sameGsameS(EPIL,PVIndex,iOOFace,loIfound); |
1192 | if (ok) { |
1193 | TopOpeBRepDS_PointIterator PI(loIfound); |
1194 | // on cree une EPI orientee <transEdge> ssi : |
1195 | // - il en existe deja une d'orientation opposee a TransEdge |
1196 | // - il n'en existe pas deja une d'orientation identique a TransEdge |
1197 | for (; PI.More(); PI.Next()){ |
1198 | TopAbs_Orientation oEPI = PI.Value()->Transition().Orientation(TopAbs_IN); |
51740958 |
1199 | if (!memorifound) memorifound = ( oEPI == anOtransEdge); |
1200 | if (!opporifound) opporifound = ( oEPI == TopAbs::Complement(anOtransEdge) ); |
7fd59977 |
1201 | addEPI = (opporifound && ! memorifound); |
1202 | if (addEPI) break; |
1203 | } |
1204 | } |
1205 | if (!ok) addEPI = Standard_True; |
1206 | } // EPIfound |
1207 | |
0797d9d3 |
1208 | #ifdef OCCT_DEBUG |
7fd59977 |
1209 | if (GLOBAL_bvpr) debvprmess(myexF1,myexF2,ili,ivp,isi); |
1210 | #endif |
1211 | |
1212 | // xpu030998 : edge has restriction on OOface, do NOT append EPIf |
1213 | // cto904A3 (edge19,OOface14,vG16), |
1214 | if (myLineINL) { |
1215 | Standard_Real tola = Precision::Angular()*1.e+4; //dealing with tolerances |
1216 | gp_Pnt2d uv = VP.SurfaceParameters(OOShapeIndex); |
1217 | Standard_Boolean EtgOOF = FUN_tool_EtgF(paredge,edge,uv,OOFace,tola); |
1218 | Standard_Boolean inERL = FUN_INlos(edge,myERL); |
1219 | if (EtgOOF && inERL) return; // cto904A3 |
1220 | } |
1221 | |
1222 | if ( addEPI && (!dge)) { |
1223 | // ShapeIndex = 1,2 --> OOShapeIndex = 2,1 |
1224 | // point est sur une seule arete <edge> de <ShapeIndex> |
1225 | // le Support de l'interference est l'autre |
1226 | // face (OOShapeIndex) / ShapeIndex |
1227 | if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex); |
1228 | Handle(TopOpeBRepDS_Interference) EPIf; |
1229 | { |
1230 | TopOpeBRepDS_Transition T = transEdge; T.Index(iOOFace); |
1231 | EPIf = MakeEPVInterference(T,iOOFace,PVIndex,paredge,PVKind,TopOpeBRepDS_FACE,SIisvertex); |
1232 | } |
1233 | myHDS->StoreInterference(EPIf,edge); |
1234 | } // addEPI |
1235 | |
1236 | } // ProcessVPonR |