File indexing completed on 2025-01-18 10:03:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _Graphic3d_ViewAffinity_HeaderFile
0017 #define _Graphic3d_ViewAffinity_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_Transient.hxx>
0021 #include <Standard_Type.hxx>
0022
0023
0024 class Graphic3d_ViewAffinity : public Standard_Transient
0025 {
0026 public:
0027
0028
0029 Graphic3d_ViewAffinity()
0030 {
0031 SetVisible (Standard_True);
0032 }
0033
0034
0035 bool IsVisible (const Standard_Integer theViewId) const
0036 {
0037 const unsigned int aBit = 1 << theViewId;
0038 return (myMask & aBit) != 0;
0039 }
0040
0041
0042 void SetVisible (const Standard_Boolean theIsVisible)
0043 {
0044 ::memset (&myMask, theIsVisible ? 0xFF : 0x00, sizeof(myMask));
0045 }
0046
0047
0048 void SetVisible (const Standard_Integer theViewId,
0049 const bool theIsVisible)
0050 {
0051 const unsigned int aBit = 1 << theViewId;
0052 if (theIsVisible)
0053 {
0054 myMask |= aBit;
0055 }
0056 else
0057 {
0058 myMask &= ~aBit;
0059 }
0060 }
0061
0062
0063 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0064
0065 private:
0066
0067 unsigned int myMask;
0068
0069 public:
0070
0071 DEFINE_STANDARD_RTTIEXT(Graphic3d_ViewAffinity,Standard_Transient)
0072
0073 };
0074
0075 DEFINE_STANDARD_HANDLE(Graphic3d_ViewAffinity, Standard_Transient)
0076
0077 #endif