public void TestToPovCode4() { PovNumber myNum = 1.234; var declElem = new DeclareElement("myVar", myNum); Check.That(declElem.ToPovCode()).IsEqualTo("#declare myVar = 1.234;"); }
public void TestToPovCode2() { var myNum = new PovVector("myVect", 5); var declElem = new DeclareElement("myVar", myNum); Check.That(declElem.ToPovCode()).IsEqualTo("#declare myVar = myVect;"); }
public void TestPovCode5() { var c = new PovColor("White"); var dec = new DeclareElement("myColor", c); Check.That(dec.ToPovCode()).IsEqualTo("#declare myColor = White;"); }
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>;"); }
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); }
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};"); }
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>;"); }
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(";"); }
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};"); }
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};"); }