Esempio n. 1
0
 public PhysicalObject3d(Object3dCollection parent, Scientrace.MaterialProperties materialproperties)
     : base(parent, materialproperties)
 {
     this.surface_sides = new HashSet<SurfaceSide>() {Scientrace.SurfaceSide.Both};
     //this.surface_sides.Add(Scientrace.SurfaceSide.Both);
     //this.materialproperties = materialproperties;
 }
Esempio n. 2
0
 public PhysicalObject3d(Object3dCollection parent, Scientrace.MaterialProperties materialproperties) : base(parent, materialproperties)
 {
     this.surface_sides = new HashSet <SurfaceSide>()
     {
         Scientrace.SurfaceSide.Both
     };
     //this.surface_sides.Add(Scientrace.SurfaceSide.Both);
     //this.materialproperties = materialproperties;
 }
Esempio n. 3
0
 private void setDefaults(Object3dCollection parent, MaterialProperties mp)
 {
     this.tag                = this.GetType().ToString();
     this.parseOrder         = TraceJournal.Instance.rnd.NextDouble();
     this.materialproperties = mp;
     this.parent             = parent;
     if (this.hasParent())
     {
         this.parent.addObject3d(this);
     }
 }
Esempio n. 4
0
        public Object3dCollection[] division; //firsthalf, secondhalf;
        //public Scientrace.RectangularPrism dummyRect;

        /// <summary>
        /// The CircularFresnelPrism is developed specifically for the SunCycle system but can be used
        /// for different purposes. It generates a filled Object3dCollection with
        /// </summary>
        /// <param name="parent">
        /// A <see cref="Object3d"/>
        /// </param>
        /// <param name="surroundingsproperties">
        /// A <see cref="MaterialProperties"/>
        /// </param>
        /// <param name="loc">
        /// A <see cref="Location"/>
        /// </param>
        /// <param name="surfacev1">
        /// A <see cref="NonzeroVector"/> orthogonal to the prism-teeth "length"-direction.
        /// </param>
        /// <param name="surfacev2">
        /// A <see cref="NonzeroVector"/>
        /// </param>
        /// <param name="surfacev3">
        /// The Z axis </param>
        /// <param name="teethCount">
        /// A int representing the number of teeth over the fresnel surface.
        /// </param>
        /// <param name="fresnelMaterial">
        /// A <see cref="MaterialProperties"/>
        /// </param>

        public CircularFresnelPrism(Object3dCollection parent, MaterialProperties surroundingsproperties,
                                    Location loc, NonzeroVector surfacev1, NonzeroVector surfacev2, NonzeroVector zaxisheight,
                                    double largeAngle_rad, double shortAngle_rad, int teethCount,
                                    MaterialProperties fresnelMaterial)
            : base(parent, surroundingsproperties)
        {
            //check vectors
            try{ surfacev1.toUnitVector(); }
            catch { throw new ZeroNonzeroVectorException("Fresnel Prism surface 1 has length 0"); }
            try{ surfacev2.toUnitVector(); }
            catch { throw new ZeroNonzeroVectorException("Fresnel Prism surface 2 has length 0"); }
            try{ zaxisheight.toUnitVector(); }
            catch { throw new ZeroNonzeroVectorException("Z-axis height has length 0"); }

            //set attributes
            this.loc       = loc;
            this.surfacev1 = surfacev1;
            this.surfacev2 = surfacev2;
            this.surfacev3 = zaxisheight;

            this.largeAngle      = largeAngle_rad;
            this.relative_angle  = Math.PI - (shortAngle_rad + largeAngle_rad);
            this.teethCount      = teethCount;
            this.fresnelMaterial = fresnelMaterial;

            //create "divisions" that organises the Fresnel-zones in segments in order to boost performance.
            this.division = new Object3dCollection[this.divisioncount];
            for (int idiv = 0; idiv < this.divisioncount; idiv++)
            {
                this.division[idiv] = new Object3dCollection(this, surroundingsproperties);
                this.division[idiv].virtualCollection = true;
                this.division[idiv].tag = "fresnel_div_" + idiv;
            }

            this.addElements();
            this.dummyborder = new RectangularPrism(null, this.materialproperties, loc - (surfacev1 + surfacev2),
                                                    surfacev1 * 2, surfacev2 * 2, surfacev3.normalized() * this.total_prism_height);
        }
