Esempio n. 1
0
        public static string GetRadianceMaterial(GlazingConstruction c)
        {
            //return "void plastic White_50 0 0 5 0.5 0.5 0.5 0 0";
            //return "void glass glass_70 0 0 3 0.77 0.77 0.77";

            double trans = 1.0;

            foreach (var l in c.Layers)
            {
                GlazingMaterial gl = l.Material as GlazingMaterial;
                if (gl != null)
                {
                    trans *= gl.VisibleTransmittance;
                }
            }

            double refractiveIndex = 1.52;
            double rad             = (Math.Sqrt(0.8402528435 + 0.0072522239 * trans * trans) - 0.9166530661) / 0.0036261119 / trans;

            return(String.Format("void glass {2}_glazing 0 0 4 {0} {0} {0} {1}\n", rad, refractiveIndex, c.Name));
        }
 public GlazingMaterial Add(GlazingMaterial obj)
 {
     if (obj == null)
     {
         return(null);
     }
     if (GlazingMaterials == null)
     {
         GlazingMaterials = new List <GlazingMaterial>();
     }
     if (!GlazingMaterials.Any(i => i.Name == obj.Name))
     {
         GlazingMaterials.Add(obj);
         return(obj);
     }
     else
     {
         var oc = GlazingMaterials.Single(o => o.Name == obj.Name);
         CopyObjectData(obj, oc, "", BindingFlags.Public | BindingFlags.Instance);
         return(oc);
     }
 }