0028010: Visualization, Prs3d_Arrow - add Shading presentation builder
[occt.git] / src / AIS / AIS_LocalStatus.cxx
CommitLineData
b311480e 1// Copyright (c) 1998-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 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
973c2be1 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.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
7fd59977 15
42cf5bc1 16#include <AIS_LocalStatus.hxx>
17#include <Standard_Transient.hxx>
18#include <Standard_Type.hxx>
19#include <TColStd_ListIteratorOfListOfInteger.hxx>
7fd59977 20
92efcf78 21IMPLEMENT_STANDARD_RTTIEXT(AIS_LocalStatus,MMgt_TShared)
22
8e5fb5ea 23AIS_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),
36 myHiStyle (theStyle)
7fd59977 37{
8e5fb5ea 38 if (theSelectionMode != -1)
39 mySModes.Append (theSelectionMode);
7fd59977 40}
41
42
43//=======================================================================
44//function : IsActivated
45//purpose :
46//=======================================================================
47
48Standard_Boolean AIS_LocalStatus::
49IsActivated(const Standard_Integer aSelMode) const
50{
51 TColStd_ListIteratorOfListOfInteger It(mySModes);
52 for(;It.More();It.Next())
53 if(It.Value()==aSelMode)
54 return Standard_True;
55 return Standard_False;
56}
57
58//=======================================================================
59//function : RemoveSelectionMode
60//purpose :
61//=======================================================================
62
63void AIS_LocalStatus::RemoveSelectionMode(const Standard_Integer aMode)
64{
65 TColStd_ListIteratorOfListOfInteger It(mySModes);
66 for(;It.More();It.Next())
67 {
68 if(It.Value()==aMode) {
69 mySModes.Remove(It);
70 return;
71 }
72 }
73}
74//=======================================================================
75//function : ClearSelectionModes
76//purpose :
77//=======================================================================
78
79void AIS_LocalStatus::ClearSelectionModes()
80{mySModes.Clear();}
81
82
83//=======================================================================
84//function : AddSelectionMode
85//purpose :
86//=======================================================================
87
88void AIS_LocalStatus::AddSelectionMode(const Standard_Integer aMode)
89{
90 if(IsSelModeIn(aMode)) return;
91
92 if(aMode!=-1)
93 mySModes.Append(aMode);
94 else
95 mySModes.Clear();
96}
97
98//=======================================================================
99//function : IsSelModeIn
100//purpose :
101//=======================================================================
102
103Standard_Boolean AIS_LocalStatus::IsSelModeIn(const Standard_Integer aMode) const
104{
105 for(TColStd_ListIteratorOfListOfInteger It(mySModes);
106 It.More();
107 It.Next()){
108 if(It.Value()==aMode)
109 return Standard_True;
110 }
111 return Standard_False;
112}