Beispiel #1
0
 public void addTracesLoc(double lambda, Location loc, UniformTraceModifier utm, Object3dEnvironment env, int node, int total)
 {
     Scientrace.Line ray = new Line(loc * 0.001, utm.modify(node, total).toUnitVector());  //start at node 1 -> ++i !
     this.addTrace(new Scientrace.Trace(lambda, this, ray, env, 1, 1));
 }
Beispiel #2
0
 public void addTracesLoc(double lambda, Location loc, UniformTraceModifier utm, Object3dEnvironment env, int node, int total)
 {
     Scientrace.Line ray = new Line(loc*0.001, utm.modify(node,total).toUnitVector()); //start at node 1 -> ++i !
     this.addTrace(new Scientrace.Trace(lambda, this, ray, env, 1 ,1));
 }
Beispiel #3
0
        public TestLight(Scientrace.Object3dEnvironment env, DistributionPattern dispat, SpatialDistribution spadis, Scientrace.NonzeroVector mean_direction, double maxangle, int raycount) : base(env)
        {
            /*UniformTraceModifier utm =  new UniformTraceModifier(
             *      //DistributionPattern.ProjectedSpiralGrid,
             *      //DistributionPattern.SphericalSpiralGrid,
             *      DistributionPattern.SingleCircle,
             *      //DistributionPattern.SquareGrid,
             *
             *      //SpatialDistribution.UniformProjections,
             *      SpatialDistribution.UniformAngles,
             *      new Scientrace.NonzeroVector(1,0,0),
             *      new Scientrace.NonzeroVector(0,1,0),
             *      new Scientrace.NonzeroVector(0,0,1));*/

            UniformTraceModifier utm = new UniformTraceModifier(
                dispat, spadis,
                mean_direction);

            utm.setMaxAngle(maxangle);
            //Console.WriteLine("MAXANGLEJ: "+(maxangle*180/Math.PI));
            //Console.WriteLine("MAXANGLEK: "+(utm.maxangle*180/Math.PI));
            int arraysize = raycount;

            double[] wavelengths = new double[arraysize];
            for (int k = 0; k < arraysize; k++)
            {
                wavelengths[k] = 400E-9;
            }

            /*double[] wavelengths = new double[100]{400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
             *                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9}; */

/*		double[] wavelengths = new double[15]{400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
 *                                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
 *                                                                                      400E-9, 400E-9, 400E-9, 400E-9, 400E-9};*/

            List <Scientrace.Location> locs = this.getLocs();

            int i = 0;

            foreach (double lambda in wavelengths)
            {
                //Scientrace.Line ray = new Line(new Location(0, 0.0, 0.0), utm.modify(++i,wavelengths.Length).toUnitVector()); //start at node 1 -> ++i !
                //this.traces.Add(new Scientrace.Trace(lambda, this, ray, env, 1 ,1));
                foreach (Location aLoc in locs)
                {
                    this.addTracesLoc(lambda, aLoc, utm, env, i++, wavelengths.Length);
                }
            }
        }
Beispiel #4
0
        public TestLight(Scientrace.Object3dEnvironment env, DistributionPattern dispat, SpatialDistribution spadis, Scientrace.NonzeroVector mean_direction, double maxangle, int raycount)
            : base(env)
        {
            /*UniformTraceModifier utm =  new UniformTraceModifier(
            //DistributionPattern.ProjectedSpiralGrid,
            //DistributionPattern.SphericalSpiralGrid,
            DistributionPattern.SingleCircle,
            //DistributionPattern.SquareGrid,

            //SpatialDistribution.UniformProjections,
            SpatialDistribution.UniformAngles,
            new Scientrace.NonzeroVector(1,0,0),
            new Scientrace.NonzeroVector(0,1,0),
            new Scientrace.NonzeroVector(0,0,1));*/

            UniformTraceModifier utm =  new UniformTraceModifier(
            dispat, spadis,
            mean_direction);
            utm.setMaxAngle(maxangle);
                //Console.WriteLine("MAXANGLEJ: "+(maxangle*180/Math.PI));
                //Console.WriteLine("MAXANGLEK: "+(utm.maxangle*180/Math.PI));
            int arraysize = raycount;
            double[] wavelengths = new double[arraysize];
            for (int k=0; k<arraysize; k++) {
            wavelengths[k] = 400E-9;
            }

            /*double[] wavelengths = new double[100]{400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9}; */

            /*		double[] wavelengths = new double[15]{400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9,
                                            400E-9, 400E-9, 400E-9, 400E-9, 400E-9};*/

            List<Scientrace.Location> locs = this.getLocs();

            int i = 0;
            foreach (double lambda in wavelengths) {
            //Scientrace.Line ray = new Line(new Location(0, 0.0, 0.0), utm.modify(++i,wavelengths.Length).toUnitVector()); //start at node 1 -> ++i !
            //this.traces.Add(new Scientrace.Trace(lambda, this, ray, env, 1 ,1));
            foreach (Location aLoc in locs) {
                this.addTracesLoc(lambda, aLoc, utm, env, i++, wavelengths.Length);
                }
            }
        }