1 // Created on: 1993-06-14
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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 <TopOpeBRepBuild_Builder.ixx>
23 #include <TopOpeBRepDS_DataMapIteratorOfDataMapOfShapeListOfShapeOn1State.hxx>
24 #include <TopOpeBRepDS_ListOfShapeOn1State.hxx>
25 #include <TopOpeBRepBuild_GTool.hxx>
26 #include <TopOpeBRepDS_SurfaceIterator.hxx>
27 #include <TopOpeBRepDS_Surface.hxx>
28 #include <TopOpeBRepDS_Curve.hxx>
29 #include <TopOpeBRepDS_CurveExplorer.hxx>
30 #include <TopOpeBRepDS_Point.hxx>
31 #include <TopOpeBRepDS_Config.hxx>
32 #include <TopOpeBRepDS_BuildTool.hxx>
33 #include <BRepClass3d_SolidClassifier.hxx>
35 #include <Precision.hxx>
36 #include <TopOpeBRepTool_ShapeExplorer.hxx>
37 #include <Geom_Curve.hxx>
38 #include <Geom2d_Curve.hxx>
39 #include <BRep_Tool.hxx>
40 #include <BRep_Builder.hxx>
41 #include <TopoDS_Compound.hxx>
42 #include <TopoDS_Shell.hxx>
43 #include <TopoDS_Wire.hxx>
46 #include <TopOpeBRepDS_Filter.hxx>
47 #include <TopOpeBRepDS_Reducer.hxx>
48 #include <TopOpeBRepBuild_define.hxx>
51 extern Standard_Boolean TopOpeBRepBuild_GettraceCU();
52 extern Standard_Boolean TopOpeBRepBuild_GettraceCUV();
53 extern Standard_Boolean TopOpeBRepBuild_GettraceSPF();
54 extern Standard_Boolean TopOpeBRepBuild_GettraceSPS();
55 extern Standard_Boolean TopOpeBRepBuild_GetcontextSF2();
56 extern Standard_Boolean TopOpeBRepBuild_GettraceSHEX();
57 Standard_EXPORT void debmarksplit(const Standard_Integer i) {cout<<"++ debmarksplit "<<i<<endl;}
58 Standard_EXPORT void debchangesplit(const Standard_Integer i) {cout<<"++ debchangesplit "<<i<<endl;}
61 static Standard_Integer STATIC_SOLIDINDEX = 0;
62 #include <TopOpeBRepBuild_SplitEdge.hxx>
63 #include <TopOpeBRepBuild_SplitFace.hxx>
64 #include <TopOpeBRepBuild_SplitSolid.hxx>
65 #include <TopOpeBRepBuild_SplitShapes.hxx>
66 #include <TopOpeBRepBuild_Fill.hxx>
68 Standard_EXPORT TopOpeBRepBuild_Builder* GLOBAL_PBUILDER;
70 //=======================================================================
71 //function : TopOpeBRepBuild_Builder
73 //=======================================================================
74 TopOpeBRepBuild_Builder::TopOpeBRepBuild_Builder(const TopOpeBRepDS_BuildTool& BT)
76 mySectionDone(Standard_False),
78 myClassifyDef(Standard_False),
79 myClassifyVal(Standard_True),
80 myProcessON(Standard_False)
82 GLOBAL_PBUILDER = this;
86 //modified by NIZHNY-MZV Sat May 6 10:04:49 2000
87 //=======================================================================
89 //purpose : virtual destructor
90 //=======================================================================
91 void TopOpeBRepBuild_Builder::Destroy()
95 //=======================================================================
96 //function : ChangeBuildTool
98 //=======================================================================
99 TopOpeBRepDS_BuildTool& TopOpeBRepBuild_Builder::ChangeBuildTool()
104 //=======================================================================
105 //function : BuildTool
107 //=======================================================================
108 const TopOpeBRepDS_BuildTool& TopOpeBRepBuild_Builder::BuildTool() const
113 //=======================================================================
114 //function : DataStructure
116 //=======================================================================
117 Handle(TopOpeBRepDS_HDataStructure) TopOpeBRepBuild_Builder::DataStructure() const
119 return myDataStructure;
122 //=======================================================================
125 //=======================================================================
126 void TopOpeBRepBuild_Builder::Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
132 myDataStructure = HDS;
134 SplitEvisoONperiodicF();
140 TopOpeBRepDS_Filter F(HDS, &myShapeClassifier);
141 F.ProcessFaceInterferences(mySplitON);
142 TopOpeBRepDS_Reducer R(HDS);
143 R.ProcessFaceInterferences(mySplitON);
146 //=======================================================================
149 //=======================================================================
150 void TopOpeBRepBuild_Builder::Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS,const TopoDS_Shape& S1, const TopoDS_Shape& S2)
153 myShape1 = S1; myShape2 = S2;
154 myIsKPart = FindIsKPart();
157 //=======================================================================
158 //function : AddIntersectionEdges
160 //=======================================================================
161 void TopOpeBRepBuild_Builder::AddIntersectionEdges
162 (TopoDS_Shape& aFace,const TopAbs_State ToBuild1,const Standard_Boolean RevOri1,TopOpeBRepBuild_ShapeSet& WES) const
165 TopOpeBRepDS_CurveIterator FCurves = myDataStructure->FaceCurves(aFace);
166 for (; FCurves.More(); FCurves.Next()) {
167 Standard_Integer iC = FCurves.Current();
169 Standard_Boolean tCU = TopOpeBRepBuild_GettraceCU();
170 Standard_Boolean NtCUV = !TopOpeBRepBuild_GettraceCUV();
171 if(tCU) {cout<<endl;myDataStructure->Curve(iC).Dump(cout,iC,NtCUV);}
173 const TopTools_ListOfShape& LnewE = NewEdges(iC);
174 for (TopTools_ListIteratorOfListOfShape Iti(LnewE); Iti.More(); Iti.Next()) {
175 anEdge = Iti.Value();
176 TopAbs_Orientation ori = FCurves.Orientation(ToBuild1);
177 TopAbs_Orientation newori = Orient(ori,RevOri1);
179 if(newori == TopAbs_EXTERNAL) continue;
181 myBuildTool.Orientation(anEdge,newori);
182 const Handle(Geom2d_Curve)& PC = FCurves.PCurve();
183 myBuildTool.PCurve(aFace,anEdge,PC);
184 WES.AddStartElement(anEdge);
189 //=======================================================================
192 //=======================================================================
193 void TopOpeBRepBuild_Builder::Clear()
195 const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
196 TopOpeBRepDS_DataMapIteratorOfDataMapOfShapeListOfShapeOn1State it;
197 for (it.Initialize(mySplitOUT); it.More(); it.Next()) {
198 const TopoDS_Shape& e = it.Key();
199 if ( e.ShapeType() == TopAbs_EDGE ) {
200 Standard_Boolean isse = BDS.IsSectionEdge(TopoDS::Edge(e));
201 if (!isse) mySplitOUT.ChangeFind(e).Clear();
204 for (it.Initialize(mySplitIN); it.More(); it.Next()) {
205 const TopoDS_Shape& e = it.Key();
206 if ( e.ShapeType() == TopAbs_EDGE ) {
207 Standard_Boolean isse = BDS.IsSectionEdge(TopoDS::Edge(e));
208 if (!isse) mySplitIN.ChangeFind(e).Clear();
211 for (it.Initialize(mySplitON); it.More(); it.Next()) {
212 const TopoDS_Shape& e = it.Key();
213 if ( e.ShapeType() == TopAbs_EDGE ) {
214 Standard_Boolean isse = BDS.IsSectionEdge(TopoDS::Edge(e));
215 if (!isse) mySplitON.ChangeFind(e).Clear();
223 //=======================================================================
224 //function : NewFaces
226 //=======================================================================
227 const TopTools_ListOfShape& TopOpeBRepBuild_Builder::NewFaces(const Standard_Integer I) const
229 const TopTools_ListOfShape& L = myNewFaces->Array1().Value(I);
233 //=======================================================================
234 //function : ChangeNewFaces
236 //=======================================================================
237 TopTools_ListOfShape& TopOpeBRepBuild_Builder::ChangeNewFaces(const Standard_Integer I)
239 TopTools_ListOfShape& L = myNewFaces->ChangeArray1().ChangeValue(I);
243 //=======================================================================
244 //function : NewEdges
246 //=======================================================================
247 const TopTools_ListOfShape& TopOpeBRepBuild_Builder::NewEdges(const Standard_Integer I) const
249 if ( myNewEdges.IsBound(I) ) {
250 return myNewEdges.Find(I);
253 return myEmptyShapeList;
257 //=======================================================================
258 //function : ChangeNewEdges
260 //=======================================================================
261 TopTools_ListOfShape& TopOpeBRepBuild_Builder::ChangeNewEdges(const Standard_Integer I)
263 if ( ! myNewEdges.IsBound(I) ) {
264 TopTools_ListOfShape thelist;
265 myNewEdges.Bind(I, thelist);
267 TopTools_ListOfShape& L = myNewEdges.ChangeFind(I);
271 //=======================================================================
272 //function : NewVertex
274 //=======================================================================
275 const TopoDS_Shape& TopOpeBRepBuild_Builder::NewVertex(const Standard_Integer I) const
277 const TopoDS_Shape& V = myNewVertices->Array1().Value(I);
281 //=======================================================================
282 //function : ChangeNewVertex
284 //=======================================================================
285 TopoDS_Shape& TopOpeBRepBuild_Builder::ChangeNewVertex(const Standard_Integer I)
287 TopoDS_Shape& V = myNewVertices->ChangeArray1().ChangeValue(I);
291 //=======================================================================
294 //=======================================================================
295 Standard_Boolean TopOpeBRepBuild_Builder::ToSplit(const TopoDS_Shape& S,const TopAbs_State ToBuild) const
297 Standard_Boolean issplit = IsSplit(S,ToBuild);
298 Standard_Boolean hasgeom = myDataStructure->HasGeometry(S);
299 Standard_Boolean hassame = myDataStructure->HasSameDomain(S);
300 Standard_Boolean tosplit = (!issplit) && (hasgeom || hassame);
303 Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
305 cout<<"tosplit "<<tosplit<<" : "<<"!issplit "<<(!issplit);
306 cout<<" && (hasgeom || hassame) ("<<hasgeom<<" || "<<hassame<<")"<<endl;
313 //=======================================================================
314 //function : MarkSplit
316 //=======================================================================
317 void TopOpeBRepBuild_Builder::MarkSplit(const TopoDS_Shape& S,const TopAbs_State ToBuild,const Standard_Boolean Bval)
319 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State* p = NULL;
320 if ( ToBuild == TopAbs_OUT ) p = &mySplitOUT;
321 else if ( ToBuild == TopAbs_IN ) p = &mySplitIN;
322 else if ( ToBuild == TopAbs_ON ) p = &mySplitON;
323 if ( p == NULL ) return;
325 TopOpeBRepDS_ListOfShapeOn1State thelist;
326 if (!(*p).IsBound(S)) (*p).Bind(S, thelist);
327 TopOpeBRepDS_ListOfShapeOn1State& losos = (*p).ChangeFind(S);
331 Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
333 GdumpSHA(S, (char *) "MarkSplit ");
334 cout<<" ";TopAbs::Print(ToBuild,cout);cout<<" "<<Bval<<endl;
341 //=======================================================================
344 //=======================================================================
345 Standard_Boolean TopOpeBRepBuild_Builder::IsSplit(const TopoDS_Shape& S,const TopAbs_State ToBuild) const
347 Standard_Boolean res = Standard_False;
348 const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State* p = NULL;
349 if ( ToBuild == TopAbs_OUT ) p = &mySplitOUT;
350 else if ( ToBuild == TopAbs_IN ) p = &mySplitIN;
351 else if ( ToBuild == TopAbs_ON ) p = &mySplitON;
352 if ( p == NULL ) return res;
354 if ((*p).IsBound(S)) {
355 const TopOpeBRepDS_ListOfShapeOn1State& losos = (*p).Find(S);
356 res = losos.IsSplit();
358 // Standard_Integer n = losos.ListOnState().Extent();
364 //=======================================================================
367 //=======================================================================
368 const TopTools_ListOfShape& TopOpeBRepBuild_Builder::Splits(const TopoDS_Shape& S, const TopAbs_State ToBuild) const
370 const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State* p = NULL;
371 if ( ToBuild == TopAbs_OUT ) p = &mySplitOUT;
372 else if ( ToBuild == TopAbs_IN ) p = &mySplitIN;
373 else if ( ToBuild == TopAbs_ON ) p = &mySplitON;
374 if ( p == NULL ) return myEmptyShapeList;
376 if ((*p).IsBound(S)) {
377 const TopOpeBRepDS_ListOfShapeOn1State& losos = (*p).Find(S);
378 const TopTools_ListOfShape& L = losos.ListOnState();
381 return myEmptyShapeList;
384 //=======================================================================
385 //function : ChangeSplit
387 //=======================================================================
388 TopTools_ListOfShape& TopOpeBRepBuild_Builder::ChangeSplit(const TopoDS_Shape& S,const TopAbs_State ToBuild)
391 Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
393 GdumpSHA(S, (char *) "ChangeSplit ");
394 cout<<" ";TopAbs::Print(ToBuild,cout);cout<<endl;
399 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State* p = NULL;
400 if ( ToBuild == TopAbs_OUT ) p = &mySplitOUT;
401 else if ( ToBuild == TopAbs_IN ) p = &mySplitIN;
402 else if ( ToBuild == TopAbs_ON ) p = &mySplitON;
403 if ( p == NULL ) return myEmptyShapeList;
404 TopOpeBRepDS_ListOfShapeOn1State thelist1;
405 if (!(*p).IsBound(S)) (*p).Bind(S, thelist1);
406 TopOpeBRepDS_ListOfShapeOn1State& losos = (*p).ChangeFind(S);
407 TopTools_ListOfShape& L = losos.ChangeListOnState();
411 //=======================================================================
412 //function : ShapePosition
413 //purpose : compute position of shape S compared with the shapes of list LS
414 // if S is found IN any shape of LS, return IN
416 //=======================================================================
417 TopAbs_State TopOpeBRepBuild_Builder::ShapePosition(const TopoDS_Shape& S, const TopTools_ListOfShape& LS)
419 TopAbs_State state = TopAbs_UNKNOWN;
421 // take the edges of myEdgeAvoid as shape to avoid
422 // during face classification
423 const TopTools_ListOfShape* PLOS = &myEmptyShapeList;
424 TopAbs_ShapeEnum tS = S.ShapeType();
425 if (tS == TopAbs_FACE) PLOS = &myEdgeAvoid;
426 // NYI : idem with myFaceAvoid if (tS == TopAbs_SOLID)
428 for (TopTools_ListIteratorOfListOfShape Iti(LS); Iti.More(); Iti.Next()) {
429 const TopoDS_Shape& SLS = Iti.Value();
431 // TopAbs_ShapeEnum tSLS = SLS.ShapeType();
433 state = myShapeClassifier.StateShapeShape(S,(*PLOS),SLS);
434 if (state != TopAbs_OUT && state != TopAbs_UNKNOWN) return state;
436 if (state == TopAbs_UNKNOWN) return state;
440 //=======================================================================
441 //function : KeepShape
442 //purpose : compute <pos2> = position of shape <S1> / shapes of list <LS2>
445 // - if (pos2 == ToBuild1)
446 //=======================================================================
447 Standard_Boolean TopOpeBRepBuild_Builder::KeepShape(const TopoDS_Shape& S1,const TopTools_ListOfShape& LS2,const TopAbs_State ToBuild1)
449 Standard_Boolean keep = Standard_True;
450 if ( ! LS2.IsEmpty() ) {
451 TopAbs_State pos2 = ShapePosition(S1,LS2);
452 if ( pos2 != ToBuild1 ) keep = Standard_False;
457 //=======================================================================
459 //purpose : return the type of upper subshape found in <S>
460 //=======================================================================
461 TopAbs_ShapeEnum TopOpeBRepBuild_Builder::TopType(const TopoDS_Shape& S)
464 TopOpeBRepTool_ShapeExplorer e;
466 t = TopAbs_COMPOUND; e.Init(S,t); if (e.More()) return t;
467 t = TopAbs_COMPSOLID; e.Init(S,t); if (e.More()) return t;
468 t = TopAbs_SOLID; e.Init(S,t); if (e.More()) return t;
469 t = TopAbs_SHELL; e.Init(S,t); if (e.More()) return t;
470 t = TopAbs_FACE; e.Init(S,t); if (e.More()) return t;
471 t = TopAbs_WIRE; e.Init(S,t); if (e.More()) return t;
472 t = TopAbs_EDGE; e.Init(S,t); if (e.More()) return t;
473 t = TopAbs_VERTEX; e.Init(S,t); if (e.More()) return t;
478 //=======================================================================
480 //purpose : compute orientation reversibility according to build states
481 //=======================================================================
482 Standard_Boolean TopOpeBRepBuild_Builder::Reverse(const TopAbs_State ToBuild1,const TopAbs_State ToBuild2)
484 Standard_Boolean rev;
485 if (ToBuild1 == TopAbs_IN && ToBuild2 == TopAbs_IN) rev = Standard_False;
486 else rev = (ToBuild1 == TopAbs_IN);
490 //=======================================================================
492 //purpose : reverse the orientation
493 //=======================================================================
494 TopAbs_Orientation TopOpeBRepBuild_Builder::Orient(const TopAbs_Orientation Ori,const Standard_Boolean Reverse)
496 TopAbs_Orientation result=TopAbs_FORWARD;
498 case Standard_True : result = TopAbs::Complement(Ori); break;
499 case Standard_False : result = Ori; break;
504 //=======================================================================
505 //function : FindSameDomain
506 //purpose : complete the lists L1,L2 with the shapes of the DS
507 // having same domain :
508 // L1 = shapes sharing the same domain of L2 shapes
509 // L2 = shapes sharing the same domain of L1 shapes
510 // (L1 contains a face)
511 //=======================================================================
512 void TopOpeBRepBuild_Builder::FindSameDomain(TopTools_ListOfShape& L1,TopTools_ListOfShape& L2) const
515 Standard_Integer nl1 = L1.Extent(), nl2 = L2.Extent();
517 while ( nl1 > 0 || nl2 > 0 ) {
519 TopTools_ListIteratorOfListOfShape it1(L1);
520 for (i=1 ; i<=nl1; i++) {
521 const TopoDS_Shape& S1 = it1.Value();
523 // Standard_Integer iS1 = myDataStructure->Shape(S1); // DEB
525 TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S1));
526 for (; itsd.More(); itsd.Next() ) {
527 const TopoDS_Shape& S2 = itsd.Value();
529 // Standard_Integer iS2 = myDataStructure->Shape(S2);// DEB
531 Standard_Boolean found = Contains(S2,L2);
541 TopTools_ListIteratorOfListOfShape it2(L2);
542 for (i=1 ; i<=nl2; i++) {
543 const TopoDS_Shape& S2 = it2.Value();
545 // Standard_Integer iS2 = myDataStructure->Shape(S2);// DEB
547 TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S2));
548 for (; itsd.More(); itsd.Next() ) {
549 const TopoDS_Shape& S1 = itsd.Value();
551 // Standard_Integer iS1 = myDataStructure->Shape(S1);// DEB
553 Standard_Boolean found = Contains(S1,L1);
568 //=======================================================================
569 //function : FindSameDomainSameOrientation
571 //=======================================================================
572 void TopOpeBRepBuild_Builder::FindSameDomainSameOrientation(TopTools_ListOfShape& L1, TopTools_ListOfShape& L2) const
574 FindSameDomain(L1,L2);
575 TopTools_ListIteratorOfListOfShape it(L1);
576 if ( !it.More() ) return;
578 const TopoDS_Shape& sref = it.Value();
580 // Standard_Integer iref = myDataStructure->SameDomainReference(sref);
582 TopOpeBRepDS_Config oref = myDataStructure->SameDomainOrientation(sref);
584 TopTools_ListOfShape LL1,LL2;
586 for (it.Initialize(L1); it.More(); it.Next() ) {
587 const TopoDS_Shape& s = it.Value();
588 TopOpeBRepDS_Config o = myDataStructure->SameDomainOrientation(s);
589 if ( o == oref && !Contains(s,LL1) ) LL1.Append(s);
590 else if ( o != oref && !Contains(s,LL2) ) LL2.Append(s);
593 for (it.Initialize(L2); it.More(); it.Next() ) {
594 const TopoDS_Shape& s = it.Value();
595 TopOpeBRepDS_Config o = myDataStructure->SameDomainOrientation(s);
596 if ( o == oref && !Contains(s,LL1) ) LL1.Append(s);
597 else if ( o != oref && !Contains(s,LL2) ) LL2.Append(s);
605 //=======================================================================
606 //function : MapShapes
608 //=======================================================================
609 void TopOpeBRepBuild_Builder::MapShapes(const TopoDS_Shape& S1,const TopoDS_Shape& S2)
611 Standard_Boolean S1null = S1.IsNull();
612 Standard_Boolean S2null = S2.IsNull();
614 if ( ! S1null ) TopExp::MapShapes(S1,myMAP1);
615 if ( ! S2null ) TopExp::MapShapes(S2,myMAP2);
618 //=======================================================================
619 //function : ClearMaps
621 //=======================================================================
622 void TopOpeBRepBuild_Builder::ClearMaps()
628 //=======================================================================
629 //function : FindSameRank
631 //=======================================================================
632 void TopOpeBRepBuild_Builder::FindSameRank(const TopTools_ListOfShape& L1,const Standard_Integer rank,TopTools_ListOfShape& L2) const
634 for ( TopTools_ListIteratorOfListOfShape it1(L1); it1.More(); it1.Next() ) {
635 const TopoDS_Shape& s = it1.Value();
636 Standard_Integer r = ShapeRank(s);
637 if ( r == rank && !Contains(s,L2) ) {
643 //=======================================================================
644 //function : ShapeRank
646 //=======================================================================
647 Standard_Integer TopOpeBRepBuild_Builder::ShapeRank(const TopoDS_Shape& s) const
649 Standard_Boolean isof1 = IsShapeOf(s,1);
650 Standard_Boolean isof2 = IsShapeOf(s,2);
651 Standard_Integer ancetre = (isof1 || isof2) ? ((isof1) ? 1 : 2) : 0;
655 //=======================================================================
656 //function : IsShapeOf
658 //=======================================================================
659 Standard_Boolean TopOpeBRepBuild_Builder::IsShapeOf(const TopoDS_Shape& s,const Standard_Integer i) const
661 Standard_Boolean b = Standard_False;
662 if (i == 1) b = myMAP1.Contains(s);
663 else if (i == 2) b = myMAP2.Contains(s);
667 //=======================================================================
668 //function : Contains
669 //purpose : returns True if S is in the list L.
670 //=======================================================================
671 Standard_Boolean TopOpeBRepBuild_Builder::Contains(const TopoDS_Shape& S,const TopTools_ListOfShape& L)
673 for (TopTools_ListIteratorOfListOfShape it(L); it.More(); it.Next() ) {
674 TopoDS_Shape& SL = it.Value();
675 Standard_Boolean issame = SL.IsSame(S);
676 if ( issame ) return Standard_True;
678 return Standard_False;
681 //=======================================================================
684 //=======================================================================
685 Standard_Boolean TopOpeBRepBuild_Builder::Opec12() const
687 Standard_Boolean b = (myState1 == TopAbs_OUT) && (myState2 == TopAbs_IN );
691 //=======================================================================
694 //=======================================================================
695 Standard_Boolean TopOpeBRepBuild_Builder::Opec21() const
697 Standard_Boolean b = (myState1 == TopAbs_IN ) && (myState2 == TopAbs_OUT);
701 //=======================================================================
704 //=======================================================================
705 Standard_Boolean TopOpeBRepBuild_Builder::Opecom() const
707 Standard_Boolean b = (myState1 == TopAbs_IN ) && (myState2 == TopAbs_IN );
711 //=======================================================================
714 //=======================================================================
715 Standard_Boolean TopOpeBRepBuild_Builder::Opefus() const
717 Standard_Boolean b = (myState1 == TopAbs_OUT) && (myState2 == TopAbs_OUT);
721 //=======================================================================
724 //=======================================================================
725 const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& TopOpeBRepBuild_Builder::MSplit(const TopAbs_State s) const
727 if (s == TopAbs_IN) return mySplitIN;
728 else if (s == TopAbs_OUT) return mySplitOUT;
729 else if (s == TopAbs_ON) return mySplitON;
733 //=======================================================================
734 //function : ChangeMSplit
736 //=======================================================================
737 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& TopOpeBRepBuild_Builder::ChangeMSplit(const TopAbs_State s)
739 if (s == TopAbs_IN) return mySplitIN;
740 else if (s == TopAbs_OUT) return mySplitOUT;
741 else if (s == TopAbs_ON) return mySplitON;