0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_FilterCurveInterferences.cxx
CommitLineData
b311480e 1// Created on: 1997-04-22
2// Created by: Prestataire Mary FABIEN
3// Copyright (c) 1997-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
42cf5bc1 18#include <TopOpeBRepDS_Filter.hxx>
19#include <TopOpeBRepDS_HDataStructure.hxx>
7fd59977 20#include <TopOpeBRepDS_Interference.hxx>
7fd59977 21#include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
42cf5bc1 22#include <TopOpeBRepDS_ListOfInterference.hxx>
7fd59977 23#include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
24
7fd59977 25//=======================================================================
26//function : ProcessCurveInterferences
27//purpose :
28//=======================================================================
29
30void TopOpeBRepDS_Filter::ProcessCurveInterferences
31(const Standard_Integer CIX)
32{
33 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
34 TopOpeBRepDS_ListOfInterference& LI = BDS.ChangeCurveInterferences(CIX);
35 TopOpeBRepDS_ListIteratorOfListOfInterference it1(LI);
36
37 // process interferences of LI with VERTEX geometry
38 while( it1.More() ) {
39 const Handle(TopOpeBRepDS_Interference)& I1 = it1.Value();
40 Standard_Integer G1 = I1->Geometry();
41 TopOpeBRepDS_Kind GT1 = I1->GeometryType();
42 TopAbs_Orientation O1 = I1->Transition().Orientation(TopAbs_IN);
43
44 if ( GT1 == TopOpeBRepDS_VERTEX ) {
45
46 TopOpeBRepDS_ListIteratorOfListOfInterference it2(it1);
47 it2.Next();
48
49 while ( it2.More() ) {
50 const Handle(TopOpeBRepDS_Interference)& I2 = it2.Value();
51 Standard_Integer G2 = I2->Geometry();
52 TopOpeBRepDS_Kind GT2 = I2->GeometryType();
53 TopAbs_Orientation O2 = I2->Transition().Orientation(TopAbs_IN);
54
55// Standard_Boolean remove = (GT2 == GT1) && (G2 == G1);
56 // xpu140898 : USA60111 : CPI(FORWARD,v10,C1) + CPIREV(REVERSED,v10,C1)
57 // do NOT delete CPIREV!!
58 Standard_Boolean remove = (GT2 == GT1) && (G2 == G1) && (O1 == O2);
59 if ( remove ) {
7fd59977 60 LI.Remove(it2);
61 }
62 else it2.Next();
63 }
64 }
65 it1.Next();
66 }
67}