1 // Copyright (c) 2013-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef OpenGl_ClippingIterator_Header
15 #define OpenGl_ClippingIterator_Header
17 #include <OpenGl_Clipping.hxx>
19 //! The iterator through clipping planes.
20 class OpenGl_ClippingIterator
25 OpenGl_ClippingIterator(const OpenGl_Clipping& theClipping)
26 : myDisabled (&theClipping.myDisabledPlanes),
29 myIter1.Init (theClipping.myPlanesGlobal);
30 myIter2.Init (theClipping.myPlanesLocal);
33 //! Return true if iterator points to the valid clipping plane.
34 bool More() const { return myIter1.More() || myIter2.More(); }
36 //! Go to the next clipping plane.
50 //! Return true if plane has been temporarily disabled either by Graphic3d_ClipPlane->IsOn() property or by temporary filter.
51 //! Beware that this method does NOT handle a Chain filter for Capping algorithm OpenGl_Clipping::CappedChain()!
52 bool IsDisabled() const { return myDisabled->Value (myCurrIndex) || !Value()->IsOn(); }
54 //! Return the plane at current iterator position.
55 const Handle(Graphic3d_ClipPlane)& Value() const
62 //! Return true if plane from the global (view) list.
63 bool IsGlobal() const { return myIter1.More(); }
65 //! Return the plane index.
66 Standard_Integer PlaneIndex() const { return myCurrIndex; }
70 Graphic3d_SequenceOfHClipPlane::Iterator myIter1;
71 Graphic3d_SequenceOfHClipPlane::Iterator myIter2;
72 const NCollection_Vector<Standard_Boolean>* myDisabled;
73 Standard_Integer myCurrIndex;
77 #endif // OpenGl_ClippingIterator_Header