示例#1
0
文件: TestField.py 项目: 4og/avango
 def testWriteSFVec4(self):
     field = avango.osg.SFVec4()
     field.value = avango.osg.Vec4(1.1, 1.2, 1.3, 1.4)
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00SFVec4\x00", "1.1\x001.2\x001.3\x001.4", "\n",
                               hout.getvalue())
示例#2
0
文件: TestField.py 项目: 4og/avango
 def testWriteMFVec3(self):
     field = avango.osg.MFVec3()
     field.value = [ avango.osg.Vec3(1.1, 1.2, 1.3), avango.osg.Vec3(2.1, 2.2, 2.3) ]
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00MFVec3\x00", "1.1\x001.2\x001.3\x002.1\x002.2\x002.3", "\n",
                               hout.getvalue())
示例#3
0
 def testWriteSFFloat(self):
     field = avango.SFFloat()
     field.value = float(1.2)
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00SFFloat\x00", "1.2", "\n",
                               hout.getvalue())
示例#4
0
 def testWriteMFString(self):
     mfstring = avango.MFString()
     mfstring.value = ["Test Number One", " Number 2. "]
     hout = StringIO.StringIO()
     connect.write("C", mfstring, hout)
     self.assertEqual("C\x00MFString\x00Test Number One\x00 Number 2. \n",
                      hout.getvalue())
示例#5
0
 def testWriteSFVec4(self):
     field = avango.osg.SFVec4()
     field.value = avango.osg.Vec4(1.1, 1.2, 1.3, 1.4)
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00SFVec4\x00",
                               "1.1\x001.2\x001.3\x001.4", "\n",
                               hout.getvalue())
示例#6
0
 def testWriteMFVec2(self):
     field = avango.osg.MFVec2()
     field.value = [avango.osg.Vec2(1.1, 1.2), avango.osg.Vec2(2.1, 2.2)]
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00MFVec2\x00",
                               "1.1\x001.2\x002.1\x002.2", "\n",
                               hout.getvalue())
