public void SampleLrtf()
        {
            ComplexLens             lens = ComplexLens.CreateDoubleGaussLens(Materials.Fixed.AIR, 4.0);
            LensRayTransferFunction lrtf = new LensRayTransferFunction(lens);
            var defaultParameters        = new LensRayTransferFunction.Parameters(0.5, 0.5, 1.0, 0.5);
            var table = lrtf.SampleLrtf1D(defaultParameters,
                                          LensRayTransferFunction.VariableParameter.DirectionTheta, 101);

            //int i = 0;
            //foreach (LensRayTransferFunction.Parameters rayParams in table)
            //{
            //    Console.WriteLine("[{0}]: {1}", i, rayParams);
            //    if (rayParams != null)
            //    {
            //        //Console.WriteLine("  {0}", lens.ConvertParametersToFrontSurfaceRay(rayParams));
            //    }
            //    i++;
            //}
            Console.WriteLine("{{ {0} }}", string.Join(",\n", table.Select((item) => (item != null) ? item.ToString() : "Null").ToArray()));
        }
Exemplo n.º 2
0
        private void Recompute()
        {
            if (!initialized)
            {
                return;
            }

            double positionTheta  = (double)positionThetaNumeric.Value;
            double positionPhi    = (double)positionPhiNumeric.Value;
            double directionTheta = (double)directionThetaNumeric.Value;
            double directionPhi   = (double)directionPhiNumeric.Value;
            var    inputRay       = new LensRayTransferFunction.Parameters(
                positionTheta, positionPhi, directionTheta, directionPhi);

            var variableParam = (LensRayTransferFunction.VariableParameter)
                                variableParameterComboBox.SelectedValue;

            outgoingRays = lrtf.SampleLrtf1D(inputRay, variableParam, sampleCount);

            InvalidatePanels();
        }