File indexing completed on 2026-06-20 08:18:29
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 OpenGl_ClippingIterator(const OpenGl_Clipping& theClipping)
0025 : myDisabled(&theClipping.myDisabledPlanes),
0026 myCurrIndex(1)
0027 {
0028 myIter1.Init(theClipping.myPlanesGlobal);
0029 myIter2.Init(theClipping.myPlanesLocal);
0030 }
0031
0032
0033 bool More() const { return myIter1.More() || myIter2.More(); }
0034
0035
0036 void Next()
0037 {
0038 ++myCurrIndex;
0039 if (myIter1.More())
0040 {
0041 myIter1.Next();
0042 }
0043 else
0044 {
0045 myIter2.Next();
0046 }
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() ? myIter1.Value() : myIter2.Value();
0058 }
0059
0060
0061 bool IsGlobal() const { return myIter1.More(); }
0062
0063
0064 Standard_Integer PlaneIndex() const { return myCurrIndex; }
0065
0066 private:
0067 Graphic3d_SequenceOfHClipPlane::Iterator myIter1;
0068 Graphic3d_SequenceOfHClipPlane::Iterator myIter2;
0069 const NCollection_Vector<Standard_Boolean>* myDisabled;
0070 Standard_Integer myCurrIndex;
0071 };
0072
0073 #endif