示例#7
0
文件: TestField.py 项目: 4og/avango
 def testWriteSFMatrix(self):
     field = avango.osg.SFMatrix()
     field.value = avango.osg.make_trans_mat(0, 8, 15)
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00SFMatrix\x00", """1.0\x000.0\x000.0\x000.0\x00
                                                       0.0\x001.0\x000.0\x000.0\x00
                                                       0.0\x000.0\x001.0\x000.0\x00
                                                       0.0\x008.0\x0015.0\x001.0""",
                                                       "\n",
                               hout.getvalue())
示例#8
0
 def testWriteSFMatrix(self):
     field = avango.osg.SFMatrix()
     field.value = avango.osg.make_trans_mat(0, 8, 15)
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual(
         "A\x00SFMatrix\x00", """1.0\x000.0\x000.0\x000.0\x00
                                                       0.0\x001.0\x000.0\x000.0\x00
                                                       0.0\x000.0\x001.0\x000.0\x00
                                                       0.0\x008.0\x0015.0\x001.0""",
         "\n", hout.getvalue())
示例#9
0
文件: TestField.py 项目: 4og/avango
 def testWriteMFMatrix(self):
     field = avango.osg.MFMatrix()
     field.value = [ avango.osg.make_trans_mat(1, 2, 3), avango.osg.make_trans_mat(4, 5, 6) ]
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00MFMatrix\x00", """1.0\x000.0\x000.0\x000.0\x00
                                                       0.0\x001.0\x000.0\x000.0\x00
                                                       0.0\x000.0\x001.0\x000.0\x00
                                                       1.0\x002.0\x003.0\x001.0\x00
                                                       1.0\x000.0\x000.0\x000.0\x00
                                                       0.0\x001.0\x000.0\x000.0\x00
                                                       0.0\x000.0\x001.0\x000.0\x00
                                                       4.0\x005.0\x006.0\x001.0
                                                       """, "\n",
                               hout.getvalue())
示例#10
0
 def testWriteMFMatrix(self):
     field = avango.osg.MFMatrix()
     field.value = [
         avango.osg.make_trans_mat(1, 2, 3),
         avango.osg.make_trans_mat(4, 5, 6)
     ]
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual(
         "A\x00MFMatrix\x00", """1.0\x000.0\x000.0\x000.0\x00
                                                       0.0\x001.0\x000.0\x000.0\x00
                                                       0.0\x000.0\x001.0\x000.0\x00
                                                       1.0\x002.0\x003.0\x001.0\x00
                                                       1.0\x000.0\x000.0\x000.0\x00
                                                       0.0\x001.0\x000.0\x000.0\x00
                                                       0.0\x000.0\x001.0\x000.0\x00
                                                       4.0\x005.0\x006.0\x001.0
                                                       """, "\n",
         hout.getvalue())
示例#11
0
文件: TestField.py 项目: 4og/avango
 def testWriteMFInt(self):
     mfint = avango.MFInt()
     mfint.value = [ 0, 8, 15 ]
     hout = StringIO.StringIO()
     connect.write("C", mfint, hout)
     self.assertEqual("C\x00MFInt\x000\x008\x0015\n", hout.getvalue())
示例#12
0
文件: TestField.py 项目: 4og/avango
 def testWriteSFFloat(self):
     field = avango.SFFloat()
     field.value = float(1.2)
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertFloatListEqual("A\x00SFFloat\x00", "1.2", "\n", hout.getvalue())
示例#13
0
文件: TestField.py 项目: 4og/avango
 def testWriteSFString(self):
     sfstring = avango.SFString()
     sfstring.value = "Test Number One"
     hout = StringIO.StringIO()
     connect.write("B", sfstring, hout)
     self.assertEqual("B\x00SFString\x00Test Number One\n", hout.getvalue())
示例#14
0
 def testWriteSFString(self):
     sfstring = avango.SFString()
     sfstring.value = "Test Number One"
     hout = StringIO.StringIO()
     connect.write("B", sfstring, hout)
     self.assertEqual("B\x00SFString\x00Test Number One\n", hout.getvalue())
示例#15
0
 def testWriteSFInt(self):
     sfint = avango.SFInt()
     sfint.value = 42
     hout = StringIO.StringIO()
     connect.write("A", sfint, hout)
     self.assertEqual("A\x00SFInt\x0042\n", hout.getvalue())
示例#16
0
 def testWriteMFInt(self):
     mfint = avango.MFInt()
     mfint.value = [0, 8, 15]
     hout = StringIO.StringIO()
     connect.write("C", mfint, hout)
     self.assertEqual("C\x00MFInt\x000\x008\x0015\n", hout.getvalue())
示例#17
0
文件: TestField.py 项目: 4og/avango
 def testWriteSFInt(self):
     sfint = avango.SFInt()
     sfint.value = 42
     hout = StringIO.StringIO()
     connect.write("A", sfint, hout)
     self.assertEqual("A\x00SFInt\x0042\n", hout.getvalue())
示例#18
0
文件: TestField.py 项目: 4og/avango
 def testWriteSFBool(self):
     field = avango.SFBool()
     field.value = True
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertEqual("A\x00SFBool\x001\n", hout.getvalue())
示例#19
0
文件: TestField.py 项目: 4og/avango
 def testWriteMFString(self):
     mfstring = avango.MFString()
     mfstring.value = [ "Test Number One", " Number 2. " ]
     hout = StringIO.StringIO()
     connect.write("C", mfstring, hout)
     self.assertEqual("C\x00MFString\x00Test Number One\x00 Number 2. \n", hout.getvalue())
示例#20
0
 def testWriteSFBool(self):
     field = avango.SFBool()
     field.value = True
     hout = StringIO.StringIO()
     connect.write("A", field, hout)
     self.assertEqual("A\x00SFBool\x001\n", hout.getvalue())