File indexing completed on 2025-01-18 10:04:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef OpenGl_ClippingIterator_Header
0015 #define OpenGl_ClippingIterator_Header
0016
0017 #include <OpenGl_Clipping.hxx>
0018
0019
0020 class OpenGl_ClippingIterator
0021 {
0022 public:
0023
0024
0025 OpenGl_ClippingIterator(const OpenGl_Clipping& theClipping)
0026 : myDisabled (&theClipping.myDisabledPlanes),
0027 myCurrIndex (1)
0028 {
0029 myIter1.Init (theClipping.myPlanesGlobal);
0030 myIter2.Init (theClipping.myPlanesLocal);
0031 }
0032
0033
0034 bool More() const { return myIter1.More() || myIter2.More(); }
0035
0036
0037 void Next()
0038 {
0039 ++myCurrIndex;
0040 if (myIter1.More())
0041 {
0042 myIter1.Next();
0043 }
0044 else
0045 {
0046 myIter2.Next();
0047 }
0048 }
0049
0050
0051
0052 bool IsDisabled() const { return myDisabled->Value (myCurrIndex) || !Value()->IsOn(); }
0053
0054
0055 const Handle(Graphic3d_ClipPlane)& Value() const
0056 {
0057 return myIter1.More()
0058 ? myIter1.Value()
0059 : myIter2.Value();
0060 }
0061
0062
0063 bool IsGlobal() const { return myIter1.More(); }
0064
0065
0066 Standard_Integer PlaneIndex() const { return myCurrIndex; }
0067
0068 private:
0069
0070 Graphic3d_SequenceOfHClipPlane::Iterator myIter1;
0071 Graphic3d_SequenceOfHClipPlane::Iterator myIter2;
0072 const NCollection_Vector<Standard_Boolean>* myDisabled;
0073 Standard_Integer myCurrIndex;
0074
0075 };
0076
0077 #endif