using LensSimulatorCore.Shapes;
namespace LensSimulatorCore.Optical;
public abstract class Surface
{
protected Surface(Element parent)
{
Parent = parent;
}
public bool IsFront { get; set; }
protected int SideSign { get; set; }
//This is the sign for front or rear. 1 if it is the front, -1 if it is the rear.
protected double QuadraticSign;
///
/// Parent Element of the Surface.
///
public Element Parent { get; set; }
///
/// All points go clockwise from the element centre.
///
public List PolyLine { get; } = new();
///
/// This function calculates the lines and points through a reflective element and applies this to the Ray given the glass properties.
///
/// This defines if it is the front or rear surface, -1 if it is the front, 1 if it is the rear.
/// The Ray that will contain the results
public virtual void Calculate(int sign, Ray ray) { }
///
/// This function calculates the lines and points through a refractive element and applies this to the Ray given the glass properties.
///
///
/// This is the Ray that will contain the results
/// Sellmeier Coefficients
public virtual void Calculate(Point hitPosition, Ray ray, SellmeierCoefficients sellmeierCoefficients) { }
//Functions
public abstract Point FindIntersection(PointVector pointVector);
public abstract void UpdateSurfacePositions();
public abstract void GeneratePolyLine();
}