Esempio n. 5
0
 /// <summary>
 /// All Object3d instances should be created with an assigned parent,
 /// an ObjectCollection instance. Except for Environment instances which
 /// are "top level" collections. Their parent is automatically set "null".
 /// </summary>
 /// <param name="parent">
 /// A <see cref="Object3d"/>
 /// </param>
 public Object3d(Object3dCollection parent, MaterialProperties mp)
 {
     this.setDefaults(parent, mp);
 }
Esempio n. 6
0
 private void setDefaults(Object3dCollection parent, MaterialProperties mp)
 {
     this.tag = this.GetType().ToString();
     this.parseOrder = TraceJournal.Instance.rnd.NextDouble();
     this.materialproperties = mp;
     this.parent = parent;
     if (this.hasParent())
     this.parent.addObject3d(this);
 }
Esempio n. 7
0
 public Cube(Object3dCollection parent, Scientrace.MaterialProperties mprops, int x, int y, int z, int width, int length, int height) : base(parent, mprops)
 {
     //TODO create constructor and basic behaviour
 }
Esempio n. 8
0
        //length is inherited from Scientrace.Prism

/* although it has no physical significance w,l and h can be thought of as below.
 *       ____
 *      /   /|
 * /__ / |
 |   | |
 | h|   | /
 |___|/ l
 |   w
 */

        public Cube(Object3dCollection parent, Scientrace.MaterialProperties mprops) : base(parent, mprops)
        {
        }
Esempio n. 9
0
 /*
 /// <summary>
 /// If a collection contains a lot of objects, it might be usefull to specify a large border
 /// whithin they all should exist. This way the raytracer can check whether they all should
 /// be parsed individually in the first place or not. Leaving this object "null" it doesn't
 /// perform this check. Any type of object will do, including collections. Of course always
 /// keep in mind the only purpose is to gain performance.
 /// </summary>
 // public Object3d contentsWithinVirtualObject = null; MADE OBSOLETE BY DUMMYBORDER */
 /// <summary>
 /// A collection of objects which will be iterated one by one when the collection is addressed.
 /// </summary>
 /// <param name="parent">
 /// A <see cref="Object3dCollection"/>. There always has to be a parent collection in which
 /// an object (including objectcollections which are also objects as such) exists. The top 
 /// collection (root) is the Object3dEnvironment collection.
 /// </param>
 /// <param name="mp">
 /// A <see cref="MaterialProperties"/>. The surroundings in which the objects are situated?
 /// </param>
 public Object3dCollection(Object3dCollection parent, MaterialProperties mp)
     : base(parent, mp)
 {
 }
Esempio n. 10
0
 /// <summary>
 /// All Object3d instances should be created with an assigned parent,
 /// an ObjectCollection instance. Except for Environment instances which
 /// are "top level" collections. Their parent is automatically set "null".
 /// </summary>
 /// <param name="parent">
 /// A <see cref="Object3d"/>
 /// </param>
 public Object3d(Object3dCollection parent, MaterialProperties mp)
 {
     this.setDefaults(parent, mp);
 }
 public AttachedObject3dCollection(Object3dCollection parent, MaterialProperties mp) : base(parent, mp)
 {
 }
Esempio n. 12
0
 public Cube(Object3dCollection parent, Scientrace.MaterialProperties mprops, int x, int y, int z, int width, int length, int height)
     : base(parent, mprops)
 {
     //TODO create constructor and basic behaviour
 }
Esempio n. 13
0
 //length is inherited from Scientrace.Prism
 /* although it has no physical significance w,l and h can be thought of as below.
  ____
 /   /|
    /__ / |
    |   | |
   h|   | /
    |___|/ l
  w
    */
 public Cube(Object3dCollection parent, Scientrace.MaterialProperties mprops)
     : base(parent, mprops)
 {
 }
Esempio n. 14
0
//	public XMLObject3dParser (XElement xel, CustomXMLDocumentOperations X, Scientrace.Object3dCollection env): base(xel, X) {
        public XMLObject3dParser(Scientrace.Object3dCollection env) : base()
        {
            this.parentcollection = env;
        }