0023024: Update headers of OCCT files
[occt.git] / src / ApproxInt / ApproxInt_MultiLine.gxx
CommitLineData
b311480e 1// Created on: 1993-03-22
2// Created by: Laurent BUCHARD
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
22#define DEBUG 0
23
24
25#include <TColStd_Array1OfReal.hxx>
26#include <IntSurf_LineOn2S.hxx>
27#include <gp_Pnt2d.hxx>
28#include <gp_Pnt.hxx>
29#include <gp_Vec2d.hxx>
30#include <gp_Vec.hxx>
31
32ApproxInt_MultiLine::ApproxInt_MultiLine(const Handle_TheLine& line,
33 const Standard_Address svsurf,
34 const Standard_Integer NbP3d,
35 const Standard_Integer NbP2d,
36 const Standard_Real xo,
37 const Standard_Real ax,
38 const Standard_Real yo,
39 const Standard_Real ay,
40 const Standard_Real zo,
41 const Standard_Real az,
42 const Standard_Real u1o,
43 const Standard_Real a1u,
44 const Standard_Real v1o,
45 const Standard_Real a1v,
46 const Standard_Real u2o,
47 const Standard_Real a2u,
48 const Standard_Real v2o,
49 const Standard_Real a2v,
50 const Standard_Boolean P2DOnFirst,
51 const Standard_Integer IndMin,
52 const Standard_Integer IndMax):
53
54 PtrOnmySvSurfaces(svsurf),
55 myLine(line),
56 indicemin(IndMin),
57 indicemax(IndMax),
58 nbp3d(NbP3d),
59 nbp2d(NbP2d),
60 p2donfirst(P2DOnFirst),
61 Xo(xo),Ax(ax),Yo(yo),Ay(ay),Zo(zo),Az(az),
62 U1o(u1o),A1u(a1u),V1o(v1o),A1v(a1v),
63 U2o(u2o),A2u(a2u),V2o(v2o),A2v(a2v)
64{
65#if DEBUG
66 if(indicemin>=indicemax) {
67 cout<<"\n********************************************";
68 cout<<"\n***** ApproxInt_MultiLine ********";
69 cout<<"\n***** indicemin = indicemax = "<<indicemin;
70 cout<<"\n********************************************"<<endl;
71
72 }
73#endif
74}
75//--------------------------------------------------------------------------------
76ApproxInt_MultiLine::ApproxInt_MultiLine(const Handle_TheLine& line,
77 const Standard_Integer NbP3d,
78 const Standard_Integer NbP2d,
79 const Standard_Real xo,
80 const Standard_Real ax,
81 const Standard_Real yo,
82 const Standard_Real ay,
83 const Standard_Real zo,
84 const Standard_Real az,
85 const Standard_Real u1o,
86 const Standard_Real a1u,
87 const Standard_Real v1o,
88 const Standard_Real a1v,
89 const Standard_Real u2o,
90 const Standard_Real a2u,
91 const Standard_Real v2o,
92 const Standard_Real a2v,
93 const Standard_Boolean P2DOnFirst,
94 const Standard_Integer IndMin,
95 const Standard_Integer IndMax):
96
97 PtrOnmySvSurfaces(0),
98 myLine(line),
99 indicemin(IndMin),
100 indicemax(IndMax),
101 nbp3d(NbP3d),
102 nbp2d(NbP2d),
103 p2donfirst(P2DOnFirst),
104 Xo(xo),Ax(ax),Yo(yo),Ay(ay),Zo(zo),Az(az),
105 U1o(u1o),A1u(a1u),V1o(v1o),A1v(a1v),
106 U2o(u2o),A2u(a2u),V2o(v2o),A2v(a2v)
107{
108 if(indicemin>=indicemax) {
109#if DEBUG
110 cout<<"\n********************************************";
111 cout<<"\n***** ApproxInt_MultiLine ********";
112 cout<<"\n***** indicemin = indicemax = "<<indicemin;
113 cout<<"\n********************************************"<<endl;
114#endif
115 }
116}
117//--------------------------------------------------------------------------------
118Standard_Integer ApproxInt_MultiLine::FirstPoint() const {
119 return(indicemin);
120}
121//--------------------------------------------------------------------------------
122Standard_Integer ApproxInt_MultiLine::LastPoint() const {
123 return(indicemax);
124}
125//--------------------------------------------------------------------------------
126Approx_Status ApproxInt_MultiLine::WhatStatus() const {
127 if(PtrOnmySvSurfaces)
128 return(Approx_PointsAdded);
129 else
130 return(Approx_NoPointsAdded);
131}
132//--------------------------------------------------------------------------------
133Standard_Integer ApproxInt_MultiLine::NbP3d() const {
134 return(nbp3d);
135}
136//--------------------------------------------------------------------------------
137Standard_Integer ApproxInt_MultiLine::NbP2d() const {
138 return(nbp2d);
139}
140//================================================================================
141void ApproxInt_MultiLine::Value(const Standard_Integer Index,
142 TColgp_Array1OfPnt& TabPnt) const
143{
144 IntSurf_PntOn2S POn2S(myLine->Point(Index));
145 Standard_Real X = POn2S.Value().X();
146 Standard_Real Y = POn2S.Value().Y();
147 Standard_Real Z = POn2S.Value().Z();
148 TabPnt(1) = gp_Pnt(X*Ax + Xo, Y*Ay + Yo, Z*Az + Zo);
149}
150//--------------------------------------------------------------------------------
151void ApproxInt_MultiLine::Value( const Standard_Integer Index
152 ,TColgp_Array1OfPnt2d& TabPnt2d) const
153{
154 IntSurf_PntOn2S POn2S(myLine->Point(Index));
155 Standard_Real u1,u2,v1,v2;
156 POn2S.Parameters(u1,v1,u2,v2);
157 if(nbp2d==1) {
158 if(p2donfirst) {
159 TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
160 }
161 else {
162 TabPnt2d(1) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
163 }
164 }
165 else {
166 TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
167 if(TabPnt2d.Length()>=2) {
168 TabPnt2d(2) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
169 }
170 }
171}
172//--------------------------------------------------------------------------------
173void ApproxInt_MultiLine::Value( const Standard_Integer Index
174 ,TColgp_Array1OfPnt& TabPnt
175 ,TColgp_Array1OfPnt2d& TabPnt2d) const
176{
177 IntSurf_PntOn2S POn2S(myLine->Point(Index));
178 Standard_Real u1,u2,v1,v2;
179 POn2S.Parameters(u1,v1,u2,v2);
180 if(nbp2d==1) {
181 if(p2donfirst) {
182 TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
183 }
184 else {
185 TabPnt2d(1) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
186 }
187 }
188 else {
189 TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
190 if(TabPnt2d.Length()>=2) {
191 TabPnt2d(2) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
192 }
193 }
194 Standard_Real X = POn2S.Value().X();
195 Standard_Real Y = POn2S.Value().Y();
196 Standard_Real Z = POn2S.Value().Z();
197 TabPnt(1) = gp_Pnt(X * Ax + Xo, Y * Ay + Yo, Z * Az + Zo);
198}
199//--------------------------------------------------------------------------------
200//--------------------------------------------------------------------------------
201Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index
202 ,TColgp_Array1OfVec& TabVec) const
203{
204 if(PtrOnmySvSurfaces==NULL)
205 return(Standard_False);
206
207 IntSurf_PntOn2S POn2S(myLine->Point(Index));
208 Standard_Real u1,u2,v1,v2;
209 gp_Vec Tg;
210 POn2S.Parameters(u1,v1,u2,v2);
211 Standard_Boolean ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->Tangency( u1,v1,u2,v2,Tg);
212 if(ret) {
213 Standard_Real X = Tg.X();
214 Standard_Real Y = Tg.Y();
215 Standard_Real Z = Tg.Z();
216 TabVec(1) = gp_Vec(X * Ax, Y * Ay, Z * Az);
217 }
218 else
219 TabVec(1) = gp_Vec(0.0,0.0,0.0);
220 return(ret);
221}
222//--------------------------------------------------------------------------------
223Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index
224 ,TColgp_Array1OfVec2d& TabVec2d) const
225{
226 if(PtrOnmySvSurfaces==NULL)
227 return(Standard_False);
228
229 IntSurf_PntOn2S POn2S(myLine->Point(Index));
230 Standard_Real u1,u2,v1,v2,U,V;
231 gp_Vec2d Tg2d;
232 Standard_Boolean ret;
233 POn2S.Parameters(u1,v1,u2,v2);
234 if(nbp2d==1) {
235 Standard_Real Au = A1u;
236 Standard_Real Av = A1v;
237 if(p2donfirst) {
238 ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
239 }
240 else {
241 ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
242 Au = A2u;
243 Av = A2v;
244 }
245 if(ret) {
246 U = Tg2d.X();
247 V = Tg2d.Y();
248 TabVec2d(1) = gp_Vec2d(U * Au, V * Av);
249 }
250 else {
251 TabVec2d(1) = gp_Vec2d(0.0,0.0);
252 }
253 }
254 else {
255 ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
256 if(ret) {
257 U = Tg2d.X();
258 V = Tg2d.Y();
259 TabVec2d(1) = gp_Vec2d(U * A1u, V * A1v);
260
261 if(TabVec2d.Length()>=2) {
262 ret&=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
263 U = Tg2d.X();
264 V = Tg2d.Y();
265 TabVec2d(2) = gp_Vec2d(U * A2u, V * A2v);
266 }
267 else {
268 TabVec2d(1) = gp_Vec2d(0.0,0.0);
269 if(TabVec2d.Length()>=2) {
270 TabVec2d(2) = gp_Vec2d(0.0,0.0);
271 }
272 }
273 }
274 }
275 return(ret);
276}
277//--------------------------------------------------------------------------------
278Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index
279 ,TColgp_Array1OfVec& TabVec
280 ,TColgp_Array1OfVec2d& TabVec2d) const
281{
282 if(PtrOnmySvSurfaces==NULL)
283 return(Standard_False);
284
285 IntSurf_PntOn2S POn2S(myLine->Point(Index));
286 Standard_Real u1,u2,v1,v2,U,V;
287 gp_Vec2d Tg2d;
288 gp_Vec Tg;
289 Standard_Boolean ret;
290 POn2S.Parameters(u1,v1,u2,v2);
291 if(nbp2d==1) {
292 Standard_Real Au = A1u;
293 Standard_Real Av = A1v;
294 if(p2donfirst) {
295 ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
296 }
297 else {
298 ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
299 Au = A2u;
300 Av = A2v;
301 }
302 if(ret) {
303 U = Tg2d.X();
304 V = Tg2d.Y();
305 TabVec2d(1) = gp_Vec2d(U * Au, V * Av);
306 }
307 else {
308 TabVec2d(1) = gp_Vec2d(0.0,0.0);
309 }
310 }
311 else {
312 ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
313 if(ret) {
314 U = Tg2d.X();
315 V = Tg2d.Y();
316 TabVec2d(1) = gp_Vec2d(U * A1u, V * A1v);
317 if(TabVec2d.Length()>=2) {
318 ret&=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
319 U = Tg2d.X();
320 V = Tg2d.Y();
321 TabVec2d(2) = gp_Vec2d(U * A2u, V * A2v);
322 }
323 }
324 else {
325 TabVec2d(1) = gp_Vec2d(0.0,0.0);
326 if(TabVec2d.Length()>=2) {
327 TabVec2d(2) = gp_Vec2d(0.0,0.0);
328 }
329 }
330 }
331 if(ret) {
332 ret&=((TheSvSurfaces *)PtrOnmySvSurfaces)->Tangency( u1,v1,u2,v2,Tg);
333 Standard_Real X = Tg.X();
334 Standard_Real Y = Tg.Y();
335 Standard_Real Z = Tg.Z();
336 TabVec(1) = gp_Vec(X * Ax, Y * Ay, Z * Az);
337 }
338 else {
339 TabVec(1) = gp_Vec(0.0,0.0,0.0);
340 }
341 return(ret);
342}
343//--------------------------------------------------------------------------------
344
345
346
347//================================================================================
348ApproxInt_MultiLine ApproxInt_MultiLine::MakeMLBetween(const Standard_Integer Low,
349 const Standard_Integer High,
350 const Standard_Integer aNbPntsToInsert)
351const {
352 if(PtrOnmySvSurfaces==NULL) {
353 //-- cout<<"\n Erreur dans : ApproxInt_MultiLine ApproxInt_MultiLine::MakeMLBetween "<<endl;
354 Handle(IntSurf_LineOn2S) vide1 = new IntSurf_LineOn2S();
355 Handle(TheLine) vide = new TheLine(vide1,Standard_False);
356 return(ApproxInt_MultiLine(vide,
357 NULL,
358 nbp3d,
359 nbp2d,
360 Xo,Ax,Yo,Ay,Zo,Az,
361 U1o,A1u,V1o,A1v,
362 U2o,A2u,V2o,A2v,
363 p2donfirst,
364 1,1));
365 //-- return(*this);
366 }
367 Standard_Integer NbPntsToInsert=aNbPntsToInsert;
368 if(NbPntsToInsert<(High-Low)) NbPntsToInsert=(High-Low);
369 Standard_Integer NbPnts = NbPntsToInsert + High - Low + 1;
370 Standard_Integer NbPntsmin = High-Low;
371 NbPntsmin+=NbPntsmin;
372
373 if(NbPnts<NbPntsmin) NbPnts=NbPntsmin;
374
375
376 gp_Vec T;
377 gp_Vec2d TS1,TS2;
378 gp_Pnt P;
379
380 //-----------------------l-------------------------------------------
381 //-- Indice : Low Low+1 I I+1 High --
382 //-- --
383 //-- Abs.Curv. : S(Low) S(I) S(I+1) S(High) --
384 //-- --
385 //-- On echantillonne a abcisse curviligne --
386 //-- constante. --
387 //-- L abcisse est calculee sur les params U1,V1 --
388 //------------------------------------------------------------------
389 TColStd_Array1OfReal U1(Low,High);
390 TColStd_Array1OfReal V1(Low,High);
391 TColStd_Array1OfReal U2(Low,High);
392 TColStd_Array1OfReal V2(Low,High);
393 TColStd_Array1OfReal AC(Low,High);
394 Standard_Real s,ds;
395
396 //------------------------------------------------------------
397 //-- Creation des Tableaux U1 .. V2 et AC
398 //--
399 Standard_Real u1,v1,u2,v2;
400 Standard_Integer i ;
401 myLine->Point(Low).Parameters(u1,v1,u2,v2);
402 U1(Low) = u1;
403 V1(Low) = v1;
404 U2(Low) = u2;
405 V2(Low) = v2;
406 AC(Low) =0.0;
407
408#if 0
409
410 for( i=Low+1; i<=High; i++) {
411 myLine->Point(i).Parameters(u1,v1,u2,v2);
412 U1(i) = u1;
413 V1(i) = v1;
414 U2(i) = u2;
415 V2(i) = v2;
416
417 Standard_Real du1=u1-U1(i-1);
418 Standard_Real dv1=v1-V1(i-1);
419
420 AC(i) = AC(i-1) + sqrt((du1*du1)+(dv1*dv1));
421 }
422#else
423 //-- Essai du 19 juin 96 (parametrage selon abs curv en XYZ)
424 for( i=Low+1; i<=High; i++) {
425 myLine->Point(i).Parameters(u1,v1,u2,v2);
426 U1(i) = u1;
427 V1(i) = v1;
428 U2(i) = u2;
429 V2(i) = v2;
430 AC(i) = AC(i-1)
431 + (myLine->Point(i-1).Value()).Distance(myLine->Point(i).Value());
432 }
433
434#endif
435 //-------------------------------------------------------------
436 //-- Creation des structures contenant les resultats
437
438 Handle(IntSurf_LineOn2S) ResultPntOn2SLine
439 = new IntSurf_LineOn2S();
440
441 IntSurf_PntOn2S StartPOn2S;
442 TColStd_Array1OfReal StartParams(1,4);
443
444
445 ds = AC(High) / (NbPnts-1);
446 Standard_Integer Indice = Low;
447 Standard_Boolean HasBeenInserted = Standard_False;
448 Standard_Real dsmin = ds*0.3;
449 Standard_Real smax = AC(High);
450
39408dc0 451 for(i=2,s=ds; (s < smax && Indice <= High-1); i++,s+=ds) {
7fd59977 452 //----------------------------------------------------------
453 //-- Recherche des indices des points --
454 //-- Point : 2 i NbPnts-1 --
455 //-- s s --
456 //-- Current Indice tel que AC(Indice)<= s < AC(Indice+1) --
457 //----------------------------------------------------------
458 while(AC(Indice+1) <= s) {
459 if(!HasBeenInserted) ResultPntOn2SLine->Add(myLine->Point(Indice));
460 HasBeenInserted = Standard_False;
461 Indice++;
39408dc0
J
462 if (Indice == High)
463 break;
7fd59977 464 }
39408dc0
J
465
466 if (Indice == High)
467 break;
468
7fd59977 469 if(!HasBeenInserted && AC(Indice) <= s) {
470 ResultPntOn2SLine->Add(myLine->Point(Indice));
471 HasBeenInserted = Standard_True;
472 }
473 Standard_Real a = s - AC(Indice);
474 Standard_Real b = AC(Indice+1) - s;
475 Standard_Real nab = 1.0/(a+b);
476
477 //----------------------------------------------------------
478 //-- Verification : Si Dist au prochain point < dsmin --
479 //-- Si Dist au precedent point < dsmin --
480 //-- --
481 //----------------------------------------------------------
482 if((a>dsmin) && (b>dsmin)) {
483
484 u1 = (U1(Indice) * b + U1(Indice+1) * a) * nab;
485 v1 = (V1(Indice) * b + V1(Indice+1) * a) * nab;
486 u2 = (U2(Indice) * b + U2(Indice+1) * a) * nab;
487 v2 = (V2(Indice) * b + V2(Indice+1) * a) * nab;
488
489
490 if(((TheSvSurfaces *)PtrOnmySvSurfaces)->Compute(u1,v1,u2,v2,P,T,TS1,TS2)) {
491 StartPOn2S.SetValue(P,u1,v1,u2,v2);
492 //-- cout<<" Insertion du point calcule : "<<u1<<","<<v1<<","<<u2<<","<<v2<<",";
493 //-- cout<<P.X()<<","<<P.Y()<<","<<P.Z()<<endl;
494 ResultPntOn2SLine->Add(StartPOn2S);
495 }
496 else {
497 //-- cout<<" Probleme Non Traite ds ApproxInt_ApproxIntIntersection "<<endl;
498 }
499 }
500 else {
501 //-- Point non situe a distance suffisante de 2 pts existants
502 //-- avec le point p[indice] deja insere
503
504 if(b<0.0) {
505 while(AC(Indice+1) <= s) {
506 if(!HasBeenInserted) ResultPntOn2SLine->Add(myLine->Point(Indice));
507 //-- cout<<" Insertion du point :"<<Indice<<endl;
508 HasBeenInserted = Standard_False;
509 Indice++;
39408dc0
J
510 if (Indice == High)
511 break;
7fd59977 512 }
39408dc0
J
513
514 if (Indice == High)
515 break;
516
7fd59977 517 if(!HasBeenInserted && AC(Indice) <= s) {
518 ResultPntOn2SLine->Add(myLine->Point(Indice));
519 HasBeenInserted = Standard_True;
520 }
521 }
522 else {
523 s+=dsmin - ds;
524 }
525 }
526 }
527
528 ResultPntOn2SLine->Add(myLine->Point(High)); //-- Point NbPnts
529 Handle(TheLine) temp = new TheLine(ResultPntOn2SLine,Standard_False);
530
531 //-- Verification a posteriori
532 //-- On verifie qu il n y a pas de virage trop important en 2d et en 3d
533
534 temp->Point(1).Parameters(u1,v1,u2,v2);
535 gp_Pnt2d P1A(u1,v1);
536 gp_Pnt2d P2A(u2,v2);
537
538 temp->Point(2).Parameters(u1,v1,u2,v2);
539 gp_Pnt2d P1B(u1,v1);
540 gp_Pnt2d P2B(u2,v2);
541
542 gp_Pnt2d P1C,P2C;
543
544 Standard_Integer CodeErreur=0;
545
546 for(i=3,NbPnts=temp->NbPnts();CodeErreur==0 && i<=NbPnts; i++) {
547 Standard_Real d,du,dv,duv2;
548 temp->Point(i).Parameters(u1,v1,u2,v2);
549 //-- Virage P1A P1B P1C
550 P1C.SetCoord(u1,v1);
551 du = P1B.X()-P1A.X();
552 dv = P1B.Y()-P1A.Y();
553 duv2= 0.25*(du*du+dv*dv);
554 u1 = P1B.X() + du;
555 v1 = P1B.Y() + dv;
556 du = P1C.X() - u1;
557 dv = P1C.Y() - v1;
558 d = du*du+dv*dv;
559 if(d>duv2) {
560 CodeErreur = 1;
561 CodeErreur = 1;
562 break;
563 }
564 //-- Virage P2A P2B P2C
565 P2C.SetCoord(u2,v2);
566 du = P2B.X()-P2A.X();
567 dv = P2B.Y()-P2A.Y();
568 duv2= 0.25*(du*du+dv*dv);
569 u2 = P2B.X() + du;
570 v2 = P2B.Y() + dv;
571 du = P2C.X() - u2;
572 dv = P2C.Y() - v2;
573 d = du*du+dv*dv;
574 if(d>duv2) {
575 CodeErreur = 2;
576 break;
577 }
578 P1A=P1B;
579 P2A=P2B;
580 P1B=P1C;
581 P2B=P2C;
582 }
583#if DEBUG
584 if (temp->NbPnts() < NbPntsToInsert + High - Low + 1) {
585 cout<<" *** Pas assez de points entre :"<<Low<<" et "<<High<<" -> "<<temp->NbPnts()<<endl;
586 }
587 if(CodeErreur) {
588 cout<<" *** CodeErreur : "<<CodeErreur<<endl;
589 }
590#endif
591 if((temp->NbPnts() >= NbPntsToInsert + High - Low + 1)
592 && (CodeErreur==0)) {
593 return(ApproxInt_MultiLine(temp,
594 (High-Low>10)? PtrOnmySvSurfaces : NULL,
595 nbp3d,
596 nbp2d,
597 Xo,Ax,Yo,Ay,Zo,Az,
598 U1o,A1u,V1o,A1v,
599 U2o,A2u,V2o,A2v,
600 p2donfirst,
601 1,ResultPntOn2SLine->NbPoints()));
602 }
603 else {
604 //-- cout<<" ApproxInt_MultiLine "<<endl;
605 //-- cout<<" Pas de Rajout de points ds1min = "<<minds1<<" ds2min = "<<minds2<<endl;
606 Handle(IntSurf_LineOn2S) vide1 = new IntSurf_LineOn2S();
607 Handle(TheLine) vide = new TheLine(vide1,Standard_False);
608 return(ApproxInt_MultiLine(vide,
609 NULL,
610 nbp3d,
611 nbp2d,
612 Xo,Ax,Yo,Ay,Zo,Az,
613 U1o,A1u,V1o,A1v,
614 U2o,A2u,V2o,A2v,
615 p2donfirst,
616 1,1));
617 }
618}
619 //======================================================================
620