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.
16 #include <IntTools_CurveRangeLocalizeData.ixx>
17 #include <IntTools_ListIteratorOfListOfCurveRangeSample.hxx>
18 #include <IntTools_ListIteratorOfListOfBox.hxx>
19 #include <IntTools_MapIteratorOfMapOfCurveSample.hxx>
21 IntTools_CurveRangeLocalizeData::IntTools_CurveRangeLocalizeData(const Standard_Integer theNbSample,
22 const Standard_Real theMinRange)
24 myNbSampleC = theNbSample;
25 myMinRangeC = theMinRange;
28 void IntTools_CurveRangeLocalizeData::AddOutRange(const IntTools_CurveRangeSample& theRange)
30 myMapRangeOut.Add(theRange);
31 myMapBox.UnBind(theRange);
34 void IntTools_CurveRangeLocalizeData::AddBox(const IntTools_CurveRangeSample& theRange,
35 const Bnd_Box& theBox)
37 myMapBox.Bind(theRange, theBox);
40 Standard_Boolean IntTools_CurveRangeLocalizeData::FindBox(const IntTools_CurveRangeSample& theRange,Bnd_Box& theBox) const
42 if(myMapBox.IsBound(theRange)) {
43 theBox = myMapBox(theRange);
46 return Standard_False;
49 Standard_Boolean IntTools_CurveRangeLocalizeData::IsRangeOut(const IntTools_CurveRangeSample& theRange) const
51 return myMapRangeOut.Contains(theRange);
54 void IntTools_CurveRangeLocalizeData::ListRangeOut(IntTools_ListOfCurveRangeSample& theList) const
56 IntTools_MapIteratorOfMapOfCurveSample anIt(myMapRangeOut);
58 for(; anIt.More(); anIt.Next())
59 theList.Append(anIt.Key());