0024428: Implementation of LGPL license
[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//
973c2be1 8// This library is free software; you can redistribute it and / or modify it
9// under the terms of the GNU Lesser General Public version 2.1 as published
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
7fd59977 17#include <AIS_GlobalStatus.ixx>
18#include <TColStd_ListIteratorOfListOfInteger.hxx>
19
7fd59977 20AIS_GlobalStatus::AIS_GlobalStatus():
21myStatus(AIS_DS_None),
22myLayerIndex(0),
23myIsHilit(Standard_False),
24myHiCol(Quantity_NOC_WHITE),
25mySubInt(Standard_False)
26{
27}
28
29AIS_GlobalStatus::AIS_GlobalStatus(const AIS_DisplayStatus DS,
30 const Standard_Integer DMode,
31 const Standard_Integer SMode,
35e08fe8 32 const Standard_Boolean /*ishilighted*/,
7fd59977 33 const Quantity_NameOfColor TheHiCol,
34 const Standard_Integer Layer):
35myStatus(DS),
36myLayerIndex(Layer),
37myIsHilit(Standard_False),
38myHiCol(TheHiCol),
39mySubInt(Standard_False)
40{
41 myDispModes.Append(DMode);
42 mySelModes.Append(SMode);
43}
44
7fd59977 45void AIS_GlobalStatus::RemoveDisplayMode(const Standard_Integer aMode)
46{
e33e7e78
RK
47 TColStd_ListIteratorOfListOfInteger anIt (myDispModes);
48 for (; anIt.More(); anIt.Next())
49 {
50 if (anIt.Value() == aMode)
51 {
52 myDispModes.Remove (anIt);
53 return;
54 }
7fd59977 55 }
56}
57
58void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode)
59{
e33e7e78
RK
60 TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
61 for (; anIt.More(); anIt.Next())
62 {
63 if (anIt.Value() == aMode)
64 {
65 mySelModes.Remove (anIt);
66 return;
67 }
7fd59977 68 }
69}
e33e7e78 70
7fd59977 71void AIS_GlobalStatus::ClearSelectionModes()
72{
73 mySelModes.Clear();
74}
75
76Standard_Boolean AIS_GlobalStatus::IsDModeIn(const Standard_Integer aMode) const
77{
e33e7e78
RK
78 TColStd_ListIteratorOfListOfInteger anIt (myDispModes);
79 for (; anIt.More(); anIt.Next())
80 {
81 if (anIt.Value() == aMode)
82 {
83 return Standard_True;
84 }
85 }
7fd59977 86 return Standard_False;
7fd59977 87}
88
89Standard_Boolean AIS_GlobalStatus::IsSModeIn(const Standard_Integer aMode) const
90{
e33e7e78
RK
91 TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
92 for (; anIt.More(); anIt.Next())
93 {
94 if (anIt.Value() == aMode)
95 {
96 return Standard_True;
97 }
98 }
7fd59977 99 return Standard_False;
100}