Example #1
0
        public void parseXObject3dCollectionContent(XElement xcol, Scientrace.Object3dCollection objectcollection)
        {
            if (xcol == null)
            {
                return;
            }
            XMLObject3dParser    o3dp = new XMLObject3dParser(objectcollection);
            ShadowClassConstruct shadowConstructor = new ShadowClassConstruct(objectcollection);

            //PARSE OBJECTS WITHIN COLLECTION HERE
            foreach (XElement xel in xcol.Elements())
            {
                this.parseXObject3d(xel, objectcollection, o3dp, shadowConstructor);
            }
        }
Example #2
0
        public void parseXObject3d(XElement xel, Scientrace.Object3dCollection col, XMLObject3dParser o3dp, ShadowClassConstruct shadowConstructor)
        {
            Scientrace.Object3d createdObject3d = null;
            switch (xel.Name.ToString())
            {
            case "CircularFresnelPrism":
                createdObject3d = o3dp.parseXFresnelPrism(xel);
                break;

            case "ParabolicMirror":
                createdObject3d = o3dp.parseXParabolicMirror(xel);
                //PARSE PARAB MIRROR
                break;

            case "Prism":             //fall through
            case "TriangularPrism":
                createdObject3d = shadowConstructor.constructTriangularPrism(xel);
                //createdObject3d = o3dp.parseXTriangularPrism(xel);
                break;

            case "RectangularPrism":
                createdObject3d = o3dp.parseXRectangularPrism(xel);
                break;

            case "SquareCell":
            case "Rectangle":
                //square cell can be used for any square or rectangular surface-object
                //createdObject3d = o3dp.parseXRectangle(xel);
                createdObject3d = shadowConstructor.constructRectangle(xel);
                break;

            case "Sphere":
                createdObject3d = o3dp.parseXSphere(xel);
                break;

            case "FresnelLens":
                createdObject3d = shadowConstructor.constructFresnelLens(xel);
                break;

            case "FresnelLensRing":
                createdObject3d = shadowConstructor.constructFresnelLensRing(xel);
                break;

            case "PlanoConvexLens":
                createdObject3d = o3dp.parseXPlanoConvexLens(xel);
                break;

            case "DoubleConvexLens":
                //createdObject3d = o3dp.parseXDoubleConvexLens(xel);
                createdObject3d = shadowConstructor.constructDoubleConvexLens(xel);
                break;

            case "BorderedVolume":
                createdObject3d = o3dp.parsXBorderedVolume(xel);
                break;

            case "ToppedPyramid":
            case "TruncatedPyramid":
                createdObject3d = o3dp.parseXTruncatedPyramid(xel);
                break;

            case "CameraViewpoint":        //fallthrough
            case "CameraFrom":             //fallthrough
            case "CameraRotation":
                //Cam settings set at environment.
                break;

            case "LightSource":
                //do nothing, already parsed previously
                break;

            case "Ignore":
            case "IGNORE":
                //do nothing, IGNORE!
                break;

            default:
                if (!(xel.Name.ToString().Substring(0, 3) == "REM"))
                {
                    Console.WriteLine("WARNING: UNKNOWN OBJECT: " + xel.Name + " \n[XML code]\n" + xel.ToString() + "\n[/XML code]\n");
                }
                break;
            }
            if (createdObject3d != null)
            {
                XMLTraceModifierParser xtmp = new XMLTraceModifierParser();
                List <Scientrace.UniformTraceModifier> utms = xtmp.getModifiers(xel);
                createdObject3d.addSurfaceModifiers(utms);
            }
        }         // end parseXObject3d
Example #3
0
        public void parseXObject3dCollectionContent(XElement xcol, Scientrace.Object3dCollection objectcollection)
        {
            if (xcol == null) return;
            XMLObject3dParser o3dp = new XMLObject3dParser(objectcollection);
            ShadowClassConstruct shadowConstructor = new ShadowClassConstruct(objectcollection);

            //PARSE OBJECTS WITHIN COLLECTION HERE
            foreach (XElement xel in xcol.Elements())
            this.parseXObject3d(xel, objectcollection, o3dp, shadowConstructor);
        }
Example #4
0
 public void parseXObject3d(XElement xel, Scientrace.Object3dCollection col, XMLObject3dParser o3dp, ShadowClassConstruct shadowConstructor)
 {
     Scientrace.Object3d createdObject3d = null;
     switch (xel.Name.ToString()) {
     case "CircularFresnelPrism":
         createdObject3d = o3dp.parseXFresnelPrism(xel);
         break;
     case "ParabolicMirror":
         createdObject3d = o3dp.parseXParabolicMirror(xel);
         //PARSE PARAB MIRROR
         break;
     case "Prism": //fall through
     case "TriangularPrism":
         createdObject3d = shadowConstructor.constructTriangularPrism(xel);
         //createdObject3d = o3dp.parseXTriangularPrism(xel);
         break;
     case "RectangularPrism":
         createdObject3d = o3dp.parseXRectangularPrism(xel);
         break;
     case "SquareCell":
     case "Rectangle":
         //square cell can be used for any square or rectangular surface-object
         //createdObject3d = o3dp.parseXRectangle(xel);
         createdObject3d = shadowConstructor.constructRectangle(xel);
         break;
     case "Sphere":
         createdObject3d = o3dp.parseXSphere(xel);
         break;
     case "FresnelLens":
         createdObject3d = shadowConstructor.constructFresnelLens(xel);
         break;
     case "FresnelLensRing":
         createdObject3d = shadowConstructor.constructFresnelLensRing(xel);
         break;
     case "PlanoConvexLens":
         createdObject3d = o3dp.parseXPlanoConvexLens(xel);
         break;
     case "DoubleConvexLens":
         //createdObject3d = o3dp.parseXDoubleConvexLens(xel);
         createdObject3d = shadowConstructor.constructDoubleConvexLens(xel);
         break;
     case "BorderedVolume":
         createdObject3d = o3dp.parsXBorderedVolume(xel);
         break;
     case "ToppedPyramid":
     case "TruncatedPyramid":
         createdObject3d = o3dp.parseXTruncatedPyramid(xel);
         break;
     case "CameraViewpoint": //fallthrough
     case "CameraFrom": //fallthrough
     case "CameraRotation":
         //Cam settings set at environment.
         break;
     case "LightSource":
         //do nothing, already parsed previously
         break;
     case "Ignore":
     case "IGNORE":
         //do nothing, IGNORE!
         break;
     default:
         if (!(xel.Name.ToString().Substring(0,3)=="REM")) {
             Console.WriteLine("WARNING: UNKNOWN OBJECT: "+xel.Name+" \n[XML code]\n"+xel.ToString()+"\n[/XML code]\n");
             }
         break;
     }
     if (createdObject3d != null) {
     XMLTraceModifierParser xtmp = new XMLTraceModifierParser();
     List<Scientrace.UniformTraceModifier> utms = xtmp.getModifiers(xel);
     createdObject3d.addSurfaceModifiers(utms);
     }
 }