private class TriangleMesh.Listener<T extends ObservableArray<T>> extends java.lang.Object implements ArrayChangeListener<T>, FloatArraySyncer, IntegerArraySyncer
Modifier and Type | Field and Description |
---|---|
protected T |
array |
protected boolean |
dirty |
protected boolean |
dirtyInFull
Array was replaced
|
protected int |
dirtyRangeFrom |
protected int |
dirtyRangeLength |
Modifier and Type | Method and Description |
---|---|
protected void |
addDirtyRange(int from,
int length)
Adds a dirty range
|
protected void |
markDirty() |
void |
onChanged(T observableArray,
boolean sizeChanged,
int from,
int to)
Called after a change has been made to an ObservableArray.
|
void |
setDirty(boolean dirty) |
float[] |
syncTo(float[] array,
int[] fromAndLengthIndices)
This method is used to sync arrays on pulses.
|
int[] |
syncTo(int[] array,
int[] fromAndLengthIndices)
This method is used to sync arrays on pulses.
|
protected final T extends ObservableArray<T> array
protected boolean dirty
protected boolean dirtyInFull
protected int dirtyRangeFrom
protected int dirtyRangeLength
public Listener(T array)
protected final void addDirtyRange(int from, int length)
from
- index of the first modified elementlength
- length of the modified rangeprotected void markDirty()
public void onChanged(T observableArray, boolean sizeChanged, int from, int to)
ArrayChangeListener
onChanged
in interface ArrayChangeListener<T extends ObservableArray<T>>
sizeChanged
- indicates size of array changedfrom
- A beginning (inclusive) of an interval related to the changeto
- An end (exclusive) of an interval related to the change.public final void setDirty(boolean dirty)
dirty
- if true, the whole collection is marked as dirty;
if false, the whole collection is marked as not-dirtypublic float[] syncTo(float[] array, int[] fromAndLengthIndices)
FloatArraySyncer
dest = source.syncTo(dest);
syncTo
in interface FloatArraySyncer
array
- previously synced arrayfromAndLengthIndices
- an int array of 2 elements that states the
start and length of elements modified.public int[] syncTo(int[] array, int[] fromAndLengthIndices)
IntegerArraySyncer
dest = source.syncTo(dest);
syncTo
in interface IntegerArraySyncer
array
- previously synced arrayfromAndLengthIndices
- an int array of 2 elements that states the
start and length of elements modified.