package ipp.imse.fusionOptics.imse;

import fusionOptics.interfaces.IsoIsoInterface;
import fusionOptics.interfaces.NullInterface;
import fusionOptics.lenses.Nikon135mmF28;
import fusionOptics.lenses.Nikon50mmF11;
import fusionOptics.lenses.SchneiderXenon25mmF095;
import fusionOptics.materials.IsotropicFixedIndexGlass;
import fusionOptics.optics.SimpleDoubleConvexLens;
import fusionOptics.surfaces.Square;
import fusionOptics.types.Medium;

public class IMSEOptics75_25_expanded_filter extends IMSEOptics {
	public IMSEOptics75_25_expanded_filter() {
		
		double filterFocalLength = 0.135;
		double effectiveFocalLength1 = 0.075;
	
		focalLength1 = 2 * filterFocalLength - effectiveFocalLength1 + 0.015 ; //this is to space the lenses (it isn't the actual focal length)
		
		focalLength2 = 0.025;

		rotateObjLens = true;
		
		imgLensPlaneToCell = 0.025; //for the 25mm

		objLensPlaneToCell = rotateObjLens ? 0.000 : 0.080; //for the 75 (50 scaled)
		
		objLens = new Nikon50mmF11(new double[]{ focalLength1 + focusAdjustObj, 0, 0 }, 0.075/0.050);
		objLensCaseRadius = ((Nikon50mmF11)objLens).getCaseRadius();
		
		imgLens = new SchneiderXenon25mmF095(new double[]{ imgLensPos(), 0, 0 });
		imgLensCaseRadius = ((SchneiderXenon25mmF095)imgLens).getCaseRadius();
				
		init();
		
		addElement(new SimpleDoubleConvexLens("Li1", 
						new double[]{ filterFocalLength, 0, 0 },
						new double[]{ 1, 0, 0 },
						0.055, new Medium(new IsotropicFixedIndexGlass(2.0)), IsoIsoInterface.ideal(), filterFocalLength, wavelength));

		removeElement(filterAtImage);
		filterAtImage = new Square("filterAtImage", 
				new double[]{ filterFocalLength + 0.010, 0, 0 },
				new double[]{ 1, 0, 0 }, new double[]{ 0, 0, 1 }, 0.140, 0.140, null, null, NullInterface.ideal());
		addElement(filterAtImage);

		addElement(new SimpleDoubleConvexLens("Li2", 
				new double[]{ filterFocalLength + 0.020, 0, 0 },
				new double[]{ 1, 0, 0 },
				0.055, new Medium(new IsotropicFixedIndexGlass(2.0)), IsoIsoInterface.ideal(), filterFocalLength, wavelength));

		removeElement(objLens);
		objLens = new SimpleDoubleConvexLens("Li3", 
				new double[]{ 2 * filterFocalLength + 0.020 - effectiveFocalLength1, 0, 0 },
				new double[]{ 1, 0, 0 },
				0.025, new Medium(new IsotropicFixedIndexGlass(2.0)), IsoIsoInterface.ideal(), -effectiveFocalLength1, wavelength);
		addElement(objLens);

		//ccd.shift(new double[]{ -0.5, 0, 0 });
	}
}
