コード例 #1
0
            /// <summary>
            /// Receiver bank constructor.
            /// </summary>
            /// <param name="Pt">array of receiver origin points</param>
            /// <param name="SrcPT">sound source point</param>
            /// <param name="Room">the acoustical scene</param>
            /// <param name="RCT">the number or rays emanating from the source</param>
            /// <param name="CSound">the speed of sound in m/s</param>
            /// <param name="SampleRate_in">the simulation histogram sampling frequency</param>
            /// <param name="COTime_in">the Cut Off Time in ms.</param>
            /// <param name="Type">the type of receivers contained in this receiver bank</param>
            public Receiver_Bank(IEnumerable<Point3d> Pt, Point3d SrcPT, Scene Sc, int SampleRate_in, double COTime_in, double delayinms, Type Type)
            {
                delay_ms = delayinms;
                SampleRate = SampleRate_in;
                SampleCT = (int)Math.Floor(COTime_in * SampleRate_in / 1000);
                this.CutOffTime = COTime_in;
                Rec_Type = Type;
                Point3d[] arrPts = Pt.ToArray<Point3d>();
                Rec_List = new Spherical_Receiver[arrPts.Length];
                Min = new Hare.Geometry.Point(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity);
                Max = new Hare.Geometry.Point(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity);

                for (int i = 0; i < arrPts.Length; i++)
                {
                    if (Type == Type.Stationary) Rec_List[i] = new Spherical_Receiver(new Point3d(arrPts[i]), new Point3d(SrcPT), Sc.Attenuation(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Sound_speed(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Rho(Utilities.PachTools.RPttoHPt(arrPts[i])), SampleRate_in, COTime_in);
                    if (Type == Type.Variable) Rec_List[i] = new Expanding_Receiver(new Point3d(arrPts[i]), new Point3d(SrcPT), RayCount, Sc.Attenuation(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Sound_speed(Utilities.PachTools.RPttoHPt(arrPts[i])), Sc.Rho(Utilities.PachTools.RPttoHPt(arrPts[i])), SampleRate_in, COTime_in);

                    if (arrPts[i].X > Max.x) Max.x = arrPts[i].X;
                    if (arrPts[i].Y > Max.y) Max.y = arrPts[i].Y;
                    if (arrPts[i].Z > Max.z) Max.z = arrPts[i].Z;
                    if (arrPts[i].X < Min.x) Min.x = arrPts[i].X;
                    if (arrPts[i].Y < Min.y) Min.y = arrPts[i].Y;
                    if (arrPts[i].Z < Min.z) Min.z = arrPts[i].Z;
                }
            }