File indexing completed on 2026-11-29 10:53:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _Graphic3d_WorldViewProjState_HeaderFile
0017 #define _Graphic3d_WorldViewProjState_HeaderFile
0018
0019 #include <Standard_Transient.hxx>
0020 #include <Standard_TypeDef.hxx>
0021
0022
0023
0024 class Graphic3d_WorldViewProjState
0025 {
0026 public:
0027
0028 Graphic3d_WorldViewProjState() { Reset(); }
0029
0030
0031
0032
0033
0034
0035 Graphic3d_WorldViewProjState(const size_t theProjectionState,
0036 const size_t theWorldViewState,
0037 const Standard_Transient* theCamera = nullptr)
0038 {
0039 Initialize(theProjectionState, theWorldViewState, theCamera);
0040 }
0041
0042 public:
0043
0044
0045 bool IsValid() { return myIsValid; }
0046
0047
0048 void Reset()
0049 {
0050 myIsValid = false;
0051 myCamera = nullptr;
0052 myProjectionState = 0;
0053 myWorldViewState = 0;
0054 }
0055
0056
0057 void Initialize(const size_t theProjectionState,
0058 const size_t theWorldViewState,
0059 const Standard_Transient* theCamera = nullptr)
0060 {
0061 myIsValid = true;
0062 myCamera = const_cast<Standard_Transient*>(theCamera);
0063 myProjectionState = theProjectionState;
0064 myWorldViewState = theWorldViewState;
0065 }
0066
0067
0068 void Initialize(const Standard_Transient* theCamera = nullptr)
0069 {
0070 myIsValid = true;
0071 myCamera = const_cast<Standard_Transient*>(theCamera);
0072 myProjectionState = 0;
0073 myWorldViewState = 0;
0074 }
0075
0076 public:
0077
0078 size_t& ProjectionState() { return myProjectionState; }
0079
0080
0081 size_t& WorldViewState() { return myWorldViewState; }
0082
0083 public:
0084
0085
0086 bool IsProjectionChanged(const Graphic3d_WorldViewProjState& theState)
0087 {
0088 return myIsValid != theState.myIsValid || myCamera != theState.myCamera
0089 || myProjectionState != theState.myProjectionState;
0090 }
0091
0092
0093
0094 bool IsWorldViewChanged(const Graphic3d_WorldViewProjState& theState)
0095 {
0096 return myIsValid != theState.myIsValid || myCamera != theState.myCamera
0097 || myWorldViewState != theState.myWorldViewState;
0098 }
0099
0100
0101
0102 bool IsChanged(const Graphic3d_WorldViewProjState& theState) { return *this != theState; }
0103
0104 public:
0105
0106
0107 bool operator!=(const Graphic3d_WorldViewProjState& theOther) const
0108 {
0109 return !(*this == theOther);
0110 }
0111
0112
0113
0114 bool operator==(const Graphic3d_WorldViewProjState& theOther) const
0115 {
0116 return myIsValid == theOther.myIsValid && myCamera == theOther.myCamera
0117 && myProjectionState == theOther.myProjectionState
0118 && myWorldViewState == theOther.myWorldViewState;
0119 }
0120
0121
0122 void DumpJson(Standard_OStream& theOStream, int) const
0123 {
0124 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myIsValid)
0125 OCCT_DUMP_FIELD_VALUE_POINTER(theOStream, myCamera)
0126 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myProjectionState)
0127 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myWorldViewState)
0128 }
0129
0130 private:
0131 bool myIsValid;
0132 Standard_Transient* myCamera;
0133 size_t myProjectionState;
0134 size_t myWorldViewState;
0135 };
0136
0137 #endif