1 // Created on: 2014-12-18
2 // Created by: Kirill Gavrilov
3 // Copyright (c) 2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _Graphic3d_ViewAffinity_HeaderFile
17 #define _Graphic3d_ViewAffinity_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Transient.hxx>
21 #include <Standard_Type.hxx>
23 //! Structure display state.
24 class Graphic3d_ViewAffinity : public Standard_Transient
28 //! Empty constructor.
29 Graphic3d_ViewAffinity()
31 SetVisible (Standard_True);
34 //! Return visibility flag.
35 bool IsVisible (const Standard_Integer theViewId) const
37 const unsigned int aBit = 1 << theViewId;
38 return (myMask & aBit) != 0;
41 //! Setup visibility flag for all views.
42 void SetVisible (const Standard_Boolean theIsVisible)
44 ::memset (&myMask, theIsVisible ? 0xFF : 0x00, sizeof(myMask));
47 //! Setup visibility flag.
48 void SetVisible (const Standard_Integer theViewId,
49 const bool theIsVisible)
51 const unsigned int aBit = 1 << theViewId;
64 unsigned int myMask; //!< affinity mask
68 DEFINE_STANDARD_RTTI(Graphic3d_ViewAffinity, Standard_Transient)
72 DEFINE_STANDARD_HANDLE(Graphic3d_ViewAffinity, Standard_Transient)
74 #endif // _Graphic3d_ViewAffinity_HeaderFile