diff --git a/src/main/java/org/orekit/rugged/los/FixedRotation.java b/src/main/java/org/orekit/rugged/los/FixedRotation.java index 5b416136738f83367c583ab4ad13fdb16e1f724f..0305aefcf6b6f6cdc5e6f403bfdc8682c2387bef 100644 --- a/src/main/java/org/orekit/rugged/los/FixedRotation.java +++ b/src/main/java/org/orekit/rugged/los/FixedRotation.java @@ -26,8 +26,10 @@ import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.rugged.utils.DerivativeGenerator; +import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; +import org.orekit.utils.TimeSpanMap; /** {@link TimeIndependentLOSTransform LOS transform} based on a fixed rotation. * @author Luc Maisonobe @@ -71,7 +73,14 @@ public class FixedRotation implements TimeIndependentLOSTransform { this.angleDriver = new ParameterDriver(name, angle, SCALE, -2 * FastMath.PI, 2 * FastMath.PI); angleDriver.addObserver(new ParameterObserver() { @Override - public void valueChanged(final double previousValue, final ParameterDriver driver) { + public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) { + // reset rotations to null, they will be evaluated lazily if needed + rotation = null; + rDS = null; + } + + @Override + public void valueSpanMapChanged​(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) { // reset rotations to null, they will be evaluated lazily if needed rotation = null; rDS = null; diff --git a/src/main/java/org/orekit/rugged/los/FixedZHomothety.java b/src/main/java/org/orekit/rugged/los/FixedZHomothety.java index f1f5c33b644addde78b9e5e11813317f2dbfbb67..a171e873835bbde99d4a09ba917ac75d3789a424 100644 --- a/src/main/java/org/orekit/rugged/los/FixedZHomothety.java +++ b/src/main/java/org/orekit/rugged/los/FixedZHomothety.java @@ -23,8 +23,10 @@ import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.rugged.utils.DerivativeGenerator; +import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; +import org.orekit.utils.TimeSpanMap; /** {@link TimeIndependentLOSTransform LOS transform} based on a homothety along the Z axis. * @author Lucie Labatallee @@ -65,7 +67,14 @@ public class FixedZHomothety implements TimeIndependentLOSTransform { this.factorDriver = new ParameterDriver(name, factorvalue, SCALE, 0, Double.POSITIVE_INFINITY); factorDriver.addObserver(new ParameterObserver() { @Override - public void valueChanged(final double previousValue, final ParameterDriver driver) { + public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) { + // reset factor to zero, they will be evaluated lazily if needed + factor = 0.0; + factorDS = null; + } + + @Override + public void valueSpanMapChanged​(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) { // reset factor to zero, they will be evaluated lazily if needed factor = 0.0; factorDS = null; diff --git a/src/main/java/org/orekit/rugged/los/LOSBuilder.java b/src/main/java/org/orekit/rugged/los/LOSBuilder.java index 3bc88855a3279cc0b235ea0c414d2e9c41a8fe3e..583bc60a1ebabfaa8a2114df255c3ad731abccec 100644 --- a/src/main/java/org/orekit/rugged/los/LOSBuilder.java +++ b/src/main/java/org/orekit/rugged/los/LOSBuilder.java @@ -28,6 +28,7 @@ import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; +import org.orekit.utils.TimeSpanMap; /** Builder for lines-of-sight list. * <p> @@ -226,7 +227,13 @@ public class LOSBuilder { final ParameterObserver resettingObserver = new ParameterObserver() { /** {@inheritDoc} */ @Override - public void valueChanged(final double previousValue, final ParameterDriver driver) { + public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) { + Arrays.fill(transformed, null); + } + + /** {@inheritDoc} */ + @Override + public void valueSpanMapChanged​(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) { Arrays.fill(transformed, null); } }; diff --git a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java index 63e3082aa271ae64ccb6d99ef31af809043dd355..79e1e99a220a88d7ea3d2da84dab506134369e0d 100644 --- a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java +++ b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java @@ -32,6 +32,7 @@ import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; +import org.orekit.utils.TimeSpanMap; /** {@link LOSTransform LOS transform} based on a rotation with polynomial angle. * @author Luc Maisonobe @@ -87,7 +88,15 @@ public class PolynomialRotation implements LOSTransform { this.coefficientsDrivers = new ParameterDriver[angleCoeffs.length]; final ParameterObserver resettingObserver = new ParameterObserver() { @Override - public void valueChanged(final double previousValue, final ParameterDriver driver) { + public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) { + // reset rotations to null, they will be evaluated lazily if needed + angle = null; + axisDS = null; + angleDS = null; + } + + @Override + public void valueSpanMapChanged​(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) { // reset rotations to null, they will be evaluated lazily if needed angle = null; axisDS = null;