File indexing completed on 2025-01-18 10:03:48
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
0026 Graphic3d_MutableIndexBuffer (const Handle(NCollection_BaseAllocator)& theAlloc) : Graphic3d_IndexBuffer (theAlloc) {}
0027
0028
0029 virtual Standard_Boolean IsMutable() const Standard_OVERRIDE { return Standard_True; }
0030
0031
0032 virtual Graphic3d_BufferRange InvalidatedRange() const Standard_OVERRIDE { return myInvalidatedRange; }
0033
0034
0035 virtual void Validate() Standard_OVERRIDE { myInvalidatedRange.Clear(); }
0036
0037
0038 virtual void Invalidate() Standard_OVERRIDE
0039 {
0040 invalidate (Graphic3d_BufferRange (0, (Standard_Integer )mySize));
0041 }
0042
0043
0044 void Invalidate (Standard_Integer theIndexLower, Standard_Integer theIndexUpper)
0045 {
0046 Standard_OutOfRange_Raise_if (theIndexLower > theIndexUpper, "Graphic3d_MutableIndexBuffer::Invalidate()");
0047 invalidate (Graphic3d_BufferRange (Stride * theIndexLower, Stride * (theIndexUpper - theIndexLower + 1)));
0048 }
0049
0050
0051 void invalidate (const Graphic3d_BufferRange& theRange) { myInvalidatedRange.Unite (theRange); }
0052
0053 protected:
0054
0055 Graphic3d_BufferRange myInvalidatedRange;
0056
0057 };
0058
0059 #endif