1 // Created on: 1993-06-17
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <BRep_Tool.hxx>
19 #include <Standard_ProgramError.hxx>
20 #include <Standard_Type.hxx>
21 #include <TopAbs_ShapeEnum.hxx>
22 #include <TopExp_Explorer.hxx>
24 #include <TopoDS_Edge.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <TopOpeBRepDS.hxx>
27 #include <TopOpeBRepDS_Check.hxx>
28 #include <TopOpeBRepDS_Curve.hxx>
29 #include <TopOpeBRepDS_CurveIterator.hxx>
30 #include <TopOpeBRepDS_DataStructure.hxx>
31 #include <TopOpeBRepDS_define.hxx>
32 #include <TopOpeBRepDS_Dumper.hxx>
33 #include <TopOpeBRepDS_EdgeInterferenceTool.hxx>
34 #include <TopOpeBRepDS_Filter.hxx>
35 #include <TopOpeBRepDS_HDataStructure.hxx>
36 #include <TopOpeBRepDS_Interference.hxx>
37 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
38 #include <TopOpeBRepDS_ListOfInterference.hxx>
39 #include <TopOpeBRepDS_Point.hxx>
40 #include <TopOpeBRepDS_PointIterator.hxx>
41 #include <TopOpeBRepDS_Reducer.hxx>
42 #include <TopOpeBRepDS_Surface.hxx>
43 #include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
44 #include <TopOpeBRepDS_SurfaceIterator.hxx>
45 #include <TopOpeBRepDS_Transition.hxx>
46 #include <TopOpeBRepTool_ShapeExplorer.hxx>
47 #include <TopTools_ListOfShape.hxx>
49 IMPLEMENT_STANDARD_RTTIEXT(TopOpeBRepDS_HDataStructure,Standard_Transient)
51 static void FUN_HDS_data(const Handle(TopOpeBRepDS_Interference)& I,
52 TopOpeBRepDS_Kind& GT1,Standard_Integer& G1,
53 TopOpeBRepDS_Kind& ST1,Standard_Integer& S1)
55 if (I.IsNull()) return;
56 GT1 = I->GeometryType(); G1 = I->Geometry();
57 ST1 = I->SupportType(); S1 = I->Support();
61 Standard_EXPORT Standard_Boolean FUN_HDS_FACESINTERFER
62 (const TopoDS_Shape& F1, const TopoDS_Shape& F2,
63 const Handle(TopOpeBRepDS_HDataStructure)& HDS)
65 Standard_Boolean yainterf = Standard_False;
66 const TopOpeBRepDS_DataStructure& DS = HDS->DS();
67 Standard_Boolean ya = DS.HasShape(F1);
68 if ( !ya ) return Standard_False;
71 Standard_Integer iF2 = DS.Shape(F2);
73 const TopOpeBRepDS_ListOfInterference& L1 = DS.ShapeInterferences(F1);
74 TopOpeBRepDS_ListIteratorOfListOfInterference itL1(L1);
75 for (;itL1.More(); itL1.Next()) {
76 const Handle(TopOpeBRepDS_Interference)& I = itL1.Value();
77 TopOpeBRepDS_Kind GT = TopOpeBRepDS_UNKNOWN, ST = TopOpeBRepDS_UNKNOWN; Standard_Integer G,S = 0;
78 FUN_HDS_data(I,GT,G,ST,S);
79 // interference face1/edge/face2
80 Standard_Boolean fef = Standard_True;
81 fef = fef && (GT==TopOpeBRepDS_EDGE);
82 fef = fef && (ST==TopOpeBRepDS_FACE);
83 fef = fef && (S==iF2);
85 yainterf = Standard_True;
93 //=======================================================================
94 //function : TopOpeBRepDS_HDataStructure
96 //=======================================================================
97 TopOpeBRepDS_HDataStructure::TopOpeBRepDS_HDataStructure()
101 //=======================================================================
102 //function : AddAncestors
104 //=======================================================================
105 void TopOpeBRepDS_HDataStructure::AddAncestors
106 (const TopoDS_Shape& S)
108 AddAncestors(S,TopAbs_WIRE,TopAbs_EDGE);
109 AddAncestors(S,TopAbs_FACE,TopAbs_WIRE);
110 AddAncestors(S,TopAbs_SHELL,TopAbs_FACE);
111 AddAncestors(S,TopAbs_SOLID,TopAbs_SHELL);
114 //=======================================================================
115 //function : AddAncestors
117 //=======================================================================
118 void TopOpeBRepDS_HDataStructure::AddAncestors
119 (const TopoDS_Shape& S,
120 const TopAbs_ShapeEnum T1,const TopAbs_ShapeEnum T2)
122 TopOpeBRepDS_DataStructure& BDS = ChangeDS();
123 Standard_Integer rankS = myDS.AncestorRank(S);
124 // find the shapes of type T1 containing HasShape() of type T2
125 for (TopOpeBRepTool_ShapeExplorer eT1(S,T1); eT1.More(); eT1.Next()) {
126 const TopoDS_Shape& ST1 = eT1.Current();
127 for (TopOpeBRepTool_ShapeExplorer eT2(ST1,T2); eT2.More(); eT2.Next()) {
128 const TopoDS_Shape& ST2 = eT2.Current();
129 if (BDS.HasShape(ST2)) {
130 BDS.AddShape(ST1,rankS);
137 //=======================================================================
139 //purpose : Check Integrity
140 //=======================================================================
141 void TopOpeBRepDS_HDataStructure::ChkIntg()
143 // Check the integrity of the DS
144 Handle(TopOpeBRepDS_Check) chk = new TopOpeBRepDS_Check(this);
146 // chk->PrintIntg(std::cout);
149 //=======================================================================
152 //=======================================================================
153 const TopOpeBRepDS_DataStructure& TopOpeBRepDS_HDataStructure::DS()const
158 //=======================================================================
159 //function : ChangeDS
161 //=======================================================================
162 TopOpeBRepDS_DataStructure& TopOpeBRepDS_HDataStructure::ChangeDS()
167 //=======================================================================
168 //function : NbSurfaces
170 //=======================================================================
171 Standard_Integer TopOpeBRepDS_HDataStructure::NbSurfaces()const
173 return myDS.NbSurfaces();
176 //=======================================================================
177 //function : NbCurves
179 //=======================================================================
180 Standard_Integer TopOpeBRepDS_HDataStructure::NbCurves()const
182 return myDS.NbCurves();
185 //=======================================================================
186 //function : NbPoints
188 //=======================================================================
189 Standard_Integer TopOpeBRepDS_HDataStructure::NbPoints()const
191 return myDS.NbPoints();
194 //=======================================================================
197 //=======================================================================
198 const TopOpeBRepDS_Surface& TopOpeBRepDS_HDataStructure::Surface
199 (const Standard_Integer I)const
201 return myDS.Surface(I);
204 //=======================================================================
205 //function : SurfaceCurves
207 //=======================================================================
208 TopOpeBRepDS_CurveIterator TopOpeBRepDS_HDataStructure::SurfaceCurves
209 (const Standard_Integer I)const
211 const TopOpeBRepDS_ListOfInterference& L = myDS.SurfaceInterferences(I);
212 return TopOpeBRepDS_CurveIterator(L);
215 //=======================================================================
218 //=======================================================================
219 const TopOpeBRepDS_Curve& TopOpeBRepDS_HDataStructure::Curve
220 (const Standard_Integer I)const
222 return myDS.Curve(I);
225 //=======================================================================
226 //function : ChangeCurve
228 //=======================================================================
229 TopOpeBRepDS_Curve& TopOpeBRepDS_HDataStructure::ChangeCurve
230 (const Standard_Integer I)
232 return myDS.ChangeCurve(I);
235 //=======================================================================
236 //function : CurvePoints
238 //=======================================================================
239 TopOpeBRepDS_PointIterator TopOpeBRepDS_HDataStructure::CurvePoints
240 (const Standard_Integer I)const
242 const TopOpeBRepDS_ListOfInterference& L = myDS.CurveInterferences(I);
243 return TopOpeBRepDS_PointIterator(L);
246 //=======================================================================
249 //=======================================================================
250 const TopOpeBRepDS_Point& TopOpeBRepDS_HDataStructure::Point
251 (const Standard_Integer I)const
253 return myDS.Point(I);
256 //=======================================================================
257 //function : HasGeometry
259 //=======================================================================
260 Standard_Boolean TopOpeBRepDS_HDataStructure::HasGeometry
261 (const TopoDS_Shape& S)const
263 Standard_Boolean b = myDS.HasGeometry(S);
267 //=======================================================================
268 //function : HasShape
270 //=======================================================================
271 Standard_Boolean TopOpeBRepDS_HDataStructure::HasShape
272 (const TopoDS_Shape& S,const Standard_Boolean FindKeep) const
274 Standard_Boolean b = myDS.HasShape(S, FindKeep);
278 //=======================================================================
279 //function : HasSameDomain
281 //=======================================================================
282 Standard_Boolean TopOpeBRepDS_HDataStructure::HasSameDomain
283 (const TopoDS_Shape& S,const Standard_Boolean FindKeep)const
285 if ( ! HasShape(S, FindKeep) ) return Standard_False;
286 const TopTools_ListOfShape& l = myDS.ShapeSameDomain(S);
287 Standard_Boolean res = ! l.IsEmpty();
291 //=======================================================================
292 //function : SameDomain
294 //=======================================================================
295 TopTools_ListIteratorOfListOfShape TopOpeBRepDS_HDataStructure::SameDomain
296 (const TopoDS_Shape& S)const
298 const TopTools_ListOfShape& L = myDS.ShapeSameDomain(S);
299 return TopTools_ListIteratorOfListOfShape(L);
302 //=======================================================================
303 //function : SameDomainOrientation
305 //=======================================================================
306 TopOpeBRepDS_Config TopOpeBRepDS_HDataStructure::SameDomainOrientation
307 (const TopoDS_Shape& S)const
309 if ( ! HasShape(S) ) return TopOpeBRepDS_UNSHGEOMETRY;
310 return myDS.SameDomainOri(S);
313 //=======================================================================
314 //function : SameDomainReference
316 //=======================================================================
317 Standard_Integer TopOpeBRepDS_HDataStructure::SameDomainReference
318 (const TopoDS_Shape& S)const
320 if ( ! HasShape(S) ) return 0;
321 return myDS.SameDomainRef(S);
324 //=======================================================================
325 //function : NbShapes
327 //=======================================================================
328 Standard_Integer TopOpeBRepDS_HDataStructure::NbShapes()const
330 return myDS.NbShapes();
333 //=======================================================================
336 //=======================================================================
337 const TopoDS_Shape& TopOpeBRepDS_HDataStructure::Shape
338 (const Standard_Integer I,const Standard_Boolean FindKeep) const
340 return myDS.Shape(I, FindKeep);
343 //=======================================================================
346 //=======================================================================
347 Standard_Integer TopOpeBRepDS_HDataStructure::Shape
348 (const TopoDS_Shape& S,const Standard_Boolean FindKeep)const
350 return myDS.Shape(S, FindKeep);
353 //=======================================================================
354 //function : SolidSurfaces
356 //=======================================================================
357 TopOpeBRepDS_SurfaceIterator TopOpeBRepDS_HDataStructure::SolidSurfaces
358 (const TopoDS_Shape& S) const
360 const TopOpeBRepDS_ListOfInterference& L = myDS.ShapeInterferences(S);
361 return TopOpeBRepDS_SurfaceIterator(L);
364 //=======================================================================
365 //function : SolidSurfaces
367 //=======================================================================
368 TopOpeBRepDS_SurfaceIterator TopOpeBRepDS_HDataStructure::SolidSurfaces
369 (const Standard_Integer I)const
371 const TopOpeBRepDS_ListOfInterference& L = myDS.ShapeInterferences(I);
372 return TopOpeBRepDS_SurfaceIterator(L);
375 //=======================================================================
376 //function : FaceCurves
378 //=======================================================================
379 TopOpeBRepDS_CurveIterator TopOpeBRepDS_HDataStructure::FaceCurves
380 (const TopoDS_Shape& F)const
382 const TopOpeBRepDS_ListOfInterference& L = myDS.ShapeInterferences(F);
383 return TopOpeBRepDS_CurveIterator(L);
386 //=======================================================================
387 //function : FaceCurves
389 //=======================================================================
390 TopOpeBRepDS_CurveIterator TopOpeBRepDS_HDataStructure::FaceCurves
391 (const Standard_Integer I)const
393 const TopOpeBRepDS_ListOfInterference& L = myDS.ShapeInterferences(I);
394 return TopOpeBRepDS_CurveIterator(L);
397 //=======================================================================
398 //function : EdgePoints
400 //=======================================================================
401 TopOpeBRepDS_PointIterator TopOpeBRepDS_HDataStructure::EdgePoints
402 (const TopoDS_Shape& E)const
404 const TopOpeBRepDS_ListOfInterference& L = myDS.ShapeInterferences(E);
405 return TopOpeBRepDS_PointIterator(L);
408 //=======================================================================
409 //function : MakeCurve
411 //=======================================================================
412 Standard_Integer TopOpeBRepDS_HDataStructure::MakeCurve
413 (const TopOpeBRepDS_Curve& curC,TopOpeBRepDS_Curve& newC)
415 // SCI1, SCI2 = new surface/curve interf. build from
416 // the surface/curve interf. of the curve curC
417 const Handle(TopOpeBRepDS_Interference)& I1 = curC.GetSCI1();
418 const Handle(TopOpeBRepDS_Interference)& I2 = curC.GetSCI2();
419 Handle(TopOpeBRepDS_SurfaceCurveInterference) SCI1,SCI2;
420 if ( ! I1.IsNull() ) SCI1 = new TopOpeBRepDS_SurfaceCurveInterference(I1);
421 if ( ! I2.IsNull() ) SCI2 = new TopOpeBRepDS_SurfaceCurveInterference(I2);
423 const TopoDS_Shape& S1 = curC.Shape1();
424 const TopoDS_Shape& S2 = curC.Shape2();
426 // add the new SCIs in the lists of SCIs connected to the shapes
427 if ( ! SCI1.IsNull() ) myDS.AddShapeInterference(S1,SCI1);
428 if ( ! SCI2.IsNull() ) myDS.AddShapeInterference(S2,SCI2);
430 // the shapes of the new curve are the shapes of curve curC
431 newC.SetShapes(S1,S2);
433 // set surface/curve interferences of the new curve
434 newC.SetSCI(SCI1,SCI2);
436 // newC is a daughter of curC
437 newC.ChangeMother(curC.DSIndex());
439 // add the new curve in the DS
440 Standard_Integer inewC = myDS.AddCurve(newC);
442 // the geometry of the new surface/curve interf. is new curve inewC
443 if ( ! SCI1.IsNull() ) SCI1->Geometry(inewC);
444 if ( ! SCI2.IsNull() ) SCI2->Geometry(inewC);
449 //=======================================================================
450 //function : RemoveCurve
452 //=======================================================================
453 void TopOpeBRepDS_HDataStructure::RemoveCurve(const Standard_Integer icurC)
455 myDS.RemoveCurve(icurC);
458 //=======================================================================
459 //function : NbGeometry
461 //=======================================================================
462 Standard_Integer TopOpeBRepDS_HDataStructure::NbGeometry
463 (const TopOpeBRepDS_Kind K) const
465 if ( ! TopOpeBRepDS::IsGeometry(K)) return 0;
467 Standard_Integer n = 0;
469 case TopOpeBRepDS_POINT : n = NbPoints(); break;
470 case TopOpeBRepDS_CURVE : n = NbCurves(); break;
471 case TopOpeBRepDS_SURFACE : n = NbSurfaces(); break;
472 default : n = 0; break;
477 //=======================================================================
478 //function : NbTopology
480 //=======================================================================
481 Standard_Integer TopOpeBRepDS_HDataStructure::NbTopology() const
483 Standard_Integer n = myDS.NbShapes();
487 //=======================================================================
488 //function : NbTopology
490 //=======================================================================
491 Standard_Integer TopOpeBRepDS_HDataStructure::NbTopology
492 (const TopOpeBRepDS_Kind K) const
494 if ( ! TopOpeBRepDS::IsTopology(K) ) return 0;
495 Standard_Integer res = 0;
496 const Standard_Boolean FindKeep = Standard_False;
498 TopAbs_ShapeEnum S = TopOpeBRepDS::KindToShape(K);
499 for (Standard_Integer i = 1; i <= NbTopology(); i++ )
500 if(myDS.KeepShape(i, FindKeep))
501 if (myDS.Shape(i, FindKeep).ShapeType() == S) res++;
505 //=======================================================================
506 //function : EdgesSameParameter
508 //=======================================================================
510 Standard_Boolean TopOpeBRepDS_HDataStructure::EdgesSameParameter() const
512 Standard_Integer i,n = myDS.NbShapes();
513 for (i = 1 ; i <= n; i++) {
514 const TopoDS_Shape& s = myDS.Shape(i);
515 if ( s.ShapeType() == TopAbs_EDGE ) {
516 const TopoDS_Edge& e = TopoDS::Edge(s);
517 if ( ! BRep_Tool::SameParameter(e) ) {
518 return Standard_False;
522 return Standard_True;
525 #include <TColStd_HArray1OfBoolean.hxx>
526 #include <TColStd_Array1OfBoolean.hxx>
528 Standard_EXPORT void FUN_TopOpeBRepDS_SortOnParameter
529 (const TopOpeBRepDS_ListOfInterference& List,
530 TopOpeBRepDS_ListOfInterference& SList)
532 // NYI : sort a list of Items, giving a sorting FUNCTION is impossible
533 // NYI : --> foobar method complexity n2.
535 Standard_Integer iIntf=0,nIntf = List.Extent();
536 if (nIntf == 0) return;
538 Handle(TColStd_HArray1OfBoolean) HT;
539 HT = new TColStd_HArray1OfBoolean(1,nIntf,Standard_False);
540 TColStd_Array1OfBoolean& T = HT->ChangeArray1();
542 Handle(TopOpeBRepDS_Interference) Intf;
544 for (Standard_Integer i = 1; i <= nIntf; i++) {
545 Standard_Real parmin = RealLast();
546 TopOpeBRepDS_PointIterator it(List);
547 for (Standard_Integer itest = 1; it.More(); it.Next(),itest++) {
549 Standard_Real par = it.Parameter();
558 T(iIntf) = Standard_True;
562 //=======================================================================
563 //function : SortOnParameter
565 //=======================================================================
566 void TopOpeBRepDS_HDataStructure::SortOnParameter
567 (const TopOpeBRepDS_ListOfInterference& List,
568 TopOpeBRepDS_ListOfInterference& SList) const
570 // NYI : sort a list of Items, giving a sorting FUNCTION is impossible
571 // NYI : --> foobar method complexity n2.
573 ::FUN_TopOpeBRepDS_SortOnParameter(List,SList);
575 // tete = interf FORWARD :
576 // modifier TopOpeBRepBuild_ParametrizedVertexSet ::SortParametrizedVertex()
577 Standard_Boolean found = Standard_False;
578 TopOpeBRepDS_ListIteratorOfListOfInterference it(SList);
579 TopOpeBRepDS_ListOfInterference L1,L2;
581 for (; it.More(); it.Next() ) {
582 Handle(TopOpeBRepDS_Interference) I = it.Value();
584 TopAbs_Orientation o = I->Transition().Orientation(TopAbs_IN);
585 if (o == TopAbs_FORWARD) {
586 found = Standard_True;
599 //=======================================================================
600 //function : SortOnParameter
602 //=======================================================================
603 void TopOpeBRepDS_HDataStructure::SortOnParameter
604 (TopOpeBRepDS_ListOfInterference& List) const
606 TopOpeBRepDS_PointIterator it(List);
608 TopOpeBRepDS_ListOfInterference SList;
609 SortOnParameter(List,SList);
614 //=======================================================================
615 //function : MinMaxOnParameter
617 //=======================================================================
618 void TopOpeBRepDS_HDataStructure::MinMaxOnParameter
619 (const TopOpeBRepDS_ListOfInterference& List,
620 Standard_Real& parmin,Standard_Real& parmax) const
622 if ( ! List.IsEmpty() ) {
623 Standard_Real parline;
624 parmin = RealLast(); parmax = RealFirst();
625 TopOpeBRepDS_PointIterator it(List);
626 for ( ; it.More(); it.Next()) {
627 parline = it.Parameter();
628 parmin = Min(parmin,parline);
629 parmax = Max(parmax,parline);
634 //-----------------------------------------------------------------------
635 // Search, among a list of interferences accessed by the iterator <IT>,
636 // a geometry whose 3D point is identical yo the 3D point of a DS point <PDS>.
637 // return True if such an interference has been found, False else.
638 // if True, iterator <IT> points (by the Value() method) on the first
639 // interference accessing an identical 3D point.
640 //-----------------------------------------------------------------------
641 //=======================================================================
642 //function : ScanInterfList
644 //=======================================================================
645 Standard_Boolean TopOpeBRepDS_HDataStructure::ScanInterfList
646 (TopOpeBRepDS_ListIteratorOfListOfInterference& IT,
647 const TopOpeBRepDS_Point& PDS) const
649 for ( ; IT.More(); IT.Next() ) {
650 TopOpeBRepDS_Kind GT = IT.Value()->GeometryType();
651 Standard_Integer G = IT.Value()->Geometry();
652 if ( GT == TopOpeBRepDS_POINT ) {
653 const TopOpeBRepDS_Point& OOPDS = myDS.Point(G);
654 Standard_Boolean iseq = PDS.IsEqual(OOPDS);
655 if (iseq) return iseq;
657 else if ( GT == TopOpeBRepDS_VERTEX ) {
658 TopOpeBRepDS_Point OOPDS(myDS.Shape(G));
659 Standard_Boolean iseq = PDS.IsEqual(OOPDS);
660 if (iseq) return iseq;
663 return Standard_False;
666 //=======================================================================
667 //function : GetGeometry
669 //=======================================================================
671 Standard_Boolean TopOpeBRepDS_HDataStructure::GetGeometry
672 (TopOpeBRepDS_ListIteratorOfListOfInterference& IT,
673 const TopOpeBRepDS_Point& PDS,
675 TopOpeBRepDS_Kind& K) const
677 Standard_Boolean found = ScanInterfList(IT,PDS);
679 G = IT.Value()->Geometry();
680 K = IT.Value()->GeometryType();
685 //=======================================================================
686 //function : StoreInterference
687 //purpose : Append an interference I to a list of interference LI
688 // Append I to the interf. list connected to I Geometry()
689 //=======================================================================
690 void TopOpeBRepDS_HDataStructure::StoreInterference
691 (const Handle(TopOpeBRepDS_Interference)& I,TopOpeBRepDS_ListOfInterference& LI, const TCollection_AsciiString&)
693 // append I to list LI
695 Standard_Integer G = I->Geometry();
697 // append I to list of interference connected to G = I->Geometry()
698 switch (I->GeometryType()) {
700 case TopOpeBRepDS_SOLID : case TopOpeBRepDS_FACE :
701 case TopOpeBRepDS_EDGE : case TopOpeBRepDS_VERTEX :
702 // appendtoG = Standard_True;
703 // myDS.ChangeShapeInterferences(G).Append(I);
706 case TopOpeBRepDS_SURFACE :
707 myDS.ChangeSurfaceInterferences(G).Append(I);
710 case TopOpeBRepDS_CURVE :
711 myDS.ChangeCurveInterferences(G).Append(I);
714 case TopOpeBRepDS_POINT :
715 // appendtoG = Standard_True;
716 // myDS.ChangePointInterferences(G).Append(I);
723 //=======================================================================
724 //function : StoreInterference
726 //=======================================================================
727 void TopOpeBRepDS_HDataStructure::StoreInterference
728 (const Handle(TopOpeBRepDS_Interference)& I,const TopoDS_Shape& S, const TCollection_AsciiString&)
730 Standard_Boolean h = myDS.HasShape(S);
732 throw Standard_ProgramError("StoreInterference on shape out of DS");
735 StoreInterference(I,myDS.ChangeShapeInterferences(S));
738 //=======================================================================
739 //function : StoreInterference
741 //=======================================================================
743 void TopOpeBRepDS_HDataStructure::StoreInterference
744 (const Handle(TopOpeBRepDS_Interference)& I,
745 const Standard_Integer IS, const TCollection_AsciiString&)
747 Standard_Integer n = myDS.NbShapes();
748 if ( IS < 1 || IS > n ) {
749 throw Standard_ProgramError("StoreInterference on index out of DS");
753 StoreInterference(I,myDS.ChangeShapeInterferences(IS));
756 //=======================================================================
757 //function : StoreInterference
759 //=======================================================================
760 void TopOpeBRepDS_HDataStructure::StoreInterferences
761 (const TopOpeBRepDS_ListOfInterference& LI,const Standard_Integer IS
762 // ,const TCollection_AsciiString& str)
763 ,const TCollection_AsciiString& )
765 TopOpeBRepDS_ListOfInterference& lids = myDS.ChangeShapeInterferences(IS);
766 TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
767 for (; it.More(); it.Next()){
768 const Handle(TopOpeBRepDS_Interference)& I = it.Value();
769 StoreInterference(I,lids);
773 //=======================================================================
774 //function : StoreInterferences
776 //=======================================================================
777 void TopOpeBRepDS_HDataStructure::StoreInterferences
778 (const TopOpeBRepDS_ListOfInterference& LI,const TopoDS_Shape& S
779 // ,const TCollection_AsciiString& str)
780 ,const TCollection_AsciiString& )
782 TopOpeBRepDS_ListOfInterference& lids = myDS.ChangeShapeInterferences(S);
783 TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
784 for (; it.More(); it.Next()){
785 const Handle(TopOpeBRepDS_Interference)& I = it.Value();
786 StoreInterference(I,lids);
790 //=======================================================================
791 //function : ClearStoreInterferences
793 //=======================================================================
794 void TopOpeBRepDS_HDataStructure::ClearStoreInterferences
795 (const TopOpeBRepDS_ListOfInterference& LI,const Standard_Integer IS
796 // ,const TCollection_AsciiString& str)
797 ,const TCollection_AsciiString& )
799 TopOpeBRepDS_ListOfInterference& lids = myDS.ChangeShapeInterferences(IS);
801 TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
802 for (; it.More(); it.Next()){
803 const Handle(TopOpeBRepDS_Interference)& I = it.Value();
804 StoreInterference(I,lids);
808 //=======================================================================
809 //function : ClearStoreInterferences
811 //=======================================================================
812 void TopOpeBRepDS_HDataStructure::ClearStoreInterferences
813 (const TopOpeBRepDS_ListOfInterference& LI,const TopoDS_Shape& S
814 // ,const TCollection_AsciiString& str)
815 ,const TCollection_AsciiString& )
817 TopOpeBRepDS_ListOfInterference& lids = myDS.ChangeShapeInterferences(S);
819 TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
820 for (; it.More(); it.Next()){
821 const Handle(TopOpeBRepDS_Interference)& I = it.Value();
822 StoreInterference(I,lids);