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.
16 #include <AIS_LocalStatus.hxx>
17 #include <Standard_Transient.hxx>
18 #include <Standard_Type.hxx>
19 #include <TColStd_ListIteratorOfListOfInteger.hxx>
21 IMPLEMENT_STANDARD_RTTIEXT(AIS_LocalStatus,MMgt_TShared)
23 AIS_LocalStatus::AIS_LocalStatus(const Standard_Boolean IsTemp,
24 const Standard_Boolean Decomp,
25 const Standard_Integer DMode,
26 const Standard_Integer SMode,
27 const Standard_Integer HMode,
28 const Standard_Boolean SubIntensity,
29 const Quantity_NameOfColor HiCol):
30 myDecomposition(Decomp),
31 myIsTemporary(IsTemp),
33 myFirstDisplay(Standard_False),
35 mySubIntensity(SubIntensity),
38 if(SMode!=-1) mySModes.Append(SMode);
42 //=======================================================================
43 //function : IsActivated
45 //=======================================================================
47 Standard_Boolean AIS_LocalStatus::
48 IsActivated(const Standard_Integer aSelMode) const
50 TColStd_ListIteratorOfListOfInteger It(mySModes);
51 for(;It.More();It.Next())
52 if(It.Value()==aSelMode)
54 return Standard_False;
57 //=======================================================================
58 //function : RemoveSelectionMode
60 //=======================================================================
62 void AIS_LocalStatus::RemoveSelectionMode(const Standard_Integer aMode)
64 TColStd_ListIteratorOfListOfInteger It(mySModes);
65 for(;It.More();It.Next())
67 if(It.Value()==aMode) {
73 //=======================================================================
74 //function : ClearSelectionModes
76 //=======================================================================
78 void AIS_LocalStatus::ClearSelectionModes()
82 //=======================================================================
83 //function : AddSelectionMode
85 //=======================================================================
87 void AIS_LocalStatus::AddSelectionMode(const Standard_Integer aMode)
89 if(IsSelModeIn(aMode)) return;
92 mySModes.Append(aMode);
97 //=======================================================================
98 //function : IsSelModeIn
100 //=======================================================================
102 Standard_Boolean AIS_LocalStatus::IsSelModeIn(const Standard_Integer aMode) const
104 for(TColStd_ListIteratorOfListOfInteger It(mySModes);
107 if(It.Value()==aMode)
108 return Standard_True;
110 return Standard_False;