42cf5bc1 |
1 | // Created on: 1997-01-24 |
2 | // Created by: Robert COUBLANC |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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 |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _AIS_GlobalStatus_HeaderFile |
18 | #define _AIS_GlobalStatus_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <AIS_DisplayStatus.hxx> |
f838dac4 |
24 | #include <Prs3d_Drawer.hxx> |
42cf5bc1 |
25 | #include <TColStd_ListOfInteger.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_Boolean.hxx> |
f838dac4 |
28 | #include <Standard_Transient.hxx> |
42cf5bc1 |
29 | |
f838dac4 |
30 | DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, Standard_Transient) |
42cf5bc1 |
31 | |
32 | //! Stores information about objects in graphic context: |
33 | //! - Status Of Display : in the main viewer |
34 | //! hidden in the main viewer |
35 | //! - Displayed Modes |
36 | //! - Active Selection Modes |
37 | //! - is the Interactive Object Current ? |
38 | //! - Layer Index |
f838dac4 |
39 | class AIS_GlobalStatus : public Standard_Transient |
42cf5bc1 |
40 | { |
f838dac4 |
41 | DEFINE_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient) |
42cf5bc1 |
42 | public: |
43 | |
42cf5bc1 |
44 | Standard_EXPORT AIS_GlobalStatus(); |
45 | |
8e5fb5ea |
46 | Standard_EXPORT AIS_GlobalStatus(const AIS_DisplayStatus aStat, const Standard_Integer aDispMode, const Standard_Integer aSelMode, const Standard_Boolean ishilighted = Standard_False, const Standard_Integer aLayerIndex = 0); |
3db69e41 |
47 | |
f838dac4 |
48 | void SetGraphicStatus (const AIS_DisplayStatus theStatus) { myStatus = theStatus; } |
3db69e41 |
49 | |
f838dac4 |
50 | void AddSelectionMode (const Standard_Integer theMode) { if (!IsSModeIn (theMode)) mySelModes.Append (theMode); } |
8e5fb5ea |
51 | |
f838dac4 |
52 | //! Sets display mode. |
53 | void SetDisplayMode (const Standard_Integer theMode) { myDispMode = theMode; } |
8e5fb5ea |
54 | |
f838dac4 |
55 | //! Returns the display mode. |
56 | Standard_Integer DisplayMode() const { return myDispMode; } |
8e5fb5ea |
57 | |
f838dac4 |
58 | void SetLayerIndex (const Standard_Integer theIndex) { myLayerIndex = theIndex; } |
59 | |
60 | void SetHilightStatus (const Standard_Boolean theStatus) { myIsHilit = theStatus; } |
61 | |
62 | //! Changes applied highlight style for a particular object |
63 | void SetHilightStyle (const Handle(Prs3d_Drawer)& theStyle) { myHiStyle = theStyle; } |
64 | |
65 | //! Returns applied highlight style for a particular object |
66 | const Handle(Prs3d_Drawer)& HilightStyle() const { return myHiStyle; } |
67 | |
68 | Standard_Boolean IsSubIntensityOn() const { return mySubInt; } |
69 | |
70 | void SubIntensityOn() { mySubInt = Standard_True; } |
71 | |
72 | void SubIntensityOff() { mySubInt = Standard_False; } |
42cf5bc1 |
73 | |
42cf5bc1 |
74 | Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode); |
75 | |
76 | Standard_EXPORT void ClearSelectionModes(); |
77 | |
f838dac4 |
78 | AIS_DisplayStatus GraphicStatus() const { return myStatus; } |
42cf5bc1 |
79 | |
42cf5bc1 |
80 | //! keeps the active selection modes of the object |
81 | //! in the main viewer. |
f838dac4 |
82 | const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; } |
42cf5bc1 |
83 | |
f838dac4 |
84 | Standard_Boolean IsHilighted() const { return myIsHilit; } |
8e5fb5ea |
85 | |
42cf5bc1 |
86 | Standard_EXPORT Standard_Boolean IsSModeIn (const Standard_Integer aMode) const; |
87 | |
1d92133e |
88 | //! Returns layer index. |
89 | Standard_Integer GetLayerIndex() const |
90 | { |
91 | return myLayerIndex; |
92 | } |
42cf5bc1 |
93 | |
42cf5bc1 |
94 | private: |
95 | |
f838dac4 |
96 | TColStd_ListOfInteger mySelModes; |
97 | Handle(Prs3d_Drawer) myHiStyle; |
42cf5bc1 |
98 | AIS_DisplayStatus myStatus; |
3db69e41 |
99 | Standard_Integer myDispMode; |
42cf5bc1 |
100 | Standard_Integer myLayerIndex; |
101 | Standard_Boolean myIsHilit; |
42cf5bc1 |
102 | Standard_Boolean mySubInt; |
103 | |
42cf5bc1 |
104 | }; |
105 | |
42cf5bc1 |
106 | #endif // _AIS_GlobalStatus_HeaderFile |