Ejemplo n.º 1
0
 private void DumpMaterialSpecs(Substance s)
 {
     Debug.WriteLine(s.ToString());
     foreach (DictionaryEntry de in s.GetMaterialSpecs())
     {
         Debug.WriteLine("\t" + de.Key + " : " + de.Value);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Applies the material specs.
        /// </summary>
        /// <param name="emitted">The emitted.</param>
        /// <param name="original">The original.</param>
        public static void ApplyMaterialSpecs(Substance emitted, Substance original)
        {
            _Debug.Assert(emitted.MaterialType.Equals(original.MaterialType));

            ArrayList emittedSpecs = new ArrayList();

            foreach (DictionaryEntry de in original.GetMaterialSpecs())
            {
                Guid   specGuid = (Guid)de.Key;
                double specMass = (double)de.Value;
                double origPctg = specMass / original.Mass;

                double emittedMass = emitted.Mass * origPctg;

                emittedSpecs.Add(new DictionaryEntry(specGuid, emittedMass));
            }
            emitted.SetMaterialSpecs(emittedSpecs);
        }