public void Invoke(object sender, System.Timers.ElapsedEventArgs notUsed) { ParamTimer tmr = sender as ParamTimer; tmr.Stop(); Model3DParams mp = tmr.DictParams as Model3DParams; Delegate method = mp.Processor; Dispatcher.BeginInvoke(method, new object[] { tmr, mp }); }
public FrequentMessage Offset(double x, double y, double z, double duration, bool isParallel) { if (IsHostReady) { FrequentMessage msg = Create(hostVisual.Invoke, null, 0, isParallel); Model3DParams mp = new Model3DParams(); mp.OffsetVector = new Vector3D(x / duration * msg.Interval, y / duration * msg.Interval, z / duration * msg.Interval); mp.OriginPosition = hostVisual.OriginPosition; mp.Remains = duration; mp.Interval = msg.Interval; mp.Processor = new VoidDictInvokes(ProceedOffset); msg.Parameters = mp; return((FrequentMessage)Add(msg)); } return(null); }
public override FrequentMessage Offset(double x, double y, double z, double duration, bool isParallel) { if (IsHostReady) { FrequentMessage msg = Create(hostVisual.Invoke, null, 0, isParallel); Model3DParams mp = new Model3DParams(); mp.OffsetVector = new Vector3D(x / duration * msg.Interval, y / duration * msg.Interval, z / duration * msg.Interval); mp.OriginPosition = hostVisual.OriginPosition; mp.Remains = duration; mp.Interval = msg.Interval; mp.Processor = new VoidDictInvokes(ProceedOffset); msg.Parameters = mp; return (FrequentMessage)Add(msg); } return null; }
public FrequentMessage Rotate(double axisX, double axisY, double axisZ, double duration, bool isParallel) { if (IsHostReady) { FrequentMessage msg = Create(hostVisual.Invoke, null, 0, isParallel); Model3DParams mp = new Model3DParams(); msg.Parameters = mp; mp.StepX = axisX / duration * msg.Interval; mp.StepY = axisY / duration * msg.Interval; mp.StepZ = axisZ / duration * msg.Interval; mp.Interval = msg.Interval; mp.Remains = duration; mp.Processor = new VoidDictInvokes(ProceedRotate); return((FrequentMessage)Add(msg)); } return(null); }
public override FrequentMessage Rotate(double axisX, double axisY, double axisZ, double duration, bool isParallel) { if (IsHostReady) { FrequentMessage msg = Create(hostVisual.Invoke, null, 0, isParallel); Model3DParams mp = new Model3DParams(); msg.Parameters = mp; mp.StepX = axisX / duration * msg.Interval; mp.StepY = axisY / duration * msg.Interval; mp.StepZ = axisZ / duration * msg.Interval; mp.Interval = msg.Interval; mp.Remains = duration; mp.Processor = new VoidDictInvokes(ProceedRotate); return (FrequentMessage)Add(msg); } return null; }
protected void ProceedOffset(object sender, Model3DParams mp) { ParamTimer tmr = (ParamTimer)sender; if (IsHostReady) { double remains = mp.Remains; double interval = mp.Interval; mp.Remains = remains - interval; FrequentMessage msg = (FrequentMessage)tmr.Param; hostVisual.Transform = MatrixHelper.Offset(hostVisual.Transform, mp.OffsetVector.X, mp.OffsetVector.Y, mp.OffsetVector.Z); if (remains > interval) { tmr.Start(); } else { msg.Release(); } } }
void ProceedOffset(object sender, Model3DParams mp) { ParamTimer tmr = (ParamTimer)sender; if (IsHostReady) { double remains = mp.Remains; double interval = mp.Interval; mp.Remains = remains - interval; FrequentMessage msg = (FrequentMessage)tmr.Param; hostVisual.Transform = MatrixHelper.Offset(hostVisual.Transform, mp.OffsetVector.X, mp.OffsetVector.Y, mp.OffsetVector.Z); if (remains > interval) { tmr.Start(); } else { msg.Release(); } } }
void ProceedRotate(object sender, Model3DParams mp) { ParamTimer tmr = (ParamTimer)sender; if (IsHostReady) { double remains = mp.Remains; double interval = mp.Interval; mp.Remains = remains - interval; FrequentMessage msg = (FrequentMessage)tmr.Param; hostVisual.Transform = MatrixHelper.Rotate3D(hostVisual.Transform, mp.StepX, mp.StepY, mp.StepZ, hostVisual.OriginPosition, hostVisual.OriginUpDir, hostVisual.OriginLookDir, MatrixHelper.RotationType.LockAxisY); if (remains > interval) { tmr.Start(); } else { msg.Release(); } } }
protected void ProceedRotate(object sender, Model3DParams mp) { ParamTimer tmr = (ParamTimer)sender; if (IsHostReady) { double remains = mp.Remains; double interval = mp.Interval; mp.Remains = remains - interval; FrequentMessage msg = (FrequentMessage)tmr.Param; hostVisual.Transform = MatrixHelper.Rotate3D(hostVisual.Transform, mp.StepX, mp.StepY, mp.StepZ, hostVisual.OriginPosition, hostVisual.OriginUpDir, hostVisual.OriginLookDir, MatrixHelper.RotationType.LockAxisY); if (remains > interval) { tmr.Start(); } else { msg.Release(); } } }