public class FeatureIndexArray
extends java.lang.Object
Constructor and Description |
---|
FeatureIndexArray() |
FeatureIndexArray(int featureCap,
int vertexCap) |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(int vidx)
Adds a vertex index to the current feature (see
beginFeature(int) |
void |
beginFeature(int number)
Starts building a feature with the provided feature number
(such as face index or line index)
|
void |
chop(int fidx,
int nfeatures)
Performs an in-place
slice(int, int) , modifying this
feature array. |
void |
endFeature()
Ends building a feature
|
int |
getFeature(int idx)
Returns the feature number at the provided index
|
int |
getFeatureLength(int idx)
The number of vertex indices that define a given feature
|
int |
getFeatureOffset(int idx)
Returns the offset into the vertex index array for the start
of the ith feature
|
DynamicIntArray |
getVertexOffsets()
Vertices associated with each feature are concatenated into a single
array (see
getVertices() ). |
VertexIndexArray |
getVertices()
Concatenated list of vertex indices for all contained features.
|
int |
numFeatures() |
FeatureIndexArray |
slice(int fidx,
int nfeatures)
Returns a subset of features
|
public FeatureIndexArray()
public FeatureIndexArray(int featureCap, int vertexCap)
public void beginFeature(int number)
number
- tracked feature numberpublic void addVertex(int vidx)
beginFeature(int)
vidx
- vertex indexpublic void endFeature()
beginFeature(int)
public int numFeatures()
public FeatureIndexArray slice(int fidx, int nfeatures)
fidx
- starting feature indexnfeatures
- number of featurespublic void chop(int fidx, int nfeatures)
slice(int, int)
, modifying this
feature array.fidx
- starting feature indexnfeatures
- number of featurespublic int getFeatureOffset(int idx)
idx
- index of featurepublic int getFeature(int idx)
idx
- index of featurepublic int getFeatureLength(int idx)
idx
- feature indexpublic DynamicIntArray getVertexOffsets()
getVertices()
). This provides the offsets into
that array. The number of vertices can be obtained by taking the difference
offset.get(i+1)-offset.get(i)
. The last element in the
offset array is the total number of vertices.public VertexIndexArray getVertices()