Ejemplo n.º 1
0
		override public void OnPulse(Timeline timeline, double time)
		{
			ViewPosition pvp = timeline.GetMostPreviousInTime(time) as ViewPosition;
			ViewPosition nvp = timeline.GetNextInTime(time) as ViewPosition;

			if (pvp != null && nvp != null)
			{
				double alpha = ScriptPlayer.ComputeAlpha(time - pvp.Time, pvp, nvp);
				double span = (nvp.Longitude - pvp.Longitude) % 360;
				if (span >= 180)
					span -= 360;
				else if (span < -180)
					span += 360;

				double lon = pvp.Longitude + alpha * span;
				double lat = pvp.Latitude + alpha * (nvp.Latitude - pvp.Latitude);
				double ele = pvp.Elevation + alpha * (nvp.Elevation - pvp.Elevation);

				this.globe.SetViewPosition(lat, lon, ele);
			}
			else if (pvp != null)
			{
				this.globe.SetViewPosition(pvp.Latitude, pvp.Longitude, pvp.Elevation);
			}
		}
Ejemplo n.º 2
0
		override public void OnPulse(Timeline timeline, double time)
		{
			WmsImage wi = timeline.GetMostPreviousInTime(time) as WmsImage;
			if (wi == null)
				return;

			this.globe.SetWmsImage(wi.Descriptor, null, 0);
		}
Ejemplo n.º 3
0
		override public void OnPulse(Timeline timeline, double time)
		{
			ToggleBase toggle = timeline.GetMostPreviousInTime(time) as ToggleBase;
			if (toggle != null)
			{
				this.DoPulse(toggle.ToggleValue);
			}
		}
Ejemplo n.º 4
0
		internal void SetTimelineHandler(Object key, Timeline.Handler handler)
		{
			Timeline t = (Timeline)this.timelines[key];
			if (t != null)
			{
				t.TimelineHandler = handler;
			}
		}
Ejemplo n.º 5
0
		override public void OnPulse(Timeline timeline, double time)
		{
			DisplayMessages dms = timeline.GetMostPreviousInTime(time) as DisplayMessages;
			if (dms == null)
				return;

			this.globe.SetDisplayMessages(dms.Messages);
		}
Ejemplo n.º 6
0
		override public void OnPulse(Timeline timeline, double time)
		{
			Layers prev = timeline.GetMostPreviousInTime(time) as Layers;
			if (prev != null)
			{
//				System.Console.Write(time + " : ");
				this.globe.SetLayers(prev.LayerList);
			}
		}
Ejemplo n.º 7
0
		override public void OnPulse(Timeline timeline, double time)
		{
			ViewDirection pvd = timeline.GetMostPreviousInTime(time) as ViewDirection;
			ViewDirection nvd = timeline.GetNextInTime(time) as ViewDirection;

			if (pvd != null)
			{
				if (pvd.SpecForm.Equals("angles"))
					this.playFromAngles(timeline, time, pvd, nvd);
				else if (pvd.SpecForm.Equals("position"))
					this.playFromPosition(timeline, time, pvd, nvd);
			}

		}
Ejemplo n.º 8
0
		private void playFromAngles(Timeline timeline, double time,
			ViewDirection pvd, ViewDirection nvd)
		{
			if (pvd != null && nvd != null && pvd.SpecForm.Equals(nvd.SpecForm))
			{
				double alpha = ScriptPlayer.ComputeAlpha(time - pvd.Time, pvd, nvd);
				double hSpan = nvd.HorizontalAngle - pvd.HorizontalAngle;
				double vSpan = nvd.VerticalAngle - pvd.VerticalAngle;

				double horizontal = pvd.HorizontalAngle + alpha * hSpan;
				double vertical = pvd.VerticalAngle + alpha * vSpan;

				this.globe.SetViewDirection(pvd.SpecForm, horizontal, vertical, 0);
			}
			else if (pvd != null)
			{
				this.globe.SetViewDirection(pvd.SpecForm, pvd.HorizontalAngle,
					pvd.VerticalAngle, 0);
			}
		}
		override public void OnPulse(Timeline timeline, double time)
		{
			VerticalExaggeration pve =
				timeline.GetMostPreviousInTime(time) as VerticalExaggeration;
			VerticalExaggeration nve =
				timeline.GetNextInTime(time) as VerticalExaggeration;

			if (pve != null && nve != null)
			{
				double alpha = ScriptPlayer.ComputeAlpha(time - pve.Time, pve, nve);
				double span = nve.Exaggeration - pve.Exaggeration;
				double ve = pve.Exaggeration + alpha * span;

				this.globe.SetVerticalExaggeration(ve);
			}
			else if (pve != null)
			{
				this.globe.SetVerticalExaggeration(pve.Exaggeration);
			}
		}	
Ejemplo n.º 10
0
		private void playFromPosition(Timeline timeline, double time,
			ViewDirection pvd, ViewDirection nvd)
		{
			if (pvd != null && nvd != null)
			{
				double alpha = ScriptPlayer.ComputeAlpha(time - pvd.Time, pvd, nvd);
				double span = (nvd.Longitude - pvd.Longitude) % 360;
				if (span >= 180)
					span -= 360;
				else if (span < -180)
					span += 360;

				double lon = pvd.Longitude + alpha * span;
				double lat = pvd.Latitude + alpha * (nvd.Latitude - pvd.Latitude);
				double ele = pvd.Elevation + alpha * (nvd.Elevation - pvd.Elevation);

				this.globe.SetViewDirection(pvd.SpecForm, lat, lon, ele);
			}
			else if (pvd != null)
			{
				this.globe.SetViewDirection(pvd.SpecForm, pvd.Latitude,
					pvd.Longitude, pvd.Elevation);
			}		
		}
Ejemplo n.º 11
0
		abstract public void OnPulse(Timeline timeline, double time);
Ejemplo n.º 12
0
		private Timeline createTimeline(Object key)
		{
			Timeline timeline = new Timeline();
			this.timelines.Add(key, timeline);
			return timeline;
		}
Ejemplo n.º 13
0
 public void DeleteSelectedCaption()
 {
     Timeline.DeleteSelectedCaption();
 }