Пример #1
0
        public Scientrace.Object3dEnvironment parseXEnv(XElement xenv)
        {
            //Create the collection itself with its properties first.
            Scientrace.Object3dEnvironment retenv;

            // Creating "the entire object-space"
            double env_radius = this.X.getXDouble(xenv, "Radius", -1);

            if (env_radius == -1)
            {
                Console.WriteLine("Warning: ObjectEnvironment has no radius attribute. Using 16 as an arbitrary default. You might want to change this.");
                env_radius = 16;
            }
            string environment_material_id = this.X.getXStringByName(xenv, "Environment", "air");

            ScientraceXMLParser.readCameraSettings(xenv);

            Scientrace.MaterialProperties env_material = Scientrace.MaterialProperties.FromIdentifier(environment_material_id);
            retenv = new Scientrace.Object3dEnvironment(env_material, env_radius);
            retenv.perishAtBorder = true;
            retenv.tag            = this.X.getXStringByName(xenv, "Tag", "ScientraceXML_Setup");

            //Parsing lightsources
            this.lp = new XMLLightSourceParser(retenv);
            this.lp.parseLightsources(xenv, retenv);

            //ADDING UNDERLYING BODIES/OBJECTS
            this.parseXObject3dCollectionContent(xenv, retenv);

            //return environment
            return(retenv);
        }
Пример #2
0
        public Scientrace.Object3dEnvironment parseXEnv(XElement xenv)
        {
            //Create the collection itself with its properties first.
            Scientrace.Object3dEnvironment retenv;

            // Creating "the entire object-space"
            double env_radius = this.X.getXDouble(xenv, "Radius", -1);
            if (env_radius == -1) {
            Console.WriteLine("Warning: ObjectEnvironment has no radius attribute. Using 16 as an arbitrary default. You might want to change this.");
            env_radius = 16;
            }
            string environment_material_id = this.X.getXStringByName(xenv, "Environment", "air");

            ScientraceXMLParser.readCameraSettings(xenv);

            Scientrace.MaterialProperties env_material = Scientrace.MaterialProperties.FromIdentifier(environment_material_id);
            retenv = new Scientrace.Object3dEnvironment(env_material, env_radius);
            retenv.perishAtBorder = true;
            retenv.tag = this.X.getXStringByName(xenv, "Tag", "ScientraceXML_Setup");

            //Parsing lightsources
            this.lp = new XMLLightSourceParser(retenv);
            this.lp.parseLightsources(xenv, retenv);

            //ADDING UNDERLYING BODIES/OBJECTS
            this.parseXObject3dCollectionContent(xenv, retenv);

            //return environment
            return retenv;
        }