Exemplo n.º 1
0
        public LightSource(ShadowScientrace.ShadowLightSource aShadowLightSource)
        {
            this.setObjectEnvironment(aShadowLightSource.env);
            this.minimum_intensity_fraction = aShadowLightSource.getDouble("minimum_intensity_fraction", this.minimum_intensity_fraction);
            this.addTraceModifiers((IEnumerable<Scientrace.UniformTraceModifier>)aShadowLightSource.getObject("trace_modifiers", true));

            //AND it was put back like a normal ShadowClass object...
            //this.spectrum = aShadowLightSource.spectrum;
            this.spectrum = (Scientrace.LightSpectrum)aShadowLightSource.getObject("spectrum", !this.mandatory_spectrum);

            if (spectrum == null)
            Console.WriteLine("WARNING: No spectrum given.");
            this.efficiency_characteristics = (Scientrace.OpticalEfficiencyCharacteristics)aShadowLightSource.getObject("efficiency_characteristics");

            this.weighted_intensity = (double)(aShadowLightSource.getNDouble("weighted_intensity") ?? this.spectrum.total_intensity);
        }
Exemplo n.º 2
0
        public LightSource(ShadowScientrace.ShadowLightSource aShadowLightSource)
        {
            this.setObjectEnvironment(aShadowLightSource.env);
            this.minimum_intensity_fraction = aShadowLightSource.getDouble("minimum_intensity_fraction", this.minimum_intensity_fraction);
            this.addTraceModifiers((IEnumerable <Scientrace.UniformTraceModifier>)aShadowLightSource.getObject("trace_modifiers", true));

            //AND it was put back like a normal ShadowClass object...
            //this.spectrum = aShadowLightSource.spectrum;
            this.spectrum = (Scientrace.LightSpectrum)aShadowLightSource.getObject("spectrum", !this.mandatory_spectrum);

            if (spectrum == null)
            {
                Console.WriteLine("WARNING: No spectrum given.");
            }
            this.efficiency_characteristics = (Scientrace.OpticalEfficiencyCharacteristics)aShadowLightSource.getObject("efficiency_characteristics");

            this.weighted_intensity = (double)(aShadowLightSource.getNDouble("weighted_intensity") ?? this.spectrum.total_intensity);
        }