7fd59977 |
1 | #include <AIS_LocalStatus.ixx> |
2 | #include <TColStd_ListIteratorOfListOfInteger.hxx> |
3 | |
4 | |
5 | AIS_LocalStatus::AIS_LocalStatus(const Standard_Boolean IsTemp, |
6 | const Standard_Boolean Decomp, |
7 | const Standard_Integer DMode, |
8 | const Standard_Integer SMode, |
9 | const Standard_Integer HMode, |
10 | const Standard_Boolean SubIntensity, |
11 | const Quantity_NameOfColor HiCol): |
12 | myDecomposition(Decomp), |
13 | myIsTemporary(IsTemp), |
14 | myDMode(DMode), |
15 | myFirstDisplay(Standard_False), |
16 | myHMode(HMode), |
17 | mySubIntensity(SubIntensity), |
18 | myHiCol(HiCol) |
19 | { |
20 | if(SMode!=-1) mySModes.Append(SMode); |
21 | } |
22 | |
23 | |
24 | //======================================================================= |
25 | //function : IsActivated |
26 | //purpose : |
27 | //======================================================================= |
28 | |
29 | Standard_Boolean AIS_LocalStatus:: |
30 | IsActivated(const Standard_Integer aSelMode) const |
31 | { |
32 | TColStd_ListIteratorOfListOfInteger It(mySModes); |
33 | for(;It.More();It.Next()) |
34 | if(It.Value()==aSelMode) |
35 | return Standard_True; |
36 | return Standard_False; |
37 | } |
38 | |
39 | //======================================================================= |
40 | //function : RemoveSelectionMode |
41 | //purpose : |
42 | //======================================================================= |
43 | |
44 | void AIS_LocalStatus::RemoveSelectionMode(const Standard_Integer aMode) |
45 | { |
46 | TColStd_ListIteratorOfListOfInteger It(mySModes); |
47 | for(;It.More();It.Next()) |
48 | { |
49 | if(It.Value()==aMode) { |
50 | mySModes.Remove(It); |
51 | return; |
52 | } |
53 | } |
54 | } |
55 | //======================================================================= |
56 | //function : ClearSelectionModes |
57 | //purpose : |
58 | //======================================================================= |
59 | |
60 | void AIS_LocalStatus::ClearSelectionModes() |
61 | {mySModes.Clear();} |
62 | |
63 | |
64 | //======================================================================= |
65 | //function : AddSelectionMode |
66 | //purpose : |
67 | //======================================================================= |
68 | |
69 | void AIS_LocalStatus::AddSelectionMode(const Standard_Integer aMode) |
70 | { |
71 | if(IsSelModeIn(aMode)) return; |
72 | |
73 | if(aMode!=-1) |
74 | mySModes.Append(aMode); |
75 | else |
76 | mySModes.Clear(); |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : IsSelModeIn |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | Standard_Boolean AIS_LocalStatus::IsSelModeIn(const Standard_Integer aMode) const |
85 | { |
86 | for(TColStd_ListIteratorOfListOfInteger It(mySModes); |
87 | It.More(); |
88 | It.Next()){ |
89 | if(It.Value()==aMode) |
90 | return Standard_True; |
91 | } |
92 | return Standard_False; |
93 | } |