Ejemplo n.º 1
0
        public Scientrace.Sphere parseXSphere(XElement xSphere)
        {
            if (xSphere.Name.ToString() != "Sphere")
            {
                throw new XMLException("Sphere does not match its name: " + xSphere.Name.ToString());
            }
            double radius = this.X.getXDouble(xSphere, "Radius");

            Scientrace.Location loc = this.X.getXLocation(xSphere, "Location");
            // Replaced with below: Scientrace.MaterialProperties materialprops = this.getXMaterial(xSphere.Element("Material"));
            Scientrace.MaterialProperties materialprops = this.getXMaterialForObject(xSphere);
            Scientrace.Sphere             tRetSphere    = new Scientrace.Sphere(this.parentcollection,
                                                                                materialprops, loc, radius);

            tRetSphere.setRefAxis(this.X.getXNzVectorByName(xSphere, "RefVec", null));
            return(tRetSphere);
        }
Ejemplo n.º 2
0
        public void paramInit(
			Scientrace.Location lens_sphere_location, double lens_sphere_radius, 
			double lens_sphere_radians_min, double lens_sphere_radians_max,
			Scientrace.UnitVector orientation_from_sphere_center, bool double_convex_ring)
        {
            this.sphereLoc = lens_sphere_location;
            this.sphereRadius = lens_sphere_radius;
            //Console.WriteLine("Sphere radius: "+sphereRadius);
            this.radiansMin = lens_sphere_radians_min;
            this.radiansMax = lens_sphere_radians_max;
            this.orientation = orientation_from_sphere_center;
            this.doubleConvexRing = double_convex_ring;

            if (lens_sphere_radians_min > 0) {
            this.innerVoid = new InfiniteCylinderBorder(null, null,
                            lens_sphere_location, orientation_from_sphere_center,
                            lens_sphere_radius*Math.Sin(lens_sphere_radians_min)
                            );
            this.innerVoid.enclosesInside = false;
            }

            this.lensSphere = new Sphere(null, null, lens_sphere_location, lens_sphere_radius);
            this.initBottom();
        }
Ejemplo n.º 3
0
        public IInterSectableBorder3d initBottom()
        {
            double planeDistanceFromSphereCenter = getDistanceFromSphereCenterToAngle(this.radiansMax);
            Location planoLoc = this.sphereLoc+(this.orientation*planeDistanceFromSphereCenter);

            if (this.doubleConvexRing) {
            this.oppositeSideSphere = new Sphere(null, null, this.sphereLoc+(this.orientation*planeDistanceFromSphereCenter*2), this.sphereRadius);
            return this.oppositeSideSphere;
            } else {
            this.flatBottomBorder = new PlaneBorder(planoLoc, this.orientation);
            return this.flatBottomBorder;
            }
        }
Ejemplo n.º 4
0
        public Scientrace.Sphere parseXSphere(XElement xSphere)
        {
            if (xSphere.Name.ToString() != "Sphere") {
            throw new XMLException("Sphere does not match its name: "+xSphere.Name.ToString());
            }
            double radius = this.X.getXDouble(xSphere, "Radius");
            Scientrace.Location loc = this.X.getXLocation(xSphere, "Location");
            // Replaced with below: Scientrace.MaterialProperties materialprops = this.getXMaterial(xSphere.Element("Material"));
            Scientrace.MaterialProperties materialprops = this.getXMaterialForObject(xSphere);
            Scientrace.Sphere tRetSphere  = new Scientrace.Sphere(this.parentcollection,
            materialprops, loc, radius);

            tRetSphere.setRefAxis(this.X.getXNzVectorByName(xSphere, "RefVec", null));
            return tRetSphere;
        }