File indexing completed on 2026-05-04 08:45:30
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 Graphic3d_ViewAffinity() { SetVisible(Standard_True); }
0029
0030
0031 bool IsVisible(const Standard_Integer theViewId) const
0032 {
0033 const unsigned int aBit = 1 << theViewId;
0034 return (myMask & aBit) != 0;
0035 }
0036
0037
0038 void SetVisible(const Standard_Boolean theIsVisible)
0039 {
0040 ::memset(&myMask, theIsVisible ? 0xFF : 0x00, sizeof(myMask));
0041 }
0042
0043
0044 void SetVisible(const Standard_Integer theViewId, const bool theIsVisible)
0045 {
0046 const unsigned int aBit = 1 << theViewId;
0047 if (theIsVisible)
0048 {
0049 myMask |= aBit;
0050 }
0051 else
0052 {
0053 myMask &= ~aBit;
0054 }
0055 }
0056
0057
0058 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0059
0060 private:
0061 unsigned int myMask;
0062
0063 public:
0064 DEFINE_STANDARD_RTTIEXT(Graphic3d_ViewAffinity, Standard_Transient)
0065 };
0066
0067 DEFINE_STANDARD_HANDLE(Graphic3d_ViewAffinity, Standard_Transient)
0068
0069 #endif