0022627: Change OCCT memory management defaults
[occt.git] / src / AIS / AIS_GlobalStatus.cxx
CommitLineData
7fd59977 1// File: AIS_GlobalStatus.cxx
2// Created: Fri Jan 24 16:54:46 1997
3// Author: Robert COUBLANC
4// <rob@robox.paris1.matra-dtv.fr>
5
7fd59977 6#include <AIS_GlobalStatus.ixx>
7#include <TColStd_ListIteratorOfListOfInteger.hxx>
8
7fd59977 9AIS_GlobalStatus::AIS_GlobalStatus():
10myStatus(AIS_DS_None),
11myLayerIndex(0),
12myIsHilit(Standard_False),
13myHiCol(Quantity_NOC_WHITE),
14mySubInt(Standard_False)
15{
16}
17
18AIS_GlobalStatus::AIS_GlobalStatus(const AIS_DisplayStatus DS,
19 const Standard_Integer DMode,
20 const Standard_Integer SMode,
21 const Standard_Boolean ishilighted,
22 const Quantity_NameOfColor TheHiCol,
23 const Standard_Integer Layer):
24myStatus(DS),
25myLayerIndex(Layer),
26myIsHilit(Standard_False),
27myHiCol(TheHiCol),
28mySubInt(Standard_False)
29{
30 myDispModes.Append(DMode);
31 mySelModes.Append(SMode);
32}
33
7fd59977 34void AIS_GlobalStatus::RemoveDisplayMode(const Standard_Integer aMode)
35{
e33e7e78
RK
36 TColStd_ListIteratorOfListOfInteger anIt (myDispModes);
37 for (; anIt.More(); anIt.Next())
38 {
39 if (anIt.Value() == aMode)
40 {
41 myDispModes.Remove (anIt);
42 return;
43 }
7fd59977 44 }
45}
46
47void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode)
48{
e33e7e78
RK
49 TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
50 for (; anIt.More(); anIt.Next())
51 {
52 if (anIt.Value() == aMode)
53 {
54 mySelModes.Remove (anIt);
55 return;
56 }
7fd59977 57 }
58}
e33e7e78 59
7fd59977 60void AIS_GlobalStatus::ClearSelectionModes()
61{
62 mySelModes.Clear();
63}
64
65Standard_Boolean AIS_GlobalStatus::IsDModeIn(const Standard_Integer aMode) const
66{
e33e7e78
RK
67 TColStd_ListIteratorOfListOfInteger anIt (myDispModes);
68 for (; anIt.More(); anIt.Next())
69 {
70 if (anIt.Value() == aMode)
71 {
72 return Standard_True;
73 }
74 }
7fd59977 75 return Standard_False;
7fd59977 76}
77
78Standard_Boolean AIS_GlobalStatus::IsSModeIn(const Standard_Integer aMode) const
79{
e33e7e78
RK
80 TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
81 for (; anIt.More(); anIt.Next())
82 {
83 if (anIt.Value() == aMode)
84 {
85 return Standard_True;
86 }
87 }
7fd59977 88 return Standard_False;
89}