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 theIsTemporary,
24 const Standard_Boolean theIsToDecompose,
25 const Standard_Integer theDisplayMode,
26 const Standard_Integer theSelectionMode,
27 const Standard_Integer theHilightMode,
28 const Standard_Boolean theIsSubIntensity,
29 const Handle(Graphic3d_HighlightStyle)& theStyle)
30 : myDecomposition (theIsToDecompose),
31 myIsTemporary (theIsTemporary),
32 myDMode (theDisplayMode),
33 myFirstDisplay (Standard_False),
34 myHMode (theHilightMode),
35 mySubIntensity (theIsSubIntensity),
38 if (theSelectionMode != -1)
39 mySModes.Append (theSelectionMode);
43 //=======================================================================
44 //function : IsActivated
46 //=======================================================================
48 Standard_Boolean AIS_LocalStatus::
49 IsActivated(const Standard_Integer aSelMode) const
51 TColStd_ListIteratorOfListOfInteger It(mySModes);
52 for(;It.More();It.Next())
53 if(It.Value()==aSelMode)
55 return Standard_False;
58 //=======================================================================
59 //function : RemoveSelectionMode
61 //=======================================================================
63 void AIS_LocalStatus::RemoveSelectionMode(const Standard_Integer aMode)
65 TColStd_ListIteratorOfListOfInteger It(mySModes);
66 for(;It.More();It.Next())
68 if(It.Value()==aMode) {
74 //=======================================================================
75 //function : ClearSelectionModes
77 //=======================================================================
79 void AIS_LocalStatus::ClearSelectionModes()
83 //=======================================================================
84 //function : AddSelectionMode
86 //=======================================================================
88 void AIS_LocalStatus::AddSelectionMode(const Standard_Integer aMode)
90 if(IsSelModeIn(aMode)) return;
93 mySModes.Append(aMode);
98 //=======================================================================
99 //function : IsSelModeIn
101 //=======================================================================
103 Standard_Boolean AIS_LocalStatus::IsSelModeIn(const Standard_Integer aMode) const
105 for(TColStd_ListIteratorOfListOfInteger It(mySModes);
108 if(It.Value()==aMode)
109 return Standard_True;
111 return Standard_False;