Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:54

0001 // Created on: 1997-01-24
0002 // Created by: Robert COUBLANC
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AIS_GlobalStatus_HeaderFile
0018 #define _AIS_GlobalStatus_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Prs3d_Drawer.hxx>
0023 #include <TColStd_ListOfInteger.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Transient.hxx>
0026 
0027 DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, Standard_Transient)
0028 
0029 //! Stores information about objects in graphic context:
0030 class AIS_GlobalStatus : public Standard_Transient
0031 {
0032   DEFINE_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
0033 public:
0034 
0035   //! Default constructor.
0036   Standard_EXPORT AIS_GlobalStatus();
0037 
0038   //! Returns the display mode.
0039   Standard_Integer DisplayMode() const { return myDispMode; }
0040 
0041   //! Sets display mode.
0042   void SetDisplayMode (const Standard_Integer theMode) { myDispMode = theMode; }
0043 
0044   //! Returns TRUE if object is highlighted
0045   Standard_Boolean IsHilighted() const { return myIsHilit; }
0046 
0047   //! Sets highlighted state.
0048   void SetHilightStatus (const Standard_Boolean theStatus) { myIsHilit = theStatus; }
0049 
0050   //! Changes applied highlight style for a particular object
0051   void SetHilightStyle (const Handle(Prs3d_Drawer)& theStyle) { myHiStyle = theStyle; }
0052 
0053   //! Returns applied highlight style for a particular object
0054   const Handle(Prs3d_Drawer)& HilightStyle() const { return myHiStyle; }
0055 
0056   //! Returns active selection modes of the object.
0057   const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
0058 
0059   //! Return TRUE if selection mode was registered.
0060   Standard_Boolean IsSModeIn (Standard_Integer theMode) const
0061   {
0062     return mySelModes.Contains (theMode);
0063   }
0064 
0065   //! Add selection mode.
0066   Standard_Boolean AddSelectionMode (const Standard_Integer theMode)
0067   {
0068     if (!mySelModes.Contains (theMode))
0069     {
0070       mySelModes.Append (theMode);
0071       return Standard_True;
0072     }
0073     return Standard_False;
0074   }
0075 
0076   //! Remove selection mode.
0077   Standard_Boolean RemoveSelectionMode (const Standard_Integer theMode)
0078   {
0079     return mySelModes.Remove (theMode);
0080   }
0081 
0082   //! Remove all selection modes.
0083   void ClearSelectionModes()
0084   {
0085     mySelModes.Clear();
0086   }
0087 
0088   Standard_Boolean IsSubIntensityOn() const { return mySubInt; }
0089 
0090   void SetSubIntensity (Standard_Boolean theIsOn) { mySubInt = theIsOn; }
0091 
0092 private:
0093 
0094   TColStd_ListOfInteger mySelModes;
0095   Handle(Prs3d_Drawer) myHiStyle;
0096   Standard_Integer myDispMode;
0097   Standard_Boolean myIsHilit;
0098   Standard_Boolean mySubInt;
0099 
0100 };
0101 
0102 #endif // _AIS_GlobalStatus_HeaderFile