|
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.CompoundBuffer<VecBuffer,VecBuffer>
gov.nasa.worldwind.util.CompoundVecBuffer
public class CompoundVecBuffer
An implementation of CompoundBuffer which manages a collection of VecBuffer buffers in a single
VecBuffer.
| Nested Class Summary | |
|---|---|
protected class |
CompoundVecBuffer.CompoundIterator<T>
|
protected class |
CompoundVecBuffer.CoordIterable
|
protected class |
CompoundVecBuffer.LocationIterable
|
protected class |
CompoundVecBuffer.PositionIterable
|
protected class |
CompoundVecBuffer.ReverseCompoundIterator<T>
|
protected static interface |
CompoundVecBuffer.SubBufferIterable<T>
|
protected class |
CompoundVecBuffer.VectorIterable
|
| Field Summary | |
|---|---|
protected BufferFactory |
bufferFactory
|
| Fields inherited from class gov.nasa.worldwind.util.CompoundBuffer |
|---|
buffer, DEFAULT_INITIAL_CAPACITY, numSubBuffers, size, subLengthBuffer, subPositionBuffer |
| Constructor Summary | |
|---|---|
CompoundVecBuffer(int coordsPerVec,
BufferFactory factory,
int initialCapacity,
int subBufferLength)
Constructs a CompoundVecBuffer with the specified coordsPerElem, bufferFactory, and initial capacity. |
|
CompoundVecBuffer(VecBuffer buffer,
java.nio.IntBuffer subPositionBuffer,
java.nio.IntBuffer subLengthBuffer,
int numSubBuffers,
BufferFactory factory)
Creates a CompoundBuffer with the specified backing buffer, sub-buffer starting positions, sub-buffer lengths, and number of sub-buffers. |
|
| Method Summary | |
|---|---|
protected void |
append(VecBuffer buffer)
|
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 |
drawArrays(DrawContext dc,
int drawMode)
Renders getTotalBufferSize() elements from the currently bounds OpenGL coordinate buffers, beginning
with element 0. |
static CompoundVecBuffer |
fromSubset(CompoundVecBuffer buffer,
int subBufferOffset,
int length)
Creates a CompoundVecBuffer from a subset of another CompoundVecBuffer. |
BufferFactory |
getBufferFactory()
Returns the BufferFactory which creates backing data for the internal VecBuffer. |
java.lang.Iterable<double[]> |
getCoords()
Returns an iterator over this buffer's logical vectors, as double[] coordinate arrays. |
java.lang.Iterable<double[]> |
getCoords(int minCoordsPerVec)
Returns an iterator over this buffer's logical vectors, as double[] coordinate arrays. |
int |
getCoordsPerVec()
Returns the number of coordinates per logical vector element. |
java.lang.Iterable<? extends LatLon> |
getLocations()
Returns an iterator over this buffer's logical vectors, as LatLon locations. |
java.lang.Iterable<? extends Position> |
getPositions()
Returns an iterator over this buffer's logical vectors, as geographic Positions. |
java.lang.Iterable<double[]> |
getReverseCoords(int minCoordsPerVec)
Returns a reverse iterator over this buffer's logical vectors, as double[] coordinate arrays. |
java.lang.Iterable<? extends LatLon> |
getReverseLocations()
Returns a reverse iterator over this buffer's logical vectors, as LatLon locations. |
java.lang.Iterable<? extends Position> |
getReversePositions()
Returns a reverse iterator over this buffer's logical vectors, as geographic Positions. |
java.lang.Iterable<? extends Vec4> |
getReverseVectors()
Returns a reverse iterator over this buffer's logical vectors, as Vec4 references. |
protected int |
getSize(VecBuffer buffer)
|
protected VecBuffer |
getSubBuffer(int position,
int length)
|
java.lang.Iterable<? extends Vec4> |
getVectors()
Returns an iterator over this buffer's logical vectors, as Vec4 references. |
protected boolean |
haveMultiDrawArrays(DrawContext dc)
|
void |
multiDrawArrays(DrawContext dc,
int drawMode)
Renders elements from the currently bounds OpenGL coordinate buffers. |
| Methods inherited from class gov.nasa.worldwind.util.CompoundBuffer |
|---|
appendEmptyBuffer, appendSubBuffer, clear, computeNewSize, getBackingBuffer, getNumSubBuffers, getSubBuffer, getSubLengthBuffer, getSubPositionBuffer, getTotalBufferSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected BufferFactory bufferFactory
| Constructor Detail |
|---|
public CompoundVecBuffer(int coordsPerVec,
BufferFactory factory,
int initialCapacity,
int subBufferLength)
coordsPerVec - the number of coordinates per logical vector.factory - the BufferFactory which creates backing data for the internal VecBuffer.initialCapacity - the compound buffer's initial capacity.subBufferLength - an estimate of the size of each sub-sequence.
java.lang.IllegalArgumentException - if the initialCapacity is negative, or if the factory is null.
public CompoundVecBuffer(VecBuffer buffer,
java.nio.IntBuffer subPositionBuffer,
java.nio.IntBuffer subLengthBuffer,
int numSubBuffers,
BufferFactory factory)
buffer - the backing buffer,subPositionBuffer - the sub-buffer logical starting positions.subLengthBuffer - the sub-buffer logical sizes.numSubBuffers - the number of sub-buffers.factory - the BufferFactory which creates backing data for the internal VecBuffer.
java.lang.IllegalArgumentException - if any of the buffer, subPositionBuffer, subLengthBuffer are null, if
numSubBuffers is negative.| Method Detail |
|---|
protected void append(VecBuffer buffer)
append in class CompoundBuffer<VecBuffer,VecBuffer>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 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 CompoundVecBuffer fromSubset(CompoundVecBuffer buffer,
int subBufferOffset,
int length)
buffer - the source CompoundVecBuffer.subBufferOffset - the index of the first sub-buffer to include in the subset.length - the number of sub-buffers to include in the subset.
public BufferFactory getBufferFactory()
BufferFactory which creates backing data for the internal VecBuffer.
BufferFactory which creates backing data for the internal VecBuffer.public java.lang.Iterable<double[]> getCoords()
public java.lang.Iterable<double[]> getCoords(int minCoordsPerVec)
minCoordsPerVec - the minimum number of coordinates returned in each double[] array.
public int getCoordsPerVec()
public java.lang.Iterable<? extends LatLon> getLocations()
public java.lang.Iterable<? extends Position> getPositions()
public java.lang.Iterable<double[]> getReverseCoords(int minCoordsPerVec)
minCoordsPerVec - the minimum number of coordinates returned in each double[] array.
public java.lang.Iterable<? extends LatLon> getReverseLocations()
public java.lang.Iterable<? extends Position> getReversePositions()
public java.lang.Iterable<? extends Vec4> getReverseVectors()
protected int getSize(VecBuffer buffer)
getSize in class CompoundBuffer<VecBuffer,VecBuffer>
protected VecBuffer getSubBuffer(int position,
int length)
getSubBuffer in class CompoundBuffer<VecBuffer,VecBuffer>public java.lang.Iterable<? extends Vec4> getVectors()
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.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||