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 //! - Status Of Display : in the main viewer
34 //! hidden in the main viewer
36 //! - Active Selection Modes
37 //! - is the Interactive Object Current ?
39 class AIS_GlobalStatus : public Standard_Transient
41 DEFINE_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
44 Standard_EXPORT AIS_GlobalStatus();
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);
48 void SetGraphicStatus (const AIS_DisplayStatus theStatus) { myStatus = theStatus; }
50 void AddSelectionMode (const Standard_Integer theMode) { if (!IsSModeIn (theMode)) mySelModes.Append (theMode); }
52 //! Sets display mode.
53 void SetDisplayMode (const Standard_Integer theMode) { myDispMode = theMode; }
55 //! Returns the display mode.
56 Standard_Integer DisplayMode() const { return myDispMode; }
58 void SetLayerIndex (const Standard_Integer theIndex) { myLayerIndex = theIndex; }
60 void SetHilightStatus (const Standard_Boolean theStatus) { myIsHilit = theStatus; }
62 //! Changes applied highlight style for a particular object
63 void SetHilightStyle (const Handle(Prs3d_Drawer)& theStyle) { myHiStyle = theStyle; }
65 //! Returns applied highlight style for a particular object
66 const Handle(Prs3d_Drawer)& HilightStyle() const { return myHiStyle; }
68 Standard_Boolean IsSubIntensityOn() const { return mySubInt; }
70 void SubIntensityOn() { mySubInt = Standard_True; }
72 void SubIntensityOff() { mySubInt = Standard_False; }
74 Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
76 Standard_EXPORT void ClearSelectionModes();
78 AIS_DisplayStatus GraphicStatus() const { return myStatus; }
80 //! keeps the active selection modes of the object
81 //! in the main viewer.
82 const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
84 Standard_Boolean IsHilighted() const { return myIsHilit; }
86 Standard_EXPORT Standard_Boolean IsSModeIn (const Standard_Integer aMode) const;
88 //! Returns layer index.
89 Standard_Integer GetLayerIndex() const
96 TColStd_ListOfInteger mySelModes;
97 Handle(Prs3d_Drawer) myHiStyle;
98 AIS_DisplayStatus myStatus;
99 Standard_Integer myDispMode;
100 Standard_Integer myLayerIndex;
101 Standard_Boolean myIsHilit;
102 Standard_Boolean mySubInt;
106 #endif // _AIS_GlobalStatus_HeaderFile