0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / TopOpeBRepBuild / TopOpeBRepBuild_Griddump.cxx
1 // Created on: 1996-03-07
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <gp_Pnt.hxx>
19 #include <Standard_NoSuchObject.hxx>
20 #include <TCollection_AsciiString.hxx>
21 #include <TopoDS_Edge.hxx>
22 #include <TopoDS_Face.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <TopoDS_Vertex.hxx>
25 #include <TopOpeBRepBuild_Builder.hxx>
26 #include <TopOpeBRepBuild_define.hxx>
27 #include <TopOpeBRepBuild_EdgeBuilder.hxx>
28 #include <TopOpeBRepBuild_FaceBuilder.hxx>
29 #include <TopOpeBRepBuild_GTopo.hxx>
30 #include <TopOpeBRepBuild_HBuilder.hxx>
31 #include <TopOpeBRepBuild_PaveSet.hxx>
32 #include <TopOpeBRepBuild_ShapeSet.hxx>
33 #include <TopOpeBRepBuild_ShellFaceSet.hxx>
34 #include <TopOpeBRepBuild_SolidBuilder.hxx>
35 #include <TopOpeBRepBuild_WireEdgeSet.hxx>
36 #include <TopOpeBRepDS_BuildTool.hxx>
37 #include <TopOpeBRepDS_CurveIterator.hxx>
38 #include <TopOpeBRepDS_HDataStructure.hxx>
39 #include <TopOpeBRepDS_PointIterator.hxx>
40 #include <TopOpeBRepDS_SurfaceIterator.hxx>
41 #include <TopOpeBRepTool_ShapeExplorer.hxx>
42
43 #include <stdio.h>
44 #ifdef DRAW
45 #include <DBRep.hxx>
46 #endif
47
48 #include <TopOpeBRepBuild_GIter.hxx>
49 #include <TopOpeBRepBuild_GTool.hxx>
50 #include <TopOpeBRepDS_Surface.hxx>
51 #include <TopOpeBRepDS_Curve.hxx>
52 #include <TopOpeBRepDS_Point.hxx>
53 #include <TopOpeBRepDS_Interference.hxx>
54 #include <TopOpeBRepDS_Config.hxx>
55 #include <TopOpeBRepDS_Dumper.hxx>
56 #include <TopOpeBRepDS.hxx>
57 #include <TopOpeBRepTool_ShapeExplorer.hxx>
58 #include <Geom_Curve.hxx>
59 #include <Geom2d_Curve.hxx>
60 #include <BRep_Tool.hxx>
61 #include <TopoDS_Shell.hxx>
62 #include <TopoDS_Wire.hxx>
63 #include <TopoDS.hxx>
64 #include <TopExp.hxx>
65 #include <Geom_Plane.hxx>
66 #include <gp_Pnt.hxx>
67 #include <gp_Pnt2d.hxx>
68 #include <ElCLib.hxx>
69 #include <ElSLib.hxx>
70 #include <Geom2dAdaptor_Curve.hxx>
71 #include <BRepAdaptor_Surface.hxx>
72 #include <GeomAbs_CurveType.hxx>
73 #include <GeomAbs_SurfaceType.hxx>
74 #include <GeomAdaptor_Curve.hxx>
75 #include <Geom_Line.hxx>
76 #include <Geom_Circle.hxx>
77 #include <Geom_Ellipse.hxx>
78 #include <Geom_Hyperbola.hxx>
79 #include <Geom_Parabola.hxx>
80 #include <Geom_BezierCurve.hxx>
81 #include <Geom_BSplineCurve.hxx>
82 #include <TCollection_AsciiString.hxx>
83 #include <TopOpeBRepBuild_WireEdgeSet.hxx>
84
85 #ifdef OCCT_DEBUG
86 static TCollection_AsciiString PRODINS("dins ");
87 #endif
88
89 //=======================================================================
90 //function : GdumpLS
91 //purpose  : 
92 //=======================================================================
93 #ifdef OCCT_DEBUG
94 void TopOpeBRepBuild_Builder::GdumpLS(const TopTools_ListOfShape& L) const 
95 {
96   TopTools_ListIteratorOfListOfShape it(L);
97   for (; it.More(); it.Next() ) {
98     const TopoDS_Shape& SL = it.Value();
99     GdumpSHA(SL);
100   }
101 }
102 #else
103 void TopOpeBRepBuild_Builder::GdumpLS(const TopTools_ListOfShape&) const 
104 {
105 }
106 #endif
107
108 //=======================================================================
109 //function : PrintGeo
110 //purpose  : 
111 //=======================================================================
112 #ifdef OCCT_DEBUG
113 void TopOpeBRepBuild_Builder::PrintGeo(const TopoDS_Shape& S)
114 {
115   if      (S.ShapeType() == TopAbs_VERTEX) PrintPnt(TopoDS::Vertex(S));
116   else if (S.ShapeType() == TopAbs_EDGE)   PrintCur(TopoDS::Edge(S));
117   else if (S.ShapeType() == TopAbs_FACE)   PrintSur(TopoDS::Face(S));
118 }
119 #else
120 void TopOpeBRepBuild_Builder::PrintGeo(const TopoDS_Shape&)
121 {
122 }
123 #endif
124
125 //=======================================================================
126 //function : PrintSur
127 //purpose  : print the name of a surface
128 //=======================================================================
129 #ifdef OCCT_DEBUG
130 void TopOpeBRepBuild_Builder::PrintSur(const TopoDS_Face& F)
131 {
132   BRepAdaptor_Surface STA_Surface(F);
133   GeomAbs_SurfaceType t =  STA_Surface.GetType();
134   switch(t) {
135   case GeomAbs_Plane               : cout<<"PLANE";               break;
136   case GeomAbs_Cylinder            : cout<<"CYLINDER";            break;
137   case GeomAbs_Cone                : cout<<"CONE";                break;
138   case GeomAbs_Sphere              : cout<<"SPHERE";              break;
139   case GeomAbs_Torus               : cout<<"TORUS";               break;
140   case GeomAbs_BezierSurface       : cout<<"BEZIERSURFACE";       break;
141   case GeomAbs_BSplineSurface      : cout<<"BSPLINESURFACE";      break;
142   case GeomAbs_SurfaceOfRevolution : cout<<"SURFACEOFREVOLUTION"; break;
143   case GeomAbs_SurfaceOfExtrusion  : cout<<"SURFACEOFEXTRUSION";  break;
144   case GeomAbs_OtherSurface : default : cout<<"OTHERSURFACE";     break;
145   }
146   cout.flush();
147 }
148 #else
149 void TopOpeBRepBuild_Builder::PrintSur(const TopoDS_Face& )
150 {
151 }
152 #endif
153
154 //=======================================================================
155 //function : PrintCur
156 //purpose  : print the name of a curve
157 //=======================================================================
158 #ifdef OCCT_DEBUG
159 void TopOpeBRepBuild_Builder::PrintCur(const TopoDS_Edge& E)
160 {
161   TopLoc_Location L; Standard_Real f,l;
162   Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,f,l);
163   if ( C.IsNull() ) return;
164   GeomAdaptor_Curve GC(C);
165   GeomAbs_CurveType t = GC.GetType();
166
167   switch(t) {
168   case GeomAbs_Line                : cout<<"LINE";              break;
169   case GeomAbs_Circle              : cout<<"CIRCLE";            break;
170   case GeomAbs_Ellipse             : cout<<"ELLIPSE";           break;
171   case GeomAbs_Hyperbola           : cout<<"HYPERBOLA";         break;
172   case GeomAbs_Parabola            : cout<<"PARABOLA";          break;
173   case GeomAbs_BezierCurve         : cout<<"BEZIERCURVE";       break;
174   case GeomAbs_BSplineCurve        : cout<<"BSPLINECURVE "<<GC.BSpline()->Degree(); break;
175   case GeomAbs_OffsetCurve         : cout<<"OFFSETCURVE";       break;
176   case GeomAbs_OtherCurve          : cout<<"OTHERCURVE";        break;
177   }
178   cout.flush();
179 }
180 #else
181 void TopOpeBRepBuild_Builder::PrintCur(const TopoDS_Edge&)
182 {
183 }
184 #endif
185
186 //=======================================================================
187 //function : PrintPnt
188 //purpose  : 
189 //=======================================================================
190 #ifdef OCCT_DEBUG
191 void TopOpeBRepBuild_Builder::PrintPnt(const TopoDS_Vertex& V)
192 {
193   GdumpPNT(BRep_Tool::Pnt(V));
194 }
195 #else
196 void TopOpeBRepBuild_Builder::PrintPnt(const TopoDS_Vertex&)
197 {
198 }
199 #endif
200
201 //=======================================================================
202 //function : PrintOri
203 //purpose  : 
204 //=======================================================================
205 #ifdef OCCT_DEBUG
206 void TopOpeBRepBuild_Builder::PrintOri(const TopoDS_Shape& S) 
207
208   TopAbs::Print(S.Orientation(),cout);
209   cout.flush(); 
210 }
211 #else
212 void TopOpeBRepBuild_Builder::PrintOri(const TopoDS_Shape& /*S*/) 
213
214 }
215 #endif
216
217 //=======================================================================
218 //function : StringState
219 //purpose  : 
220 //=======================================================================
221 #ifdef OCCT_DEBUG
222 TCollection_AsciiString TopOpeBRepBuild_Builder::StringState(const TopAbs_State st) 
223 #else
224 TCollection_AsciiString TopOpeBRepBuild_Builder::StringState(const TopAbs_State) 
225 #endif
226
227   TCollection_AsciiString s;
228 #ifdef OCCT_DEBUG
229   switch(st) {
230   case TopAbs_ON : s.AssignCat("ON"); break;
231   case TopAbs_IN : s.AssignCat("IN"); break;
232   case TopAbs_OUT : s.AssignCat("OUT"); break;
233   case TopAbs_UNKNOWN : s.AssignCat("UNKNOWN"); break;
234   }
235 #endif
236   return s;
237 }
238
239 //=======================================================================
240 //function : GdumpPNT
241 //purpose  : 
242 //=======================================================================
243 #ifdef OCCT_DEBUG
244 void TopOpeBRepBuild_Builder::GdumpPNT(const gp_Pnt& P)
245
246   cout<<P.X()<<" "<<P.Y()<<" "<<P.Z();  cout.flush();
247 }
248 #else
249 void TopOpeBRepBuild_Builder::GdumpPNT(const gp_Pnt&)
250
251 }
252 #endif
253
254 //=======================================================================
255 //function : GdumpORIPARPNT
256 //purpose  : 
257 //=======================================================================
258 #ifdef OCCT_DEBUG
259 void TopOpeBRepBuild_Builder::GdumpORIPARPNT(const TopAbs_Orientation o,
260                                              const Standard_Real p,
261                                              const gp_Pnt& Pnt)
262
263   TopAbs::Print(o,cout); cout<<" "<<p<<" pnt "; GdumpPNT(Pnt);  cout.flush();
264 }
265 #else
266 void TopOpeBRepBuild_Builder::GdumpORIPARPNT(const TopAbs_Orientation, 
267                                              const Standard_Real,const gp_Pnt&)
268 {
269 }
270 #endif
271
272 //=======================================================================
273 //function : GdumpEDGVER
274 //purpose  : 
275 //=======================================================================
276 #ifdef OCCT_DEBUG
277 void TopOpeBRepBuild_Builder::GdumpEDGVER(const TopoDS_Shape& E,
278                                           const TopoDS_Shape& V,
279                                           const Standard_Address s) const 
280
281   char* c = (char*)s; if (c) cout<<c;
282   const TopoDS_Edge& EE = TopoDS::Edge(E);
283   const TopoDS_Vertex& VV = TopoDS::Vertex(V);
284   Standard_Real par = BRep_Tool::Parameter(VV,EE);
285   gp_Pnt P = BRep_Tool::Pnt(VV);
286   GdumpORIPARPNT(VV.Orientation(),par,P);
287   cout.flush();
288 }
289 #else
290 void TopOpeBRepBuild_Builder::GdumpEDGVER(const TopoDS_Shape&,
291                                           const TopoDS_Shape&,
292                                           const Standard_Address) const 
293 {
294 }
295 #endif
296
297 //=======================================================================
298 //function : GdumpEDG
299 //purpose  : 
300 //=======================================================================
301 #ifdef OCCT_DEBUG
302 void TopOpeBRepBuild_Builder::GdumpEDG(const TopoDS_Shape& E,
303                                        const Standard_Address s) const 
304 {
305   char* c = (char*)s; if (c) cout<<c;
306   const TopoDS_Edge& EE = TopoDS::Edge(E);
307   Standard_Integer n = 0;
308   GdumpSHAORI(E, (char *) "vertices of ");cout<<endl;
309   TopOpeBRepTool_ShapeExplorer ex(E,TopAbs_VERTEX);
310   char strpar[256]; 
311   Sprintf(strpar," #");
312   for (; ex.More(); ex.Next()) {
313     const TopoDS_Vertex& VV = TopoDS::Vertex(ex.Current());
314     TopAbs_Orientation o = VV.Orientation();
315     cout<<"vertex v";
316     if      (o == TopAbs_FORWARD)  cout<<"F";
317     else if (o == TopAbs_REVERSED) cout<<"R";
318     else if (o == TopAbs_INTERNAL) cout<<"I";
319     else if (o == TopAbs_EXTERNAL) cout<<"E";
320     cout<<++n<<" "; TopOpeBRepBuild_Builder::PrintPnt(VV); cout<<";";
321     Standard_Real par = BRep_Tool::Parameter(VV,EE);
322     char spar[255];
323     Sprintf(spar," par%d %f",n,par); 
324     strcat(strpar,spar);
325   }
326   if(n) cout<<strpar<<endl;
327   cout.flush();
328 }
329 #else
330 void TopOpeBRepBuild_Builder::GdumpEDG(const TopoDS_Shape&,
331                                        const Standard_Address) const 
332 {
333 }
334 #endif
335
336 //=======================================================================
337 //function : GdumpSAMDOM
338 //purpose  : 
339 //=======================================================================
340 void TopOpeBRepBuild_Builder::GdumpSAMDOM(const TopTools_ListOfShape& L,
341                                           const Standard_Address astr) const 
342 {
343   TopOpeBRepDS_Dumper Dumper(myDataStructure);
344   cout<<Dumper.SPrintShapeRefOri(L,(char*)astr)<<endl;
345   cout.flush();
346 }
347
348 //=======================================================================
349 //function : GdumpSHA
350 //purpose  : 
351 //=======================================================================
352 #ifdef OCCT_DEBUG
353 void TopOpeBRepBuild_Builder::GdumpSHA(const TopoDS_Shape& S,
354                                        const Standard_Address str) const 
355 {
356   char* c = (char*)str; if (c) cout<<c;
357   if (S.IsNull()) return;
358   TopAbs_ShapeEnum tS = S.ShapeType(); Standard_Integer iS = 0;
359   if ( ! myDataStructure.IsNull() ) iS = myDataStructure->Shape(S);
360   TopOpeBRepDS::Print(tS,iS,cout);
361   cout.flush();
362 }
363 #else
364 void TopOpeBRepBuild_Builder::GdumpSHA(const TopoDS_Shape&,
365                                        const Standard_Address) const 
366 {
367 }
368 #endif
369
370 //=======================================================================
371 //function : GdumpSHAORI
372 //purpose  : 
373 //=======================================================================
374 #ifdef OCCT_DEBUG
375 void TopOpeBRepBuild_Builder::GdumpSHAORI(const TopoDS_Shape& S,
376                                           const Standard_Address str) const
377 {
378   char* c = (char*)str; if (c) cout<<c;
379   GdumpSHA(S,NULL); cout<<","; PrintOri(S);
380   cout.flush();
381 }
382 #else
383 void TopOpeBRepBuild_Builder::GdumpSHAORI(const TopoDS_Shape& ,
384                                           const Standard_Address ) const
385 {
386 }
387 #endif
388 //=======================================================================
389 //function : GdumpSHAORIGEO
390 //purpose  : 
391 //=======================================================================
392 #ifdef OCCT_DEBUG
393 void TopOpeBRepBuild_Builder::GdumpSHAORIGEO(const TopoDS_Shape& S,
394                                              const Standard_Address str) const
395 {
396   char* c = (char*)str; if (c) cout<<c;
397   GdumpSHAORI(S,NULL); cout<<","; PrintGeo(S);
398   cout.flush();
399 }
400 #else
401 void TopOpeBRepBuild_Builder::GdumpSHAORIGEO(const TopoDS_Shape& ,
402                                              const Standard_Address ) const
403 {
404 }
405 #endif
406 //=======================================================================
407 //function : GdumpSHASTA
408 //purpose  : 
409 //=======================================================================
410 #ifdef OCCT_DEBUG
411 void TopOpeBRepBuild_Builder::GdumpSHASTA(const TopoDS_Shape& S,
412                                           const TopAbs_State T,
413                                           const TCollection_AsciiString& a,
414                                           const TCollection_AsciiString& b) const 
415 {
416   cout<<a;
417   GdumpSHAORIGEO(S,NULL); cout<<","<<StringState(T).ToCString();
418   cout<<b;
419   cout.flush();
420 }
421 #else
422 void TopOpeBRepBuild_Builder::GdumpSHASTA(const TopoDS_Shape& ,
423                                           const TopAbs_State ,
424                                           const TCollection_AsciiString& ,
425                                           const TCollection_AsciiString& ) const 
426 {
427 }
428 #endif
429
430 //=======================================================================
431 //function : GdumpSHASTA
432 //purpose  : 
433 //=======================================================================
434 #ifdef OCCT_DEBUG
435 void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer iS,
436                                           const TopAbs_State T,
437                                           const TCollection_AsciiString& a,
438                                           const TCollection_AsciiString& b) const 
439 {
440   const TopoDS_Shape& S = myDataStructure->Shape(iS);
441   GdumpSHASTA(S,T,a,b);
442   cout.flush();
443 }
444 #else
445 void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer ,
446                                           const TopAbs_State ,
447                                           const TCollection_AsciiString& ,
448                                           const TCollection_AsciiString& ) const 
449 {
450 }
451 #endif
452
453 //=======================================================================
454 //function : GdumpSHASTA
455 //purpose  : 
456 //=======================================================================
457 #ifdef OCCT_DEBUG
458 void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer iS,
459                                           const TopAbs_State T,
460                                           const TopOpeBRepBuild_ShapeSet& SS,
461                                           const TCollection_AsciiString& a,
462                                           const TCollection_AsciiString& b,
463                                           const TCollection_AsciiString& c)const
464 {
465   const TopoDS_Shape& S = myDataStructure->Shape(iS);
466   TCollection_AsciiString aib = a + " " + SS.DEBNumber() + " " + b;
467   GdumpSHASTA(S,T,aib,c);
468   cout.flush();
469 }
470 #else
471 void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer ,
472                                           const TopAbs_State ,
473                                           const TopOpeBRepBuild_ShapeSet& ,
474                                           const TCollection_AsciiString& ,
475                                           const TCollection_AsciiString& ,
476                                           const TCollection_AsciiString& )const
477 {
478 }
479 #endif
480
481 //=======================================================================
482 //function : GdumpSHASETreset
483 //purpose  : 
484 //=======================================================================
485 void TopOpeBRepBuild_Builder::GdumpSHASETreset()
486
487 #ifdef OCCT_DEBUG
488   mySHASETindex = 0;
489 #endif
490 }
491
492 //=======================================================================
493 //function : GdumpSHASETindex
494 //purpose  : 
495 //=======================================================================
496 Standard_Integer TopOpeBRepBuild_Builder::GdumpSHASETindex()
497 {
498   Standard_Integer n = 0;
499 #ifdef OCCT_DEBUG
500   n = ++mySHASETindex;
501 #endif
502   return n;
503 }
504
505 //=======================================================================
506 //function : GdumpEXP
507 //purpose  : 
508 //=======================================================================
509 #ifdef OCCT_DEBUG
510 void TopOpeBRepBuild_Builder::GdumpEXP(const TopOpeBRepTool_ShapeExplorer& Ex) const 
511 {
512   if ( ! Ex.More() ) return;
513   TopAbs_ShapeEnum t = Ex.Current().ShapeType();
514   if      (t == TopAbs_SOLID) cout<<"";
515   else if (t == TopAbs_FACE)  cout<<"  ";
516   else if (t == TopAbs_EDGE)  cout<<"     ";
517   else cout<<"??";
518   Ex.DumpCurrent(cout);
519   Standard_Integer I = myDataStructure->Shape(Ex.Current());
520   if ( I != 0 ) cout<<" :  shape "<<I;
521   cout<<endl;
522   cout.flush();
523 }
524 #else
525 void TopOpeBRepBuild_Builder::GdumpEXP(const TopOpeBRepTool_ShapeExplorer& ) const 
526 {
527 }
528 #endif
529
530 //=======================================================================
531 //function : GdumpSOBU
532 //purpose  : 
533 //=======================================================================
534 void TopOpeBRepBuild_Builder::GdumpSOBU(TopOpeBRepBuild_SolidBuilder& /*ME*/) const 
535 {
536 #ifdef OCCT_DEBUG
537 #endif
538 } // GdumpSOBU
539
540 #ifdef OCCT_DEBUG
541 void* GFABUMAKEFACEPWES_DEB = NULL;
542 #endif
543
544 //=======================================================================
545 //function : GdumpFABU
546 //purpose  : 
547 //=======================================================================
548 #ifdef OCCT_DEBUG
549 void TopOpeBRepBuild_Builder::GdumpFABU(TopOpeBRepBuild_FaceBuilder& ME) const 
550 {
551   const TopoDS_Shape& face = ME.Face();
552   Standard_Integer iF; 
553 //  Standard_Boolean tSPS = 
554   GtraceSPS(face,iF);
555   TopOpeBRepBuild_WireEdgeSet* PWES = (TopOpeBRepBuild_WireEdgeSet*)GFABUMAKEFACEPWES_DEB;
556
557   Standard_Integer nf,nw,ne;
558   ME.InitFace();
559   if ( ME.MoreFace() ) cout<<"clear;"<<endl;
560   for (nf=0;ME.MoreFace();ME.NextFace()) { 
561     nf++;
562     cout<<"# face "<<nf<<endl;
563     for (nw=0,ME.InitWire();ME.MoreWire();ME.NextWire()) { 
564       nw++;
565       Standard_Boolean ow = ME.IsOldWire();
566       cout<<"#  wire "<<nw;if(ow)cout<<" (old)";else cout<<" (new)";cout<<endl;
567       if (!ow) {
568         TCollection_AsciiString whatis("whatis");
569         for(ne=0,ME.InitEdge();ME.MoreEdge();ME.NextEdge()) { 
570           ne++;
571           const TopoDS_Edge& EE = TopoDS::Edge(ME.Edge());
572           TCollection_AsciiString Enam("E");
573           TCollection_AsciiString VFnam("VF");
574           TCollection_AsciiString VRnam("VR");
575           Enam  = Enam  + ne + "NF" + nf + "F" + iF;
576           if (PWES) Enam = Enam + PWES->DEBName() + PWES->DEBNumber();
577           VFnam = VFnam + ne + "NF" + nf + "F" + iF;
578           VRnam = VRnam + ne + "NF" + nf + "F" + iF;
579 //        cout<<"    puts \"edge "<<ne<<" : "<<Enam<<"\"";cout<<"; ";
580           TopoDS_Vertex VF,VR; TopExp::Vertices(EE,VF,VR);
581           if ( ! VF.IsNull() && !VR.IsNull() && !EE.IsNull()) {
582 #ifdef DRAW
583             DBRep::Set(Enam.ToCString(),EE); 
584             DBRep::Set(VFnam.ToCString(),VF);
585             DBRep::Set(VRnam.ToCString(),VR);
586 #endif
587             cout<<PRODINS<<"-O -p 0.5 "<<Enam; cout<<"; ";
588 //          cout<<PRODINS<<VFnam; cout<<"; ";
589 //          cout<<PRODINS<<VRnam; cout<<"; ";
590 //          gp_Pnt PF = BRep_Tool::Pnt(VF); 
591 //          gp_Pnt PR = BRep_Tool::Pnt(VR);
592 //          cout<<endl;
593 //          cout<<"# ";
594 //          cout<<"dinp "<<VFnam<<" ";TopOpeBRepBuild_Builder::PrintPnt(VF);cout<<"; ";
595 //          cout<<"dinp "<<VRnam<<" ";TopOpeBRepBuild_Builder::PrintPnt(VR);cout<<"; ";
596             cout<<endl;
597             whatis += " "; whatis += Enam;
598           }
599         }
600         if (ne) cout<<"    "<<whatis<<endl<<endl;
601       }
602     }
603   }
604   cout.flush();
605 } // GdumpFABU
606 #else
607 void TopOpeBRepBuild_Builder::GdumpFABU(TopOpeBRepBuild_FaceBuilder& ) const 
608 {
609 }
610 #endif
611
612 //=======================================================================
613 //function : GdumpEDBU
614 //purpose  : 
615 //=======================================================================
616 void TopOpeBRepBuild_Builder::GdumpEDBU(TopOpeBRepBuild_EdgeBuilder& /*ME*/) const 
617 {
618 #ifdef OCCT_DEBUG
619 #endif
620 } // GdumpEDBU
621
622 //=======================================================================
623 //function : GtraceSPS
624 //purpose  : 
625 //=======================================================================
626 #ifdef OCCT_DEBUG
627 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer iS) const 
628 #else
629 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer ) const        
630 #endif       
631 {
632   Standard_Boolean b = Standard_False;
633 #ifdef OCCT_DEBUG
634   Standard_Integer ibid;
635   b = GtraceSPS(myDataStructure->Shape(iS),ibid);
636 #endif
637   return b;
638 }
639
640 //=======================================================================
641 //function : GtraceSPS
642 //purpose  : 
643 //=======================================================================
644 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer ,
645                                                     const Standard_Integer ) const 
646 {
647   return Standard_False;
648 }
649
650 //=======================================================================
651 //function : GtraceSPS
652 //purpose  : 
653 //=======================================================================
654 #ifdef OCCT_DEBUG
655 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape& S) const 
656 #else
657 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape& ) const        
658 #endif       
659 {
660   Standard_Boolean b = Standard_False;
661 #ifdef OCCT_DEBUG
662   Standard_Integer iS;
663   b = GtraceSPS(S,iS);
664 #endif
665   return b;
666 }
667
668 //=======================================================================
669 //function : GtraceSPS
670 //purpose  : 
671 //=======================================================================
672 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape&,
673                                                     Standard_Integer& IS) const 
674 {
675   IS = 0;
676   return Standard_False;
677 }
678
679
680 //=======================================================================
681 //function : GcheckNBOUNDS
682 //purpose  : 
683 //=======================================================================
684 #ifdef OCCT_DEBUG
685 Standard_Boolean TopOpeBRepBuild_Builder::GcheckNBOUNDS(const TopoDS_Shape& E) 
686 #else
687 Standard_Boolean TopOpeBRepBuild_Builder::GcheckNBOUNDS(const TopoDS_Shape& )
688 #endif     
689 {
690   Standard_Boolean res = Standard_False;
691 #ifdef OCCT_DEBUG
692   Standard_Integer nf = 0, nr = 0;
693   TopOpeBRepTool_ShapeExplorer ex(E,TopAbs_VERTEX);
694   for(; ex.More(); ex.Next()) {
695     TopAbs_Orientation o = ex.Current().Orientation();
696     if (o == TopAbs_FORWARD) nf++;
697     if (o == TopAbs_REVERSED) nr++;
698   }
699   if ( nf == 1 && nr == 1 ) res = Standard_True;
700 #endif
701   return res;
702 }