Esempio n. 1
0
 /// <summary>
 /// Allows selecting new static center of view.
 /// </summary>
 /// <param name="position">World coordinates of new view center</param>
 public void SelectNewCenter(long[] position)
 {
     selectedObject = null;
     viewCenter     = position;
     windowCalculatorHelper.ChangeCenter(viewCenter);
 }
Esempio n. 2
0
 /// <summary>
 /// Redraws single object.
 /// </summary>
 /// <param name="obj">Object to be redrawn</param>
 private void RedrawObject(CelestialObject obj)
 {
     double[] position = windowCalculatorHelper.CalculateScreenPosition(obj.Position);
     Canvas.SetLeft(obj.Picture, position[0] - obj.Picture.ActualWidth / 2);
     Canvas.SetTop(obj.Picture, position[1] - obj.Picture.ActualHeight / 2);
 }
Esempio n. 3
0
 /// <summary>
 /// Allows selecting new object to be center of view.
 /// </summary>
 /// <remarks>
 /// View will follow selected object keeping it in the middle.
 /// </remarks>
 /// <param name="name">Name of object to be followed by view</param>
 public void SelectNewCenter(string name)
 {
     selectedObject = system.SelectObject(name);
 }