package nxm.sys.test;

import nxm.sys.lib.Position;
import nxm.sys.lib.Vehicle;
import nxm.sys.libg.LayerVehicle;

/** Utility methods required for testing LayerVehicle. This class exists only for use by the
    tests for LayerVehicle, and may be changed or removed without notice.

    @author  J. Czechowski IV
 */
public class test_plot_layervehicle {

  /** default constructor */
  public test_plot_layervehicle () {}

  /** Sets a sample footprint shaped like a triangle for a given vehicle.

     @param veh The vehicle object to be used
     @param name The pointing position
   */
  public static void setSampleFootprint (Vehicle veh, String name) {
    double[][] fp = { { -45,-40,0,  -50,-50,0,  -40,-50,0,  -45,-40,0 } };
    veh.getPointingPos(name).setFootprint(fp);
  }

  /** Overrides POSP within the layer draws. This class exists only for use by the
      tests for LayerVehicle, and may be changed or removed without notice.
   */
  public static class LayerVehicleFixedPosp extends LayerVehicle {
    private Position fixedPosp;

    /** LayerVehicleFixedPosp default constructor */
    public LayerVehicleFixedPosp () {
      super("VEHICLEFIXEDPOSP");
    }

    protected void drawVehicle (Vehicle vehicle) {
      drawVehicle(vehicle, fixedPosp, cangle, crange, Double.NaN);
    }

    /** Set the fixed pointing position
     *  @param alt fixed position pointer altitude
     *  @param lat fixed pointing pointer latitude
     *  @param lon fixed pointing pointer longitude
     */
    public void setFixedPosp (double alt, double lat, double lon) {
      fixedPosp = Position.fromGeo(alt, lat, lon);
    }

    /** Get the fixed position pointer
     *  @return the fixed position pointer
     */
    public Position getFixedPosp () {
      return fixedPosp;
    }
  }
}