예제 #1
0
        public void TestToPovCode4()
        {
            PovNumber myNum    = 1.234;
            var       declElem = new DeclareElement("myVar", myNum);

            Check.That(declElem.ToPovCode()).IsEqualTo("#declare myVar = 1.234;");
        }
예제 #2
0
        public void TestToPovCode2()
        {
            var myNum    = new PovVector("myVect", 5);
            var declElem = new DeclareElement("myVar", myNum);

            Check.That(declElem.ToPovCode()).IsEqualTo("#declare myVar = myVect;");
        }
예제 #3
0
        public void TestPovCode5()
        {
            var c   = new PovColor("White");
            var dec = new DeclareElement("myColor", c);

            Check.That(dec.ToPovCode()).IsEqualTo("#declare myColor = White;");
        }
예제 #4
0
        public void TestToPovCode3()
        {
            var myNum    = new PovVector(5);
            var declElem = new DeclareElement("myVar", myNum);
            var povCode  = declElem.ToPovCode();

            Check.That(povCode).IsEqualTo("#declare myVar = < 5, 5, 5>;");
        }
예제 #5
0
        public T Declare <T>(string elementName, T element) where T : AbstractPovElement
        {
            DeclareElement decl = new DeclareElement(elementName, element);

            Elements.Add(decl);
            element.Name = elementName;
            return(element);
        }
예제 #6
0
        public void TestDeclarePigmentPovCode()
        {
            var c       = new PovColor("White", 1, 1, 1);
            var pigment = new Pigment(c);
            var dec     = new DeclareElement("myPigment", pigment);
            var povCode = dec.ToPovCode();

            Check.That(povCode).IsEqualTo("#declare myPigment = pigment {\n color White\n};");
        }
예제 #7
0
        public void TestToPovCode5()
        {
            var       myNum  = new PovNumber("myNum", 5);
            PovVector myVect = new PovVector {
                X = myNum, Y = 2, Z = myNum
            };
            var declElem = new DeclareElement("myVar", myVect);

            Check.That(declElem.ToPovCode()).IsEqualTo("#declare myVar = < myNum, 2, myNum>;");
        }
예제 #8
0
        public void TestConstructor2()
        {
            var myNum    = new PovNumber(5);
            var declElem = new DeclareElement("myVar", myNum);

            Check.That(declElem.Name).IsNull();
            Check.That(myNum.Name).IsEqualTo("myVar");
            Check.That(declElem.PovElement).IsEqualTo(myNum);
            Check.That(declElem.End).IsEqualTo(";");
        }
예제 #9
0
        public void TestPovDeclareCamera()
        {
            PovVector v0 = new PovVector("myLocation");
            PovVector v1 = new PovVector(0);

            var cam = new Camera {
                Location = v0, LookAt = v1
            };
            var decl    = new DeclareElement("myCam", cam, ";");
            var povCode = decl.ToPovCode();

            Check.That(povCode).IsEqualTo("#declare myCam = camera {\n location myLocation\n look_at < 0, 0, 0>\n};");
        }
예제 #10
0
        public void TestDeclareLight()
        {
            PovVector v0 = new PovVector("myLocation");

            var light = new Light()
            {
                Location = v0, Color = new PovColor(1)
            };
            var decl    = new DeclareElement("myLight", light);
            var povCode = decl.ToPovCode();

            Check.That(povCode).IsEqualTo("#declare myLight = light_source {\n myLocation, rgb < 1, 1, 1>\n};");
        }