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_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
0029 Graphic3d_WorldViewProjState()
0030 {
0031 Reset();
0032 }
0033
0034
0035
0036
0037
0038
0039 Graphic3d_WorldViewProjState (const Standard_Size theProjectionState,
0040 const Standard_Size theWorldViewState,
0041 const Standard_Transient* theCamera = NULL)
0042 {
0043 Initialize (theProjectionState, theWorldViewState, theCamera);
0044 }
0045
0046 public:
0047
0048
0049
0050 Standard_Boolean IsValid()
0051 {
0052 return myIsValid;
0053 }
0054
0055
0056 void Reset()
0057 {
0058 myIsValid = Standard_False;
0059 myCamera = NULL;
0060 myProjectionState = 0;
0061 myWorldViewState = 0;
0062 }
0063
0064
0065 void Initialize (const Standard_Size theProjectionState,
0066 const Standard_Size theWorldViewState,
0067 const Standard_Transient* theCamera = NULL)
0068 {
0069 myIsValid = Standard_True;
0070 myCamera = const_cast<Standard_Transient*> (theCamera);
0071 myProjectionState = theProjectionState;
0072 myWorldViewState = theWorldViewState;
0073 }
0074
0075
0076 void Initialize (const Standard_Transient* theCamera = NULL)
0077 {
0078 myIsValid = Standard_True;
0079 myCamera = const_cast<Standard_Transient*> (theCamera);
0080 myProjectionState = 0;
0081 myWorldViewState = 0;
0082 }
0083
0084 public:
0085
0086
0087 Standard_Size& ProjectionState()
0088 {
0089 return myProjectionState;
0090 }
0091
0092
0093 Standard_Size& WorldViewState()
0094 {
0095 return myWorldViewState;
0096 }
0097
0098 public:
0099
0100
0101
0102 Standard_Boolean IsProjectionChanged (const Graphic3d_WorldViewProjState& theState)
0103 {
0104 return myIsValid != theState.myIsValid
0105 || myCamera != theState.myCamera
0106 || myProjectionState != theState.myProjectionState;
0107 }
0108
0109
0110
0111 Standard_Boolean IsWorldViewChanged (const Graphic3d_WorldViewProjState& theState)
0112 {
0113 return myIsValid != theState.myIsValid
0114 || myCamera != theState.myCamera
0115 || myWorldViewState != theState.myWorldViewState;
0116 }
0117
0118
0119
0120 Standard_Boolean IsChanged (const Graphic3d_WorldViewProjState& theState)
0121 {
0122 return *this != theState;
0123 }
0124
0125 public:
0126
0127
0128
0129 bool operator != (const Graphic3d_WorldViewProjState& theOther) const
0130 {
0131 return !(*this == theOther);
0132 }
0133
0134
0135
0136 bool operator == (const Graphic3d_WorldViewProjState& theOther) const
0137 {
0138 return myIsValid == theOther.myIsValid
0139 && myCamera == theOther.myCamera
0140 && myProjectionState == theOther.myProjectionState
0141 && myWorldViewState == theOther.myWorldViewState;
0142 }
0143
0144
0145 void DumpJson (Standard_OStream& theOStream, Standard_Integer) const
0146 {
0147 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsValid)
0148 OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera)
0149 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myProjectionState)
0150 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myWorldViewState)
0151 }
0152
0153 private:
0154
0155 Standard_Boolean myIsValid;
0156 Standard_Transient* myCamera;
0157 Standard_Size myProjectionState;
0158 Standard_Size myWorldViewState;
0159 };
0160
0161 #endif