File indexing completed on 2026-09-26 09:03:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Graphic3d_MutableIndexBuffer_HeaderFile
0015 #define _Graphic3d_MutableIndexBuffer_HeaderFile
0016
0017 #include <Graphic3d_IndexBuffer.hxx>
0018
0019
0020 class Graphic3d_MutableIndexBuffer : public Graphic3d_IndexBuffer
0021 {
0022 DEFINE_STANDARD_RTTIEXT(Graphic3d_MutableIndexBuffer, Graphic3d_IndexBuffer)
0023 public:
0024
0025 Graphic3d_MutableIndexBuffer(const occ::handle<NCollection_BaseAllocator>& theAlloc)
0026 : Graphic3d_IndexBuffer(theAlloc)
0027 {
0028 }
0029
0030
0031 bool IsMutable() const override { return true; }
0032
0033
0034 Graphic3d_BufferRange InvalidatedRange() const override { return myInvalidatedRange; }
0035
0036
0037 void Validate() override { myInvalidatedRange.Clear(); }
0038
0039
0040 void Invalidate() override { invalidate(Graphic3d_BufferRange(0, (int)mySize)); }
0041
0042
0043 void Invalidate(int theIndexLower, int theIndexUpper)
0044 {
0045 Standard_OutOfRange_Raise_if(theIndexLower > theIndexUpper,
0046 "Graphic3d_MutableIndexBuffer::Invalidate()");
0047 invalidate(
0048 Graphic3d_BufferRange(Stride * theIndexLower, Stride * (theIndexUpper - theIndexLower + 1)));
0049 }
0050
0051
0052 void invalidate(const Graphic3d_BufferRange& theRange) { myInvalidatedRange.Unite(theRange); }
0053
0054 protected:
0055 Graphic3d_BufferRange myInvalidatedRange;
0056 };
0057
0058 #endif