Commit | Line | Data |
---|---|---|
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 | // |
d5f74e42 | 8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 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 | |
42cf5bc1 | 17 | |
3db69e41 | 18 | #include <AIS_DisplayMode.hxx> |
42cf5bc1 | 19 | #include <AIS_GlobalStatus.hxx> |
20 | #include <Standard_Type.hxx> | |
7fd59977 | 21 | #include <TColStd_ListIteratorOfListOfInteger.hxx> |
22 | ||
92efcf78 | 23 | IMPLEMENT_STANDARD_RTTIEXT(AIS_GlobalStatus,MMgt_TShared) |
24 | ||
7fd59977 | 25 | AIS_GlobalStatus::AIS_GlobalStatus(): |
26 | myStatus(AIS_DS_None), | |
3db69e41 | 27 | myDispMode(AIS_WireFrame), |
7fd59977 | 28 | myLayerIndex(0), |
29 | myIsHilit(Standard_False), | |
7fd59977 | 30 | mySubInt(Standard_False) |
31 | { | |
32 | } | |
33 | ||
34 | AIS_GlobalStatus::AIS_GlobalStatus(const AIS_DisplayStatus DS, | |
35 | const Standard_Integer DMode, | |
36 | const Standard_Integer SMode, | |
35e08fe8 | 37 | const Standard_Boolean /*ishilighted*/, |
7fd59977 | 38 | const Standard_Integer Layer): |
39 | myStatus(DS), | |
3db69e41 | 40 | myDispMode(DMode), |
7fd59977 | 41 | myLayerIndex(Layer), |
42 | myIsHilit(Standard_False), | |
7fd59977 | 43 | mySubInt(Standard_False) |
44 | { | |
7fd59977 | 45 | mySelModes.Append(SMode); |
46 | } | |
47 | ||
7fd59977 | 48 | void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode) |
49 | { | |
e33e7e78 RK |
50 | TColStd_ListIteratorOfListOfInteger anIt (mySelModes); |
51 | for (; anIt.More(); anIt.Next()) | |
52 | { | |
53 | if (anIt.Value() == aMode) | |
54 | { | |
55 | mySelModes.Remove (anIt); | |
56 | return; | |
57 | } | |
7fd59977 | 58 | } |
59 | } | |
e33e7e78 | 60 | |
7fd59977 | 61 | void AIS_GlobalStatus::ClearSelectionModes() |
62 | { | |
63 | mySelModes.Clear(); | |
64 | } | |
65 | ||
7fd59977 | 66 | Standard_Boolean AIS_GlobalStatus::IsSModeIn(const Standard_Integer aMode) const |
67 | { | |
e33e7e78 RK |
68 | TColStd_ListIteratorOfListOfInteger anIt (mySelModes); |
69 | for (; anIt.More(); anIt.Next()) | |
70 | { | |
71 | if (anIt.Value() == aMode) | |
72 | { | |
73 | return Standard_True; | |
74 | } | |
75 | } | |
7fd59977 | 76 | return Standard_False; |
77 | } |