0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / AIS / AIS_GlobalStatus.cxx
CommitLineData
b311480e 1// Created on: 1997-01-24
2// Created by: Robert COUBLANC
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17
18#include <AIS_GlobalStatus.hxx>
19#include <Standard_Type.hxx>
7fd59977 20#include <TColStd_ListIteratorOfListOfInteger.hxx>
21
7fd59977 22AIS_GlobalStatus::AIS_GlobalStatus():
23myStatus(AIS_DS_None),
24myLayerIndex(0),
25myIsHilit(Standard_False),
26myHiCol(Quantity_NOC_WHITE),
27mySubInt(Standard_False)
28{
29}
30
31AIS_GlobalStatus::AIS_GlobalStatus(const AIS_DisplayStatus DS,
32 const Standard_Integer DMode,
33 const Standard_Integer SMode,
35e08fe8 34 const Standard_Boolean /*ishilighted*/,
7fd59977 35 const Quantity_NameOfColor TheHiCol,
36 const Standard_Integer Layer):
37myStatus(DS),
38myLayerIndex(Layer),
39myIsHilit(Standard_False),
40myHiCol(TheHiCol),
41mySubInt(Standard_False)
42{
43 myDispModes.Append(DMode);
44 mySelModes.Append(SMode);
45}
46
7fd59977 47void AIS_GlobalStatus::RemoveDisplayMode(const Standard_Integer aMode)
48{
e33e7e78
RK
49 TColStd_ListIteratorOfListOfInteger anIt (myDispModes);
50 for (; anIt.More(); anIt.Next())
51 {
52 if (anIt.Value() == aMode)
53 {
54 myDispModes.Remove (anIt);
55 return;
56 }
7fd59977 57 }
58}
59
60void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode)
61{
e33e7e78
RK
62 TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
63 for (; anIt.More(); anIt.Next())
64 {
65 if (anIt.Value() == aMode)
66 {
67 mySelModes.Remove (anIt);
68 return;
69 }
7fd59977 70 }
71}
e33e7e78 72
7fd59977 73void AIS_GlobalStatus::ClearSelectionModes()
74{
75 mySelModes.Clear();
76}
77
78Standard_Boolean AIS_GlobalStatus::IsDModeIn(const Standard_Integer aMode) const
79{
e33e7e78
RK
80 TColStd_ListIteratorOfListOfInteger anIt (myDispModes);
81 for (; anIt.More(); anIt.Next())
82 {
83 if (anIt.Value() == aMode)
84 {
85 return Standard_True;
86 }
87 }
7fd59977 88 return Standard_False;
7fd59977 89}
90
91Standard_Boolean AIS_GlobalStatus::IsSModeIn(const Standard_Integer aMode) const
92{
e33e7e78
RK
93 TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
94 for (; anIt.More(); anIt.Next())
95 {
96 if (anIt.Value() == aMode)
97 {
98 return Standard_True;
99 }
100 }
7fd59977 101 return Standard_False;
102}