示例#1
0
        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 });
        }
示例#2
0
 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);
 }
示例#3
0
		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;
		}
示例#4
0
 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);
 }
示例#5
0
		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;
		}
示例#6
0
		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();
				}
			}
		}
示例#7
0
            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();
                    }
                }
            }
示例#8
0
            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();
                    }
                }
            }
示例#9
0
		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();
				}
			}
		}