use of maspack.matrix.Vector in project artisynth_core by artisynth.
the class VectorMultiField method valueToText.
@Override
protected String[] valueToText(Object vec) {
Vector vbase = (Vector) vec;
String[] strs = new String[myVectorSize];
for (int i = 0; i < myVectorSize; i++) {
strs[i] = myFmt.format(vbase.get(i));
}
return strs;
}
use of maspack.matrix.Vector in project artisynth_core by artisynth.
the class VariableVectorField method updateInternalValue.
protected boolean updateInternalValue(Object value) {
if (!valuesEqual(value, myValue)) {
if (value instanceof Vector) {
// make a defensive copy of the
// supplied vector
Vector vecValue = (Vector) value;
if (myResultHolder != null) {
// use the result holder as the value
// itself. Reason
// is that the result holder can be guaranteed to
// have the Vector sub-type, since it was supplied
// by the user.
myResultHolder.set(vecValue);
value = myResultHolder;
} else {
// make a defensive copy of the supplied vector
value = new VectorNd(vecValue);
}
}
myValue = value;
return true;
} else {
return false;
}
}
use of maspack.matrix.Vector in project artisynth_core by artisynth.
the class VectorMultiField method updateInternalValue.
protected boolean updateInternalValue(Object value) {
if (!valuesEqual(value, myValue)) {
if (value instanceof Vector) {
// make a defensive copy of the
// supplied vector
VectorNd vecValue = new VectorNd((Vector) value);
if (myResultHolder != null) {
for (int i = 0; i < myVectorSize; i++) {
myResultHolder.set(i, vecValue.get(i));
}
}
value = vecValue;
}
myValue = value;
return true;
} else {
return false;
}
}