Integration of OCCT 6.5.0 from SVN
[occt.git] / src / BRepCheck / BRepCheck_Result.cxx
1 // File:        BRepCheck_Result.cxx
2 // Created:     Thu Dec  7 10:41:49 1995
3 // Author:      Jacques GOUSSARD
4 //              <jag@bravox>
5
6
7 #include <BRepCheck_Result.ixx>
8 #include <BRepCheck.hxx>
9
10
11 //=======================================================================
12 //function : BRepCheck_Result
13 //purpose  : 
14 //=======================================================================
15
16 BRepCheck_Result::BRepCheck_Result() :
17    myMin(Standard_False),myBlind(Standard_False)
18 {
19 }
20
21
22 //=======================================================================
23 //function : Init
24 //purpose  : 
25 //=======================================================================
26
27 void BRepCheck_Result::Init(const TopoDS_Shape& S)
28 {
29   myShape = S;
30   myMin = Standard_False;
31   myBlind = Standard_False;
32   myMap.Clear();
33   Minimum();
34 }
35
36 //=======================================================================
37 //function : SetFailStatus
38 //purpose  : 
39 //=======================================================================
40 void BRepCheck_Result::SetFailStatus(const TopoDS_Shape& S) 
41 {
42   if(!myMap.IsBound(S)) {
43     BRepCheck_ListOfStatus thelist;
44     myMap.Bind(S, thelist);
45   }
46   BRepCheck::Add(myMap(S), BRepCheck_CheckFail);
47 }
48
49
50 //=======================================================================
51 //function : StatusOnShape
52 //purpose  : 
53 //=======================================================================
54
55 const BRepCheck_ListOfStatus& BRepCheck_Result::StatusOnShape
56    (const TopoDS_Shape& S)
57 {
58   if (!myMap.IsBound(S)) {
59     InContext(S);
60   }
61   return myMap(S);
62 }
63
64
65 //=======================================================================
66 //function : InitContextIterator
67 //purpose  : 
68 //=======================================================================
69
70 void BRepCheck_Result::InitContextIterator()
71 {
72   myIter.Initialize(myMap);
73   // Au minimum 1 element : le Shape lui meme
74   if (myIter.Key().IsSame(myShape)) {
75     myIter.Next();
76   }
77 }
78
79
80 //=======================================================================
81 //function : NextShapeInContext
82 //purpose  : 
83 //=======================================================================
84
85 void BRepCheck_Result::NextShapeInContext()
86 {
87   myIter.Next();
88   if (myIter.More() && myIter.Key().IsSame(myShape)) {
89     myIter.Next();
90   }
91 }