|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.CompoundVecBuffer
gov.nasa.worldwind.util.VecBufferSequence
public class VecBufferSequence
VecBufferSequence provides storage and retrieval of a sequence of logical VecBuffers in a single VecBuffer that
expands when more capacity is needed. VecBuffers added to a VecBufferSequence by calling append(VecBuffer).
This copies the specified VecBuffer's data to the VecBuffer backing the VecBufferSequence, and expands the backing
VecBuffer if necessary.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class gov.nasa.worldwind.util.CompoundVecBuffer |
|---|
CompoundVecBuffer.CompoundIterator<T>, CompoundVecBuffer.CoordIterable, CompoundVecBuffer.EmptyCompoundVecBuffer, CompoundVecBuffer.LocationIterable, CompoundVecBuffer.PositionIterable, CompoundVecBuffer.ReverseCompoundIterator<T>, CompoundVecBuffer.SubBufferIterable<T>, CompoundVecBuffer.VectorIterable |
| Field Summary | |
|---|---|
protected VecBuffer |
buffer
|
protected int |
vecCount
|
| Fields inherited from class gov.nasa.worldwind.util.CompoundVecBuffer |
|---|
ALLOCATE_DIRECT_BUFFERS, capacity, count, DEFAULT_INITIAL_CAPACITY, lengths, offsets |
| Constructor Summary | |
|---|---|
|
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)
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class gov.nasa.worldwind.util.CompoundVecBuffer |
|---|
addSubBuffer, emptyCompoundVecBuffer, expandCapacity, getCoords, getCoords, getLocations, getPositions, getReverseCoords, getReverseLocations, getReversePositions, getReverseVectors, getVectors, size, slice, slice, slice, subBuffer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected VecBuffer buffer
protected int vecCount
| Constructor Detail |
|---|
public VecBufferSequence(VecBuffer buffer)
buffer - the backing VecBuffer.
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.
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)
| Method Detail |
|---|
public int append(VecBuffer buffer)
buffer - the sub-buffer to append.
IllegalArgumentException - if the subBuffer is null.public void bindAsNormalBuffer(DrawContext dc)
Buffer. This buffer's vector size must be 3.
dc - the current DrawContext.
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.
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.
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.
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 CompoundVecBufferpublic 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.
IllegalArgumentException - if the DrawContext is null.public int subBufferSize(int index)
subBufferSize in class CompoundVecBufferindex - the index for the VecBuffer who's size is returned.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||