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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _AIS_GlobalStatus_HeaderFile
18 #define _AIS_GlobalStatus_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <AIS_DisplayStatus.hxx>
24 #include <Prs3d_Drawer.hxx>
25 #include <TColStd_ListOfInteger.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Standard_Transient.hxx>
30 DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, Standard_Transient)
32 //! Stores information about objects in graphic context:
33 class AIS_GlobalStatus : public Standard_Transient
35 DEFINE_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
38 //! Default constructor.
39 Standard_EXPORT AIS_GlobalStatus();
41 //! Returns the display mode.
42 Standard_Integer DisplayMode() const { return myDispMode; }
44 //! Sets display mode.
45 void SetDisplayMode (const Standard_Integer theMode) { myDispMode = theMode; }
47 //! Returns TRUE if object is highlighted
48 Standard_Boolean IsHilighted() const { return myIsHilit; }
50 //! Sets highlighted state.
51 void SetHilightStatus (const Standard_Boolean theStatus) { myIsHilit = theStatus; }
53 //! Changes applied highlight style for a particular object
54 void SetHilightStyle (const Handle(Prs3d_Drawer)& theStyle) { myHiStyle = theStyle; }
56 //! Returns applied highlight style for a particular object
57 const Handle(Prs3d_Drawer)& HilightStyle() const { return myHiStyle; }
59 //! Returns active selection modes of the object.
60 const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
62 //! Return TRUE if selection mode was registered.
63 Standard_Boolean IsSModeIn (Standard_Integer theMode) const
65 return mySelModes.Contains (theMode);
68 //! Add selection mode.
69 Standard_Boolean AddSelectionMode (const Standard_Integer theMode)
71 if (!mySelModes.Contains (theMode))
73 mySelModes.Append (theMode);
76 return Standard_False;
79 //! Remove selection mode.
80 Standard_Boolean RemoveSelectionMode (const Standard_Integer theMode)
82 return mySelModes.Remove (theMode);
85 //! Remove all selection modes.
86 void ClearSelectionModes()
91 Standard_Boolean IsSubIntensityOn() const { return mySubInt; }
93 void SetSubIntensity (Standard_Boolean theIsOn) { mySubInt = theIsOn; }
97 TColStd_ListOfInteger mySelModes;
98 Handle(Prs3d_Drawer) myHiStyle;
99 Standard_Integer myDispMode;
100 Standard_Boolean myIsHilit;
101 Standard_Boolean mySubInt;
105 #endif // _AIS_GlobalStatus_HeaderFile