public class VecBufferSequence extends CompoundVecBuffer
append(VecBuffer)
.
This copies the specified VecBuffer's data to the VecBuffer backing the VecBufferSequence, and expands the backing
VecBuffer if necessary.CompoundVecBuffer.CompoundIterator<T>, CompoundVecBuffer.CoordIterable, CompoundVecBuffer.EmptyCompoundVecBuffer, CompoundVecBuffer.LocationIterable, CompoundVecBuffer.PositionIterable, CompoundVecBuffer.ReverseCompoundIterator<T>, CompoundVecBuffer.SubBufferIterable<T>, CompoundVecBuffer.VectorIterable
Modifier and Type | Field and Description |
---|---|
protected VecBuffer |
buffer |
protected int |
vecCount |
ALLOCATE_DIRECT_BUFFERS, capacity, count, DEFAULT_INITIAL_CAPACITY, lengths, offsets
Modifier | Constructor and Description |
---|---|
|
VecBufferSequence(VecBuffer buffer)
Constructs a PackedCompoundVecBuffer with the specified backing VecBuffer and the default initial capacity.
|
|
VecBufferSequence(VecBuffer buffer,
int capacity)
Constructs a PackedCompoundVecBuffer with the specified backing VecBuffer and the specified initial capacity.
|
protected |
VecBufferSequence(VecBufferSequence that,
int[] indices,
int offset,
int length) |
protected |
VecBufferSequence(VecBufferSequence that,
int beginIndex,
int endIndex) |
Modifier and Type | Method and Description |
---|---|
int |
append(VecBuffer buffer)
Appends the contents of the specified sub-buffer to the end of this PackedCompoundVecBuffer, incrementing the
number of sub-buffers by one.
|
void |
bindAsNormalBuffer(DrawContext dc)
Binds this buffer as the source of normal coordinates to use when rendering OpenGL primitives.
|
void |
bindAsTexCoordBuffer(DrawContext dc)
Binds this buffer as the source of texture coordinates to use when rendering OpenGL primitives.
|
void |
bindAsVertexBuffer(DrawContext dc)
Binds this buffer as the source of vertex coordinates to use when rendering OpenGL primitives.
|
void |
clear()
Sets the number sub-buffers to zero.
|
protected CompoundVecBuffer |
createSlice(int[] indices,
int offset,
int length) |
protected CompoundVecBuffer |
createSlice(int beginIndex,
int endIndex) |
protected VecBuffer |
createSubBuffer(int offset,
int length) |
void |
drawArrays(DrawContext dc,
int drawMode)
Renders
getTotalBufferSize() elements from the currently bounds OpenGL coordinate buffers, beginning
with element 0. |
static VecBufferSequence |
emptyVecBufferSequence(int coordsPerVec)
Returns an empty VecBufferSequence.
|
protected void |
expandBufferCapacity(int minCapacity) |
int |
getCoordsPerVec()
Returns the number of coordinates per logical vector element.
|
VecBuffer |
getVecBuffer()
Returns the VecBuffer that stores this PackedCompoundVecBuffer's sub-buffers.
|
protected boolean |
haveMultiDrawArrays(DrawContext dc) |
void |
multiDrawArrays(DrawContext dc,
int drawMode)
Renders elements from the currently bounds OpenGL coordinate buffers.
|
int |
subBufferSize(int index)
Returns the size in logical vectors of the VecBuffer with the specified index.
|
addSubBuffer, emptyCompoundVecBuffer, expandCapacity, getCoords, getCoords, getLocations, getPositions, getReverseCoords, getReverseLocations, getReversePositions, getReverseVectors, getVectors, size, slice, slice, slice, subBuffer
protected VecBuffer buffer
protected int vecCount
public VecBufferSequence(VecBuffer buffer)
buffer
- the backing VecBuffer.java.lang.IllegalArgumentException
- if the buffer is null.public VecBufferSequence(VecBuffer buffer, int capacity)
buffer
- the backing VecBuffer.capacity
- the PackedCompoundVecBuffer's initial capacity, in number of sub-buffers.java.lang.IllegalArgumentException
- if the buffer is null, or if the capacity is less than 1.protected VecBufferSequence(VecBufferSequence that, int[] indices, int offset, int length)
protected VecBufferSequence(VecBufferSequence that, int beginIndex, int endIndex)
public int append(VecBuffer buffer)
buffer
- the sub-buffer to append.java.lang.IllegalArgumentException
- if the subBuffer is null.public void bindAsNormalBuffer(DrawContext dc)
Buffer
. This buffer's vector size must be 3.dc
- the current DrawContext
.java.lang.IllegalArgumentException
- if the DrawContext is null, or if this buffer is not compatible as a normal
buffer.public void bindAsTexCoordBuffer(DrawContext dc)
dc
- the current DrawContext.java.lang.IllegalArgumentException
- if the DrawContext is null, or if this buffer is not compatible as a normal
buffer.public void bindAsVertexBuffer(DrawContext dc)
dc
- the current DrawContext.java.lang.IllegalArgumentException
- if the DrawContext is null, or if this buffer is not compatible as a vertex
buffer.public void clear()
clear
in class CompoundVecBuffer
protected CompoundVecBuffer createSlice(int[] indices, int offset, int length)
createSlice
in class CompoundVecBuffer
protected CompoundVecBuffer createSlice(int beginIndex, int endIndex)
createSlice
in class CompoundVecBuffer
protected VecBuffer createSubBuffer(int offset, int length)
createSubBuffer
in class CompoundVecBuffer
public void drawArrays(DrawContext dc, int drawMode)
getTotalBufferSize()
elements from the currently bounds OpenGL coordinate buffers, beginning
with element 0. The specified drawMode indicates which type of OpenGL primitives to render.dc
- the current DrawContext.drawMode
- the type of OpenGL primtives to render.java.lang.IllegalArgumentException
- if the DrawContext is null.public static VecBufferSequence emptyVecBufferSequence(int coordsPerVec)
coordsPerVec
- the number of coordinates per logical vector.protected void expandBufferCapacity(int minCapacity)
public int getCoordsPerVec()
getCoordsPerVec
in class CompoundVecBuffer
public VecBuffer getVecBuffer()
protected boolean haveMultiDrawArrays(DrawContext dc)
public void multiDrawArrays(DrawContext dc, int drawMode)
drawArrays(gov.nasa.worldwind.render.DrawContext, int)
, except that each sub-buffer is rendered independently.
The specified drawMode indicates which type of OpenGL primitives to render.dc
- the current DrawContext.drawMode
- the type of OpenGL primtives to render.java.lang.IllegalArgumentException
- if the DrawContext is null.public int subBufferSize(int index)
subBufferSize
in class CompoundVecBuffer
index
- the index for the VecBuffer who's size is returned.