1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <AIS_LocalStatus.ixx>
16 #include <TColStd_ListIteratorOfListOfInteger.hxx>
19 AIS_LocalStatus::AIS_LocalStatus(const Standard_Boolean IsTemp,
20 const Standard_Boolean Decomp,
21 const Standard_Integer DMode,
22 const Standard_Integer SMode,
23 const Standard_Integer HMode,
24 const Standard_Boolean SubIntensity,
25 const Quantity_NameOfColor HiCol):
26 myDecomposition(Decomp),
27 myIsTemporary(IsTemp),
29 myFirstDisplay(Standard_False),
31 mySubIntensity(SubIntensity),
34 if(SMode!=-1) mySModes.Append(SMode);
38 //=======================================================================
39 //function : IsActivated
41 //=======================================================================
43 Standard_Boolean AIS_LocalStatus::
44 IsActivated(const Standard_Integer aSelMode) const
46 TColStd_ListIteratorOfListOfInteger It(mySModes);
47 for(;It.More();It.Next())
48 if(It.Value()==aSelMode)
50 return Standard_False;
53 //=======================================================================
54 //function : RemoveSelectionMode
56 //=======================================================================
58 void AIS_LocalStatus::RemoveSelectionMode(const Standard_Integer aMode)
60 TColStd_ListIteratorOfListOfInteger It(mySModes);
61 for(;It.More();It.Next())
63 if(It.Value()==aMode) {
69 //=======================================================================
70 //function : ClearSelectionModes
72 //=======================================================================
74 void AIS_LocalStatus::ClearSelectionModes()
78 //=======================================================================
79 //function : AddSelectionMode
81 //=======================================================================
83 void AIS_LocalStatus::AddSelectionMode(const Standard_Integer aMode)
85 if(IsSelModeIn(aMode)) return;
88 mySModes.Append(aMode);
93 //=======================================================================
94 //function : IsSelModeIn
96 //=======================================================================
98 Standard_Boolean AIS_LocalStatus::IsSelModeIn(const Standard_Integer aMode) const
100 for(TColStd_ListIteratorOfListOfInteger It(mySModes);
103 if(It.Value()==aMode)
104 return Standard_True;
106 return Standard_False;