Search in sources :

Example 1 with Interpolation

use of maspack.interpolation.Interpolation in project artisynth_core by artisynth.

the class NumericControlProbe method setDefaultValues.

protected void setDefaultValues() {
    super.setDefaultValues();
    myInterpolation = new Interpolation(defaultInterpolationOrder, defaultExtendData);
}
Also used : Interpolation(maspack.interpolation.Interpolation)

Example 2 with Interpolation

use of maspack.interpolation.Interpolation in project artisynth_core by artisynth.

the class NumericInputProbe method setDefaultValues.

protected void setDefaultValues() {
    super.setDefaultValues();
    myInterpolation = new Interpolation(defaultInterpolationOrder, defaultExtendData);
}
Also used : Interpolation(maspack.interpolation.Interpolation)

Example 3 with Interpolation

use of maspack.interpolation.Interpolation in project artisynth_core by artisynth.

the class RigidTransformInputProbe method setRigid.

/**
 * Set the rigid body associated with this probe.
 *
 * This must only be called once in the lifetime of the probe. Reseting the
 * rigid body is not supported at the moment.  Create a new
 * RigidTransformInputProbe instead.
 *
 * @param rigid rigid body for this probe
 */
public void setRigid(RigidBody rigid) {
    if (rigid != null) {
        throw new UnsupportedOperationException("A rigid body has already been set! Aborting");
    }
    myRigid = rigid;
    /*
       * setup default interpolator
       */
    myTransAndQuaternParams = new NumericList(myVectorSize);
    myInterpolation = new Interpolation(Interpolation.Order.Linear, myExtendEnd);
    myTransAndQuaternParams.setInterpolation(myInterpolation);
    myTmpVec = new VectorNd(myVectorSize);
    setStartTime(0.);
    setStopTime(0.);
    setUpdateInterval(-1);
    setActive(true);
}
Also used : Interpolation(maspack.interpolation.Interpolation) NumericList(maspack.interpolation.NumericList) VectorNd(maspack.matrix.VectorNd)

Example 4 with Interpolation

use of maspack.interpolation.Interpolation in project artisynth_core by artisynth.

the class NumericProbeBase method setDefaultValues.

protected void setDefaultValues() {
    super.setDefaultValues();
    myFormatStr = defaultFormatStr;
    myInterpolation = new Interpolation(defaultInterpolationOrder, false);
    myDefaultDisplayMin = defaultDefaultDisplayRange[0];
    myDefaultDisplayMax = defaultDefaultDisplayRange[1];
}
Also used : Interpolation(maspack.interpolation.Interpolation)

Example 5 with Interpolation

use of maspack.interpolation.Interpolation in project artisynth_core by artisynth.

the class NumericProbeBase method clone.

public Object clone() throws CloneNotSupportedException {
    NumericProbeBase probe = (NumericProbeBase) super.clone();
    probe.myNumericList = (NumericList) myNumericList.clone();
    probe.myInterpolation = new Interpolation(myInterpolation);
    if (myVariables != null) {
        // make a deep copy of the variable list
        probe.myVariables = new LinkedHashMap<String, NumericProbeVariable>();
        for (Map.Entry<String, NumericProbeVariable> entry : myVariables.entrySet()) {
            probe.myVariables.put(entry.getKey(), new NumericProbeVariable(entry.getValue()));
        }
    }
    if (myDrivers != null) {
        probe.myDrivers = new ArrayList<NumericProbeDriver>();
        for (NumericProbeDriver oldDriver : myDrivers) {
            NumericProbeDriver driver = new NumericProbeDriver();
            try {
                driver.setExpression(oldDriver.getExpression(), probe.myVariables);
            } catch (Exception e) {
                throw new InternalErrorException("Illegal driver expression '" + oldDriver.getExpression() + "': " + e.getMessage());
            }
            probe.myDrivers.add(driver);
        }
    }
    if (myPropList != null) {
        probe.myPropList = (ArrayList<Property>) myPropList.clone();
    }
    if (myConverters != null) {
        probe.myConverters = new NumericConverter[myConverters.length];
        for (int i = 0; i < myConverters.length; i++) {
            probe.myConverters[i] = new NumericConverter(myConverters[i]);
        }
    }
    // clear the displays because these are lazily allocated and
    // we don't want them reused
    probe.mySmallDisplay = null;
    probe.myDisplays = new ArrayList<NumericProbePanel>();
    // attached file should also not be brought into clone
    probe.myAttachedFileName = null;
    return probe;
}
Also used : NumericProbePanel(artisynth.core.gui.NumericProbePanel) PyString(org.python.core.PyString) IOException(java.io.IOException) Interpolation(maspack.interpolation.Interpolation) NumericConverter(maspack.properties.NumericConverter) PyStringMap(org.python.core.PyStringMap) Property(maspack.properties.Property)

Aggregations

Interpolation (maspack.interpolation.Interpolation)5 NumericProbePanel (artisynth.core.gui.NumericProbePanel)1 IOException (java.io.IOException)1 NumericList (maspack.interpolation.NumericList)1 VectorNd (maspack.matrix.VectorNd)1 NumericConverter (maspack.properties.NumericConverter)1 Property (maspack.properties.Property)1 PyString (org.python.core.PyString)1 PyStringMap (org.python.core.PyStringMap)1