0029007: Visualization, AIS_InteractiveContext - the method for accessing Detected...
[occt.git] / src / AIS / AIS_LocalStatus.hxx
1 // Created on: 1997-01-20
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_LocalStatus_HeaderFile
18 #define _AIS_LocalStatus_HeaderFile
19
20 #include <Prs3d_Drawer.hxx>
21 #include <Standard_Transient.hxx>
22 #include <Standard.hxx>
23 #include <Standard_Type.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TColStd_ListOfInteger.hxx>
27
28 DEFINE_STANDARD_HANDLE(AIS_LocalStatus, Standard_Transient)
29
30 //! Stored Info about temporary objects.
31 class AIS_LocalStatus : public Standard_Transient
32 {
33   DEFINE_STANDARD_RTTIEXT(AIS_LocalStatus, Standard_Transient)
34 public:
35
36   Standard_EXPORT AIS_LocalStatus (const Standard_Boolean theIsTemporary = Standard_True,
37                                    const Standard_Boolean theIsToDecompose = Standard_False,
38                                    const Standard_Integer theDisplayMode = -1,
39                                    const Standard_Integer theSelectionMode = -1,
40                                    const Standard_Integer theHilightMode = 0,
41                                    const Standard_Boolean theIsSubIntensity = 0,
42                                    const Handle(Prs3d_Drawer)& theStyle = Handle(Prs3d_Drawer)());
43   
44     Standard_Boolean Decomposed() const;
45   
46     Standard_Boolean IsTemporary() const;
47   
48     Standard_Integer DisplayMode() const;
49   
50     const TColStd_ListOfInteger& SelectionModes() const;
51   
52   Standard_EXPORT Standard_Boolean IsActivated (const Standard_Integer aSelMode) const;
53   
54     Standard_Integer HilightMode() const;
55   
56     Standard_Boolean IsSubIntensityOn() const;
57   
58   const Handle(Prs3d_Drawer)& HilightStyle() const
59   {
60     return myHiStyle;
61   }
62   
63     void SetDecomposition (const Standard_Boolean astatus);
64   
65     void SetTemporary (const Standard_Boolean astatus);
66   
67     void SetDisplayMode (const Standard_Integer aMode);
68   
69     void SetFirstDisplay (const Standard_Boolean aStatus);
70   
71     Standard_Boolean IsFirstDisplay() const;
72   
73   Standard_EXPORT void AddSelectionMode (const Standard_Integer aMode);
74   
75   Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
76   
77   Standard_EXPORT void ClearSelectionModes();
78   
79   Standard_EXPORT Standard_Boolean IsSelModeIn (const Standard_Integer aMode) const;
80   
81     void SetHilightMode (const Standard_Integer aMode);
82   
83   void SetHilightStyle (const Handle(Prs3d_Drawer)& theStyle)
84   {
85     myHiStyle = theStyle;
86   }
87   
88     void SubIntensityOn();
89   
90     void SubIntensityOff();
91   
92     void SetPreviousState (const Handle(Standard_Transient)& aStatus);
93   
94     const Handle(Standard_Transient)& PreviousState() const;
95
96 private:
97   Standard_Boolean myDecomposition;
98   Standard_Boolean myIsTemporary;
99   Standard_Integer myDMode;
100   Standard_Boolean myFirstDisplay;
101   Standard_Integer myHMode;
102   TColStd_ListOfInteger mySModes;
103   Standard_Boolean mySubIntensity;
104   Handle(Standard_Transient) myPreviousState;
105   Handle(Prs3d_Drawer) myHiStyle;
106 };
107
108 #include <AIS_LocalStatus.lxx>
109
110 #endif // _AIS_LocalStatus_HeaderFile