Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public void configX3DOutput(XElement xx3d)
        {
            Scientrace.TraceJournal tj = Scientrace.TraceJournal.Instance;
            tj.exportx3d                 = this.X.getXBool(xx3d, "Export", true);
            tj.x3d_line_thickness        = this.X.getXDouble(xx3d, "LineWidth", 0);
            tj.x3d_draw_direction_arrows = this.X.getXBool(xx3d, "DrawArrows", true);

            ScientraceXMLParser.readCameraSettings(xx3d);

            //Console.WriteLine("WRITING DATA IS " + tj.exportdata.ToString());
            tj.x3dfilename = this.X.getXStringByName(xx3d, "Filename", "3dview_" + tj.getSourceFilenameNoExt() + ".x3d");
        }
        public void parseConfiguration()
        {
            Console.WriteLine(">>> loading configuration file: " + this.configfilename);

            Scientrace.TraceJournal tj = Scientrace.TraceJournal.Instance;
            tj.source_filename = this.configfilename;

            string xmlsource = this.preProcess(this.configfilename);

            tj.xml_export_preprocessed_string = xmlsource;

            this.sctxp = new ScientraceXMLParser(XDocument.Parse(xmlsource));
            this.env = this.sctxp.parseEnvironment();
            this.sctxp.parseOutput();
        }
Exemplo n.º 4
0
        public void parseConfiguration()
        {
            Console.WriteLine(">>> loading configuration file: " + this.configfilename);

            Scientrace.TraceJournal tj = Scientrace.TraceJournal.Instance;
            tj.source_filename = this.configfilename;

            string xmlsource = this.preProcess(this.configfilename);

            tj.xml_export_preprocessed_string = xmlsource;

            this.sctxp = new ScientraceXMLParser(XDocument.Parse(xmlsource));
            this.env   = this.sctxp.parseEnvironment();
            this.sctxp.parseOutput();
        }