Exemple #1
0
            public SpeakerSource(Speaker_Balloon S, double[] power_in_db, double[] phase_in, Point Source, int[] Bands, int ID)
                : base(power_in_db, Source, Phase_Regime.Explicit_Nonhomogeneous, ID)
            {
                for (int oct = 0; oct < 8; oct++)
                {
                    if (oct < Bands[0] || oct > Bands[1])
                    {
                        base.SourcePower[oct] = 0;
                        base.SPL[oct]         = 0;
                    }
                }

                base.phase = phase_in;
                type       = "Loudspeaker";
                Balloon    = new Voxel_Grid(S.Balloons(power_in_db), 1);
                ///Testing///
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[0]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[1]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[2]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[3]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[4]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[5]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[6]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[7]);
                /////////////
            }
Exemple #2
0
 public SpeakerSource(Speaker_Balloon S, double[] power_in_db, double[] phase_in, Point Source, int[] Bands, double delay_in, int ID)
     : this(S, power_in_db, phase_in, Source, Bands, ID)
 {
     delay = delay_in;
 }
 public void AddBalloon(System.Guid ID, Speaker_Balloon B)
 {
     for (int i = 0; i < m_id_list.Count; i++)
     {
         if ((ID == m_id_list[i]))
         {
             m_Balloons[i] = B;
             return;
         }
     }
 }
            /// <summary>
            /// Adds a source to the conduit.
            /// </summary>
            /// <param name="rhino_object"></param>
            public void SetSource(Rhino.DocObjects.RhinoObject rhino_object)
            {
                if ((rhino_object == null))
                {
                    if (m_id_list.Count == 0)
                    {
                        SetupEventHandlers(false);
                        Enabled = false;
                        return;
                    }
                }

                SetupEventHandlers(true);
                Enabled = true;

                if (!m_id_list.Contains(rhino_object.Attributes.ObjectId))
                {
                    m_id_list.Add(rhino_object.Attributes.ObjectId);
                    string typ = "";
                    typ = rhino_object.Geometry.GetUserString("SourceType");
                    if (rhino_object.ObjectType == Rhino.DocObjects.ObjectType.Point)
                    {
                        if (typ == "2")
                        {
                            string[] strballoon = new string[8];
                            string Aim = "";
                            string ft = "";
                            string SWLMax = "";
                            strballoon[0] = rhino_object.Geometry.GetUserString("Balloon63");
                            strballoon[1] = rhino_object.Geometry.GetUserString("Balloon125");
                            strballoon[2] = rhino_object.Geometry.GetUserString("Balloon250");
                            strballoon[3] = rhino_object.Geometry.GetUserString("Balloon500");
                            strballoon[4] = rhino_object.Geometry.GetUserString("Balloon1000");
                            strballoon[5] = rhino_object.Geometry.GetUserString("Balloon2000");
                            strballoon[6] = rhino_object.Geometry.GetUserString("Balloon4000");
                            strballoon[7] = rhino_object.Geometry.GetUserString("Balloon8000");
                            Aim = rhino_object.Geometry.GetUserString("Aiming");
                            SWLMax = rhino_object.Geometry.GetUserString("SWLMax");
                            string[] A = Aim.Split(';');
                            ft = rhino_object.Geometry.GetUserString("FileType");
                            Speaker_Balloon L = new Speaker_Balloon(strballoon, SWLMax, int.Parse(ft), rhino_object.Geometry.GetBoundingBox(true).Min);
                            L.CurrentAlt = float.Parse(A[0]);
                            L.CurrentAzi = float.Parse(A[1]);
                            L.CurrentAxi = float.Parse(A[2]);
                            L.Update_Position();
                            this.m_Balloons.Add(L);
                        }
                        else
                        {
                            m_Balloons.Add(null);
                        }
                    }
                    else if (rhino_object.ObjectType == Rhino.DocObjects.ObjectType.Curve)
                    {
                        m_Balloons.Add(null);
                    }
                    else if (rhino_object.ObjectType == Rhino.DocObjects.ObjectType.Brep)
                    {
                        m_Balloons.Add(null);
                    }
                }
            }
            public SpeakerSource(Speaker_Balloon S, double[] power_in_db, double[] phase_in, Point3d Source, int[] Bands, int ID)
                :base(power_in_db, Source, Phase_Regime.Explicit_Nonhomogeneous, ID)
            {
                for (int oct = 0; oct < 8; oct++)
                {
                    if (oct < Bands[0] || oct > Bands[1])
                    {
                        base.SourcePower[oct] = 0;
                        base.SPL[oct] = 0;
                    }
                }

                base.phase = phase_in;
                type = "Loudspeaker";
                Balloon = new Voxel_Grid(S.Balloons(power_in_db), 1);
                ///Testing///
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[0]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[1]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[2]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[3]); 
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[4]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[5]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[6]);
                //Utilities.PachTools.Plot_Hare_Topology(Balloon.Model[7]);
                /////////////
            }
 public SpeakerSource(Speaker_Balloon S, double[] power_in_db, double[] phase_in, Point3d Source, int[] Bands, double delay_in, int ID)
 :this(S, power_in_db, phase_in, Source, Bands, ID)
 {
     delay = delay_in;
 }