1 // Created on: 1995-07-11
2 // Created by: Christophe MARION
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 #include <Standard_Stream.hxx>
23 #include <HLRAlgo_PolyInternalData.ixx>
24 #include <HLRAlgo_BiPoint.hxx>
26 #define Tri1Node1 ((Standard_Integer*)Tri1Indices)[0]
27 #define Tri1Node2 ((Standard_Integer*)Tri1Indices)[1]
28 #define Tri1Node3 ((Standard_Integer*)Tri1Indices)[2]
29 #define Tri1Flags ((Standard_Boolean*)Tri1Indices)[3]
31 #define Tri2Node1 ((Standard_Integer*)Tri2Indices)[0]
32 #define Tri2Node2 ((Standard_Integer*)Tri2Indices)[1]
33 #define Tri2Node3 ((Standard_Integer*)Tri2Indices)[2]
34 #define Tri2Flags ((Standard_Boolean*)Tri2Indices)[3]
36 #define Seg1LstSg1 ((Standard_Integer*)Seg1Indices)[0]
37 #define Seg1LstSg2 ((Standard_Integer*)Seg1Indices)[1]
38 #define Seg1NxtSg1 ((Standard_Integer*)Seg1Indices)[2]
39 #define Seg1NxtSg2 ((Standard_Integer*)Seg1Indices)[3]
40 #define Seg1Conex1 ((Standard_Integer*)Seg1Indices)[4]
41 #define Seg1Conex2 ((Standard_Integer*)Seg1Indices)[5]
43 #define Seg2LstSg1 ((Standard_Integer*)Seg2Indices)[0]
44 #define Seg2LstSg2 ((Standard_Integer*)Seg2Indices)[1]
45 #define Seg2NxtSg1 ((Standard_Integer*)Seg2Indices)[2]
46 #define Seg2NxtSg2 ((Standard_Integer*)Seg2Indices)[3]
47 #define Seg2Conex1 ((Standard_Integer*)Seg2Indices)[4]
48 #define Seg2Conex2 ((Standard_Integer*)Seg2Indices)[5]
50 #define Nod1NdSg ((Standard_Integer*)Nod1Indices)[0]
51 #define Nod1Flag ((Standard_Boolean*)Nod1Indices)[1]
52 #define Nod1Edg1 ((Standard_Boolean*)Nod1Indices)[2]
53 #define Nod1Edg2 ((Standard_Boolean*)Nod1Indices)[3]
55 #define Nod1PntX ((Standard_Real*)Nod1RValues)[ 0]
56 #define Nod1PntY ((Standard_Real*)Nod1RValues)[ 1]
57 #define Nod1PntZ ((Standard_Real*)Nod1RValues)[ 2]
58 #define Nod1PntU ((Standard_Real*)Nod1RValues)[ 3]
59 #define Nod1PntV ((Standard_Real*)Nod1RValues)[ 4]
60 #define Nod1NrmX ((Standard_Real*)Nod1RValues)[ 5]
61 #define Nod1NrmY ((Standard_Real*)Nod1RValues)[ 6]
62 #define Nod1NrmZ ((Standard_Real*)Nod1RValues)[ 7]
63 #define Nod1PCu1 ((Standard_Real*)Nod1RValues)[ 8]
64 #define Nod1PCu2 ((Standard_Real*)Nod1RValues)[ 9]
65 #define Nod1Scal ((Standard_Real*)Nod1RValues)[10]
67 #define Nod2NdSg ((Standard_Integer*)Nod2Indices)[0]
68 #define Nod2Flag ((Standard_Boolean*)Nod2Indices)[1]
69 #define Nod2Edg1 ((Standard_Boolean*)Nod2Indices)[2]
70 #define Nod2Edg2 ((Standard_Boolean*)Nod2Indices)[3]
72 #define Nod2PntX ((Standard_Real*)Nod2RValues)[ 0]
73 #define Nod2PntY ((Standard_Real*)Nod2RValues)[ 1]
74 #define Nod2PntZ ((Standard_Real*)Nod2RValues)[ 2]
75 #define Nod2PntU ((Standard_Real*)Nod2RValues)[ 3]
76 #define Nod2PntV ((Standard_Real*)Nod2RValues)[ 4]
77 #define Nod2NrmX ((Standard_Real*)Nod2RValues)[ 5]
78 #define Nod2NrmY ((Standard_Real*)Nod2RValues)[ 6]
79 #define Nod2NrmZ ((Standard_Real*)Nod2RValues)[ 7]
80 #define Nod2PCu1 ((Standard_Real*)Nod2RValues)[ 8]
81 #define Nod2PCu2 ((Standard_Real*)Nod2RValues)[ 9]
82 #define Nod2Scal ((Standard_Real*)Nod2RValues)[10]
84 #define Nod3NdSg ((Standard_Integer*)Nod3Indices)[0]
85 #define Nod3Flag ((Standard_Boolean*)Nod3Indices)[1]
86 #define Nod3Edg1 ((Standard_Boolean*)Nod3Indices)[2]
87 #define Nod3Edg2 ((Standard_Boolean*)Nod3Indices)[3]
89 #define Nod3PntX ((Standard_Real*)Nod3RValues)[ 0]
90 #define Nod3PntY ((Standard_Real*)Nod3RValues)[ 1]
91 #define Nod3PntZ ((Standard_Real*)Nod3RValues)[ 2]
92 #define Nod3PntU ((Standard_Real*)Nod3RValues)[ 3]
93 #define Nod3PntV ((Standard_Real*)Nod3RValues)[ 4]
94 #define Nod3NrmX ((Standard_Real*)Nod3RValues)[ 5]
95 #define Nod3NrmY ((Standard_Real*)Nod3RValues)[ 6]
96 #define Nod3NrmZ ((Standard_Real*)Nod3RValues)[ 7]
97 #define Nod3PCu1 ((Standard_Real*)Nod3RValues)[ 8]
98 #define Nod3PCu2 ((Standard_Real*)Nod3RValues)[ 9]
99 #define Nod3Scal ((Standard_Real*)Nod3RValues)[10]
101 #define Nod4NdSg ((Standard_Integer*)Nod4Indices)[0]
102 #define Nod4Flag ((Standard_Boolean*)Nod4Indices)[1]
103 #define Nod4Edg1 ((Standard_Boolean*)Nod4Indices)[2]
104 #define Nod4Edg2 ((Standard_Boolean*)Nod4Indices)[3]
106 #define Nod4PntX ((Standard_Real*)Nod4RValues)[ 0]
107 #define Nod4PntY ((Standard_Real*)Nod4RValues)[ 1]
108 #define Nod4PntZ ((Standard_Real*)Nod4RValues)[ 2]
109 #define Nod4PntU ((Standard_Real*)Nod4RValues)[ 3]
110 #define Nod4PntV ((Standard_Real*)Nod4RValues)[ 4]
111 #define Nod4NrmX ((Standard_Real*)Nod4RValues)[ 5]
112 #define Nod4NrmY ((Standard_Real*)Nod4RValues)[ 6]
113 #define Nod4NrmZ ((Standard_Real*)Nod4RValues)[ 7]
114 #define Nod4PCu1 ((Standard_Real*)Nod4RValues)[ 8]
115 #define Nod4PCu2 ((Standard_Real*)Nod4RValues)[ 9]
116 #define Nod4Scal ((Standard_Real*)Nod4RValues)[10]
118 static Standard_Integer TRACE = Standard_False;
119 static Standard_Integer ERROR = Standard_False;
121 //=======================================================================
122 //function : PolyInternalData
124 //=======================================================================
126 HLRAlgo_PolyInternalData::HLRAlgo_PolyInternalData
127 (const Standard_Integer nbNod,
128 const Standard_Integer nbTri) :
134 myIntOutL(Standard_False),
135 myPlanar(Standard_False)
138 myMxPISeg = 2 + (3 * nbTri + nbNod) / 2;
139 myTData = new HLRAlgo_HArray1OfTData(0,myMxTData);
140 myPISeg = new HLRAlgo_HArray1OfPISeg(0,myMxPISeg);
141 myPINod = new HLRAlgo_HArray1OfPINod(0,myMxPINod);
143 HLRAlgo_Array1OfPINod& PINod = myPINod->ChangeArray1();
144 Handle(HLRAlgo_PolyInternalNode)* NN = &(PINod.ChangeValue(1));
145 // Standard_Address Nod1Indices;
147 for (i = 1; i <= myMxPINod; i++) {
148 *NN = new HLRAlgo_PolyInternalNode();
153 //=======================================================================
154 //function : UpdateLinks
156 //=======================================================================
158 void HLRAlgo_PolyInternalData::UpdateLinks
159 (Standard_Address& TData,
160 Standard_Address& PISeg,
161 Standard_Address& PINod)
163 Standard_Integer i,n1,n2;
164 Standard_Integer find,iiii,icsv;
165 Standard_Address A1,A2,A3,Nod1Indices,Nod2Indices,Seg2Indices,Tri2Indices;
166 Standard_Boolean newSeg = Standard_False;
167 HLRAlgo_TriangleData* TD =
168 &(((HLRAlgo_Array1OfTData*)TData)->ChangeValue(1));
170 for (i = 1; i <= myNbTData; i++) {
171 Tri2Indices = TD->Indices();
172 A1 = ((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node1)->Indices();
173 A2 = ((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node2)->Indices();
174 A3 = ((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node3)->Indices();
179 newSeg = Standard_False;
180 if (Nod1NdSg == 0 && Nod2NdSg == 0) {
181 newSeg = Standard_True;
183 Nod1NdSg = myNbPISeg;
184 Nod2NdSg = myNbPISeg;
191 while (iiii != 0 && find == 0) {
193 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(iiii).Indices();
194 if (Seg2LstSg1 == n1) {
195 if (Seg2LstSg2 == n2) find = iiii;
196 else iiii = Seg2NxtSg1;
200 if (Seg2LstSg1 == n2) find = iiii;
201 else iiii = Seg2NxtSg2;
206 newSeg = Standard_True;
208 if (icsv == 1) Seg2NxtSg1 = myNbPISeg;
209 else Seg2NxtSg2 = myNbPISeg;
214 newSeg = Standard_True;
216 Nod1NdSg = myNbPISeg;
224 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(iiii).Indices();
225 if (Seg2LstSg1 == n2) { icsv = 1; iiii = Seg2NxtSg1; }
226 else { icsv = 2; iiii = Seg2NxtSg2; }
228 if (icsv == 1) Seg2NxtSg1 = myNbPISeg;
229 else Seg2NxtSg2 = myNbPISeg;
231 else Nod2NdSg = myNbPISeg;
236 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(myNbPISeg).Indices();
249 newSeg = Standard_False;
250 if (Nod1NdSg == 0 && Nod2NdSg == 0) {
251 newSeg = Standard_True;
253 Nod1NdSg = myNbPISeg;
254 Nod2NdSg = myNbPISeg;
261 while (iiii != 0 && find == 0) {
263 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(iiii).Indices();
264 if (Seg2LstSg1 == n1) {
265 if (Seg2LstSg2 == n2) find = iiii;
266 else iiii = Seg2NxtSg1;
270 if (Seg2LstSg1 == n2) find = iiii;
271 else iiii = Seg2NxtSg2;
276 newSeg = Standard_True;
278 if (icsv == 1) Seg2NxtSg1 = myNbPISeg;
279 else Seg2NxtSg2 = myNbPISeg;
284 newSeg = Standard_True;
286 Nod1NdSg = myNbPISeg;
294 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(iiii).Indices();
295 if (Seg2LstSg1 == n2) { icsv = 1; iiii = Seg2NxtSg1; }
296 else { icsv = 2; iiii = Seg2NxtSg2; }
298 if (icsv == 1) Seg2NxtSg1 = myNbPISeg;
299 else Seg2NxtSg2 = myNbPISeg;
301 else Nod2NdSg = myNbPISeg;
306 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(myNbPISeg).Indices();
319 newSeg = Standard_False;
320 if (Nod1NdSg == 0 && Nod2NdSg == 0) {
321 newSeg = Standard_True;
323 Nod1NdSg = myNbPISeg;
324 Nod2NdSg = myNbPISeg;
331 while (iiii != 0 && find == 0) {
333 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(iiii).Indices();
334 if (Seg2LstSg1 == n1) {
335 if (Seg2LstSg2 == n2) find = iiii;
336 else iiii = Seg2NxtSg1;
340 if (Seg2LstSg1 == n2) find = iiii;
341 else iiii = Seg2NxtSg2;
346 newSeg = Standard_True;
348 if (icsv == 1) Seg2NxtSg1 = myNbPISeg;
349 else Seg2NxtSg2 = myNbPISeg;
354 newSeg = Standard_True;
356 Nod1NdSg = myNbPISeg;
364 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(iiii).Indices();
365 if (Seg2LstSg1 == n2) { icsv = 1; iiii = Seg2NxtSg1; }
366 else { icsv = 2; iiii = Seg2NxtSg2; }
368 if (icsv == 1) Seg2NxtSg1 = myNbPISeg;
369 else Seg2NxtSg2 = myNbPISeg;
371 else Nod2NdSg = myNbPISeg;
376 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(myNbPISeg).Indices();
388 //=======================================================================
391 //=======================================================================
394 HLRAlgo_PolyInternalData::AddNode (const Standard_Address Nod1RValues,
395 const Standard_Address Nod2RValues,
396 Standard_Address& PINod1,
397 Standard_Address& PINod2,
398 const Standard_Real coef1,
399 const Standard_Real X3,
400 const Standard_Real Y3,
401 const Standard_Real Z3)
403 Standard_Real coef2 = 1 - coef1;
404 IncPINod(PINod1,PINod2);
405 Standard_Integer ip3 = myNbPINod;
406 Handle(HLRAlgo_PolyInternalNode)* pip3 =
407 &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(ip3));
408 *pip3 = new HLRAlgo_PolyInternalNode();
409 const Standard_Address Nod3RValues = (*pip3)->RValues();
410 const Standard_Address Nod3Indices = (*pip3)->Indices();
416 Nod3PntU = Nod1PntU * coef2 + Nod2PntU * coef1;
417 Nod3PntV = Nod1PntV * coef2 + Nod2PntV * coef1;
418 Nod3Scal = Nod1Scal * coef2 + Nod2Scal * coef1;
419 Standard_Real x = Nod1NrmX * coef2 + Nod2NrmX * coef1;
420 Standard_Real y = Nod1NrmY * coef2 + Nod2NrmY * coef1;
421 Standard_Real z = Nod1NrmZ * coef2 + Nod2NrmZ * coef1;
422 Standard_Real d = sqrt(x * x + y * y + z * z);
435 cout << "HLRAlgo_PolyInternalData::AddNode" << endl;
441 //=======================================================================
442 //function : UpdateLinks
444 //=======================================================================
447 HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1,
448 const Standard_Integer ip2,
449 const Standard_Integer ip3,
450 Standard_Address& TData1,
451 Standard_Address& TData2,
452 Standard_Address& PISeg1,
453 Standard_Address& PISeg2,
454 Standard_Address& PINod1,
457 Standard_Integer find,iiii,iisv,icsv,iip2 =0,cnx1 =0,cnx2 =0;
458 Standard_Address Seg1Indices,Seg2Indices;
463 IncPISeg(PISeg1,PISeg2);
464 IncPISeg(PISeg1,PISeg2);
465 IncPISeg(PISeg1,PISeg2);
468 IncTData(TData1,TData2);
469 IncTData(TData1,TData2);
472 Standard_Address Nod1Indices =
473 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(ip1)->Indices();
474 Standard_Address Nod2Indices =
475 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(ip2)->Indices();
476 Standard_Address Nod3Indices =
477 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(ip3)->Indices();
480 while (iiii != 0 && find == 0) {
482 ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(iiii).Indices();
483 if (Seg2LstSg1 == ip2) {
484 if (Seg2LstSg2 == ip1) {
490 Seg2NxtSg1 = myNbPISeg;
491 if (iisv == 0) Nod2NdSg = myNbPISeg;
492 else if (icsv == 1) Seg1NxtSg1 = myNbPISeg;
493 else Seg1NxtSg2 = myNbPISeg;
502 if (Seg2LstSg1 == ip1) {
508 Seg2NxtSg2 = myNbPISeg;
509 if (iisv == 0) Nod2NdSg = myNbPISeg;
510 else if (icsv == 1) Seg1NxtSg1 = myNbPISeg;
511 else Seg1NxtSg2 = myNbPISeg;
519 Seg1Indices = Seg2Indices;
525 cout << "HLRAlgo_PolyInternalData::UpdateLinks : segment error";
532 ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(myNbPISeg).Indices();
541 Standard_Integer iOld,iNew,iTr,skip,ip4,itpk[2];
542 Standard_Integer n1,n2,n3,nOld[3],nNew[3],New[4];
544 New[2] = myNbTData + 1;
551 New[3] = myNbTData + 2;
554 for (skip = 0; skip <= 1; skip++) {
556 iNew = New[skip + 2];
558 Standard_Address Tri1Indices =
559 ((HLRAlgo_Array1OfTData*)TData1)->ChangeValue(iOld).Indices();
560 Standard_Address Tri2Indices =
561 ((HLRAlgo_Array1OfTData*)TData1)->ChangeValue(iNew).Indices();
571 Standard_Boolean found = Standard_False;
572 if (n1 == ip1 && n2 == ip2) {
573 found = Standard_True;
578 else if (n1 == ip2 && n2 == ip1) {
579 found = Standard_True;
584 else if (n2 == ip1 && n3 == ip2) {
585 found = Standard_True;
590 else if (n2 == ip2 && n3 == ip1) {
591 found = Standard_True;
596 else if (n3 == ip1 && n1 == ip2) {
597 found = Standard_True;
602 else if (n3 == ip2 && n1 == ip1) {
603 found = Standard_True;
611 Standard_Address Nod4Indices =
612 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(ip4)->Indices();
619 Tri2Flags = Tri1Flags;
622 ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(myNbPISeg).Indices();
625 Seg2NxtSg1 = Nod3NdSg;
626 Seg2NxtSg2 = Nod4NdSg;
629 Nod3NdSg = myNbPISeg;
630 Nod4NdSg = myNbPISeg;
634 cout << "HLRAlgo_PolyInternalData::UpdateLinks : triangle error ";
641 for (iTr = 0; iTr <= 3; iTr++) {
643 if (iTr < 2) skip = iTr;
648 Standard_Address Tri2Indices =
649 ((HLRAlgo_Array1OfTData*)TData1)->ChangeValue(iNew).Indices();
654 if (!((n1 == ip3 && n2 == ip4) ||
655 (n2 == ip3 && n1 == ip4))) {
656 Standard_Boolean found = Standard_False;
658 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(n1)->Indices();
661 while (iiii != 0 && !found) {
663 ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(iiii).Indices();
664 if (Seg2LstSg1 == n1) {
665 if (Seg2LstSg2 == n2) {
666 found = Standard_True;
667 if (Seg2Conex1 == iOld) Seg2Conex1 = iNew;
668 else if (Seg2Conex2 == iOld) Seg2Conex2 = iNew;
670 else iiii = Seg2NxtSg1;
673 if (Seg2LstSg1 == n2) {
674 found = Standard_True;
675 if (Seg2Conex1 == iOld) Seg2Conex1 = iNew;
676 else if (Seg2Conex2 == iOld) Seg2Conex2 = iNew;
678 else iiii = Seg2NxtSg2;
683 if (!((n2 == ip3 && n3 == ip4) ||
684 (n3 == ip3 && n2 == ip4))) {
685 Standard_Boolean found = Standard_False;
687 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(n2)->Indices();
690 while (iiii != 0 && !found) {
692 ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(iiii).Indices();
693 if (Seg2LstSg1 == n2) {
694 if (Seg2LstSg2 == n3) {
695 found = Standard_True;
696 if (Seg2Conex1 == iOld) Seg2Conex1 = iNew;
697 else if (Seg2Conex2 == iOld) Seg2Conex2 = iNew;
699 else iiii = Seg2NxtSg1;
702 if (Seg2LstSg1 == n3) {
703 found = Standard_True;
704 if (Seg2Conex1 == iOld) Seg2Conex1 = iNew;
705 else if (Seg2Conex2 == iOld) Seg2Conex2 = iNew;
707 else iiii = Seg2NxtSg2;
712 if (!((n3 == ip3 && n1 == ip4) ||
713 (n1 == ip3 && n3 == ip4))) {
714 Standard_Boolean found = Standard_False;
716 ((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(n3)->Indices();
719 while (iiii != 0 && !found) {
721 ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(iiii).Indices();
722 if (Seg2LstSg1 == n3) {
723 if (Seg2LstSg2 == n1) {
724 found = Standard_True;
725 if (Seg2Conex1 == iOld) Seg2Conex1 = iNew;
726 else if (Seg2Conex2 == iOld) Seg2Conex2 = iNew;
728 else iiii = Seg2NxtSg1;
731 if (Seg2LstSg1 == n1) {
732 found = Standard_True;
733 if (Seg2Conex1 == iOld) Seg2Conex1 = iNew;
734 else if (Seg2Conex2 == iOld) Seg2Conex2 = iNew;
736 else iiii = Seg2NxtSg2;
745 //=======================================================================
748 //=======================================================================
750 void HLRAlgo_PolyInternalData::Dump () const
752 Standard_Integer i;//,i1,i2,i3;
753 Standard_Address Seg2Indices;
754 Standard_Address TData = &myTData->ChangeArray1();
755 Standard_Address PISeg = &myPISeg->ChangeArray1();
756 Standard_Address PINod = &myPINod->ChangeArray1();
758 for (i = 1; i <= myNbPINod; i++) {
759 const Handle(HLRAlgo_PolyInternalNode)* pi =
760 &(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(i));
761 Standard_Address Nod1Indices = (*pi)->Indices();
762 Standard_Address Nod1RValues = (*pi)->RValues();
763 cout << "Node " << setw(6) << i << " : ";
764 cout << setw(6) << Nod1NdSg;
765 cout << setw(20)<< Nod1PntX;
766 cout << setw(20)<< Nod1PntY;
767 cout << setw(20)<< Nod1PntZ;
771 for (i = 1; i <= myNbPISeg; i++) {
773 ((HLRAlgo_Array1OfPISeg*)PISeg)->ChangeValue(i).Indices();
774 cout << "Segment " << setw(6) << i << " : ";
775 cout << setw(6) << Seg2LstSg1;
776 cout << setw(6) << Seg2LstSg2;
777 cout << setw(6) << Seg2NxtSg1;
778 cout << setw(6) << Seg2NxtSg2;
779 cout << setw(6) << Seg2Conex1;
780 cout << setw(6) << Seg2Conex2;
784 for (i = 1; i <= myNbTData; i++) {
785 Standard_Address Tri2Indices =
786 ((HLRAlgo_Array1OfTData*)TData)->ChangeValue(i).Indices();
787 cout << "Triangle " << setw(6) << i << " : ";
788 cout << setw(6) << Tri2Node1;
789 cout << setw(6) << Tri2Node2;
790 cout << setw(6) << Tri2Node3;
795 //=======================================================================
796 //function : IncTData
798 //=======================================================================
800 void HLRAlgo_PolyInternalData::
801 IncTData (Standard_Address& TData1,
802 Standard_Address& TData2)
804 if (myNbTData >= myMxTData) {
807 cout << "HLRAlgo_PolyInternalData::IncTData : " << myMxTData << endl;
809 Standard_Integer i,j,k;
813 Handle(HLRAlgo_HArray1OfTData) NwTData =
814 new HLRAlgo_HArray1OfTData(0,k);
815 HLRAlgo_Array1OfTData& oTData = myTData->ChangeArray1();
816 HLRAlgo_Array1OfTData& nTData = NwTData->ChangeArray1();
817 HLRAlgo_TriangleData* OT = &(oTData.ChangeValue(1));
818 HLRAlgo_TriangleData* NT = &(nTData.ChangeValue(1));
819 Standard_Address Tri1Indices,Tri2Indices;
821 for (i = 1; i <= j; i++) {
822 Tri1Indices = OT->Indices();
823 Tri2Indices = NT->Indices();
824 Tri2Node1 = Tri1Node1;
825 Tri2Node2 = Tri1Node2;
826 Tri2Node3 = Tri1Node3;
827 Tri2Flags = Tri1Flags;
833 if (TData1 == TData2) {
844 //=======================================================================
845 //function : IncPISeg
847 //=======================================================================
849 void HLRAlgo_PolyInternalData::
850 IncPISeg (Standard_Address& PISeg1,
851 Standard_Address& PISeg2)
853 if (myNbPISeg >= myMxPISeg) {
856 cout << "HLRAlgo_PolyInternalData::IncPISeg : " << myMxPISeg << endl;
858 Standard_Integer i,j,k;
861 Handle(HLRAlgo_HArray1OfPISeg) NwPISeg =
862 new HLRAlgo_HArray1OfPISeg(0,k);
863 HLRAlgo_Array1OfPISeg& oPISeg = myPISeg->ChangeArray1();
864 HLRAlgo_Array1OfPISeg& nPISeg = NwPISeg->ChangeArray1();
865 HLRAlgo_PolyInternalSegment* OS = &(oPISeg.ChangeValue(1));
866 HLRAlgo_PolyInternalSegment* NS = &(nPISeg.ChangeValue(1));
867 Standard_Address Seg1Indices,Seg2Indices;
869 for (i = 1; i <= j; i++) {
870 Seg1Indices = OS->Indices();
871 Seg2Indices = NS->Indices();
872 Seg2LstSg1 = Seg1LstSg1;
873 Seg2LstSg2 = Seg1LstSg2;
874 Seg2NxtSg1 = Seg1NxtSg1;
875 Seg2NxtSg2 = Seg1NxtSg2;
876 Seg2Conex1 = Seg1Conex1;
877 Seg2Conex2 = Seg1Conex2;
883 if (PISeg1 == PISeg2) {
894 //=======================================================================
895 //function : IncPINod
897 //=======================================================================
899 void HLRAlgo_PolyInternalData::
900 IncPINod (Standard_Address& PINod1,
901 Standard_Address& PINod2)
903 if (myNbPINod >= myMxPINod) {
906 cout << "HLRAlgo_PolyInternalData::IncPINod : " << myMxPINod << endl;
908 Standard_Integer i,j,k;
909 // Standard_Address Nod1Indices;
912 Handle(HLRAlgo_HArray1OfPINod) NwPINod =
913 new HLRAlgo_HArray1OfPINod(0,k);
914 HLRAlgo_Array1OfPINod& oPINod = myPINod->ChangeArray1();
915 HLRAlgo_Array1OfPINod& nPINod = NwPINod->ChangeArray1();
916 Handle(HLRAlgo_PolyInternalNode)* ON = &(oPINod.ChangeValue(1));
917 Handle(HLRAlgo_PolyInternalNode)* NN = &(nPINod.ChangeValue(1));
919 for (i = 1; i <= j; i++) {
926 if (PINod1 == PINod2) {