Class TLcdEarthObjectMappedIndexedVertexArray
java.lang.Object
com.luciad.earth.tileset.datatype.TLcdEarthVertexArray
com.luciad.earth.tileset.datatype.TLcdEarthIndexedVertexArray
com.luciad.earth.tileset.datatype.TLcdEarthObjectMappedIndexedVertexArray
- All Implemented Interfaces:
ILcdBounded
An indexed vertex array that has an object mapped to each element of the
vertex array. If a vertex array contains the visual representation of more
than one domain object, for instance, then this class can be used to map
parts of the vertex array back to their originating domain object. This in
turn makes it possible to visualize this vertex array in parts rather than
as a whole, and to apply different styling to different parts of the array.
- Since:
- 9.1
-
Field Summary
Fields inherited from class com.luciad.earth.tileset.datatype.TLcdEarthVertexArray
GL_C3F_V3F, GL_C4F_N3F_V3F, GL_LINE_LOOP, GL_LINE_STRIP, GL_LINES, GL_N3F_V3F, GL_POINTS, GL_POLYGON, GL_QUAD_STRIP, GL_QUADS, GL_T2F_C3F_V3F, GL_T2F_C4F_N3F_V3F, GL_T2F_N3F_V3F, GL_T2F_V3F, GL_T4F_C4F_N3F_V4F, GL_T4F_V4F, GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, GL_TRIANGLES, GL_V2F, GL_V3F
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdEarthObjectMappedIndexedVertexArray
. -
Method Summary
Modifier and TypeMethodDescriptiongetMappedObject
(int aElementIndex) Returns the object that is mapped to the element at the given index inTLcdEarthIndexedVertexArray.getIndices()
.getObject
(int aObjectIndex) Returns the object at the given index.int
Returns the total number of objects that have some data in this vertex array.int
getObjectEndOffset
(int aObjectIndex) Returns the end offset inTLcdEarthIndexedVertexArray.getIndices()
of the object at the given index.int
getObjectStartOffset
(int aObjectIndex) Returns the start offset inTLcdEarthIndexedVertexArray.getIndices()
of the object at the given index.void
setObjects
(Object[] aObjects, int[] aOffsets) Sets the list of objects whose data is in this vertex array and the offsets at which these objects can be found in the vertex array.Methods inherited from class com.luciad.earth.tileset.datatype.TLcdEarthIndexedVertexArray
getIndices, setIndices
Methods inherited from class com.luciad.earth.tileset.datatype.TLcdEarthVertexArray
getBounds, getCoordinateOrigin, getPrimitiveType, getVertexFormat, getVertices, setBounds, setCoordinateOrigin, setPrimitiveType, setVertexFormat, setVertices
-
Constructor Details
-
TLcdEarthObjectMappedIndexedVertexArray
public TLcdEarthObjectMappedIndexedVertexArray()Creates a newTLcdEarthObjectMappedIndexedVertexArray
. Object mapping information must be set before this vertex array can be used.- See Also:
-
-
Method Details
-
setObjects
Sets the list of objects whose data is in this vertex array and the offsets at which these objects can be found in the vertex array. The two arrays must have equal lengths.aOffsets[i]
should point to the start ofaObjects[i]
inTLcdEarthIndexedVertexArray.getIndices()
. The objects are assumed to be continuous inTLcdEarthIndexedVertexArray.getIndices()
, i.e. there should be no holes or unmapped indices in between objects. Hence, the number of indices corresponding to an object is implied by the offset of the next object. The last object is assumed to range from its start offset to the end ofTLcdEarthIndexedVertexArray.getIndices()
. The first object's offset is expected to be 0.All elements in
TLcdEarthIndexedVertexArray.getIndices()
must be mapped to exactly 1 object (i.e. the first/last end index should exactly be the index of the first/last element ofTLcdEarthIndexedVertexArray.getIndices()
) and the end index should always be greater than or equal to the start index.- Parameters:
aObjects
- the list of objectsaOffsets
- the list of offsets for the given objects- See Also:
-
getMappedObject
Returns the object that is mapped to the element at the given index inTLcdEarthIndexedVertexArray.getIndices()
.- Parameters:
aElementIndex
- A valid element index- Returns:
- The mapped object
-
getObjectCount
public int getObjectCount()Returns the total number of objects that have some data in this vertex array.- Returns:
- The number of mapped objects.
-
getObject
Returns the object at the given index.- Parameters:
aObjectIndex
- An index in [0,getObjectCount()
[.- Returns:
- The object at the given index.
-
getObjectStartOffset
public int getObjectStartOffset(int aObjectIndex) Returns the start offset inTLcdEarthIndexedVertexArray.getIndices()
of the object at the given index. This offset is obtained from the array supplied bysetObjects(Object[], int[])
.- Parameters:
aObjectIndex
- An index in [0,getObjectCount()
[.- Returns:
- The start offset, which points to an element of
TLcdEarthIndexedVertexArray.getIndices()
-
getObjectEndOffset
public int getObjectEndOffset(int aObjectIndex) Returns the end offset inTLcdEarthIndexedVertexArray.getIndices()
of the object at the given index. This offset is the start offset of the next object minus one, or the last element ofTLcdEarthIndexedVertexArray.getIndices()
in the case of the last object.- Parameters:
aObjectIndex
- An index in [0,getObjectCount()
[.- Returns:
- The end offset, which points to an element of
TLcdEarthIndexedVertexArray.getIndices()
-