0022627: Change OCCT memory management defaults
[occt.git] / src / BOPTest / BOPTest_CheckCommands.cxx
CommitLineData
7fd59977 1// File: BOPTest_CheckCommands.cxx
2// Created: Mon Aug 5 11:07:19 2002
3// Author: Peter KURNEV
4// <pkv@irinox>
5
6#include <BOPTest.ixx>
7//
8#include <TCollection_AsciiString.hxx>
9
10#include <gp_Pnt.hxx>
11
12#include <TopoDS_Shape.hxx>
13#include <TopoDS_Compound.hxx>
14#include <BRep_Builder.hxx>
15
16#include <BooleanOperations_ShapesDataStructure.hxx>
17
18#include <BOPTools_InterferencePool.hxx>
19#include <BOPTools_Checker.hxx>
20// modified by NIZHNY-MKK Fri Sep 3 17:50:06 2004
21#include <BOP_CheckStatus.hxx>
22#include <BOP_Operation.hxx>
23#include <BOP_ArgumentAnalyzer.hxx>
24#include <BOP_CheckResult.hxx>
25#include <BOP_ListOfCheckResult.hxx>
26#include <BOP_ListIteratorOfListOfCheckResult.hxx>
27
28#include <BOPTools_CheckResult.hxx>
29#include <BOPTools_ListOfCheckResults.hxx>
30#include <BOPTools_ListIteratorOfListOfCheckResults.hxx>
31#include <TopTools_ListOfShape.hxx>
32#include <TopTools_ListIteratorOfListOfShape.hxx>
33
34#include <DBRep.hxx>
35
36#include <Geom_Geometry.hxx>
37#include <Geom_CartesianPoint.hxx>
38
39#include <DrawTrSurf.hxx>
40
41
42//
43static
44 Standard_Integer bopcheck (Draw_Interpretor&, Standard_Integer, const char** );
45
46static
47 Standard_Integer bopargcheck (Draw_Interpretor&, Standard_Integer, const char** );
48//
49
50//=======================================================================
51//function : CheckCommands
52//purpose :
53//=======================================================================
54 void BOPTest::CheckCommands(Draw_Interpretor& theCommands)
55{
56 static Standard_Boolean done = Standard_False;
57 if (done)
58 return;
59
60 done = Standard_True;
61 // Chapter's name
62 const char* g = "CCR commands";
63 //
64 theCommands.Add("bopcheck" , "Use >bopcheck Shape", __FILE__, bopcheck, g);
65 theCommands.Add("bopargcheck" , "Use bopargcheck without parameters to get ", __FILE__, bopargcheck, g);
66}
67
68//=======================================================================
69//function : bopcheck
70//purpose :
71//=======================================================================
72Standard_Integer bopcheck (Draw_Interpretor& di, Standard_Integer n, const char** a )
73{
74
75 if (n<2) {
76 di << " Use >bopcheck Shape" << "\n";
77 return 1;
78 }
79
80 TopoDS_Shape aS = DBRep::Get(a[1]);
81 //
82 BOPTools_Checker aChecker(aS);
83
84 aChecker.Perform();
85
86 if (aChecker.HasFaulty()) {
87 const BOPTools_ListOfCheckResults& aResultList = aChecker.GetCheckResult();
88// const TopoDS_Shape& aSF1=aChecker.FaultyShape1();
89// const TopoDS_Shape& aSF2=aChecker.FaultyShape2();
90 Standard_Integer shapeit = 1;
91 BOPTools_ListIteratorOfListOfCheckResults anIt(aResultList);
92
93 for(; anIt.More(); anIt.Next()) {
94 const BOPTools_CheckResult& aCheckResult = anIt.Value();
95 switch(aCheckResult.GetCheckStatus()) {
96 case BOPTools_CHKUNKNOWN: {
97 di << "Unknown status" << "\n";
98 break;
99 }
100 case BOPTools_VERTEXVERTEX: {
101 di << "Self-intersection near vertices" << "\n";
102 break;
103 }
104 case BOPTools_VERTEXEDGE: {
105 di << "Self-intersection near vertex and edge" << "\n";
106 break;
107 }
108 case BOPTools_VERTEXFACE: {
109 di << "Self-intersection near vertex and face" << "\n";
110 break;
111 }
112 case BOPTools_EDGEEDGE: {
113 di << "Self-intersection near edges" << "\n";
114 break;
115 }
116 case BOPTools_EDGEEDGECOMBLK: {
117 di << "Coincidance of edges" << "\n";
118 break;
119 }
120 case BOPTools_EDGEFACE: {
121 di << "Self-intersection near edge and face" << "\n";
122 break;
123 }
124 case BOPTools_EDGEFACECOMBLK: {
125 di << "Edge belong to face not topologically but geometrically" << "\n";
126 break;
127 }
128 case BOPTools_FACEFACE: {
129 di << "Self-intersection near faces" << "\n";
130 break;
131 }
132 case BOPTools_BADSHRANKRANGE: {
133 di << "Can not obtain shrunk range: too small edge" << "\n";
134 break;
135 }
136 case BOPTools_NULLSRANKRANGE: {
137 di << "Shrunk range is empty: too small edge" << "\n";
138 break;
139 }
140 default: {
141 di << "Program error" << "\n";
142 break;
143 }
144 }
145
146 TopTools_ListIteratorOfListOfShape anIt2(aCheckResult.GetShapes());
147 TCollection_AsciiString aBaseName("x");
148 TopoDS_Shape aSF1;
149
150 for(; anIt2.More(); anIt2.Next()) {
151 TopoDS_Shape aSF2 = anIt2.Value();
152 Standard_Boolean bPrint = Standard_False;
153
154 if(aSF1.IsNull()) {
155 bPrint = Standard_True;
156 }
157 else if (!aSF2.IsSame(aSF1)) {
158 bPrint = Standard_True;
159 }
160
161 if(bPrint) {
162 TCollection_AsciiString anumbername(shapeit);
163 TCollection_AsciiString aXName = aBaseName + anumbername;
164 //char* aname = aXName.ToCString();
165 Standard_CString aname=aXName.ToCString();
166 DBRep::Set (aname, aSF2);
167 //printf(aname);
168 di << aname << " ";
169 //printf(" ");
170 shapeit++;
171 }
172 aSF1 = aSF2;
173 }
174 //printf("\n");
175 di << "\n";
176 //
177 const Handle(Geom_Geometry)& aGG=aCheckResult.GetInterferenceGeometry();
178
179 if (!aGG.IsNull()) {
180
181 TCollection_AsciiString aNmx("x0");
182 Standard_CString name= aNmx.ToCString();
183 //
184 Handle (Geom_CartesianPoint) aGCP=
185 Handle (Geom_CartesianPoint)::DownCast(aGG);
186 //
187 if (!aGCP.IsNull()) {
188 const gp_Pnt& aP3D=aGCP->Pnt();
189 DrawTrSurf::Set(name, aP3D);
190 }
191 else {
192 DrawTrSurf::Set(name, aGG);
193 }
194 }
195 }
196 }
197 //
198 else {
199 di << " This shape seems to be OK." << "\n";
200 }
201
202 return 0;
203}
204
205static void MakeShapeForFullOutput(const TCollection_AsciiString & aBaseName,
206 const Standard_Integer aIndex,
207 const TopTools_ListOfShape & aList,
208 Standard_Integer& aCount,
209 Draw_Interpretor& di)
210{
211 TCollection_AsciiString aNum(aIndex);
212 TCollection_AsciiString aName = aBaseName + aNum;
213 Standard_CString name = aName.ToCString();
214
215 TopoDS_Compound cmp;
216 BRep_Builder BB;
217 BB.MakeCompound(cmp);
218
219 TopTools_ListIteratorOfListOfShape anIt(aList);
220 for(; anIt.More(); anIt.Next()) {
221 const TopoDS_Shape & aS = anIt.Value();
222 BB.Add(cmp, aS);
223 aCount++;
224 }
225 di << "Made faulty shape: " << name << "\n";
226 DBRep::Set(name, cmp);
227}
228
229
230Standard_Integer bopargcheck (Draw_Interpretor& di, Standard_Integer n, const char** a )
231{
232 if (n<2) {
233 di << "\n";
234// cout << " Use >bopargcheck Shape1 [[Shape2] [-F/O/C/T/S/U] [+R|F|T|V|E|I|P]] [#BF]" << endl << endl;
235 di << " Use >bopargcheck Shape1 [[Shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF]" << "\n" << "\n";
236 di << " -<Boolean Operation>" << "\n";
237 di << " F (fuse)" << "\n";
238 di << " O (common)" << "\n";
239 di << " C (cut)" << "\n";
240 di << " T (cut21)" << "\n";
241 di << " S (section)" << "\n";
242 di << " U (unknown)" << "\n";
243 di << " For example: \"bopargcheck s1 s2 -F\" enables checking for Fuse operation" << "\n";
244 di << " default - section" << "\n" << "\n";
245// cout << " +<Test Options>" << endl;
246 di << " /<Test Options>" << "\n";
247// cout << " R (enable small edges (shrank range) test)" << endl;
248 di << " R (disable small edges (shrank range) test)" << "\n";
249// cout << " F (enable faces verification test)" << endl;
250 di << " F (disable faces verification test)" << "\n";
251// cout << " T (enable tangent faces searching test)" << endl;
252 di << " T (disable tangent faces searching test)" << "\n";
253// cout << " V (test possibility to merge vertices)" << endl;
254 di << " V (disable test possibility to merge vertices)" << "\n";
255// cout << " E (test possibility to merge edges)" << endl;
256 di << " E (disable test possibility to merge edges)" << "\n";
257 di << " I (disable self-interference test)" << "\n";
258 di << " P (disable shape type test)" << "\n";
259 di << " For example: \"bopargcheck s1 s2 /RI\" disables small edge detection and self-intersection detection" << "\n";
260 di << " default - all options are enabled" << "\n" << "\n";
261 di << " #<Additional Test Options>" << "\n";
262 di << " B (stop test on first faulty found); default OFF" << "\n";
263 di << " F (full output for faulty shapes); default - output in a short format" << "\n" << "\n";
264 di << " NOTE: <Boolean Operation> and <Test Options> are used only for couple" << "\n";
265 di << " of argument shapes, except I and P options that are always used for" << "\n";
266 di << " couple of shapes as well as for single shape test." << "\n";
267 return 1;
268 }
269
270 TopoDS_Shape aS1 = DBRep::Get(a[1]);
271
272 if(aS1.IsNull()) {
273 di << "Error: null shape not allowed!" << "\n";
274 di << "Type bopargcheck without arguments for more information" << "\n";
275 return 1;
276 }
277
278 Standard_Boolean isBO = Standard_False;
279 Standard_Integer indxBO = 0;
280 Standard_Boolean isOP = Standard_False;
281 Standard_Integer indxOP = 0;
282 Standard_Boolean isAD = Standard_False;
283 Standard_Integer indxAD = 0;
284 Standard_Boolean isS2 = Standard_False;
285 Standard_Integer indxS2 = 0;
286
287 if(n >= 3) {
288 Standard_Integer iIndex = 0;
289 for(iIndex = 2; iIndex < n; iIndex++) {
290 if(a[iIndex][0] == '-')
291 {
292 isBO = Standard_True;
293 indxBO = iIndex;
294 }
295 //else if(a[iIndex][0] == '+')
296 else if(a[iIndex][0] == '/')
297 {
298 isOP = Standard_True;
299 indxOP = iIndex;
300 }
301 else if(a[iIndex][0] == '#')
302 {
303 isAD = Standard_True;
304 indxAD = iIndex;
305 }
306 else {
307 isS2 = Standard_True;
308 indxS2 = iIndex;
309 }
310 }
311 }
312
313 // set & test second shape
314 TopoDS_Shape aS2;
315 if(isS2) {
316 if(indxS2 != 2) {
317 di << "Error: second shape should follow the first one!" << "\n";
318 di << "Type bopargcheck without arguments for more information" << "\n";
319 return 1;
320 }
321 else {
322 aS2 = DBRep::Get(a[2]);
323 if(aS2.IsNull()) {
324 di << "Error: second shape is null!" << "\n";
325 di << "Type bopargcheck without arguments for more information" << "\n";
326 return 1;
327 }
328 }
329 }
330
331 // init checker
332 BOP_ArgumentAnalyzer aChecker;
333 aChecker.SetShape1(aS1);
334
335 // set default options (always tested!) for single and couple shapes
336 aChecker.ArgumentTypeMode() = Standard_True;
337 aChecker.SelfInterMode() = Standard_True;
338
339 // test & set options and operation for two shapes
340 if(!aS2.IsNull()) {
341 aChecker.SetShape2(aS2);
342 // set operation (default - Section)
343 if(isBO) {
344 if(a[indxBO][1] == 'F' || a[indxBO][1] == 'f') {
345 aChecker.OperationType() = BOP_FUSE;
346 }
347 else if(a[indxBO][1] == 'O' || a[indxBO][1] == 'o') {
348 aChecker.OperationType() = BOP_COMMON;
349 }
350 else if(a[indxBO][1] == 'C' || a[indxBO][1] == 'c') {
351 aChecker.OperationType() = BOP_CUT;
352 }
353 else if(a[indxBO][1] == 'T' || a[indxBO][1] == 't') {
354 aChecker.OperationType() = BOP_CUT21;
355 }
356 else if(a[indxBO][1] == 'S' || a[indxBO][1] == 's') {
357 aChecker.OperationType() = BOP_SECTION;
358 }
359 else if(a[indxBO][1] == 'U' || a[indxBO][1] == 'u') {
360 aChecker.OperationType() = BOP_UNKNOWN;
361 }
362 else {
363 di << "Error: invalid boolean operation type!" << "\n";
364 di << "Type bopargcheck without arguments for more information" << "\n";
365 return 1;
366 }
367 }
368 else
369 aChecker.OperationType() = BOP_SECTION;
370
371 aChecker.SmallEdgeMode() = Standard_True;
372 aChecker.RebuildFaceMode() = Standard_True;
373 aChecker.TangentMode() = Standard_True;
374 aChecker.MergeVertexMode() = Standard_True;
375 aChecker.MergeEdgeMode() = Standard_True;
376
377 // set options (default - all ON)
378 if(isOP) {
379 Standard_Integer ind = 1;
380 while(a[indxOP][ind] != 0) {
381 if(a[indxOP][ind] == 'R' || a[indxOP][ind] == 'r') {
382 //aChecker.SmallEdgeMode() = Standard_True;
383 aChecker.SmallEdgeMode() = Standard_False;
384 }
385 else if(a[indxOP][ind] == 'F' || a[indxOP][ind] == 'f') {
386 //aChecker.RebuildFaceMode() = Standard_True;
387 aChecker.RebuildFaceMode() = Standard_False;
388 }
389 else if(a[indxOP][ind] == 'T' || a[indxOP][ind] == 't') {
390 //aChecker.TangentMode() = Standard_True;
391 aChecker.TangentMode() = Standard_False;
392 }
393 else if(a[indxOP][ind] == 'V' || a[indxOP][ind] == 'v') {
394 //aChecker.MergeVertexMode() = Standard_True;
395 aChecker.MergeVertexMode() = Standard_False;
396 }
397 else if(a[indxOP][ind] == 'E' || a[indxOP][ind] == 'e') {
398 //aChecker.MergeEdgeMode() = Standard_True;
399 aChecker.MergeEdgeMode() = Standard_False;
400 }
401 else if(a[indxOP][ind] == 'I' || a[indxOP][ind] == 'i') {
402 aChecker.SelfInterMode() = Standard_False;
403 }
404 else if(a[indxOP][ind] == 'P' || a[indxOP][ind] == 'p') {
405 aChecker.ArgumentTypeMode() = Standard_False;
406 }
407 else {
408 di << "Error: invalid test option(s)!" << "\n";
409 di << "Type bopargcheck without arguments for more information" << "\n";
410 return 1;
411 }
412 ind++;
413 }
414 }
415 else {
416 // default test mode (all - ON)
417 aChecker.SmallEdgeMode() = Standard_True;
418 aChecker.RebuildFaceMode() = Standard_True;
419 aChecker.TangentMode() = Standard_True;
420 aChecker.MergeVertexMode() = Standard_True;
421 aChecker.MergeEdgeMode() = Standard_True;
422 }
423 }
424 else {
425 // check type and self-interference mode for single shape test
426 // also check small edges and check faces
427 aChecker.SmallEdgeMode() = Standard_True;
428 aChecker.RebuildFaceMode() = Standard_True;
429
430 if(isOP) {
431 Standard_Integer ind = 1;
432 while(a[indxOP][ind] != 0) {
433 if(a[indxOP][ind] == 'R' || a[indxOP][ind] == 'r') {
434 }
435 else if(a[indxOP][ind] == 'F' || a[indxOP][ind] == 'f') {
436 }
437 else if(a[indxOP][ind] == 'T' || a[indxOP][ind] == 't') {
438 }
439 else if(a[indxOP][ind] == 'V' || a[indxOP][ind] == 'v') {
440 }
441 else if(a[indxOP][ind] == 'E' || a[indxOP][ind] == 'e') {
442 }
443 else if(a[indxOP][ind] == 'I' || a[indxOP][ind] == 'i') {
444 aChecker.SelfInterMode() = Standard_False;
445 }
446 else if(a[indxOP][ind] == 'P' || a[indxOP][ind] == 'p') {
447 aChecker.ArgumentTypeMode() = Standard_False;
448 }
449 else {
450 di << "Error: invalid test option(s)!" << "\n";
451 di << "Type bopargcheck without arguments for more information" << "\n";
452 return 1;
453 }
454 ind++;
455 }
456 }
457 }
458
459 // set additional options
460 Standard_Boolean fullOutput = Standard_False;
461 if(isAD) {
462 Standard_Integer ind = 1;
463 while(a[indxAD][ind] != 0) {
464 if(a[indxAD][ind] == 'B' || a[indxAD][ind] == 'b') {
465 aChecker.StopOnFirstFaulty() = Standard_True;
466 }
467 else if(a[indxAD][ind] == 'F' || a[indxAD][ind] == 'f') {
468 fullOutput = Standard_True;
469 }
470 else {
471 di << "Error: invalid additional test option(s)!" << "\n";
472 di << "Type bopargcheck without arguments for more information" << "\n";
473 return 1;
474 }
475 ind++;
476 }
477 }
478
479 // run checker
480 aChecker.Perform();
481
482 // process result of checking
483 if(!aChecker.HasFaulty()) {
484 di << "Shape(s) seem(s) to be valid for BOP." << "\n";
485 }
486 else {
487 if(!fullOutput) {
488 di << "Faulties, that can not be treated by BOP, are detected." << "\n";
489 }
490 else {
491 const BOP_ListOfCheckResult& aResultList = aChecker.GetCheckResult();
492 BOP_ListIteratorOfListOfCheckResult anIt(aResultList);
493
494 Standard_Integer S1_BadType = 0, S1_SelfInt = 0, S1_SmalE = 0, S1_BadF = 0, S1_BadV = 0, S1_BadE = 0;
495 Standard_Integer S1_SelfIntAll = 0, S1_SmalEAll = 0, S1_BadFAll = 0, S1_BadVAll = 0, S1_BadEAll = 0;
496 Standard_Integer S2_BadType = 0, S2_SelfInt = 0, S2_SmalE = 0, S2_BadF = 0, S2_BadV = 0, S2_BadE = 0;
497 Standard_Integer S2_SelfIntAll = 0, S2_SmalEAll = 0, S2_BadFAll = 0, S2_BadVAll = 0, S2_BadEAll = 0;
498 Standard_Boolean hasUnknown = Standard_False;
499
500 TCollection_AsciiString aS1SIBaseName("s1si_");
501 TCollection_AsciiString aS1SEBaseName("s1se_");
502 TCollection_AsciiString aS1BFBaseName("s1bf_");
503 TCollection_AsciiString aS1BVBaseName("s1bv_");
504 TCollection_AsciiString aS1BEBaseName("s1be_");
505 TCollection_AsciiString aS2SIBaseName("s2si_");
506 TCollection_AsciiString aS2SEBaseName("s2se_");
507 TCollection_AsciiString aS2BFBaseName("s2bf_");
508 TCollection_AsciiString aS2BVBaseName("s2bv_");
509 TCollection_AsciiString aS2BEBaseName("s2be_");
510
511 for(; anIt.More(); anIt.Next()) {
512 const BOP_CheckResult& aResult = anIt.Value();
513 const TopoDS_Shape & aSS1 = aResult.GetShape1();
514 const TopoDS_Shape & aSS2 = aResult.GetShape2();
515 const TopTools_ListOfShape & aLS1 = aResult.GetFaultyShapes1();
516 const TopTools_ListOfShape & aLS2 = aResult.GetFaultyShapes2();
517 Standard_Boolean isL1 = !aLS1.IsEmpty();
518 Standard_Boolean isL2 = !aLS2.IsEmpty();
519
520 switch(aResult.GetCheckStatus()) {
521 case BOP_BadType: {
522 if(!aSS1.IsNull()) S1_BadType++;
523 if(!aSS2.IsNull()) S2_BadType++;
524 }
525 break;
526 case BOP_SelfIntersect: {
527 if(!aSS1.IsNull()) {
528 S1_SelfInt++;
529 if(isL1)
530 MakeShapeForFullOutput(aS1SIBaseName, S1_SelfInt, aLS1, S1_SelfIntAll, di);
531 }
532 if(!aSS2.IsNull()) {
533 S2_SelfInt++;
534 if(isL2)
535 MakeShapeForFullOutput(aS2SIBaseName, S2_SelfInt, aLS2, S2_SelfIntAll, di);
536 }
537 }
538 break;
539 case BOP_TooSmallEdge: {
540 if(!aSS1.IsNull()) {
541 S1_SmalE++;
542 if(isL1)
543 MakeShapeForFullOutput(aS1SEBaseName, S1_SmalE, aLS1, S1_SmalEAll, di);
544 }
545 if(!aSS2.IsNull()) {
546 S2_SmalE++;
547 if(isL2)
548 MakeShapeForFullOutput(aS2SEBaseName, S2_SmalE, aLS2, S2_SmalEAll, di);
549 }
550 }
551 break;
552 case BOP_NonRecoverableFace: {
553 if(!aSS1.IsNull()) {
554 S1_BadF++;
555 if(isL1)
556 MakeShapeForFullOutput(aS1BFBaseName, S1_BadF, aLS1, S1_BadFAll, di);
557 }
558 if(!aSS2.IsNull()) {
559 S2_BadF++;
560 if(isL2)
561 MakeShapeForFullOutput(aS2BFBaseName, S2_BadF, aLS2, S2_BadFAll, di);
562 }
563 }
564 break;
565 case BOP_IncompatibilityOfVertex: {
566 if(!aSS1.IsNull()) {
567 S1_BadV++;
568 if(isL1) {
569 MakeShapeForFullOutput(aS1BVBaseName, S1_BadV, aLS1, S1_BadVAll, di);
570 }
571 }
572 if(!aSS2.IsNull()) {
573 S2_BadV++;
574 if(isL2){
575 MakeShapeForFullOutput(aS2BVBaseName, S2_BadV, aLS2, S2_BadVAll, di);
576 }
577 }
578 }
579 break;
580 case BOP_IncompatibilityOfEdge: {
581 if(!aSS1.IsNull()) {
582 S1_BadE++;
583 if(isL1) {
584 MakeShapeForFullOutput(aS1BEBaseName, S1_BadE, aLS1, S1_BadEAll, di);
585 }
586 }
587 if(!aSS2.IsNull()) {
588 S2_BadE++;
589 if(isL2) {
590 MakeShapeForFullOutput(aS2BEBaseName, S2_BadE, aLS2, S2_BadEAll, di);
591 }
592 }
593 }
594 break;
595 case BOP_IncompatibilityOfFace: {
596 // not yet implemented
597 }
598 break;
599 case BOP_CheckUnknown:
600 default: {
601 hasUnknown = Standard_True;
602 }
603 break;
604 } // switch
605 }// faulties
606
607 Standard_Integer FS1 = S1_SelfInt + S1_SmalE + S1_BadF + S1_BadV + S1_BadE;
608 FS1 += (S1_BadType != 0) ? 1 : 0;
609 Standard_Integer FS2 = S2_SelfInt + S2_SmalE + S2_BadF + S2_BadV + S2_BadE;
610 FS2 += (S2_BadType != 0) ? 1 : 0;
611
612 // output for first shape
613 di << "Faulties for FIRST shape found : " << FS1 << "\n";
614 if(FS1 != 0) {
615 di << "---------------------------------" << "\n";
616 Standard_CString CString1;
617 if (S1_BadType != 0)
618 CString1="YES";
619 else
620 CString1="NO";
621 di << "Shapes are not suppotrted by BOP: " << CString1 << "\n";
622 Standard_CString CString2;
623 if (S1_SelfInt != 0)
624 CString2="YES";
625 else
626 CString2="NO";
627 di << "Self-Intersections : " << CString2;
628 if(S1_SelfInt != 0)
629 di << " Cases(" << S1_SelfInt << ") Total shapes(" << S1_SelfIntAll << ")" << "\n";
630 else
631 di << "\n";
632 Standard_CString CString3;
633 if (S1_SmalE != 0)
634 CString3="YES";
635 else
636 CString3="NO";
637 di << "Too small edges : " << CString3;
638 if(S1_SmalE != 0)
639 di << " Cases(" << S1_SmalE << ") Total shapes(" << S1_SmalEAll << ")" << "\n";
640 else
641 di << "\n";
642 Standard_CString CString4;
643 if (S1_BadF != 0)
644 CString4="YES";
645 else
646 CString4="NO";
647 di << "Bad faces : " << CString4;
648 if(S1_BadF != 0)
649 di << " Cases(" << S1_BadF << ") Total shapes(" << S1_BadFAll << ")" << "\n";
650 else
651 di << "\n";
652 Standard_CString CString5;
653 if (S1_BadV != 0)
654 CString5="YES";
655 else
656 CString5="NO";
657 di << "Too close vertices : " << CString5;
658 if(S1_BadV != 0)
659 di << " Cases(" << S1_BadV << ") Total shapes(" << S1_BadVAll << ")" << "\n";
660 else
661 di << "\n";
662 Standard_CString CString6;
663 if (S1_BadE != 0)
664 CString6="YES";
665 else
666 CString6="NO";
667 di << "Too close edges : " << CString6;
668 if(S1_BadE != 0)
669 di << " Cases(" << S1_BadE << ") Total shapes(" << S1_BadEAll << ")" << "\n";
670 else
671 di << "\n";
672 }
673
674 // output for second shape
675 di << "\n";
676 di << "Faulties for SECOND shape found : " << FS2 << "\n";
677 if(FS2 != 0) {
678 di << "---------------------------------" << "\n";
679 Standard_CString CString7;
680 if (S2_BadType != 0)
681 CString7="YES";
682 else
683 CString7="NO";
684 di << "Shapes are not suppotrted by BOP: " << CString7 << "\n";
685 Standard_CString CString8;
686 if (S2_SelfInt != 0)
687 CString8="YES";
688 else
689 CString8="NO";
690 di << "Self-Intersections : " << CString8;
691 if(S2_SelfInt != 0)
692 di << " Cases(" << S2_SelfInt << ") Total shapes(" << S2_SelfIntAll << ")" << "\n";
693 else
694 di << "\n";
695 Standard_CString CString9;
696 if (S2_SmalE != 0)
697 CString9="YES";
698 else
699 CString9="NO";
700 di << "Too small edges : " << CString9;
701 if(S2_SmalE != 0)
702 di << " Cases(" << S2_SmalE << ") Total shapes(" << S2_SmalEAll << ")" << "\n";
703 else
704 di << "\n";
705 Standard_CString CString10;
706 if (S2_BadF != 0)
707 CString10="YES";
708 else
709 CString10="NO";
710 di << "Bad faces : " << CString10;
711 if(S2_BadF != 0)
712 di << " Cases(" << S2_BadF << ") Total shapes(" << S2_BadFAll << ")" << "\n";
713 else
714 di << "\n";
715 Standard_CString CString11;
716 if (S2_BadV != 0)
717 CString11="YES";
718 else
719 CString11="NO";
720 di << "Too close vertices : " << CString11;
721 if(S2_BadV != 0)
722 di << " Cases(" << S2_BadV << ") Total shapes(" << S2_BadVAll << ")" << "\n";
723 else
724 di << "\n";
725 Standard_CString CString12;
726 if (S2_BadE != 0)
727 CString12="YES";
728 else
729 CString12="NO";
730 di << "Too close edges : " << CString12;
731 if(S2_BadE != 0)
732 di << " Cases(" << S2_BadE << ") Total shapes(" << S2_BadEAll << ")" << "\n";
733 else
734 di << "\n";
735
736 // warning
737 di << "\n";
738 if(hasUnknown)
739 di << "WARNING: The unexpected test break occurs!" << "\n";
740 }
741 } // full output
742 } // has faulties
743
744 return 0;
745}