1 // Created on: 2005-10-14
2 // Created by: Mikhail KLOKOV
3 // Copyright (c) 2005-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <Bnd_Box.hxx>
18 #include <IntTools_CurveRangeLocalizeData.hxx>
19 #include <IntTools_CurveRangeSample.hxx>
20 #include <IntTools_ListIteratorOfListOfBox.hxx>
21 #include <IntTools_ListIteratorOfListOfCurveRangeSample.hxx>
22 #include <IntTools_MapIteratorOfMapOfCurveSample.hxx>
24 IntTools_CurveRangeLocalizeData::IntTools_CurveRangeLocalizeData(const Standard_Integer theNbSample,
25 const Standard_Real theMinRange)
27 myNbSampleC = theNbSample;
28 myMinRangeC = theMinRange;
31 void IntTools_CurveRangeLocalizeData::AddOutRange(const IntTools_CurveRangeSample& theRange)
33 myMapRangeOut.Add(theRange);
34 myMapBox.UnBind(theRange);
37 void IntTools_CurveRangeLocalizeData::AddBox(const IntTools_CurveRangeSample& theRange,
38 const Bnd_Box& theBox)
40 myMapBox.Bind(theRange, theBox);
43 Standard_Boolean IntTools_CurveRangeLocalizeData::FindBox(const IntTools_CurveRangeSample& theRange,Bnd_Box& theBox) const
45 if(myMapBox.IsBound(theRange)) {
46 theBox = myMapBox(theRange);
49 return Standard_False;
52 Standard_Boolean IntTools_CurveRangeLocalizeData::IsRangeOut(const IntTools_CurveRangeSample& theRange) const
54 return myMapRangeOut.Contains(theRange);
57 void IntTools_CurveRangeLocalizeData::ListRangeOut(IntTools_ListOfCurveRangeSample& theList) const
59 IntTools_MapIteratorOfMapOfCurveSample anIt(myMapRangeOut);
61 for(; anIt.More(); anIt.Next())
62 theList.Append(anIt.Key());