Search in sources :

Example 1 with Vector

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;
}
Also used : Vector(maspack.matrix.Vector)

Example 2 with Vector

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;
    }
}
Also used : VectorNd(maspack.matrix.VectorNd) Vector(maspack.matrix.Vector)

Example 3 with Vector

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;
    }
}
Also used : VectorNd(maspack.matrix.VectorNd) Vector(maspack.matrix.Vector)

Aggregations

Vector (maspack.matrix.Vector)3 VectorNd (maspack.matrix.VectorNd)2