Integration of OCCT 6.5.0 from SVN
[occt.git] / src / IntTools / IntTools_CurveRangeLocalizeData.cxx
CommitLineData
7fd59977 1// File: IntTools_CurveRangeLocalizeData.cxx
2// Created: Fri Oct 14 19:59:41 2005
3// Author: Mikhail KLOKOV
4// <mkk@kurox>
5
6
7#include <IntTools_CurveRangeLocalizeData.ixx>
8#include <IntTools_ListIteratorOfListOfCurveRangeSample.hxx>
9#include <IntTools_ListIteratorOfListOfBox.hxx>
10#include <IntTools_MapIteratorOfMapOfCurveSample.hxx>
11
12IntTools_CurveRangeLocalizeData::IntTools_CurveRangeLocalizeData(const Standard_Integer theNbSample,
13 const Standard_Real theMinRange)
14{
15 myNbSampleC = theNbSample;
16 myMinRangeC = theMinRange;
17}
18
19void IntTools_CurveRangeLocalizeData::AddOutRange(const IntTools_CurveRangeSample& theRange)
20{
21 myMapRangeOut.Add(theRange);
22 myMapBox.UnBind(theRange);
23}
24
25void IntTools_CurveRangeLocalizeData::AddBox(const IntTools_CurveRangeSample& theRange,
26 const Bnd_Box& theBox)
27{
28 myMapBox.Bind(theRange, theBox);
29}
30
31Standard_Boolean IntTools_CurveRangeLocalizeData::FindBox(const IntTools_CurveRangeSample& theRange,Bnd_Box& theBox) const
32{
33 if(myMapBox.IsBound(theRange)) {
34 theBox = myMapBox(theRange);
35 return Standard_True;
36 }
37 return Standard_False;
38}
39
40Standard_Boolean IntTools_CurveRangeLocalizeData::IsRangeOut(const IntTools_CurveRangeSample& theRange) const
41{
42 return myMapRangeOut.Contains(theRange);
43}
44
45void IntTools_CurveRangeLocalizeData::ListRangeOut(IntTools_ListOfCurveRangeSample& theList) const
46{
47 IntTools_MapIteratorOfMapOfCurveSample anIt(myMapRangeOut);
48
49 for(; anIt.More(); anIt.Next())
50 theList.Append(anIt.Key());
51}
52