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